Repository navigation
Conversation
Write-surface ownership was per file, so independent issues touching different functions of verify.ts were serialized by the replan gate and the planner prompt. A writes entry may now name a region as path#symbol; two active stories sharing a file are admitted when both name regions and none collides, and the merge gate decides whether the guess was right. Fixes #172 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Fixes #172
Summary
Write-surface ownership worked per file, so independent stories that edit different functions of one large module (verify.ts, orchestrate.ts, collective-board.ts) got serialized. This PR implements Option 1 (optimistic overlap) from the issue. It reuses the existing
writesfield, so no new PRD/story field has to be threaded through the TS planner schemas or the RustOption<Vec<String>>round-trip:writesentry can be a bare path (the whole file) orpath#symbol(one function, class or top-level const in that file). The new leaf moduleplanning/domain/write-claims.tsparses entries and decides conflicts. Two stories conflict on a shared file when either one claims the whole file, or when both name the same region.writeSurfaceOfdrops the region suffix, so the pre-write hooks,ownedElsewhere, trespass revert, Sentry, merge awareness, edge pruning and the Claude hook bridge still get plain paths.runtime-replan.ts).overlapping_write_surfacenow uses the region-aware rule. If an added story and an active owner claim disjoint regions of a file, the story is admitted. For path-only plans the rejection reason is byte-identical to before. In the overlap facts,ownedFilesandremainingPathsnow carry region entries, so a resubmitted tail keeps its regions.disjointWidthEvidence). When the planner exceedsmaxStories, siblings with disjoint regions count as disjoint.dependsOnedge, so pruning stays as conservative as before.prepareConflictRetrypath: the attempt is preserved and the story is offered again from the latest integrated HEAD.regions(the story's own region claims) andshared(active peers that also write the file, excluding peers ordered with it bydependsOn). Thewrite-surfacegate prompt lists the story's regions and its co-writers, and tells the agent to stay inside its regions.surfaceKeyincludes both fields, so a running lease is told again when they change. The OpenAI in-process lane keeps them in sync across rule revisions. For path-only stories the surface shape is unchanged.path#symboland the exception for one shared file. The overlap remedy section offers a 4th remedy ("claim the other regions") only when the colliding owner itself claims regions, where that remedy can actually work.What remains (not in this PR)
-X theirs, so there a wrong region guess is auto-resolved instead of rebuilt. That is the same as today for stories that share whole files, but it is a weaker fallback than the retry in collective mode.Test plan
tsc -p packages/baro-orchestrator/tsconfig.json --noEmitis clean.test/planning/write-claims.test.tscovers parsing, normalization, a bare path absorbing its regions, the conflict matrix (disjoint regions, same region, whole file vs region), and width evidence for the three verify.ts siblings from the harness-3 run.test/runtime-graph/runtime-replan-board.test.tscovers admitting a different region of an owned file; rejecting the same region, or a bare path against a region owner, with exact reason and facts; and rejecting a region against a whole-file owner.test/execution/write-surface.test.tscovers theregions/sharedsurface and its gate prompt, excluding dependency-ordered peers fromshared, path-only surfaces keeping the old keys, andsurfaceKeychanging with sharing.test/planning/planner-prompts-repair.test.tschecks that the region remedy appears only when the owner claims regions.npm run test:fast: 1655/1659 pass. The 4 failures are timing/environment tests, unrelated to this change, and they fail or flake onorigin/mainon the same machine:continuous-gate-runnerfails deterministically on main.run-architect-awake-budgetflakes on main.provider-ownership-manifestandcommand-timingpass when rerun in isolation.collective-orchestrateandprogressive-orchestrate: 28/29 pass. The one failure, "settles when the Surgeon decides before the Board receives a failed result", also fails deterministically onorigin/main.npm testrun was not completed. On the shared machine, the slow acceptance suites (critic-evidence and similar) took more than 20 minutes per file under load.cargo build/cargo testwere not needed.Generated with Devin