Files
msd-core/tests/response-language-coverage.test.cjs
JusticeWay 0fca71eaae enhance(#2529): cover every workflow with response-language directives + CI lint (#2558)
* enhance(#2529): cover every workflow with response-language directives + CI lint

Every workflow now carries response-language coverage in one of three forms,
and a CI lint keeps it that way.

- 43 workflows load the new shared reference,
  `gsd-core/references/response-language-directive.md`, by eager `@`-import.
- Lazy-loaded modes/steps/templates, which cannot rely on an eager import,
  carry an exact inline directive; 35 such paths are pinned by exact path.
- Fragments dispatched by a covered parent inherit coverage, proven per file
  rather than granted per directory.

The 45 workflows whose directive covered only "questions, prompts, and
explanations" now name inter-tool narration, which is the defect #2529
reports: the running commentary between tool calls stayed English while the
answers around it were translated.

`scripts/lint-response-language-coverage.cjs` enforces it and fails closed on
three independent discovery failures (unreadable catalog, empty catalog,
unfollowed symlink). It resolves which reference a workflow imports and applies
the same four-predicate test to that file, so a weakened shared reference
uncovers its importers instead of passing silently, reported once as a systemic
failure rather than 43 times. The walk follows symlinked subtrees with a
realpath cycle bound. `lint:ci` invokes it by name.

REQ-LANG-03 and REQ-LANG-04 state the contract in docs/FEATURES.md;
REQ-LANG-04 names the two forms that satisfy it ("narration", "between tool
calls") rather than enumerating class members an author cannot use verbatim,
and a test pins that text to what the matcher accepts.

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

* chore(#2529): register the coverage test in the docs-guard lane

`107eb8c1` (#3787) landed the docs-guard lane on `next` while this PR was
open: a test that reads a `docs/` path must be named in
`scripts/docs-guard-registry.cjs` or carry a `docs-guard-exempt` marker,
so the guards that read a doc run on the PR that changes it.

`tests/response-language-coverage.test.cjs` reads `docs/FEATURES.md` -- it
extracts every form REQ-LANG-04 offers an author and runs each through the
matcher that enforces it. Registration, not exemption, is the correct side
of that gate: a reword of the requirement with no code change is precisely
the diff this test exists to catch, and it is the diff the lane would
otherwise skip.

Registered narrowly (`['docs/FEATURES.md']`) rather than with the `'*'`
sentinel, so an unrelated docs change does not pull this test into the lane.

Verified: lint-docs-guard-registration 0 violations, tests/ci-docs-guard-registry.test.cjs
51/51, lint:ci exit 0.

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

* chore(#2529): consolidate this PR's emitted-growth acks into its own fragment

This PR ripples emitted bytes across 85 workflow paths. Until now each ripple
was acknowledged by appending to whichever live fragment owned that path,
because two ack sources may never name the same path.

`a84f7563` (#3078) swept all 45 fully-spent fragments off `next`. Forty-two of
the paths this PR grows were owned by swept fragments, so those keys are now
unowned and this PR's own fragment declares them directly -- one path, one
source, and no dependence on a fragment that no longer exists. Each adopted
entry keeps its measurement and records where it came from.

Two paths are handled differently, because the sweep did not free them:

- `review.md` is now owned by `3034-parallel-reviewer-lanes.json`, which
  landed on `next` after the sweep. Its entry is live, so the old route still
  applies: this PR's note is appended to that entry rather than declared a
  second time.
- `plan-review-convergence.md` keeps the arrangement made in round 24.

Result: 3 fragments in the directory, 85 keys in this PR's own,
0 cross-source duplicates. `lint-emitted-drift-ack` exit 0,
`tests/emitted-attribution.test.cjs` green.

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

* fix(#2529): move REQ-LANG-03/04 into the feature fragment that now generates them

`36375513` (#3845) made docs/FEATURES.md a generated projection of
docs/features/*.md, marked "do not edit by hand". This PR wrote REQ-LANG-03
and REQ-LANG-04 straight into the generated file, so the rebase left the
requirement present in the projection and absent from its source -- the next
regeneration would have deleted both, and `tests/features-index-gate.test.cjs`
was already red on the mismatch.

Both requirements now live in docs/features/response-language-config.md
alongside REQ-LANG-01 and -02. Regenerating produces a docs/FEATURES.md that is
byte-identical to the committed one, so the text this PR shipped is unchanged --
only its source of truth moved to where #3840 put it.

The docs-guard registration is widened to name the fragment as well as the
projection. The requirement's source is the fragment now, and an edit there
that skips regeneration would otherwise reach this guard through neither path.

Verified: features-index-gate 68/68, lint-docs-guard-registration 0 violations,
ci-docs-guard-registry + response-language-coverage 142/142.

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

* chore(#2529): hand the plan-phase ack back to its new live owner

`c933184b` (#3825) landed `3172-stated-failing-direction.json` on `next` after
fragment had adopted that path when the sweep left it unowned, so the merged
tree named it from two sources -- a hard failure in
`scripts/lint-emitted-drift-ack.cjs`.

The path has a live owner again, so the append route applies: this PR's note
joins that entry, carrying its own measurement, and the key is dropped from
this PR's fragment (84 keys left, the others untouched). The provenance
sentence written for the swept-fragment case is removed rather than reused --
this path was never orphaned, so that account of it would be false.

Same shape as `review.md` and `plan-review-convergence.md`: ownership is a
property of the merged tree, and a fragment landing upstream after a push can
reclaim a key no local check would have flagged.

Verified: lint-emitted-drift-ack exit 0, lint:ci exit 0.

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

* fix(#2529): state byte figures that are true against the tree

The reference claimed `execute-phase.md` has "2 bytes of headroom under the
ceiling named below". That was true when the sentence was written -- the file
sat at 93398 against the 93400 comfort assert -- and upstream has since shrunk
it to 91493 against a 93600 hard ceiling, so the figure now understates the
headroom by three orders of magnitude. The rationale the sentence supports does
not depend on the number, so the number is gone rather than refreshed: a
restated figure would go stale again on the next upstream edit, and nothing
parses it.

Audited every other numeric claim this PR ships the same way, mechanically
against the merge base: all 82 FILE-delta claims in the ack fragment match the
real per-file delta exactly, and the 1,629-byte reference and 63-byte import
line check out. One class was imprecise: the 41 notes for workflows whose
inline directive was rewritten in place quoted the conversion counterfactual as
"+1,692 bytes more loaded context", which is the reference form's whole weight,
not the increase over the inline directive those files already carry. Each now
names both quantities and the net (+1,605 / +1,609 / +1,584).

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

* fix(#2529): one rule for pinned vs inherited coverage, and the docs to pick it

Review measured that 14 of the 35 pinned fragments would pass by inheritance
anyway, and that the PR asserted both readings at once: inheritance is real
coverage (so those 14 pins are noise) or it is not (so 30 inheriting fragments
are green-but-uncovered). Only one can be true.

Inheritance is real: the predicate proves it per file -- the parent must
dispatch this exact path from a read/execute context AND be covered itself --
so the parent's directive is in the loaded context by the time the fragment is
read. The 14 pins are therefore removed along with the directive lines they
pinned, and those files inherit like the 30 structurally identical ones. The
rule is now stated where the set is declared, and enforced from the other side
by a test: no member of the pinned set may be one that would have inherited.
That is what decides the form for the next fragment.

- pinned set 35 -> 21; 14 workflow files revert to their base content
- `findViolations` no longer returns early on a pinned path: a file that becomes
  eagerly loaded and takes the shared reference is strictly better off, and the
  gate must not red that. The reference form is admitted because its own wording
  is validated in turn; an arbitrary reworded inline line still fails.
- the reference-directive cache is keyed by size and mtime, not by path alone,
  so a rewritten reference re-asked in one process no longer returns the stale
  verdict
- `carriesInlineDirective` names its negation blindness: four independent hits
  read vocabulary, not polarity
- the real-tree scan asserts each source produced files instead of `> 152`, a
  constant that read as the workflow count and would have passed a scan that
  lost one of its two directories
- the pinned-set size assertion goes the same way: the size follows from the
  rule, so the rule is what the suite asserts

Docs, for the gate that now governs every future workflow:
- `docs/contributing/response-language-coverage.md` -- why the narration class
  is the discriminator, the four coverage forms, the decision order that picks
  one, the pinned line, and what each failure message means
- a row in CONTRIBUTING.md's CI checks table, matching the docs-guard row
- `docs/CONFIGURATION.md` points at it from the `response_language` entry

Also: the changeset said 45 reworded workflows; it is 44 (42 @-reference + 21
pinned + 44 rewritten = 107 touched). That text ships to CHANGELOG.md.

`3707-parse-gap-reporting.json` landed on `next` reclaiming `audit-uat.md` and
`progress.md`; both handed back by the append route, leaving 82 keys here.

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

* fix(#2529): correct the reference-taker count, 43 -> 42

The ack notes said the import line is byte-identical "in each of the 43
workflows that take the reference" and that the alternative would be "43 inline
copies". The shared reference has 42 importers; the 43rd file in review's table
is `execute-phase.md`, which imports the OTHER reference. Corrected in all 41
notes that carry the sentence, across this PR's fragment and the two it appends
to.

Found by re-running the numeric audit from the previous round after the rebase,
which also re-verified all 84 FILE-delta claims against the new base -- all
exact.

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

* chore(#2529): migrate the emitted-drift ack from a fragment to commit trailers

ADR-3942 (#3954) landed while this PR was open: the acknowledgment is now a commit
trailer and tests/emitted-drift-acks/ no longer exists. The fragment is deleted and
each key it declared becomes one trailer, reasons unchanged.

The four keys this PR had handed to 3034-*, 3172-* and 3707-* under the one-source
rule come home here. That rule was the whole reason for the hand-backs, and the
trailer model has no shared namespace to collide in -- five of this PR's rounds were
spent on exactly those collisions.

Emitted-Drift-Ack-Growth: add-backlog.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: add-phase.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: add-tests.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation.
Emitted-Drift-Ack-Growth: add-todo.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation.
Emitted-Drift-Ack-Growth: ai-integration-phase.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 16: the fragment that carried this sentence (`3423-required-reading.json`) was retired on `next` by ddf85287 (fix(#3357), #3513), and no fragment on `next` declares this path now. The ack therefore returns to this PR's own fragment, which is the only live source for it — the change to the path is this PR's.
Emitted-Drift-Ack-Growth: analyze-dependencies.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: audit-fix.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed in round 19: this PR declared the path in its own fragment, and `3602-workflow-subagent-model-resolution.json` landed on `next` declaring it too. One path takes exactly one ack source, so the sentence moves here and the key leaves ours. Re-homed from `3602-workflow-subagent-model-resolution.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: audit-milestone.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed from `2962-zsh-nomatch-for-glob-portability.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: audit-uat.md — A live/archived split was added and then reverted on this branch (see `$comment`): the split's extra rule in `initialize`, the narrowed Unparsed-table filter, and the separate 'Unparsed UAT Files in Archived Milestones' informational section are all removed, so the file settles at origin/next 5582 -> 7124 bytes (+1542, final). #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: autonomous.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed in round 16: `3210-autonomous-precondition-gate.json` landed on `next` in 8fc88f66 (fix(#3210), #3528) and declares this path today. One path takes exactly one ack source, so the sentence moves here and the key leaves this PR's fragment. Re-homed from `3210-autonomous-precondition-gate.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: check-todos.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation.
Emitted-Drift-Ack-Growth: cleanup.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 18: this PR declared the path in its own fragment, and `2142-quick-task-archival.json` landed on `next` declaring it too. One path takes exactly one ack source, so the sentence moves here and the key leaves ours. Re-homed from `2142-quick-task-archival.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: code-review-fix.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed in round 13: `3190-code-review-fix-auto-rewrite-review.json` landed on `next` in 1d5d7795 (fix(#3190), #3434) and declares this path too. One path takes exactly one ack source, so the sentence moves here and the key leaves this PR's fragment. Re-homed from `3190-code-review-fix-auto-rewrite-review.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: code-review.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed in round 19: the fragment that carried this sentence (`3503-diff-base-scope-anchor.json`) was retired on `next` by 2fca0e17 (enhance(#2554), #3695), and `2554-code-review-depth-overrides.json` declares this path today. One path takes exactly one ack source, so the sentence follows the path to its live owner. Re-homed from `2554-code-review-depth-overrides.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: complete-milestone.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 15: the fragment carrying it (`3458-audit-open-acknowledge-wiring.json`) was retired on `next` and the path is declared by `3409-unreachable-guard-arms.json` today. One path takes exactly one ack source, so the sentence follows the path to its live owner. Re-homed from `3409-unreachable-guard-arms.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: debug.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 14: the fragment that carried this sentence (`3149-init-debug-entry-point.json`) was retired on `next` by 26f8015c (fix(#3448), #3476), and `3448-debug-autoresume-next-action.json` declares the path today. One path takes exactly one ack source, so the sentence follows the path to its live owner rather than being dropped or re-armed under a retired number. Re-homed from `3448-debug-autoresume-next-action.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: diagnose-issues.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: an inline copy in every workflow would be that many places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed in round 19: this PR declared the path in its own fragment, and `3602-workflow-subagent-model-resolution.json` landed on `next` declaring it too. One path takes exactly one ack source, so the sentence moves here and the key leaves ours. Re-homed from `3602-workflow-subagent-model-resolution.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: discuss-phase.md — #2529 round 36: this workflow's inline directive was rewritten in round 10 to name inter-tool narration, but in the compressed form, and that rewrite came to −1 byte against `next` — so it declared no growth and this key was absent from this PR's ack set until now. Round 36 replaces the compressed clause with the same enumeration the other rewordings carry — narration between tool calls, status updates, progress notes, findings, questions, prompts, and explanations — because `discuss-phase.md` started from the identical upstream sentence as `verify-work.md` and `new-milestone.md` and those two took the full list, so the shorthand was an inconsistency rather than a decision. +87 bytes against `next`, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. The directive stays INLINE rather than becoming an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have cost 1,692 bytes of loaded context against the 87 this sentence costs. `commands/gsd/discuss-phase.md` dispatches this workflow lazily (`Read and execute ...`) rather than `@`-importing it, so the 87 bytes land in the installed file and are read once the workflow is dispatched, not on every command invocation.
Emitted-Drift-Ack-Growth: discuss-phase-assumptions.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 15: `3409-unreachable-guard-arms.json` landed on `next` in #3558 and declares this path too. One path takes exactly one ack source, so the sentence moves here and the key leaves this PR's fragment. Re-homed from `3409-unreachable-guard-arms.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: discuss-phase-power.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: do.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation.
Emitted-Drift-Ack-Growth: docs-update.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +83 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +83 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 83 bytes this inline directive costs, a net +1,609. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,609 bytes more loaded context per invocation. Re-homed in round 19: this PR declared the path in its own fragment, and `3602-workflow-subagent-model-resolution.json` landed on `next` declaring it too. One path takes exactly one ack source, so the sentence moves here and the key leaves ours. Re-homed from `3602-workflow-subagent-model-resolution.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: edit-phase.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed in round 13: `3262-editphase-milestone-scope-guard.json` landed on `next` in fd4715f8 (fix(#3262), #3446) and declares this path too. One path takes exactly one ack source, so the sentence moves here and the key leaves this PR's fragment. Re-homed from `3262-editphase-milestone-scope-guard.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: eval-review.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 16: the fragment that carried this sentence (`3423-required-reading.json`) was retired on `next` by ddf85287 (fix(#3357), #3513), and no fragment on `next` declares this path now. The ack therefore returns to this PR's own fragment, which is the only live source for it — the change to the path is this PR's.
Emitted-Drift-Ack-Growth: execute-plan.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 14: the fragment that carried this sentence (`2652-quick-diagnose-dispatch-isolation.json`) was retired on `next` by 362d0434 (fix(#3370), #3478), and `3370-execute-phase-gate-conflation.json` declares the path today. One path takes exactly one ack source, so the sentence follows the path to its live owner rather than being dropped or re-armed under a retired number. Re-homed from `3370-execute-phase-gate-conflation.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: explore.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed from `2229-explore-claim-disposition.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: extract-learnings.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: fast.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Re-homed in round 18: this PR declared the path in its own fragment, and `3585-planning-commit-guard.json` landed on `next` declaring it too. One path takes exactly one ack source, so the sentence moves here and the key leaves ours. Re-homed from `3585-planning-commit-guard.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: forensics.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: graduation.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation.
Emitted-Drift-Ack-Growth: health.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 13: the fragment that carried this sentence (`2573-state-head-freshness.json`) was retired on `next` by 7ddcc198 (fix(#3309)), and `3309-health-docs-generated.json` declares the path today. One path takes exactly one ack source, so the sentence follows the path to its live owner rather than being dropped or re-armed under a retired number. Re-homed from `3309-health-docs-generated.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: help.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: import.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed in round 18: this PR declared the path in its own fragment, and `3576-references-canonical-cites.json` landed on `next` declaring it too. One path takes exactly one ack source, so the sentence moves here and the key leaves ours. Re-homed from `3576-references-canonical-cites.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: inbox.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation.
Emitted-Drift-Ack-Growth: ingest-docs.md — #2529 MAJOR 1 (round 10): the workflow's pre-existing inline response-language directive is rewritten IN PLACE so the sentence names inter-tool NARRATION explicitly — narration between tool calls, status updates, progress notes, findings — instead of only "questions, prompts, and explanations". That older wording is the defect #2529 reports (it leaves the running commentary between tool calls in English while the answers around it are translated), and `scripts/lint-response-language-coverage.cjs` had been certifying it as coverage, so the gate legitimised the bug. +87 bytes, prose only: no step, gate, tool invocation, or subagent dispatch shape changed. FILE delta and LOADED-CONTEXT delta are both +87 here, and that identity is the point — the directive was deliberately NOT converted to an `@`-reference, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"), so the conversion would have bought a smaller measured file at a cost of 1,692 bytes of loaded context per workflow — the 63-byte import line plus the 1,629-byte reference — against the 87 bytes this inline directive costs, a net +1,605. Stated plainly because the gates cannot state it: the repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so an `@`-reference conversion would have READ as a smaller change to every gate in the repo while costing 1,605 bytes more loaded context per invocation. Re-homed from `2658-trae-instruction-file-path.json` in round 26: `a84f7563` (#3078) swept that fragment as all-spent, so this path is unowned and this PR's own fragment declares it directly.
Emitted-Drift-Ack-Growth: insert-phase.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: list-phase-assumptions.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: list-seeds.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 bytes; the remaining 1,629 are declared here because no gate reads them. The eager import is accepted on its merits, not hidden: 42 inline copies would be 43 places for the wording to drift, and the reference is the one place it is maintained. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed.
Emitted-Drift-Ack-Growth: list-workspaces.md — #2529 — RESTATED in round 10, superseding this PR's earlier "+63 bytes, prose only" wording, which reported a file delta as if it were the whole cost. The workflow gains the shared response-language directive as a single `@`-reference line. FILE delta: +63 bytes, byte-identical in each of the 42 workflows that take the reference. LOADED-CONTEXT delta: +1,692 bytes per workflow — the 63-byte import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates — the tier hard caps in `tests/workflow-size-budget.test.cjs` and this size ratchet — measure the FILE, not the transitive inline, so they see 63 of those 1,692 …

* fix(#2529): read the catalog-relative dispatch spelling, and the plural of "output"

Two false positives in the coverage lint, both surfaced by this round's work
rather than by a red gate finding them for us.

#3552 landed `execute-phase/steps/protected-branch.md` on next while this PR was
open, dispatched from execute-phase.md's `"none"` arm with the path written
RELATIVE to the catalog. `namesFragmentAsEntryPoint` only ever looked for the
`gsd-core/workflows/`-rooted spelling, so it read a live dispatch as no dispatch
and the new fragment as uncovered. It now accepts both spellings and matches the
relative one on a path boundary, so `vendor/<path>` cannot vouch for `<path>`.

Recognizing that spelling makes one pin redundant: execute-phase.md dispatches
executor-isolation-dispatch.md the same way, so the fragment inherits and its
own copy of the sentence comes back out. That is the rule round 29 encoded,
enforced by the test that measures it rather than by hand.

`output` was the one term in USER_OUTPUT_RE without an `s?`, so "translate all
outputs, including narration between tool calls" read as uncovered. The new
property tests caught it on their first run.

Those properties pin the rule the hand-written cases are instances of: four
signals on ONE line accept, dropping any one rejects, spreading them across
lines rejects. The vocabulary is written out in the test rather than read back
from the script's regexes, per CONTRIBUTING.md "Fixture provenance (#2371)" -- a
generator seeded from the matcher can only re-derive what the matcher already
believes, and that independence is what caught the plural. Both new properties
are mutation-verified: dropping the narration predicate reds the necessity
property, and collapsing the document to a single line reds the cross-line one.

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

* enhance(#2529): spell the narration enumeration out in the last two shorthand directives

discuss-phase.md and plan-phase.md were the only two of this PR's 44
rewordings that abbreviated the inserted clause to "narration between tool
calls included" instead of naming the output classes the way the rest of them
do. Both forms satisfy the lint's four predicates, so nothing was broken --
but the point of #2529 is that an author reading one workflow should not have
to infer what the neighbouring one means by "included".

Both abbreviations were size decisions rather than wording ones, and both
reasons have since expired because next shrank the files. discuss-phase.md
sat 25 bytes under the 32,000-byte #717 dispatcher budget and now has 1,825;
plan-phase.md sat 87 bytes under the 94,519-byte ADR-857 capstone ratchet
against a +108 clause and now has 3,180. Neither budget is raised here and no
unrelated prose is trimmed; workflow-size-budget and
phase6-capstone-conformance both pass.

discuss-phase.md started from the identical upstream sentence as verify-work.md
and new-milestone.md ("All user-facing questions, prompts, and explanations in
this workflow"), and those two received the full enumeration; it now matches
them exactly. plan-phase.md keeps its own scope word ("orchestrator output") and
its subagent pass-through instruction, both upstream's, and only trades the
shorthand for the enumeration.

The shorthand now appears nowhere in the catalog. The two remaining variants
(plan-review-convergence.md, spec-phase.md) keep upstream's own verb and scope
and end on "report prose", which is what those workflows actually emit --
rewriting those would change a directive's strength, not its wording.

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

* fix(#2529): match the workflow extension case-insensitively in coverage discovery

`findMarkdownFilesRecursive` filtered on `entry.name.endsWith('.md')`, so
`SETTINGS.MD` — the same file to Windows and macOS, a different one to Linux —
was skipped on the only platform whose verdict gates the merge. The direction of
that failure is the problem: a workflow the walk declines to see is a workflow
this lint certifies by omission, which is the same vacuous pass `main()` already
refuses when discovery returns nothing at all.

The filter is now an allowlist keyed on the lowercased `path.extname`.
`.mdx` stays out on purpose: admitting an extension states what a workflow IS,
and that claim has a second half — `inheritsParentCoverage` resolves a
fragment's parent as `<workflow>.md`. An `.mdx` entry belongs here next to the
parent resolution it would have to move with, not ahead of it.

Two tests: an uppercase-extension file is discovered AND lands as a violation
rather than an exemption, and every admitted extension is spelled so the
lowercasing match can reach it (an uppercase or dotless entry would be dead
configuration that reads like coverage).

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

* enhance(#2529): cover the quick-batch workflow that #3676 landed uncovered

`next` gained `quick-batch.md` and nine step fragments in 2f64e6230 (#3676,
PR #4212) with no response-language directive, so the merge result reds this
PR's own lint with 10 violations. The lint is doing exactly what it exists to
do; the coverage is what has to move.

`quick-batch.md` takes the shared @-reference on line 1, the same as the other
42 top-level workflows, and eight of the nine fragments then inherit through
its `read and execute` stubs. The ninth does not:
`quick-batch/steps/plan-checker-loop.md` is dispatched by a SIBLING fragment
(`planner-wave.md:134`) and named in the parent only inside a parenthetical
with no dispatch verb, which is the shape round 29's rule already covers for
`execute-phase/steps/regression-gate-run.md` and
`plan-phase/steps/prd-express-path.md`. It carries the pinned inline directive
and joins `EXACT_INLINE_DIRECTIVE_WORKFLOWS`; the comment above that set now
names four such fragments instead of three. Coverage: 163 workflows.

`FULL_BUDGET` in tests/skill-frontmatter-contract.test.cjs moves 844 -> 846.
The same commit grew `help/modes/full.md` from 834 to 844 lines, landing it
exactly on the ceiling with zero slack, and the two lines this PR adds there
are its pinned directive and the blank separating it. That is a coverage
contract every workflow carries, not the content creep the budget guards.
The #597 ratchet rule holds: actualMax 846, slack 0, well inside LARGE_GRACE.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Emitted-Drift-Ack-Growth: quick-batch.md — #2529: the workflow arrived on `next` in 2f64e6230 (#3676, PR #4212) with no response-language directive, so this PR's lint reds on the merge result; covering it is the PR's whole contract, not an optional extra. It gains the shared directive as a single eager `@`-reference line, the identical form the other 42 top-level workflows take. FILE delta: +62 bytes, as the gate measures it. LOADED-CONTEXT delta: +1,691 bytes — the import line plus the 1,629 bytes of `gsd-core/references/response-language-directive.md`, because an `@`-import in this repo is EAGER (ADR-1610 Decision point 4; docs/ARCHITECTURE.md: moving prose into a file that is still eagerly `@`-imported "shrinks the measured file without shrinking loaded context"). The repo's size gates read the FILE and not the transitive inline, so they see 62 of those 1,691 bytes; the remaining 1,629 are declared here because no gate reads them. Prose only: no step, gate, tool invocation, or subagent dispatch shape changed. Nine `quick-batch/steps/*` fragments are covered without a byte of their own — eight inherit through the parent's dispatch stubs, and the ninth takes the pinned inline sentence, which the emitted surface does not measure.

* fix(#2529): scope row 48 by what a diff says, not by which paths it names

`tests/gsd-quick-batch-quick-regression.test.cjs` treats any branch touching a
`quick-batch` path as #3676 phase work, then forbids it from editing ordinary
`quick.md`. This PR covers EVERY workflow with the shared response-language
directive — quick-batch.md and its fragments included — so the scope check
turned true, and the row read this PR's one-line directive on `quick.md` as a
phase violation.

That is the false positive the row's own #3730 note already scoped away from,
arriving by the other door: not an unrelated branch that misses the surface,
but a catalog-wide sweep that touches all of it. A path now counts as phase
work only when its diff says something other than the coverage contract, and
the two accepted directive forms are read from
`scripts/lint-response-language-coverage.cjs` rather than restated, so a
reworded contract cannot leave the carve-out matching prose the lint no longer
recognizes. A file the branch ADDED still counts — every line is new, which is
what a real #3676-phase branch looks like.

The invariant is unweakened in the direction that matters: a phase branch that
edits `commands/gsd/quick.md`, `gsd-core/workflows/quick.md` or anything under
`quick/steps/` for any reason other than the directive still fails the row.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Tom Boucher <trekkie@nomorestars.com>
2026-09-04 21:12:12 -04:00

919 lines
41 KiB
JavaScript

'use strict';
const { afterEach, describe, test } = 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 { cleanup } = require('./helpers.cjs');
const fc = require('./helpers/fast-check-setup.cjs');
const {
EXACT_INLINE_DIRECTIVE_WORKFLOWS,
INLINE_RESPONSE_LANGUAGE_DIRECTIVE,
REFERENCE_ROOT,
WORKFLOW_EXTENSIONS,
WORKFLOWS_DIR,
carriesInlineDirective,
findBrokenDirectiveReferences,
findMarkdownFilesRecursive,
findViolations,
hasResponseLanguageCoverage,
inheritsParentCoverage,
namesFragmentAsEntryPoint,
main,
} = require('../scripts/lint-response-language-coverage.cjs');
describe('response-language workflow coverage lint (#2529)', () => {
const tempDirs = [];
afterEach(() => {
for (const dir of tempDirs.splice(0)) cleanup(dir);
});
function fixture() {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-'));
tempDirs.push(root);
fs.mkdirSync(path.join(root, 'nested', 'modes'), { recursive: true });
fs.writeFileSync(
path.join(root, 'covered-by-reference.md'),
'@~/.claude/gsd-core/references/response-language-directive.md\n',
);
fs.writeFileSync(
path.join(root, 'nested', 'covered-inline.md'),
'Use config.response_language for all prose, narration included.\n',
);
fs.writeFileSync(
path.join(root, 'nested', 'mere-field-mention.md'),
'Parse JSON for: phase_number, response_language.\n',
);
fs.writeFileSync(path.join(root, 'nested', 'modes', 'uncovered.md'), '# English-only mode\n');
fs.writeFileSync(path.join(root, 'nested', 'ignored.txt'), 'not a workflow');
return root;
}
test('walks nested workflow directories recursively and ignores non-Markdown files', () => {
const root = fixture();
const relative = findMarkdownFilesRecursive(root)
.map((file) => path.relative(root, file).replaceAll(path.sep, '/'));
assert.deepStrictEqual(relative, [
'covered-by-reference.md',
'nested/covered-inline.md',
'nested/mere-field-mention.md',
'nested/modes/uncovered.md',
]);
});
test('an uppercase extension is discovered, and is a violation rather than an exemption', () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-case-'));
tempDirs.push(root);
fs.writeFileSync(path.join(root, 'SHOUTING.MD'), '# no directive\n');
fs.writeFileSync(path.join(root, 'mixed.Md'), '# no directive\n');
fs.writeFileSync(path.join(root, 'not-a-workflow.mdx'), '# a format the catalog does not emit\n');
const relative = findMarkdownFilesRecursive(root)
.map((file) => path.relative(root, file).replaceAll(path.sep, '/'));
assert.deepStrictEqual(relative, ['SHOUTING.MD', 'mixed.Md']);
// The point is the direction of the old failure: a case-sensitive suffix
// test dropped these two on Linux alone, and a dropped file is a file this
// lint certifies by never having looked at it. Both must land as
// violations, the same as any lowercase sibling carrying no directive.
const violations = findViolations(root)
.map((file) => path.relative(root, file).replaceAll(path.sep, '/'));
assert.deepStrictEqual(violations, ['SHOUTING.MD', 'mixed.Md']);
});
test('every admitted extension is spelled so the case-insensitive match can reach it', () => {
// `isWorkflowFile` lowercases the extension before the lookup, so an entry
// carrying any uppercase would be unreachable — dead configuration that
// reads like coverage. The leading dot is the other half: `path.extname`
// returns one, and an entry without it matches nothing.
for (const extension of WORKFLOW_EXTENSIONS) {
assert.equal(extension, extension.toLowerCase(), `${extension} can never match`);
assert.ok(extension.startsWith('.'), `${extension} is not an extension path.extname returns`);
}
});
test('reports an uncovered nested workflow while accepting both coverage forms', () => {
const root = fixture();
const violations = findViolations(root)
.map((file) => path.relative(root, file).replaceAll(path.sep, '/'));
assert.deepStrictEqual(violations, [
'nested/mere-field-mention.md',
'nested/modes/uncovered.md',
]);
});
test('pins every shared inline directive site to one exact canonical line', () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-parity-'));
tempDirs.push(root);
for (const relative of EXACT_INLINE_DIRECTIVE_WORKFLOWS) {
const file = path.join(root, relative);
fs.mkdirSync(path.dirname(file), { recursive: true });
fs.writeFileSync(file, `${INLINE_RESPONSE_LANGUAGE_DIRECTIVE}\n`);
}
// Not a count. The size of this set is a consequence of the rule enforced in
// "a pinned workflow is one that could not have inherited instead" — it moves
// whenever the catalog does, and a number here would only record when it last
// moved. What has to hold is that the set is non-empty (an empty set would make
// every assertion below vacuous) and that every member pins to the one line.
assert.ok(EXACT_INLINE_DIRECTIVE_WORKFLOWS.size > 0, "the pinned set is empty");
assert.deepStrictEqual(findViolations(root), []);
const drifted = path.join(root, 'discuss-phase', 'modes', 'advisor.md');
fs.writeFileSync(
drifted,
'Apply response_language to all user-facing prose; preserve code and paths.\n',
);
assert.deepStrictEqual(findViolations(root), [drifted]);
});
// #1671 keeps extracting workflow prose into fragments. A fragment carries no
// directive of its own, so without inheritance every extraction reds this lint
// for prose that was already covered where it used to live.
function fragmentFixture({ parentCovered = true, parentNamesFragment = true } = {}) {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-fragment-'));
tempDirs.push(root);
fs.mkdirSync(path.join(root, 'autonomous', 'steps'), { recursive: true });
fs.writeFileSync(
path.join(root, 'autonomous.md'),
[
parentCovered
? '@~/.claude/gsd-core/references/response-language-directive.md'
: '# No directive here',
parentNamesFragment
? 'read and execute `gsd-core/workflows/autonomous/steps/converge-banner.md`'
: 'read and execute `gsd-core/workflows/autonomous/steps/something-else.md`',
].join('\n') + '\n',
);
fs.writeFileSync(
path.join(root, 'autonomous', 'steps', 'converge-banner.md'),
'Display: `Planning: convergence enabled`\n',
);
return root;
}
test('a fragment inherits coverage from the parent that names it', () => {
const root = fragmentFixture();
assert.strictEqual(
inheritsParentCoverage(root, 'autonomous/steps/converge-banner.md'),
true,
);
assert.deepStrictEqual(findViolations(root), []);
});
test('inheritance is refused when the parent is uncovered or does not name the fragment', () => {
const uncoveredParent = fragmentFixture({ parentCovered: false });
assert.deepStrictEqual(
findViolations(uncoveredParent).map((file) => path.relative(uncoveredParent, file).replaceAll(path.sep, '/')),
['autonomous.md', 'autonomous/steps/converge-banner.md'],
);
const unreferenced = fragmentFixture({ parentNamesFragment: false });
assert.deepStrictEqual(
findViolations(unreferenced).map((file) => path.relative(unreferenced, file).replaceAll(path.sep, '/')),
['autonomous/steps/converge-banner.md'],
);
});
// #2558 round 10, Minor D. `inheritsParentCoverage` used to prove the parent
// "is the way in" with a bare substring test, so any mention of the fragment
// path — a changelog line, a deprecation note, a sentence about the file —
// granted the fragment its parent's coverage. Inheritance is only sound when
// the parent DISPATCHES the fragment, since that is what guarantees the
// parent's directive is loaded when the fragment runs.
test('inheritance requires a dispatching read/execute context, not a bare mention', () => {
const dispatches = [
'If `section_manifest` is `null`: read and execute `gsd-core/workflows/a/steps/b.md`. Otherwise skip.',
'Read and execute `gsd-core/workflows/a/steps/b.md`.',
'Read+execute `gsd-core/workflows/a/steps/b.md` (defines the helpers).',
'Read `gsd-core/workflows/a/steps/b.md` if planning freezes on Windows.',
// #1689's per-plan executor routing dispatches with `run`, not read/execute.
'**Executor routing.** Per plan, run `gsd-core/workflows/a/steps/b.md` to set `EXECUTOR_TYPE`.',
// #3552's `branching_strategy: none` arm dispatches with the path written
// RELATIVE to the catalog. A rooted-only needle read that live dispatch as
// no dispatch, and the fragment it reaches read as uncovered.
'**"none":** Read and execute `a/steps/b.md`.',
];
for (const line of dispatches) {
assert.strictEqual(
namesFragmentAsEntryPoint(`${line}\n`, 'a/steps/b.md'),
true,
`dispatch stub not recognized: ${line}`,
);
}
const mentions = [
'- #1234: extracted the wave logic into `gsd-core/workflows/a/steps/b.md`.',
'The prose below used to live in `gsd-core/workflows/a/steps/b.md`.',
'`gsd-core/workflows/a/steps/b.md` is deprecated and no longer dispatched.',
// The verb is on a different line: it governs nothing here.
'Read and execute the step below.\nSee `gsd-core/workflows/a/steps/b.md`.',
// The verb is on the same line but a whole clause away, so it belongs to a
// different sentence — the window is what keeps it from vouching.
'Read the roadmap first, then decide whether any of this still applies to `gsd-core/workflows/a/steps/b.md`.',
// The relative form matches on a path boundary, so a DIFFERENT file whose
// path merely ends with this one dispatches itself, not this fragment.
'Read and execute `vendor/a/steps/b.md`.',
];
for (const line of mentions) {
assert.strictEqual(
namesFragmentAsEntryPoint(`${line}\n`, 'a/steps/b.md'),
false,
`bare mention accepted as a dispatch: ${line}`,
);
}
});
test('a fragment mentioned but never dispatched does not inherit', () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-mention-'));
tempDirs.push(root);
fs.mkdirSync(path.join(root, 'autonomous', 'steps'), { recursive: true });
fs.writeFileSync(
path.join(root, 'autonomous.md'),
'@~/.claude/gsd-core/references/response-language-directive.md\n'
+ '- #1671: the banner prose moved to `gsd-core/workflows/autonomous/steps/converge-banner.md`.\n',
);
fs.writeFileSync(
path.join(root, 'autonomous', 'steps', 'converge-banner.md'),
'Display: `Planning: convergence enabled`\n',
);
assert.strictEqual(
inheritsParentCoverage(root, 'autonomous/steps/converge-banner.md'),
false,
);
assert.deepStrictEqual(
findViolations(root).map((file) => path.relative(root, file).replaceAll(path.sep, '/')),
['autonomous/steps/converge-banner.md'],
);
});
// #2558 round 10 (Minor C), narrowed in round 13. The `gsd-verifier` subagent
// emits user-facing prose but reads no workflow file of its own, so its
// coverage lives entirely in the dispatch prompt execute-phase.md builds: the
// reference tells the orchestrator to carry the directive "immediately after
// `Create VERIFICATION.md.`", and that anchor lives in the workflow.
//
// Round 13 removed the lint's side of this: it hung off `verify-phase.md`, a
// catalog file `next` deleted in #3421. The contract outlived the file — the
// verifier still runs — but nothing in the workflows tree carries it any more,
// so the lint cannot see it and this test is now the only thing holding the two
// halves together. Asserted against the REAL tree, not a fixture: a fixture
// would only prove the assertion can pass.
const VERIFIER_DISPATCH_CONTRACT = {
reference: '../references/execute-phase-response-language.md',
directive: 'Use response_language {response_language} for all user-facing prose — narration between tool calls, status updates, progress notes, and findings included; preserve code and paths.',
anchor: 'Create VERIFICATION.md.',
anchorIn: 'execute-phase.md',
};
test('the gsd-verifier dispatch contract still has both of its halves', () => {
const { reference, directive, anchor, anchorIn } = VERIFIER_DISPATCH_CONTRACT;
const referencePath = path.join(WORKFLOWS_DIR, reference);
assert.ok(fs.existsSync(referencePath), `reference is stale: ${reference}`);
const referenceFile = fs.readFileSync(referencePath, 'utf8');
assert.ok(
referenceFile.includes(directive),
`${reference} no longer carries the directive the verifier dispatch must inject`,
);
const anchorPath = path.join(WORKFLOWS_DIR, anchorIn);
assert.ok(fs.existsSync(anchorPath), `anchor file is stale: ${anchorIn}`);
assert.ok(
fs.readFileSync(anchorPath, 'utf8').split(/\r?\n/).some((line) => line.includes(anchor)),
`${anchorIn} no longer carries the anchor "${anchor}" that the injected `
+ `response-language directive is positioned against. Re-anchor it in ${reference}.`,
);
// The reference must keep naming the same anchor, or the two halves drift
// apart while each stays individually true.
assert.ok(
referenceFile.includes(anchor),
`${reference} no longer names the anchor "${anchor}"`,
);
});
test('inheritance reaches fragment directories only, never a nested workflow tree', () => {
const root = fragmentFixture();
// Depth and directory name are both load-bearing: a two-segment path has no
// parent workflow, and a directory outside the fragment set is not a section.
assert.strictEqual(inheritsParentCoverage(root, 'autonomous.md'), false);
assert.strictEqual(
inheritsParentCoverage(root, 'autonomous/steps/nested/converge-banner.md'),
false,
);
assert.strictEqual(
inheritsParentCoverage(root, 'autonomous/references/converge-banner.md'),
false,
);
});
test('rejects a bare config mention and accepts an actionable inline directive', () => {
assert.strictEqual(hasResponseLanguageCoverage('response_language\n'), false);
assert.strictEqual(
hasResponseLanguageCoverage(
'Apply response_language to all user-facing prose, narration included.\n',
),
true,
);
});
// The regression guard for the fix in #2558 round 13, and the sibling of the
// dispatch-vs-mention test above. Before it, the reference check was a bare
// `content.includes(ref)`: a workflow whose changelog merely NAMED the shared
// directive was certified covered while shipping no import at all — the same
// false-positive class, one level up.
test('coverage by reference requires an @-import, not a mention of the path', () => {
const imports = [
'@~/.claude/gsd-core/references/response-language-directive.md',
'@$HOME/.claude/gsd-core/references/response-language-directive.md',
'@~/.claude/gsd-core/references/execute-phase-response-language.md',
// Leading/trailing whitespace is still an import line.
' @~/.claude/gsd-core/references/response-language-directive.md ',
];
for (const line of imports) {
assert.strictEqual(
hasResponseLanguageCoverage(`${line}\n`),
true,
`import line not recognized: ${line}`,
);
}
const mentions = [
'- #2529: added the shared references/response-language-directive.md reference.',
'The directive lives in `gsd-core/references/response-language-directive.md`.',
'references/response-language-directive.md is deprecated; do not import it.',
// An import that is only quoted as an example, mid-sentence, loads nothing.
'Add `@~/.claude/gsd-core/references/response-language-directive.md` to new workflows.',
];
for (const line of mentions) {
assert.strictEqual(
hasResponseLanguageCoverage(`${line}\n`),
false,
`bare mention accepted as coverage: ${line}`,
);
}
});
// The regression guard for the fix in #2558 round 10. Before it, the lint
// certified 45 workflows whose directive named only "questions, prompts, and
// explanations" — the exact wording #2529 filed as the DEFECT, because it
// leaves the model's between-tool-call narration in English while the answers
// around it are translated. Certifying that wording made the gate legitimise
// the bug it exists to catch, so the old sentence must now FAIL.
test('the pre-#2558 weak wording is no longer coverage; naming narration is', () => {
const weak =
'**If `response_language` is set:** All user-facing questions, prompts, and '
+ 'explanations in this workflow MUST be presented in `{response_language}`. '
+ 'Technical terms, code, file paths, and subagent prompts stay in English — '
+ 'only user-facing output is translated.\n';
assert.strictEqual(
hasResponseLanguageCoverage(weak),
false,
'a directive naming only the question/prompt surface must not count as coverage',
);
// Every narration-class form the lint accepts, each asserted on its own so a
// future edit to the alternation cannot silently drop one while the others
// keep the suite green.
for (const token of [
'narration between tool calls',
'narration',
'output between tool calls',
]) {
assert.strictEqual(
hasResponseLanguageCoverage(
`Apply response_language to all user-facing output — ${token} included.\n`,
),
true,
`"${token}" must satisfy the narration-class requirement`,
);
}
// Round 21: a word that merely APPEARS in the canonical phrasing does not
// name the class. REQ-LANG-04 requires the directive to name inter-tool
// narration; "report status" names a surface the model already reports in
// English and says nothing about the commentary between tool calls, so the
// earlier token list was weaker than the requirement it enforced.
for (const weakToken of ['status updates', 'progress notes', 'findings']) {
assert.strictEqual(
hasResponseLanguageCoverage(
`Apply response_language to all user-facing output — ${weakToken} included.\n`,
),
false,
`"${weakToken}" alone must not satisfy the narration-class requirement`,
);
}
// The narration token alone is not a directive either: the line still has to
// name response_language and act on it, so the tightening did not swap one
// half of the predicate for the other.
assert.strictEqual(
hasResponseLanguageCoverage('Narration between tool calls is emitted here.\n'),
false,
);
// Both halves must land on the SAME line. A workflow that mentions narration
// in one paragraph and response_language in another has stated no rule.
assert.strictEqual(
hasResponseLanguageCoverage(
'Apply response_language to all user-facing prose.\nNarration is emitted between tool calls.\n',
),
false,
);
});
// The wording migration is only real if it actually landed in the catalog: the
// lint could pass on a tree where every file still carried the weak sentence if
// the tightening above were ever reverted. Assert the catalog directly.
// Round 21 widened the scan from the workflow catalog to the references
// directory as well. The predicate check on imported references (above) is the
// durable guard; this is the cheap independent one, and the two fail for
// different reasons — the predicate asks whether a directive is present and
// actionable, this asks whether the specific sentence #2529 filed as the
// defect has come back. A shared reference carrying that sentence would be
// the single highest-blast-radius regression in the catalog: 43 workflows
// hold no directive of their own.
test('no shipped workflow or reference still carries the pre-#2558 weak directive sentence', () => {
const WEAK_SENTENCE =
'All user-facing questions, prompts, and explanations in this workflow MUST be presented in';
const workflows = findMarkdownFilesRecursive(WORKFLOWS_DIR);
const references = findMarkdownFilesRecursive(path.join(REFERENCE_ROOT, 'references'));
const scanned = [...workflows, ...references];
const offenders = scanned
.filter((file) => fs.readFileSync(file, 'utf8').includes(WEAK_SENTENCE))
.map((file) => path.relative(REFERENCE_ROOT, file).replaceAll(path.sep, '/'));
assert.deepStrictEqual(offenders, []);
// A scan that inspected nothing proves nothing — the same rule main() applies.
// Stated as "each source produced files" rather than as a floor. A numeric
// floor here reads as the workflow count, is stale the moment the catalog
// moves, and would still pass a scan that lost one of the two directories
// entirely — the failure it exists to catch.
assert.ok(workflows.length > 0, 'the workflow catalog scan produced no files');
assert.ok(references.length > 0, 'the reference directory scan produced no files');
});
test('main returns a failure code and reports each violation', () => {
const root = fixture();
const errors = [];
const logs = [];
const exitCode = main(root, {
error: (message) => errors.push(message),
log: (message) => logs.push(message),
});
assert.strictEqual(exitCode, 1);
assert.strictEqual(logs.length, 0);
assert.match(errors[0], /2 workflow\(s\) have no response-language coverage/);
assert.match(errors[0], /nested\/mere-field-mention\.md/);
assert.match(errors[0], /nested\/modes\/uncovered\.md/);
});
test('main returns success and emits the covered workflow count', () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-ok-'));
tempDirs.push(root);
fs.writeFileSync(
path.join(root, 'covered.md'),
'Apply response_language to all user-facing prose, narration included.\n',
);
const errors = [];
const logs = [];
assert.strictEqual(main(root, {
error: (message) => errors.push(message),
log: (message) => logs.push(message),
}), 0);
assert.deepStrictEqual(errors, []);
assert.deepStrictEqual(logs, [
'lint-response-language-coverage: OK (1 workflows covered)',
]);
});
test('main fails instead of passing vacuously when discovery finds no workflow', () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-empty-'));
tempDirs.push(root);
fs.mkdirSync(path.join(root, 'not-a-workflow'), { recursive: true });
fs.writeFileSync(path.join(root, 'not-a-workflow', 'notes.txt'), 'not Markdown');
const errors = [];
const logs = [];
assert.strictEqual(main(root, {
error: (message) => errors.push(message),
log: (message) => logs.push(message),
}), 1);
assert.deepStrictEqual(logs, []);
assert.match(errors[0], /no workflow files found/);
});
test('main fails closed on an unreadable workflow directory rather than throwing', () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-absent-'));
tempDirs.push(root);
fs.writeFileSync(path.join(root, 'file-not-dir.md'), 'Apply response_language to all prose.\n');
const errors = [];
const logs = [];
const io = {
error: (message) => errors.push(message),
log: (message) => logs.push(message),
};
assert.strictEqual(main(path.join(root, 'does-not-exist'), io), 1);
assert.match(errors[0], /cannot read the workflow directory/);
assert.match(errors[0], /ENOENT/);
assert.strictEqual(main(path.join(root, 'file-not-dir.md'), io), 1);
assert.match(errors[1], /cannot read the workflow directory/);
assert.deepStrictEqual(logs, []);
});
// #2558 round 21, Blocker. 43 workflows hold no directive of their own and take
// ALL of their coverage from one shared file. The lint checked only that the
// @-import LINE existed, so rewriting that file back to the pre-#2529 sentence
// left every one of them "covered" with the whole suite green — the same
// "the gate certifies the defect" failure the round-10 fix closed, one level up.
// These tests fail on the unfixed lint.
function referenceFixture(referenceText) {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-ref-'));
tempDirs.push(root);
const workflows = path.join(root, 'workflows');
fs.mkdirSync(path.join(root, 'references'), { recursive: true });
fs.mkdirSync(workflows, { recursive: true });
fs.writeFileSync(
path.join(workflows, 'takes-the-reference.md'),
'@~/.claude/gsd-core/references/response-language-directive.md\n',
);
if (referenceText !== null) {
fs.writeFileSync(
path.join(root, 'references', 'response-language-directive.md'),
referenceText,
);
}
return { root, workflows };
}
const STRONG_REFERENCE =
'ALL user-facing output of this workflow MUST be in `response_language` — '
+ 'narration between tool calls, findings, and report prose.\n';
const WEAK_REFERENCE =
'**If `response_language` is set:** All user-facing questions, prompts, and '
+ 'explanations in this workflow MUST be presented in `{response_language}`.\n';
test('an imported reference that no longer carries a directive uncovers its importers', () => {
const strong = referenceFixture(STRONG_REFERENCE);
assert.deepStrictEqual(findViolations(strong.workflows, strong.root), []);
assert.deepStrictEqual(findBrokenDirectiveReferences(
findMarkdownFilesRecursive(strong.workflows), strong.root,
), []);
// The reviewer's mutation: the shared file reworded back to the defect.
const weak = referenceFixture(WEAK_REFERENCE);
assert.deepStrictEqual(
findViolations(weak.workflows, weak.root).map((file) => path.basename(file)),
['takes-the-reference.md'],
);
// ...and the same for a reference that is missing outright.
const missing = referenceFixture(null);
assert.deepStrictEqual(
findViolations(missing.workflows, missing.root).map((file) => path.basename(file)),
['takes-the-reference.md'],
);
});
test('main reports a weakened reference as one systemic failure, not per importer', () => {
const weak = referenceFixture(WEAK_REFERENCE);
const errors = [];
const logs = [];
const exitCode = main(weak.workflows, {
error: (message) => errors.push(message),
log: (message) => logs.push(message),
}, weak.root);
assert.strictEqual(exitCode, 1);
assert.deepStrictEqual(logs, []);
assert.match(errors[0], /shared directive reference\(s\) no longer carry an actionable directive/);
assert.match(errors[0], /references\/response-language-directive\.md/);
// The cause, not its 43 symptoms.
assert.doesNotMatch(errors[0], /workflow\(s\) have no response-language coverage/);
});
test('every shipped directive reference carries an actionable directive', () => {
// The real tree, not a fixture: this is the assertion that would have caught
// the hole, and it holds for both references the catalog imports.
for (const ref of ['response-language-directive.md', 'execute-phase-response-language.md']) {
const file = path.join(REFERENCE_ROOT, 'references', ref);
assert.ok(fs.existsSync(file), `missing shipped reference: ${ref}`);
assert.strictEqual(
carriesInlineDirective(fs.readFileSync(file, 'utf8')),
true,
`${ref} must itself name the narration class alongside response_language`,
);
}
assert.deepStrictEqual(
findBrokenDirectiveReferences(findMarkdownFilesRecursive(WORKFLOWS_DIR)),
[],
);
});
// #2558 round 21, Minor 1. Dirent uses lstat semantics, so a symlinked
// directory answers false to both isDirectory() and isFile() — the walk used
// to skip such a subtree in silence while files.length > 0 kept the run green,
// which is precisely what main()'s comment claims cannot happen.
test('the walk follows a symlinked subtree instead of skipping it silently', (t) => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-response-language-symlink-'));
tempDirs.push(root);
const workflows = path.join(root, 'workflows');
const outside = path.join(root, 'outside');
fs.mkdirSync(workflows, { recursive: true });
fs.mkdirSync(outside, { recursive: true });
fs.writeFileSync(
path.join(workflows, 'covered.md'),
'Apply response_language to all user-facing prose, narration included.\n',
);
fs.writeFileSync(path.join(outside, 'uncovered.md'), '# English-only mode\n');
try {
fs.symlinkSync(outside, path.join(workflows, 'linked'), 'junction');
} catch {
// Unprivileged Windows without Developer Mode cannot create links at all.
t.skip('symlink creation not permitted in this environment');
return;
}
assert.deepStrictEqual(
findMarkdownFilesRecursive(workflows)
.map((file) => path.relative(workflows, file).replaceAll(path.sep, '/'))
.sort(),
['covered.md', 'linked/uncovered.md'],
);
assert.deepStrictEqual(
findViolations(workflows).map((file) => path.basename(file)),
['uncovered.md'],
);
});
test('REQ-LANG-04 offers authors only forms the lint accepts', () => {
// Round 22: the requirement text is the shipped contract, so every form it
// hands an author must pass the lint that enforces it. The earlier wording
// enumerated four items joined by `or`, but only two of them name the
// narration class — an author copying `status updates` straight out of the
// requirement got a red lint for following it. Pin text and matcher
// together so the next reword of either cannot drift from the other.
const features = fs.readFileSync(
path.join(__dirname, '..', 'docs', 'FEATURES.md'),
'utf8',
);
const requirement = features
.split(/\r?\n/)
.find((line) => line.startsWith('- REQ-LANG-04:'));
assert.ok(requirement, 'REQ-LANG-04 must be present in docs/FEATURES.md');
// Round 23: scoped to the CLAUSE that states how the class is named, not to
// every quoted span on the line. Reading the whole line cannot tell an OFFER
// from a MENTION, so quoting the defective wording in order to warn against
// it — or quoting the class members descriptively — would have failed the
// document for offering the thing it warns against. That is the same
// mention-vs-claim confusion #3752 just repaired in the parity guard.
// Bounded quantifiers throughout: the scan runs over file content
// (local/no-unbounded-quantifier).
const offeredForms = (line) => {
const clause = line.match(/A directive names it by using ([^;.]{1,200})/);
return clause
? [...clause[1].matchAll(/"([^"]{1,40})"/g)].map((match) => match[1])
: [];
};
const offered = offeredForms(requirement);
assert.ok(
offered.length >= 2,
'REQ-LANG-04 must state how a directive names the class, quoting each accepted form',
);
for (const form of offered) {
assert.strictEqual(
hasResponseLanguageCoverage(
`Apply response_language to all user-facing output — ${form} included.\n`,
),
true,
`REQ-LANG-04 offers "${form}", so the lint must accept it`,
);
}
// The class members it lists are described as insufficient alone, which is
// what NARRATION_CLASS_RE enforces and what the assertions above at the
// weak-token loop prove.
assert.match(requirement, /does not satisfy the rule/);
for (const member of ['status updates', 'progress notes', 'findings']) {
assert.ok(
!offered.includes(member),
`REQ-LANG-04 must not offer "${member}" as a standalone form`,
);
}
// The extraction reads the offering clause, so a quoted span elsewhere on
// the line is a mention and not an offer. Each addition below is a correct
// edit to the requirement that the round-22 whole-line scan rejected.
// Asserted last so a genuine drift in the line above fails on its own
// message rather than on this guard.
for (const mention of [
' A directive saying "questions, prompts, and explanations" is the defect.',
' The class covers "status updates" and "progress notes" as members.',
' See also "response-language coverage".',
]) {
assert.deepStrictEqual(
offeredForms(requirement + mention),
offered,
`a mention must not read as an offer: ${mention.trim()}`,
);
}
});
test('every pinned workflow path is live in the real catalog', () => {
// The pinned sets are enforced by exact path. A rename that leaves a stale
// entry behind does not fail the lint — the moved file quietly falls back
// to the loose coverage check, so the exact-line pin stops being enforced
// without anything going red. Assert the pins still resolve.
const discovered = new Set(
findMarkdownFilesRecursive(WORKFLOWS_DIR)
.map((file) => path.relative(WORKFLOWS_DIR, file).replaceAll(path.sep, '/')),
);
const pinned = [...EXACT_INLINE_DIRECTIVE_WORKFLOWS].sort();
assert.deepStrictEqual(pinned.filter((relative) => !discovered.has(relative)), []);
});
test('a pinned workflow is one that could not have inherited instead', () => {
// The rule this set encodes: a lazy-loaded mode/step/template carries its own
// directive only where inheritance cannot be PROVEN for it — no parent
// dispatches it from a read/execute context, or the parent is uncovered. Where
// inheritance is proven, the pin is a second copy of one sentence with no
// coverage behind it, and the two forms then look arbitrary to the next author.
// This PR shipped 14 such pins before review measured them. Assert the rule
// rather than the count, so the set cannot re-grow the noise.
const redundant = [...EXACT_INLINE_DIRECTIVE_WORKFLOWS]
.filter((relative) => inheritsParentCoverage(WORKFLOWS_DIR, relative))
.sort();
assert.deepStrictEqual(redundant, []);
});
test('a pinned workflow that converts to the shared reference is not a violation', () => {
// The pin means "this file cannot take the eager @-reference", not "the
// reference is worse than the pin". A fragment that becomes eagerly loaded and
// takes the reference is strictly better off, and an early return on the pinned
// path alone would red that improvement — a gate stricter than the contract it
// enforces, with no escape but editing the set.
const pinned = [...EXACT_INLINE_DIRECTIVE_WORKFLOWS].find((p) => !p.includes("/"));
assert.ok(pinned, "expected at least one top-level pinned workflow");
const converted = referenceFixture(STRONG_REFERENCE);
fs.writeFileSync(
path.join(converted.workflows, pinned),
'@~/.claude/gsd-core/references/response-language-directive.md\n',
);
assert.deepStrictEqual(findViolations(converted.workflows, converted.root), []);
// The pin still holds against everything else. A reworded inline line is a
// violation exactly as before, and so is the reference form when the shared
// file itself has been weakened — the swap inherits the reference's validation,
// it does not escape validation.
const reworded = referenceFixture(STRONG_REFERENCE);
fs.writeFileSync(
path.join(reworded.workflows, pinned),
'Apply response_language to user-facing prose, narration included.\n',
);
assert.deepStrictEqual(
findViolations(reworded.workflows, reworded.root).map((file) => path.basename(file)),
[pinned],
);
const weakened = referenceFixture(WEAK_REFERENCE);
fs.writeFileSync(
path.join(weakened.workflows, pinned),
'@~/.claude/gsd-core/references/response-language-directive.md\n',
);
assert.deepStrictEqual(
findViolations(weakened.workflows, weakened.root).map((file) => path.basename(file)).sort(),
[pinned, 'takes-the-reference.md'].sort(),
);
});
});
/**
* Property tests for the four-predicate directive-line matcher.
*
* `carriesInlineDirective` accepts a document when ONE line carries all four
* signals at once: the config field, an action verb, a user-output term, and
* the narration class. The cases above pin particular phrasings; these pin the
* rule those phrasings are instances of.
*
* Per CONTRIBUTING.md "Fixture provenance (#2371)" the vocabulary below is
* written out here rather than read back from the script's own regexes. A
* generator seeded from the matcher can only re-derive what the matcher already
* believes — spelled out independently, these properties fail when a predicate
* is widened, dropped, or allowed to span lines. That independence paid for
* itself immediately: the plural forms below are what caught `output` being the
* one term in its class without an `s?`, so "translate all outputs, including
* narration between tool calls" read as uncovered.
*/
describe('response-language directive line: matcher properties (#2529)', () => {
const FIELD = 'response_language';
const NARRATION = 'between tool calls';
// The output pool deliberately EXCLUDES narration-class words. "narration" is
// in both classes, so one token would satisfy two predicates and the
// necessity property below could no longer tell them apart.
const ACTIONS = [
'apply', 'present', 'render', 'respond', 'translate', 'use', 'write', 'must', 'should',
];
const OUTPUTS = [
'explanation', 'explanations', 'language', 'output', 'outputs', 'prompt', 'prompts',
'prose', 'question', 'questions', 'template', 'templates', 'user-facing',
];
const FILLER = ['the', 'and', 'of', 'in', 'for', 'each', 'step', 'file', 'then', 'this'];
const cased = (word, mode) => {
if (mode === 'upper') return word.toUpperCase();
if (mode === 'title') return word.replace(/\b[a-z]/g, (c) => c.toUpperCase());
return word;
};
const partsArb = fc.record({
action: fc.constantFrom(...ACTIONS),
output: fc.constantFrom(...OUTPUTS),
order: fc.shuffledSubarray([0, 1, 2, 3], { minLength: 4, maxLength: 4 }),
mode: fc.constantFrom('lower', 'upper', 'title'),
gaps: fc.array(fc.array(fc.constantFrom(...FILLER), { maxLength: 4 }), {
minLength: 5, maxLength: 5,
}),
});
const signals = ({ action, output }) => [FIELD, action, output, NARRATION];
// One line, the four signals in generated order, arbitrary neutral filler
// between them. `omit` drops exactly one signal for the necessity property.
const buildLine = (parts, omit = -1) => {
const tokens = signals(parts);
const words = [];
parts.order
.filter((index) => index !== omit)
.forEach((index, position) => {
words.push(...parts.gaps[position], cased(tokens[index], parts.mode));
});
words.push(...parts.gaps[4]);
return words.join(' ').trim();
};
test('property: one line carrying all four signals is coverage, wherever it sits', () => {
fc.assert(fc.property(
partsArb,
fc.array(fc.constantFrom(...FILLER), { maxLength: 4 }),
fc.array(fc.constantFrom(...FILLER), { maxLength: 4 }),
(parts, before, after) => {
const line = buildLine(parts);
const document = [...before, line, ...after].join('\n');
assert.equal(
carriesInlineDirective(document), true,
`read as uncovered: ${JSON.stringify(line)}`,
);
},
));
});
test('property: dropping any one of the four signals is not coverage', () => {
fc.assert(fc.property(partsArb, fc.integer({ min: 0, max: 3 }), (parts, omit) => {
const line = buildLine(parts, omit);
assert.equal(
carriesInlineDirective(line), false,
`read as covered without ${JSON.stringify(signals(parts)[omit])}: ${JSON.stringify(line)}`,
);
}));
});
test('property: the four signals spread across lines are not coverage', () => {
fc.assert(fc.property(
partsArb,
fc.array(fc.boolean(), { minLength: 3, maxLength: 3 }),
(parts, breaks) => {
// No break at all is the single-line case above, not this property.
fc.pre(breaks.some(Boolean));
const tokens = signals(parts);
const document = parts.order.reduce(
(text, index, position) => (position === 0
? cased(tokens[index], parts.mode)
: text + (breaks[position - 1] ? '\n' : ' ') + cased(tokens[index], parts.mode)),
'',
);
assert.equal(
carriesInlineDirective(document), false,
`read as covered across lines: ${JSON.stringify(document)}`,
);
},
));
});
});