fix(#4455): autonomous.md and complete-milestone.md resolve STATE/ROADMAP/MILESTONES/PROJECT/REQUIREMENTS through the workstream-scoped init fields (#4542)

* fix(#4455): thread workstream-scoped paths through autonomous and complete-milestone workflows

autonomous.md and complete-milestone.md read/wrote hardcoded literal
`.planning/STATE.md` / `.planning/ROADMAP.md` / `.planning/milestones/...`
paths in their shell fences, bypassing workstream scoping entirely. With
GSD_WORKSTREAM=alpha set, planningDir(cwd) correctly resolves into
workstreams/alpha/, but a literal `cat .planning/STATE.md` still read the
ROOT file (or silently returned empty if root state was absent) --
reproduced deterministically in the issue's own repro.

Root cause: each workflow step's bash fence is a separate shell
invocation, and cmdInitManager/cmdInitCompleteMilestone's JSON payloads
never carried resolved state_path/roadmap_path/archive_dir fields for the
workflows to extract -- unlike cmdInitPlanPhase, which already does this
correctly and is the pattern this fix mirrors.

- src/init.cts: cmdInitManager and cmdInitCompleteMilestone now emit
  state_path/roadmap_path (workstream-scoped via planningDir(cwd),
  existence-checked, toPosixPath'd, null when absent -- identical to
  cmdInitPlanPhase's existing contract) and archive_dir (the milestone
  archive directory, composed the same way milestone.cts's already-correct
  archive helper does per #1911).
- autonomous.md: discover_phases and iterate now extract state_path via
  the already-fetched INIT_MANAGER payload instead of hardcoding
  `.planning/STATE.md`; iterate's second, previously-separate hardcoded
  read is folded into the same fence (no double-fetch); lifecycle step 5b
  checks the resolved archive_dir instead of a hardcoded milestones path.
- complete-milestone.md's reorganize_roadmap_and_delete_originals step
  (which previously called no init command at all) now fetches
  init.complete-milestone and uses the resolved roadmap_path/state_path/
  archive_dir for the backlog read, the write-guard sentinel's armed
  content, the Write-tool target for the reorganized ROADMAP.md (the
  sentinel fence now echoes the resolved path so the executing agent can
  see it), and the safety-commit --files list. `.planning/MILESTONES.md`
  and `.planning/PROJECT.md` stay literal root paths -- documented shared
  files, per the issue's explicit "not a blanket replacement" scope.

Regression tests extract and execute the real bash fences (with a stubbed
gsd_run) rather than string-matching the markdown, covering flat mode
(unaffected), an active workstream (the issue's own repro shape, now
correctly resolving), the no-double-fetch requirement, and a dedicated
guard locking MILESTONES.md/PROJECT.md as shared.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(#4455): add changeset for workstream-scoped autonomous/complete-milestone fix

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(#4455): close write-guard gap on workstream-scoped curated paths

Isolated security review of the #4455 fix (workstream-scoped STATE/
ROADMAP/milestone-archive path resolution in autonomous.md and
complete-milestone.md) flagged that hooks/gsd-write-guard.js's
CURATED_PATTERNS only matched root-level .planning/ paths, never
.planning/[<project>/]workstreams/<ws>/... — meaning the catastrophic-
shrink guard silently never engaged for a workstream-scoped write.
This is directly relevant here: the #4455 change makes a workstream-
scoped ROADMAP.md Write reachable via complete-milestone.md's own
explicit sentinel-hatch instructions, which assume guard protection
that did not actually exist for that path shape. Extended
CURATED_PATTERNS with the three workstream-scoped equivalents;
consumeSentinelFor's own path-derivation logic needed no change since
it derives from the actual write target. Verified empirically (a
293->16 line workstream ROADMAP.md shrink now correctly returns
exit 2 / decision:"block") and with 5 new regression tests.

Also addressed a code-review nit on the core #4455 fix:
cmdInitCompleteMilestone called planningDir(cwd) three separate
times instead of caching it once.

Accepted as-is (not fixed): complete-milestone.md's
reorganize_roadmap_and_delete_originals step re-fetches
`gsd_run query init.complete-milestone` three times across its
fences rather than merging the first two (no state-changing Write
between them, unlike autonomous.md's iterate step which does merge).
This is an efficiency nit, not a correctness bug — merging risks
disrupting the step's prose flow and its existing binding test for a
non-functional gain.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(#4455): add changeset for the write-guard workstream-scope fix

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(#4455): fix gsd-test-surfaced regressions from workstream-path fix

Running gsd-test against the full #4455 diff (including the write-guard
security fix and the cmdInitCompleteMilestone caching nit) surfaced four
real, non-flaky failures, all direct consequences of editing
gsd-core/workflows/autonomous.md and complete-milestone.md:

1. tests/autonomous-converge.test.cjs pinned the OLD hardcoded
   `STATE_CONTENT=$(cat .planning/STATE.md ...)` read in both
   discover_phases and iterate. That is exactly the literal-path
   behavior #4455 fixes, so the test needed updating to assert the new
   init.manager-resolved `STATE_PATH` read instead (with an explicit
   doesNotMatch guard against regressing to the old literal).

2. tests/workstream-scoped-paths.test.cjs's own "no-double-fetch" test
   counted gsd_run invocations via a shell variable incremented inside
   the stub function — but `INIT_MANAGER=$(gsd_run ...)` runs gsd_run
   inside the command-substitution SUBSHELL, so that increment never
   survives back to the parent shell and the counter always read 0.
   Switched to a file-based call log (one byte appended per call),
   which survives the subshell boundary.

3. tests/compact-content-partition-guard.test.cjs's disjointness check
   flagged the reorganize_roadmap_and_delete_originals step's new
   `INIT_CM=$(gsd_run query init.complete-milestone)` fetch (added 3x,
   per the accepted-as-is disposition in the prior commit) as
   byte-identical to a pre-existing, unrelated fetch already present in
   complete-milestone/detail/elaboration.md's handle_branches section
   (§2). Same idiom, same conventional variable name, coincidentally
   colliding across the spine/detail split boundary. Renamed the new
   step's local variable to INIT_REORG — a distinct, purpose-specific
   name is arguably better practice anyway for two logically unrelated
   fetches, and it removes the literal collision honestly rather than
   restructuring the split.

4. tests/benchmark-compact-content.test.cjs reported real byte-count
   drift in the committed baseline (autonomous.md and
   complete-milestone.md both grew from the #4455 content). Refreshed
   via `node scripts/benchmark-compact-content.cjs --write`.

Verified: node scripts/benchmark-compact-content.cjs --check now
reports the baseline up to date; a standalone invocation of
checkDisjointness() against the real repo state now reports zero
violations across all 6 registered splits; manual bash-fence execution
of both the autonomous.md iterate fence (call count = 1) and the
complete-milestone.md backlog fence (with INIT_REORG) confirms correct
behavior.

Emitted-Drift-Ack-Growth: autonomous.md — #4455 workstream-scoped STATE.md path resolution replaces hardcoded literal reads
Emitted-Drift-Ack-Growth: complete-milestone.md — #4455 workstream-scoped STATE/ROADMAP/archive path resolution replaces hardcoded literal reads
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(#4455): MILESTONES.md/PROJECT.md/REQUIREMENTS.md are workstream-scoped too, and so is project-only mode

Fresh isolated code-review and security-review passes against the full
diff (run after the previous gsd-test-surfaced fixups landed) each
found one real, confirmed defect:

Code review: the safety-commit `--files` list and the REQUIREMENTS.md
`git rm` step both hardcoded `.planning/MILESTONES.md`,
`.planning/PROJECT.md`, and `.planning/REQUIREMENTS.md` as literal
root paths — but src/milestone.cts's cmdMilestoneComplete writes
MILESTONES.md via `planningPaths(cwd).planning` (the workstream base)
and PROJECT.md/REQUIREMENTS.md resolve the same way through
`planningPaths().project`/`.requirements` (src/planning-workspace.cts).
Only `todos` is the documented root-scoped exception (#4256); an
earlier version of this fix wrongly generalized that exception to
MILESTONES.md/PROJECT.md too, and the now-corrected test previously
enshrined that wrong behavior as intended. Under an active workstream,
the safety commit would have silently missed the actual files
`milestone complete` just wrote, and the git-rm step would have
targeted the wrong (root) REQUIREMENTS.md entirely. Fixed by exposing
`milestones_path`/`project_path`/`requirements_path` from
init.complete-milestone (src/init.cts) and resolving all three through
them, the same pattern already used for state_path/roadmap_path/
archive_dir. The four remaining literal MILESTONES.md/PROJECT.md
mentions elsewhere in complete-milestone.md (lines ~12-13, ~441, ~607,
~662) are display-only prose in status/summary message templates, not
actual file operations — left as-is; they are a cosmetic path-display
inaccuracy under an active workstream, not a data-integrity bug like
the two fixed here.

Security review: confirmed the write-guard fix from the prior commit
is correct and complete for workstream scoping, and independently
surfaced the same project-only gap the code-review pass above also
caught structurally: `CURATED_PATTERNS` had no pattern for
`.planning/<project>/...` (GSD_PROJECT set, GSD_WORKSTREAM unset) —
planningDir(cwd) supports that shape independently of workstream
nesting, so it is reachable, not hypothetical. Fixed by adding three
more patterns, verified empirically (a project-scoped 292->16 line
ROADMAP.md shrink now correctly returns exit 2 / decision:"block")
and with 6 new regression tests.

Verified: manual bash-fence execution of the corrected commit-files
and requirements-rm fences (both flat mode and GSD_WORKSTREAM=alpha)
resolves to the right paths in both cases; a standalone invocation of
checkDisjointness() against the real repo state still reports zero
violations; the benchmark baseline was refreshed again for the further
size change (already covered by the existing Emitted-Drift-Ack-Growth
trailer on complete-milestone.md two commits back — that trailer is
read over the whole merge-base..HEAD range, not per-commit, so it
still applies here).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(#4455): backfill changeset PR numbers and correct final scope

pr: 0 -> pr: 4542 for both fragments, and updated both bodies to
reflect the final fix scope (MILESTONES/PROJECT/REQUIREMENTS are
workstream-scoped too, not shared-root exceptions; the write-guard fix
also covers project-only scoping, not just workstream nesting).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(#4455): lifecycle-5b archive-path assertions use the fence's own separator, not path.join

PR CI's windows-latest shard 3/3 failed: "expected ls to find the root
archive file, got: ...\milestones-root/v1.0-ROADMAP.md". The
autonomous.md lifecycle step 5b fence composes the checked path with a
literal bash `/` (`"${ARCHIVE_DIR}/v${milestone_version}-ROADMAP.md"`),
which on Windows yields a MIXED-separator path — Windows backslashes
from archiveDir plus one trailing `/`. My test's assertion used
path.join(archiveDir, 'v1.0-ROADMAP.md') instead, which on a Windows
Node process produces an all-backslash path that never matches the
fence's mixed-separator output. Both assertions in that describe block
now mirror the fence's own literal `/` concatenation
(`${archiveDir}/v1.0-ROADMAP.md`) instead of path.join — matching the
style the other two describe blocks in this same file (safety-commit
--files list) already used correctly for the identical archive-dir
pattern, so this brings the one outlier into line rather than
introducing a new idiom.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(#4455): write-guard sentinel comparison now realpath-resolves the token, not just the target

PR CI's macos-latest full-test shard 2/3 failed a #4455 test: "the
sentinel hatch ... unblocks a workstream ROADMAP.md write" got status
2 (still blocked) instead of 0.

Root cause, unrelated to the Windows fix in the previous commit:
hooks/gsd-write-guard.js's main flow realpath-resolves the Write
TARGET before the curated-pattern match (round 9 Minor 1's
symlink-before-match fix, `filePath = fs.realpathSync(filePath)`), but
consumeSentinelFor resolved the sentinel TOKEN's absolute path via
plain path.resolve() with no realpath step. On macOS, os.tmpdir()
resolves through a /var -> /private/var symlink, so a test's cwd
(lexically under /var/folders/...) and its realpath'd target
(/private/var/folders/...) diverge — an armed, correct sentinel then
never matches the realpath'd target string, and the guard stays
incorrectly blocked. This is not macOS-specific in principle: ANY cwd
sitting under a symlink (a symlinked project checkout, a symlinked
worktree) hits the same asymmetry — gsd-test's Linux bench runs never
caught it because /tmp there is not a symlink.

Fixed by applying the same fs.realpathSync (with the same
keep-lexical-on-failure fallback the caller already uses) to the
token's resolved path before comparing. The named file is already
known to exist at this point (the caller only reaches consumeSentinelFor
after successfully reading the target), so realpath is expected to
succeed in the legitimate case; a garbage/mismatched token still fails
safe (verified — falls back to the lexical path, still mismatches,
stays blocked).

Verified: reproduced the exact bug locally (macOS) via os.tmpdir()
before the fix, confirmed it resolves after; the negative case
(sentinel armed for a DIFFERENT file) still correctly blocks; the
pre-existing relative-token sentinel tests (predating #4455) still
pass; a garbage/non-existent token still fails safe. Added a
deterministic, cross-platform regression test using an explicit
symlink (skipped on Windows, matching the existing round-9 symlink
test's own skip condition) so this class of bug is caught by
gsd-test's Linux bench too, not only by a real macOS CI run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: sim <sim@local>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-09-08 04:56:11 -04:00
committed by GitHub
parent b8c70a33c0
commit c6df4e1e46
11 changed files with 846 additions and 25 deletions

View File

@@ -25,6 +25,7 @@
const { describe, test, before, after } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const { createTempDir, cleanup } = require('./helpers.cjs');
const { runHook: runHookSeam } = require('./helpers/process-seam.cjs');
@@ -540,6 +541,187 @@ describe('guard <-> complete-milestone workflow binding (the escape hatch is WIR
});
});
describe('workstream-scoped curated paths (#4455)', () => {
// Security-review finding on #4455: planningDir(cwd) (src/planning-workspace.cts)
// resolves to `.planning/[<project>/]workstreams/<ws>/...` whenever GSD_WORKSTREAM
// is set — but CURATED_PATTERNS only matched the root form, so the guard's ENTIRE
// catastrophic-shrink protection (not just the sentinel step — the ratio check too)
// silently never engaged for a workstream-scoped ROADMAP.md/STATE.md/milestone
// archive Write. complete-milestone.md's reorganize step explicitly targets a
// resolved (potentially workstream-scoped) $ROADMAP_PATH via the Write tool and
// claims "the guard allows this one shrink" — that claim was FALSE under an active
// workstream, since the guard never recognized the target as curated at all.
let wsProjectDir;
let wsRoadmapPath;
let wsStatePath;
let wsMilestoneArchivePath;
let wsPlanningDir;
before(() => {
wsProjectDir = createTempDir('gsd-write-guard-ws-');
wsPlanningDir = path.join(wsProjectDir, '.planning');
const wsDir = path.join(wsPlanningDir, 'workstreams', 'alpha');
fs.mkdirSync(path.join(wsDir, 'milestones'), { recursive: true });
wsRoadmapPath = path.join(wsDir, 'ROADMAP.md');
wsStatePath = path.join(wsDir, 'STATE.md');
wsMilestoneArchivePath = path.join(wsDir, 'milestones', 'v1.0-ROADMAP.md');
});
after(() => {
cleanup(wsProjectDir);
});
test('a workstream-scoped ROADMAP.md catastrophic shrink is BLOCKED (was silently unguarded before #4455)', () => {
fs.writeFileSync(wsRoadmapPath, lines(292));
const r = runHook(writePayload(wsRoadmapPath, lines(16), { cwd: wsProjectDir }));
assert.equal(r.status, 2, `expected exit 2 (blocked), got ${r.status}; stdout: ${r.stdout}`);
assert.equal(JSON.parse(r.stdout).decision, 'block');
});
test('a workstream-scoped STATE.md catastrophic shrink is BLOCKED', () => {
fs.writeFileSync(wsStatePath, lines(292));
const r = runHook(writePayload(wsStatePath, lines(16), { cwd: wsProjectDir }));
assert.equal(r.status, 2, `expected exit 2 (blocked), got ${r.status}; stdout: ${r.stdout}`);
assert.equal(JSON.parse(r.stdout).decision, 'block');
});
test('a workstream-scoped milestone archive ROADMAP catastrophic shrink is BLOCKED', () => {
fs.writeFileSync(wsMilestoneArchivePath, lines(292));
const r = runHook(writePayload(wsMilestoneArchivePath, lines(16), { cwd: wsProjectDir }));
assert.equal(r.status, 2, `expected exit 2 (blocked), got ${r.status}; stdout: ${r.stdout}`);
assert.equal(JSON.parse(r.stdout).decision, 'block');
});
test('the sentinel hatch (armed at the ROOT .planning/.gsd-allow-shrink, naming the workstream path) unblocks a workstream ROADMAP.md write', () => {
// complete-milestone.md's sentinel fence always writes to the ROOT
// .planning/.gsd-allow-shrink (unchanged by #4455 — consumeSentinelFor
// derives that same root location from the write TARGET's path
// regardless of how deep a workstream target is nested), naming the
// resolved (workstream-scoped) $ROADMAP_PATH as its content.
fs.writeFileSync(wsRoadmapPath, lines(292));
fs.writeFileSync(path.join(wsPlanningDir, '.gsd-allow-shrink'), `${wsRoadmapPath}\n`);
const r = runHook(writePayload(wsRoadmapPath, lines(16), { cwd: wsProjectDir }));
assert.equal(r.status, 0,
`expected the sentinel to unblock the workstream-scoped write, got status ${r.status}; stdout: ${r.stdout}`);
});
test('a non-curated file inside a workstream dir stays exempt (no widening beyond ROADMAP/STATE/milestone-archive)', () => {
const notesPath = path.join(wsPlanningDir, 'workstreams', 'alpha', 'NOTES.md');
fs.writeFileSync(notesPath, lines(292));
const r = runHook(writePayload(notesPath, lines(16), { cwd: wsProjectDir }));
assert.equal(r.status, 0, `non-curated workstream file must pass; stdout: ${r.stdout}`);
});
test('the sentinel hatch unblocks even when cwd sits under a symlink (macOS full-test CI finding)',
{ skip: process.platform === 'win32' ? 'symlink creation needs privilege on Windows' : false }, () => {
// PR CI's macos-latest full-test shard caught this for free — os.tmpdir()
// on macOS resolves through a /var -> /private/var symlink, so the
// ABOVE test (identical cwd/target shape) failed there while passing
// everywhere gsd-test's Linux bench runs, where /tmp is not a symlink.
// This test reproduces the same asymmetry deterministically on any
// platform via an EXPLICIT symlink, so a regression here is caught by
// gsd-test too, not only by a real macOS CI run.
//
// Root cause: the caller (guard's main flow) realpath-resolves the
// WRITE TARGET before the curated match (round 9 Minor 1), but
// consumeSentinelFor compared the sentinel TOKEN's resolved path
// without the same realpath step — an armed, correct sentinel then
// never matched whenever cwd traversed a symlink.
const realBase = createTempDir('gsd-write-guard-symlink-real-');
const linkedProjectDir = path.join(os.tmpdir(), `gsd-write-guard-symlink-link-${process.pid}-${Date.now()}`);
fs.symlinkSync(realBase, linkedProjectDir, 'dir');
try {
const linkedPlanningDir = path.join(linkedProjectDir, '.planning');
const linkedWsDir = path.join(linkedPlanningDir, 'workstreams', 'alpha');
fs.mkdirSync(linkedWsDir, { recursive: true });
const linkedRoadmapPath = path.join(linkedWsDir, 'ROADMAP.md');
fs.writeFileSync(linkedRoadmapPath, lines(292));
// Armed with the LEXICAL (through-the-symlink) path, matching exactly
// what the workflow's own $ROADMAP_PATH (from init.complete-milestone,
// never realpath-resolved) would contain.
fs.writeFileSync(path.join(linkedPlanningDir, '.gsd-allow-shrink'), `${linkedRoadmapPath}\n`);
const r = runHook(writePayload(linkedRoadmapPath, lines(16), { cwd: linkedProjectDir }));
assert.equal(r.status, 0,
`expected the sentinel to unblock through the symlinked cwd, got status ${r.status}; stdout: ${r.stdout}`);
} finally {
cleanup(linkedProjectDir);
cleanup(realBase);
}
});
});
describe('project-only-scoped curated paths (#4455 follow-up)', () => {
// planningDir(cwd) ALSO resolves to `.planning/<project>/...` when
// GSD_PROJECT is set with NO GSD_WORKSTREAM — an independent dimension
// from the workstream nesting covered above. Found during this same PR's
// own review pass (identical root cause, one more path-shape variant) and
// fixed in the same change per this repo's no-deferral policy rather than
// left open as a "pre-existing, out of scope" gap.
let projProjectDir;
let projPlanningDir;
let projRoadmapPath;
let projStatePath;
let projMilestoneArchivePath;
before(() => {
projProjectDir = createTempDir('gsd-write-guard-proj-');
projPlanningDir = path.join(projProjectDir, '.planning');
const projDir = path.join(projPlanningDir, 'myproject');
fs.mkdirSync(path.join(projDir, 'milestones'), { recursive: true });
projRoadmapPath = path.join(projDir, 'ROADMAP.md');
projStatePath = path.join(projDir, 'STATE.md');
projMilestoneArchivePath = path.join(projDir, 'milestones', 'v1.0-ROADMAP.md');
});
after(() => {
cleanup(projProjectDir);
});
test('a project-scoped ROADMAP.md catastrophic shrink is BLOCKED (was silently unguarded before this fix)', () => {
fs.writeFileSync(projRoadmapPath, lines(292));
const r = runHook(writePayload(projRoadmapPath, lines(16), { cwd: projProjectDir }));
assert.equal(r.status, 2, `expected exit 2 (blocked), got ${r.status}; stdout: ${r.stdout}`);
assert.equal(JSON.parse(r.stdout).decision, 'block');
});
test('a project-scoped STATE.md catastrophic shrink is BLOCKED', () => {
fs.writeFileSync(projStatePath, lines(292));
const r = runHook(writePayload(projStatePath, lines(16), { cwd: projProjectDir }));
assert.equal(r.status, 2, `expected exit 2 (blocked), got ${r.status}; stdout: ${r.stdout}`);
assert.equal(JSON.parse(r.stdout).decision, 'block');
});
test('a project-scoped milestone archive ROADMAP catastrophic shrink is BLOCKED', () => {
fs.writeFileSync(projMilestoneArchivePath, lines(292));
const r = runHook(writePayload(projMilestoneArchivePath, lines(16), { cwd: projProjectDir }));
assert.equal(r.status, 2, `expected exit 2 (blocked), got ${r.status}; stdout: ${r.stdout}`);
assert.equal(JSON.parse(r.stdout).decision, 'block');
});
test('a non-curated file inside a project dir stays exempt', () => {
const notesPath = path.join(projPlanningDir, 'myproject', 'NOTES.md');
fs.writeFileSync(notesPath, lines(292));
const r = runHook(writePayload(notesPath, lines(16), { cwd: projProjectDir }));
assert.equal(r.status, 0, `non-curated project-scoped file must pass; stdout: ${r.stdout}`);
});
test('a project-scoped path is not accidentally matched by the workstream patterns (regex specificity check)', () => {
// Guards against a regression where the workstream patterns' optional
// `(?:[^/]+\/)?` project prefix is loosened enough to also swallow this
// shape by accident — asserting BOTH describe blocks' patterns exist
// independently, not that this one only passes via the other's regex.
const wsShapeAtProjectPath = path.join(projPlanningDir, 'myproject', 'workstreams');
fs.mkdirSync(wsShapeAtProjectPath, { recursive: true });
// Sanity: the project-scoped ROADMAP.md itself (not inside `workstreams/`)
// must still be curated — already proven above; this test only confirms
// the directory literally named "workstreams" existing alongside it
// doesn't change that outcome.
fs.writeFileSync(projRoadmapPath, lines(292));
const r = runHook(writePayload(projRoadmapPath, lines(16), { cwd: projProjectDir }));
assert.equal(r.status, 2, `project-scoped ROADMAP.md must stay blocked; stdout: ${r.stdout}`);
});
});
describe('the shipped claim matches the shipped guarantee (round 10 Major 2)', () => {
// The guard's reach is bounded: the sentinel is a plain file, so an agent
// that would reason past an advisory can arm one with a single Bash call.