Remove static writePaths lock; detect concurrent lane overlap at spawn - #591
Merged
TheGreatAxios merged 2 commits intoAug 24, 2026
Conversation
Deletes DirectorPackage.writePaths / AgentProfile.writePaths and the gate.ts enforcement that read them (write-path-policy.ts and its test are now dead and removed). No shipped director ever set a non-empty writePaths, so this was already unenforced-in-practice authz machinery that read as active. Replaces it with a non-blocking conflict detector in the task tool: each running dispatch is tracked by call id and resolved cwd; a new dispatch that shares a still-running lane's cwd is recorded (not blocked) as a concurrent-lane-overlap intervention. A completed lane is removed before the next dispatch starts, so sequential work against the same cwd never triggers it. Judgement calls: - task() has no field for a caller to declare which paths a dispatch will touch, so cwd is the only intended-scope signal honestly available at spawn. Worktree-isolated lanes get distinct cwds by construction and can never collide here; this only fires in the shared-cwd fallback, which is the one case where two lanes can really overwrite each other. - Warn/record, not block: cwd equality does not prove two lanes touch the same files, only that they could, so refusing the spawn would invent precision the signal does not have. - Recorded in intervention-log.ts (new "conflict" class) rather than a separate mechanism, alongside the existing parent-side refusal/outcome records it already keeps for this task tool instance.
docs/IMPLEMENTATION.md, docs/ARCHITECTURE.md, and docs/PRODUCT.md still described DirectorPackage/AgentProfile writePaths as an existing, enforced feature. Update all references to describe what actually happens now: no static write-path declaration, and a shared-cwd lane overlap is recorded as a conflict intervention rather than gated.
TheGreatAxios
enabled auto-merge
August 24, 2026 00:16
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.
Closes CL-6952. Removes the static per-package writePaths authz lock (DirectorPackage.writePaths, AgentProfile.writePaths, and the gate.ts enforcement block at the old lines 394-413, plus write-path-policy.ts and its test) and replaces it with detection of concurrent lane overlap at spawn.
No shipped director ever set a non-empty writePaths (registry.test.ts explicitly asserted this) — this removes dead enforcement that only ever read as a live guarantee, not a working one.
What was deleted:
DirectorPackage.writePaths/AgentProfile.writePathsand all propagation through registry.ts, task-tool.ts, RunSubAgentParams, SubAgentIdentity.What replaced it:
A non-blocking conflict detector inside the existing task() dispatch in task-tool.ts. Each running dispatch is tracked (by call id) with the cwd it resolved to; a new dispatch checks currently-running lanes for one already working in the same cwd and records a
concurrent-lane-overlapentry (newconflictclass in intervention-log.ts) if so. A lane is removed from tracking the moment its dispatch finishes, so sequential work against the same cwd is never flagged.Judgement calls:
conflictas a new InterventionClass rather than overloadingblock/nudge, which mean something more specific (actually refusing/injecting).Docs updated to match: docs/IMPLEMENTATION.md (5 spots — module table entries for task-tool.ts/identity-context.ts/gate.ts, the packageToProfile mapping note, and the primary-role/leaf-writePaths notes), docs/ARCHITECTURE.md (director-package field list, docs/design director tool-envelope note, primary-role note), and docs/PRODUCT.md (primary-role paragraph) — all previously described writePaths as an existing, enforced feature.
Gate:
bun run checkgreen — lint 0 errors, tsc clean, build succeeds, 5363 tests pass.