audit-tools 0.28.5 → 0.28.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,6 +120,23 @@ export declare function mergeWorktree(root: string, worktreePath: string, branch
120
120
  success: false;
121
121
  error: string;
122
122
  };
123
+ /**
124
+ * Rebase a node's worktree branch onto the main checkout's current HEAD (the
125
+ * remediation branch tip) so a sibling that merged AFTER this worktree was created
126
+ * is folded in before this node verifies and merges. Additive edits to a shared
127
+ * file merge automatically (git's per-commit 3-way); a true hunk conflict is a
128
+ * genuine seam that aborts cleanly so the node routes to triage instead of landing
129
+ * a broken merge. The branch is checked out in the worktree, so the rebase runs
130
+ * there. A no-op (branch already on HEAD — the common, no-sibling-merged case)
131
+ * succeeds. Leaves the branch on its pre-rebase commit on abort (so the failed
132
+ * node's work can still be quarantined).
133
+ */
134
+ export declare function rebaseBranchOntoHead(root: string, worktreePath: string, branch: string): {
135
+ ok: true;
136
+ } | {
137
+ ok: false;
138
+ error: string;
139
+ };
123
140
  /** Worktree path for a remediation block. */
124
141
  export declare function worktreePath(root: string, blockId: string, runId: string): string;
125
142
  export declare function remediationBranchName(runId: string): string;
@@ -195,8 +212,14 @@ export interface AcceptNodeWorktreeParams {
195
212
  branch: string;
196
213
  /** The worker's transport outcome from the node dispatcher. */
197
214
  workerOutcome: NodeWorkerOutcome;
198
- /** Deduped per-node verify commands (from the block's findings). */
199
- targetedCommands: string[];
215
+ /**
216
+ * Per-node verify commands. OMIT (leave `undefined`) for the real rolling drivers:
217
+ * the gate then DERIVES the verify from the node's actually-touched test files
218
+ * post-commit ({@link deriveVerifyCommandsFromBranch}) — correct paths/runner by
219
+ * construction, never the whole suite. Pass `[]` to skip the gate (lifecycle unit
220
+ * tests on a minimal temp repo), or an explicit list to force specific commands.
221
+ */
222
+ targetedCommands?: string[];
200
223
  /**
201
224
  * Accept-time write-scope inputs (OBL-DS-06). When present, the write-scope
202
225
  * gate runs HERE — after the verify, BEFORE the cherry-pick — so an out-of-scope
@@ -211,8 +234,6 @@ export interface AcceptNodeWorktreeParams {
211
234
  block_id: string;
212
235
  write_paths: string[];
213
236
  }>;
214
- /** The worker's self-reported `amended_files` (adjudicated, never trusted as the gate input). */
215
- amendedFiles: string[];
216
237
  };
217
238
  }
