Skip to content

feat(daemon): a worker with real drivers holds a per-user lock - #1193

Merged
V3RON merged 35 commits into
feature/1189-adrfrom
task/1191
Nov 2, 2026
Merged

V3RON merged 35 commits into
feature/1189-adrfrom
task/1191

Conversation

@V3RON

@V3RON V3RON commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1191

Status

Implement: done Review: passed (R1–R4 fixed, R5 dup) Hardware: pass ADR 0059: Accepted (adr-flip-check ok) Gate: not run — merge needs the maintainer's permission
Next: .agents/scripts/merge-pr.sh 1193 (gates and merges #1190 and #1193)

Assumptions

  • Assumption: a failed check after the socket claim — the start fails for any error from that check, not only a foreign live holder; the conservative reading of ADR 0059's "makes sure it holds the lock".

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 4 blocking, 4 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 11.9M.
Runs: 20. Cost USD: 8.9458. Agent seconds: 4414.
Assessment: complete

Done when

  • pnpm exec vitest run --project unit src/daemon/main.test.ts src/ports/worker-lock.test.ts src/slow-e2e.test.ts passes, with the lines above. — run by the build, audit and fix runs; CI Unit tests on the head
  • Slow lane, real hardware: e2e/slow-android-smoke.test.ts checks that /tmp/simlock-<uid>/worker.lock/owner.json names its worker's pid and folder while it runs, and is gone after simlock daemon stop. — hardware verifier pass at f3dced3 (log simlock-slow-e2e-20261102-120326.log)
  • pnpm test:e2e passes with its files in parallel (F11). — CI E2E jobs on the head
  • running-the-daemon.mdx no longer offers a second worker through SIMLOCK_HOME, and says a second worker refuses to start and names the first. — spec and claims review, round 1
  • ADR 0059 is set to Accepted on PR docs(adr): 0059 a worker with real drivers holds a per-user lock (#1189) #1190 when this merges. — adr: 0059 to Accepted fix run on this branch, adr-flip-check
  • A second real-driver worker of the same user with another folder refuses to start with the message above, exit 1, and starts no driver. — main.test.ts worker-lock block (refusal before discovery, R1 probe)
  • The first worker's stop frees the lock; a crashed worker's lock is taken over at the next start. — main.test.ts stop table, worker-lock.test.ts stale case, slow-android-smoke
  • pnpm test:e2e still runs its files in parallel and passes. — CI E2E jobs on the head
  • scripts/slow-e2e.sh exits 69 naming the holder while a worker outside the lane holds the lock. — src/slow-e2e.test.ts
  • worker/running-the-daemon.mdx no longer offers a separate install with SIMLOCK_HOME. — claims review, round 1

Written by an agent.

V3RON added 16 commits November 2, 2026 11:14
@V3RON

V3RON commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 301ccc3
Round 2: 0e73f7f
Round fix-check: 9b0a816
Round fix-check: f3dced3
Round fix-check: a69ecaf
Round fix-check: 54b88ab

Runs: 21. Cost USD: 9.0742. Agent seconds: 4492.
Tokens input 730, output 214331, cache read 21231114, cache write 1119758.
- build implementer: claude-sonnet-5-5 679 s $1.3495
- build implementer: claude-sonnet-5-5 376 s $0.6966
- audit implementer: claude-sonnet-5-5 168 s $0.223
- review 1 reviewer: claude-sonnet-5-5 525 s $0.3126
- review 1 spec: claude-sonnet-5-5 53 s $0.2247
- review 1 code both: claude-opus-5-5 427 s $2.4154
- review 1 claims: claude-sonnet-5-5 40 s $0.1198
- fix 1 implementer: claude-sonnet-5-5 554 s $0.773
- fix 1 implementer: claude-sonnet-5-5 55 s $0.115
- review 2 reviewer: claude-sonnet-5-5 312 s $0.2438
- review 2 code both: claude-opus-5-5 196 s $0.8451
- review 2 claims: claude-sonnet-5-5 38 s $0.1154
- fix 2 implementer: claude-sonnet-5-5 112 s $0.1939
- review fix-check reviewer: claude-sonnet-5-5 289 s $0.1416
- review fix-check code-reviewer both: claude-opus-5-5 207 s $0.7529
- hardware hardware-verifier: claude-sonnet-5-5 119 s $0.0732
- hardware-fix implementer: claude-sonnet-5-5 138 s $0.1603
- hardware hardware-verifier: claude-sonnet-5-5 84 s $0.0634
- review fix-check reviewer: claude-sonnet-5-5 38 s $0.1013
- fix implementer: claude-sonnet-5-5 52 s $0.0675
- fix implementer: claude-sonnet-5-5 30 s $0.0862
Finding outcomes: {"duplicate":1,"fixed":4}. Classes: {"flow missing lock steps":1,"ownership assumed":2,"testing 10":1,"testing 3":1}.
{"findings":[{"id":"R1","role":"code","class":"testing 10","outcome":"fixed","path":"src/daemon/main.test.ts","round":"1","fix":"382997c9e"},{"id":"R2","role":"code","class":"ownership assumed","outcome":"fixed","path":"src/ports/worker-lock.ts","round":"1","fix":"9b0a8166b73"},{"id":"R3","role":"code","class":"testing 3","outcome":"fixed","path":"src/daemon/main.test.ts","round":"1","fix":"382997c9e"},{"id":"R4","role":"claims","class":"flow missing lock steps","outcome":"fixed","path":"docs/internal/flows/startup.md","round":"1","fix":"86777ac90"},{"id":"R5","role":"code","class":"ownership assumed","outcome":"duplicate","path":"src/ports/worker-lock.ts","round":"2","canonicalId":"R2","fix":"9b0a8166b73"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 2, 2026 11:08
@V3RON
V3RON merged commit 77c507f into main Nov 2, 2026
34 checks passed
@V3RON
V3RON deleted the task/1191 branch November 2, 2026 11:25
V3RON added a commit that referenced this pull request Nov 2, 2026
…) (#1190)

ADR 0059 for #1189, Accepted — not yet implemented. A worker that runs
real drivers takes a per-user lock (`/tmp/simlock-<uid>/worker.lock/`,
holding pid, folder and start time) before it discovers drivers. A
second real-driver worker of the same user with another folder refuses
to start and names the first. Workers with substituted drivers (the fast
e2e lane, the gateway-fleet tests) and gateways never take it. It
narrows ADR 0034 §1's "No new lock is needed" and ends bug #264 for one
user.

This PR is the bottom of #1189's stack and merges with the feature's
last task.

## Status

Review: round 1 3 blocking, round 2 1 blocking, fix-check passed (R1–R3
fixed) Gate: waiting for the stack
Next: stack with #1193

## Review

Spec review: 4 blocking, 4 fixed, 1 notes. Code review: skipped. Claims
review: skipped.
Rounds: 2. Tokens: 6.6M.
Runs: 7. Cost USD: 2.3004. Agent seconds: 759.
Assessment: complete

*Written by an agent.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A second real-driver worker of the same user refuses to start, naming the first

1 participant