Repository navigation
docs(adr): 0059 a worker with real drivers holds a per-user lock (#1189) - #1190
Merged
Merged
Conversation
This was referenced Nov 2, 2026
10 tasks done
Contributor
Author
Decision takenQuestion: two starts of the same folder race. Start A takes the worker lock, start B (same folder, lock held by a live A) goes on, and B wins the socket claim. A then fails and removes its lock, so B runs real drivers with no lock. What should happen? Options:
Why: the first keeps today's "already running" behaviour, and changes only who is named in Reverting: one rewrite step after the socket claim in Written by an agent. |
Contributor
Author
Review ledgerRound 1: 9aaaecb {"findings":[{"id":"R1","role":"spec","class":"false statement in ADR consequence","outcome":"fixed","path":"docs/internal/adr/0059-a-worker-with-real-drivers-holds-a-per-user-lock.md","round":"1","fix":"15b43ff13e4cb3fabae085dec77e1503bf8119ec"},{"id":"R2","role":"spec","class":"same-folder race undecided","outcome":"fixed","path":"docs/internal/adr/0059-a-worker-with-real-drivers-holds-a-per-user-lock.md","round":"1","fix":"d5cd4be973890d68a22b59b9c783ced67afa88f9"},{"id":"R3","role":"spec","class":"adr-index status lines stale","outcome":"fixed","path":"docs/internal/adr/README.md","round":"1","fix":"15b43ff13e4cb3fabae085dec77e1503bf8119ec"}]}Written by an agent. |
Contributor
Author
Review notesNot blocking, not verified. Each is one reviewer's claim.
Written by an agent. |
V3RON
marked this pull request as ready for review
November 2, 2026 10:14
V3RON
added a commit
that referenced
this pull request
Nov 2, 2026
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 - [x] `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 - [x] 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) - [x] `pnpm test:e2e` passes with its files in parallel (F11). — CI E2E jobs on the head - [x] `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 - [x] ADR 0059 is set to Accepted on PR #1190 when this merges. — `adr: 0059 to Accepted` fix run on this branch, adr-flip-check - [x] 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) - [x] 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 - [x] `pnpm test:e2e` still runs its files in parallel and passes. — CI E2E jobs on the head - [x] `scripts/slow-e2e.sh` exits 69 naming the holder while a worker outside the lane holds the lock. — src/slow-e2e.test.ts - [x] `worker/running-the-daemon.mdx` no longer offers a separate install with `SIMLOCK_HOME`. — claims review, round 1 *Written by an agent.*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.