218
239
  export interface AcceptNodeWorktreeResult {
@@ -314,6 +335,21 @@ export interface DagNodeFields {
314
335
  * - `node --test <path>`
315
336
  */
316
337
  export declare function isBuildFreeVerifyCommand(cmd: string): boolean;
338
+ /**
339
+ * Derive a node's per-node verify commands from the test files it ACTUALLY touched
340
+ * on its worktree branch (the git ground truth), instead of trusting host-authored
341
+ * `targeted_commands` whose paths/runner can drift from where the worker put the
342
+ * test. Always typechecks (`npm run check`, no emit), then runs ONLY this node's
343
+ * own touched test files with the repo's runners — never the whole suite (which
344
+ * would re-enter worktree-spawning tests inside a nested worktree). Build-free: the
345
+ * host owns the central build; a node's own test imports the source it changed via
346
+ * the tsx loader. Returns `[]` when there is no git ground truth so the caller can
347
+ * skip the gate rather than fabricate a command.
348
+ */
349
+ /** Pure assembly (git-free) of the verify commands for a set of edited paths —
350
+ * the testable core of {@link deriveVerifyCommandsFromBranch}. */
351
+ export declare function verifyCommandsForEdits(editedFiles: Iterable<string>): string[];
352
+ export declare function deriveVerifyCommandsFromBranch(root: string, branch: string): string[];
317
353
  /**
318
354
  * Best-effort: repo-relative test files that reference any of `sourceFiles` (by
319
355
  * module basename). Pulling them into a block's access lets the worker that
@@ -435,19 +471,29 @@ export declare function blockScopesFromPlan(plan: RemediationDispatchPlan): Arra
435
471
  */
436
472
  export declare function declaredPathsFromPlan(plan: RemediationDispatchPlan, blockId: string): string[];
437
473
  /**
438
- * Accept-time write-scope gate (OBL-DS-06), run from `acceptNodeWorktree` AFTER
439
- * the verify and BEFORE the cherry-pick so a violation PREVENTS the merge rather
440
- * than being reported once the edit already landed in main. It adjudicates the
441
- * worker's self-reported `amended_files` against all blocks' declared scopes via
442
- * an ephemeral `OwnershipRegistry` seeded from `allBlockScopes`: an unowned
443
- * amended path is granted and widens this node's effective scope (the surfaced
444
- * amend path a too-narrow declared scope no longer blocks a correct fix); a path
445
- * owned by another block is a seam conflict that blocks. The gate then diffs the
446
- * worktree branch (the git ground truth, never the self-report) against the
447
- * effective scope. Cross-sibling contention on a file two live nodes both amend is
448
- * left to the merge-time lost-update detector (`detectOverlappingEdits`), which
474
+ * Pure write-scope adjudication (OBL-DS-06) git-free so it is unit-testable with
475
+ * a synthetic edit set. Seeds an ephemeral `OwnershipRegistry` from `allBlockScopes`
476
+ * (normalised to repo-relative so ownership compares like-for-like) and routes the
477
+ * node's ACTUAL out-of-declared edits the git ground truth, never a self-report:
478
+ * - an edit to a file no sibling block owns is granted and widens this node's
479
+ * effective scope (a too-narrow or empty declared scope no longer blocks a
480
+ * correct fix; this is the sanctioned "extend into unowned files" path);
481
+ * - an edit to a file in another block's declared scope is a seam conflict that
482
+ * blocks until the seam protocol re-scopes or serialises the nodes.
483
+ * Cross-sibling contention on a file two live nodes both touch (neither declared)
484
+ * is left to the merge-time lost-update detector (`detectOverlappingEdits`), which
449
485
  * sees the full set of merged blocks a single accept cannot.
450
486
  */
487
+ export declare function adjudicateWriteScope(allBlockScopes: Array<{
488
+ block_id: string;
489
+ write_paths: string[];
490
+ }>, blockId: string, edited: GitEditedFiles, root: string): WriteScopeDecision;
491
+ /**
492
+ * Accept-time write-scope gate, run from `acceptNodeWorktree` AFTER the verify and
493
+ * BEFORE the cherry-pick so a violation PREVENTS the merge rather than being
494
+ * reported once the edit already landed in main. Thin git wrapper around
495
+ * {@link adjudicateWriteScope}: resolves the branch's actual edits and adjudicates.
496
+ */
451
497
  export declare function enforceAcceptWriteScope(params: {
452
498
  root: string;
453
499
  branch: string;
@@ -456,7 +502,6 @@ export declare function enforceAcceptWriteScope(params: {
456
502
  block_id: string;
457
503
  write_paths: string[];
458
504
  }>;
459
- amendedFiles: string[];
460
505
  }): WriteScopeDecision;
461
506
  /**
462
507
  * Build the map from a known obligation/node alias to the finding id that owns
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/remediate/steps/dispatch.ts"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,eAAe,EAEf,oBAAoB,EACpB,2BAA2B,EAE3B,oBAAoB,EACpB,YAAY,EACb,MAAM,oBAAoB,CAAC;AA6B5B,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AAapB,OAAO,EAEL,8BAA8B,EAM/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,8BAA8B,EAAE,CAAC;AAC1C,OAAO,EACL,6BAA6B,IAAI,4BAA4B,GAC9D,MAAM,wBAAwB,CAAC;AAOhC,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAIrC,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC;IAC3C;;;OAGG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C,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,gBAAgB,GACtB,eAAe,CA+BjB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,MAAM,EAAE,EACzB,iBAAiB,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,EACrE,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAaf;AAMD,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpB;AAED,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,gBAAgB,EAAE,GAChC,eAAe,EAAE,CAwBnB;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAkC3B;AA8eD,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAE9B;AAED,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,uBAAuB,CAAC,CAElC"}
@@ -507,6 +507,44 @@ export function mergeWorktree(root, worktreePath, branchName) {
507
507
  removeWorktree(root, worktreePath);
508
508
  return { success: true };
509
509
  }
510
+ /**
511
+ * Rebase a node's worktree branch onto the main checkout's current HEAD (the
512
+ * remediation branch tip) so a sibling that merged AFTER this worktree was created
513
+ * is folded in before this node verifies and merges. Additive edits to a shared
514
+ * file merge automatically (git's per-commit 3-way); a true hunk conflict is a
515
+ * genuine seam that aborts cleanly so the node routes to triage instead of landing
516
+ * a broken merge. The branch is checked out in the worktree, so the rebase runs
517
+ * there. A no-op (branch already on HEAD — the common, no-sibling-merged case)
518
+ * succeeds. Leaves the branch on its pre-rebase commit on abort (so the failed
519
+ * node's work can still be quarantined).
520
+ */
521
+ export function rebaseBranchOntoHead(root, worktreePath, branch) {
522
+ const head = spawnSync("git", ["rev-parse", "HEAD"], { cwd: root, encoding: "utf8", shell: false });
523
+ if (head.error || head.status !== 0) {
524
+ const detail = (head.stderr ?? head.error?.message ?? "git rev-parse failed").toString().trim();
525
+ return { ok: false, error: `could not resolve remediation HEAD for rebase: ${detail}` };
526
+ }
527
+ const target = head.stdout.trim();
528
+ const rebase = spawnSync("git", ["rebase", target], {
529
+ cwd: worktreePath,
530
+ encoding: "utf8",
531
+ shell: false,
532
+ });
533
+ if (rebase.error || rebase.status !== 0) {
534
+ const detail = [rebase.stdout ?? "", rebase.stderr ?? "", rebase.error?.message ?? ""]
535
+ .filter(Boolean)
536
+ .join("\n")
537
+ .trim();
538
+ // Leave a clean tree: abort the in-progress rebase before the worktree is dropped.
539
+ spawnSync("git", ["rebase", "--abort"], { cwd: worktreePath, shell: false });
540
+ return {
541
+ ok: false,
542
+ error: `rebase onto the current remediation HEAD conflicted (a real seam — two ` +
543
+ `nodes edited the same lines): ${detail}`,
544
+ };
545
+ }
546
+ return { ok: true };
547
+ }
510
548
  /** Worktree path for a remediation block. */
511
549
  export function worktreePath(root, blockId, runId) {
512
550
  return join(root, ".audit-tools", "worktrees", `remediate-${blockId}-${runId}`);
@@ -725,8 +763,27 @@ export function acceptNodeWorktree(params) {
725
763
  removeWorktree(root, wt);
726
764
  return { outcome: "success", verifyPassed, merged };
727
765
  }
728
- const verify = targetedCommands.length > 0
729
- ? verifyNodeInWorktree(wt, targetedCommands)
766
+ // Rebase the node's branch onto the current remediation HEAD BEFORE verify, so a
767
+ // sibling that merged after this worktree was created is folded in. Verify, the
768
+ // write-scope gate, and the cherry-pick then all operate on the FINAL to-be-merged
769
+ // content (green-at-merge; the later cherry-pick can no longer conflict). A true
770
+ // hunk conflict here is a genuine seam — preserve the work and route to triage
771
+ // rather than land a broken merge.
772
+ const rebase = rebaseBranchOntoHead(root, wt, branch);
773
+ if (!rebase.ok) {
774
+ quarantineFailedNodeCommit(root, branch, runId, blockId);
775
+ removeWorktree(root, wt);
776
+ return { outcome: "error", verifyPassed, merged, diagnostic: rebase.error };
777
+ }
778
+ // Verify commands: when the host omits them (real rolling drivers), DERIVE them
779
+ // from the just-committed branch's touched test files — correct paths/runner by
780
+ // construction, only this node's own tests, never the whole suite. An explicit
781
+ // list (or `[]` to skip) overrides; both used by lifecycle unit tests.
782
+ const verifyCommands = targetedCommands === undefined
783
+ ? deriveVerifyCommandsFromBranch(root, branch)
784
+ : targetedCommands;
785
+ const verify = verifyCommands.length > 0
786
+ ? verifyNodeInWorktree(wt, verifyCommands)
730
787
  : { passed: true, output: "" };
731
788
  verifyPassed = verify.passed;
732
789
  if (!verify.passed) {
@@ -742,16 +799,16 @@ export function acceptNodeWorktree(params) {
742
799
  // Write-scope gate (OBL-DS-06), BEFORE the cherry-pick: an out-of-scope or
743
800
  // seam-conflicting edit must never land in the main tree, so it is adjudicated
744
801
  // against the branch's git diff (the ground truth) here rather than reported
745
- // after `mergeWorktree` already merged it. A worker that legitimately needed a
746
- // file outside its declared scope declares it via `amended_files`; an unowned
747
- // amendment widens the effective scope, while one owned by another block blocks.
802
+ // after `mergeWorktree` already merged it. The gate routes the node's ACTUAL
803
+ // out-of-declared edits (git diff, never a self-report): an edit to a file no
804
+ // sibling block owns widens the effective scope, while one owned by another
805
+ // block blocks as a seam conflict.
748
806
  if (params.scope) {
749
807
  const decision = enforceAcceptWriteScope({
750
808
  root,
751
809
  branch,
752
810
  blockId,
753
811
  allBlockScopes: params.scope.allBlockScopes,
754
- amendedFiles: params.scope.amendedFiles,
755
812
  });
756
813
  if (decision.blocked) {
757
814
  // Scope-blocked but the node committed real work — preserve it for recovery.
@@ -881,6 +938,55 @@ function buildFreeVerifyCommands(commands) {
881
938
  return [];
882
939
  return commands.filter((c) => typeof c === "string" && isBuildFreeVerifyCommand(c));
883
940
  }
941
+ /** A repo-relative test path → the runner that executes that file directly. */
942
+ function verifyRunnerForTestFile(repoRelPath) {
943
+ // node:test suites (audit/shared) — run via the tsx loader so the TS source the
944
+ // test imports needs no prior build. vitest suites (remediate) — `vitest run`.
945
+ if (/^tests\/.+\.test\.mjs$/.test(repoRelPath))
946
+ return "node:test";
947
+ if (/^tests\/.+\.test\.(ts|tsx)$/.test(repoRelPath))
948
+ return "vitest";
949
+ return undefined;
950
+ }
951
+ /**
952
+ * Derive a node's per-node verify commands from the test files it ACTUALLY touched
953
+ * on its worktree branch (the git ground truth), instead of trusting host-authored
954
+ * `targeted_commands` whose paths/runner can drift from where the worker put the
955
+ * test. Always typechecks (`npm run check`, no emit), then runs ONLY this node's
956
+ * own touched test files with the repo's runners — never the whole suite (which
957
+ * would re-enter worktree-spawning tests inside a nested worktree). Build-free: the
958
+ * host owns the central build; a node's own test imports the source it changed via
959
+ * the tsx loader. Returns `[]` when there is no git ground truth so the caller can
960
+ * skip the gate rather than fabricate a command.
961
+ */
962
+ /** Pure assembly (git-free) of the verify commands for a set of edited paths —
963
+ * the testable core of {@link deriveVerifyCommandsFromBranch}. */
964
+ export function verifyCommandsForEdits(editedFiles) {
965
+ const nodeTests = [];
966
+ const vitestTests = [];
967
+ for (const f of editedFiles) {
968
+ const rel = f.replace(/\\/g, "/");
969
+ const runner = verifyRunnerForTestFile(rel);
970
+ if (runner === "node:test")
971
+ nodeTests.push(rel);
972
+ else if (runner === "vitest")
973
+ vitestTests.push(rel);
974
+ }
975
+ const cmds = ["npm run check"];
976
+ if (nodeTests.length > 0) {
977
+ cmds.push(`node --import tsx/esm --test ${nodeTests.sort().join(" ")}`);
978
+ }
979
+ if (vitestTests.length > 0) {
980
+ cmds.push(`npx vitest run ${vitestTests.sort().join(" ")}`);
981
+ }
982
+ return cmds;
983
+ }
984
+ export function deriveVerifyCommandsFromBranch(root, branch) {
985
+ const edited = gitEditedFilesForBranch(root, branch);
986
+ if (!edited.available)
987
+ return [];
988
+ return verifyCommandsForEdits(edited.files);
989
+ }
884
990
  function markStarted(item) {
885
991
  item.started_at ??= new Date().toISOString();
886
992
  delete item.completed_at;
@@ -1781,46 +1887,63 @@ export function declaredPathsFromPlan(plan, blockId) {
1781
1887
  return [...(item.access.write_paths ?? []), ...(item.access.read_paths ?? [])];
1782
1888
  }
1783
1889
  /**
1784
- * Accept-time write-scope gate (OBL-DS-06), run from `acceptNodeWorktree` AFTER
1785
- * the verify and BEFORE the cherry-pick so a violation PREVENTS the merge rather
1786
- * than being reported once the edit already landed in main. It adjudicates the
1787
- * worker's self-reported `amended_files` against all blocks' declared scopes via
1788
- * an ephemeral `OwnershipRegistry` seeded from `allBlockScopes`: an unowned
1789
- * amended path is granted and widens this node's effective scope (the surfaced
1790
- * amend path a too-narrow declared scope no longer blocks a correct fix); a path
1791
- * owned by another block is a seam conflict that blocks. The gate then diffs the
1792
- * worktree branch (the git ground truth, never the self-report) against the
1793
- * effective scope. Cross-sibling contention on a file two live nodes both amend is
1794
- * left to the merge-time lost-update detector (`detectOverlappingEdits`), which
1890
+ * Pure write-scope adjudication (OBL-DS-06) git-free so it is unit-testable with
1891
+ * a synthetic edit set. Seeds an ephemeral `OwnershipRegistry` from `allBlockScopes`
1892
+ * (normalised to repo-relative so ownership compares like-for-like) and routes the
1893
+ * node's ACTUAL out-of-declared edits the git ground truth, never a self-report:
1894
+ * - an edit to a file no sibling block owns is granted and widens this node's
1895
+ * effective scope (a too-narrow or empty declared scope no longer blocks a
1896
+ * correct fix; this is the sanctioned "extend into unowned files" path);
1897
+ * - an edit to a file in another block's declared scope is a seam conflict that
1898
+ * blocks until the seam protocol re-scopes or serialises the nodes.
1899
+ * Cross-sibling contention on a file two live nodes both touch (neither declared)
1900
+ * is left to the merge-time lost-update detector (`detectOverlappingEdits`), which
1795
1901
  * sees the full set of merged blocks a single accept cannot.
1796
1902
  */
1797
- export function enforceAcceptWriteScope(params) {
1798
- const { root, branch, blockId, allBlockScopes, amendedFiles } = params;
1903
+ export function adjudicateWriteScope(allBlockScopes, blockId, edited, root) {
1799
1904
  const registry = new OwnershipRegistry();
1800
- registry.initialize(allBlockScopes.map((b) => ({ node_id: b.block_id, write_paths: b.write_paths })));
1801
- if (amendedFiles.length > 0) {
1802
- const { seam_routed } = routeAmendmentRequest(registry, blockId, amendedFiles);
1803
- if (seam_routed.length > 0) {
1804
- const detail = seam_routed
1805
- .map((r) => {
1806
- const reason = r.reason;
1807
- if (reason.outcome === "owned")
1808
- return `${r.path} owned by ${reason.owner_node_id}`;
1809
- if (reason.outcome === "contended") {
1810
- return `${r.path} contended by ${reason.sibling_node_id}`;
1811
- }
1812
- return r.path;
1813
- })
1814
- .join("; ");
1815
- return {
1816
- blocked: true,
1817
- reason: `Worker amended files owned by another block (seam conflict): ${detail}. ` +
1818
- `Resolve via the seam protocol before this node can land.`,
1819
- };
1905
+ registry.initialize(allBlockScopes.map((b) => ({
1906
+ node_id: b.block_id,
1907
+ write_paths: b.write_paths.map((p) => toRepoRelative(p, root)),
1908
+ })));
1909
+ if (edited.available) {
1910
+ // The node's real source edits outside its declared scope (sanctioned side
1911
+ // outputs already excluded by writeScopeViolations).
1912
+ const candidates = writeScopeViolations(registry.getScope(blockId), edited.files, root);
1913
+ if (candidates.length > 0) {
1914
+ const { seam_routed } = routeAmendmentRequest(registry, blockId, candidates);
1915
+ if (seam_routed.length > 0) {
1916
+ const detail = seam_routed
1917
+ .map((r) => {
1918
+ const reason = r.reason;
1919
+ if (reason.outcome === "owned")
1920
+ return `${r.path} owned by ${reason.owner_node_id}`;
1921
+ if (reason.outcome === "contended") {
1922
+ return `${r.path} contended by ${reason.sibling_node_id}`;
1923
+ }
1924
+ return r.path;
1925
+ })
1926
+ .join("; ");
1927
+ return {
1928
+ blocked: true,
1929
+ reason: `Node edited files owned by another block (seam conflict): ${detail}. ` +
1930
+ `Resolve via the seam protocol (re-scope contracts or serialise the nodes) before this node can land.`,
1931
+ };
1932
+ }
1933
+ // every candidate was unowned → granted into this node's effective scope.
1820
1934
  }
1821
1935
  }
1822
- const effective = registry.getScope(blockId);
1823
- return enforceWriteScope(effective, gitEditedFilesForBranch(root, branch), root);
1936
+ return enforceWriteScope(registry.getScope(blockId), edited, root);
1937
+ }
1938
+ /**
1939
+ * Accept-time write-scope gate, run from `acceptNodeWorktree` AFTER the verify and
1940
+ * BEFORE the cherry-pick so a violation PREVENTS the merge rather than being
1941
+ * reported once the edit already landed in main. Thin git wrapper around
1942
+ * {@link adjudicateWriteScope}: resolves the branch's actual edits and adjudicates.
1943
+ */
1944
+ export function enforceAcceptWriteScope(params) {
1945
+ const { root, branch, blockId, allBlockScopes } = params;
1946
+ return adjudicateWriteScope(allBlockScopes, blockId, gitEditedFilesForBranch(root, branch), root);
1824
1947
  }
1825
1948
  // ---------------------------------------------------------------------------
1826
1949
  // Merge-seam: obligation-id → node remap + multi-entry collapse (tolerance)