triage prompt's docs/agents/triage-labels.md pointer lives in a vendor-EXCLUDED dir — it resolves only in repos that happen to carry their own copy #47

Closed
opened 2026-08-24 01:41:55 +00:00 by matou-build-agent · 1 comment

Why

Found while landing #42 (which took the docs/adr/0174-*.md path out of
run-triage.sh's /triage prompt and routed the two-way-door pointer through
the new TWO_WAY_DOOR_DOC policy knob). The same prompt string carries a
SECOND repo-relative doc path, one line further on:

Only label ready-for-human when the call is a genuine one-way door (state
which in a ## Why human line, per docs/agents/triage-labels.md)

docs/** is vendor-excluded (onboarding/vendor-exclude), so a consumer's
.sandcastle/ never carries it. The prompt runs with the consumer's repo
checkout as cwd, so the path resolves only if that repo happens to keep its own
docs/agents/triage-labels.md. It exists here and (by lineage) in Matou/idss;
whether matou-app has one is unverified — if not, a triage agent there is sent
to a 404 for the label vocabulary it is being told to route by, the same defect
class as #33/#42 one doc-family over.

#42's new ratchet deliberately scans only docs/adr/ paths in harness .sh
files, precisely so this does not red before it is ruled: unlike the ADR
pointer, a consumer has no knob to fix a docs/agents/ path in a vendored
script, so redding on it would trap the consumer rather than route them.

Ask

Rule where the harness's own agent-facing DOCS live for a consumer, then apply
it. Sketch of the options, none pre-judged:

  • A — vendor docs/agents/** (manifest entry), so every consumer carries
    the factory's label vocabulary and issue-tracker doc at its pin, and the
    prompt points at .sandcastle/docs/agents/triage-labels.md. Note docs/** is
    currently classified as factory-only in vendor-exclude; moving a subtree
    crosses the coverage test (onboarding/tests/vendor-manifest-coverage-test.sh)
    and needs the split spelled out.
  • B — inline the vocabulary: the prompt already states the ## Why human
    rule itself; drop the path and keep the sentence (the same shape #42 gave the
    undeclared two-way-door case).
  • C — per-repo knob, as #42 did for the ADR pointer. Probably wrong here:
    the label vocabulary is FACTORY doctrine, not per-repo doctrine — every
    consumer routes by the same four triggers.

Same treatment for the lower-stakes comment references (forgejo-lib.sh,
list-ready-tasks.sh, preflight-triage.sh all name docs/agents/*.md in
comments — those are for humans reading the code, not text handed to an agent).

Whatever is ruled, extend tests/judgement-call-prompts-test.sh's .sh scan
from docs/adr/ to the doc family the ruling settles on, so the next occurrence
reds instead of shipping.

ready-for-session: live prompt text with factory-wide blast radius, plus a
vendor-boundary decision (what counts as harness docs a consumer carries) —
design work, per CLAUDE.md's blast-radius rules.

## Why Found while landing #42 (which took the `docs/adr/0174-*.md` path out of `run-triage.sh`'s `/triage` prompt and routed the two-way-door pointer through the new `TWO_WAY_DOOR_DOC` policy knob). The same prompt string carries a SECOND repo-relative doc path, one line further on: > Only label ready-for-human when the call is a genuine one-way door (state > which in a `## Why human` line, per `docs/agents/triage-labels.md`) `docs/**` is **vendor-excluded** (`onboarding/vendor-exclude`), so a consumer's `.sandcastle/` never carries it. The prompt runs with the consumer's repo checkout as cwd, so the path resolves only if that repo happens to keep its own `docs/agents/triage-labels.md`. It exists here and (by lineage) in `Matou/idss`; whether `matou-app` has one is unverified — if not, a triage agent there is sent to a 404 for the label vocabulary it is being told to route by, the same defect class as #33/#42 one doc-family over. #42's new ratchet deliberately scans only `docs/adr/` paths in harness `.sh` files, precisely so this does not red before it is ruled: unlike the ADR pointer, a consumer has **no knob** to fix a `docs/agents/` path in a vendored script, so redding on it would trap the consumer rather than route them. ## Ask Rule where the harness's own agent-facing DOCS live for a consumer, then apply it. Sketch of the options, none pre-judged: - **A — vendor `docs/agents/**`** (manifest entry), so every consumer carries the factory's label vocabulary and issue-tracker doc at its pin, and the prompt points at `.sandcastle/docs/agents/triage-labels.md`. Note `docs/**` is currently classified as factory-only in `vendor-exclude`; moving a subtree crosses the coverage test (`onboarding/tests/vendor-manifest-coverage-test.sh`) and needs the split spelled out. - **B — inline the vocabulary**: the prompt already states the `## Why human` rule itself; drop the path and keep the sentence (the same shape #42 gave the undeclared two-way-door case). - **C — per-repo knob**, as #42 did for the ADR pointer. Probably wrong here: the label vocabulary is FACTORY doctrine, not per-repo doctrine — every consumer routes by the same four triggers. Same treatment for the lower-stakes comment references (`forgejo-lib.sh`, `list-ready-tasks.sh`, `preflight-triage.sh` all name `docs/agents/*.md` in comments — those are for humans reading the code, not text handed to an agent). Whatever is ruled, extend `tests/judgement-call-prompts-test.sh`'s `.sh` scan from `docs/adr/` to the doc family the ruling settles on, so the next occurrence reds instead of shipping. `ready-for-session`: live prompt text with factory-wide blast radius, plus a vendor-boundary decision (what counts as harness docs a consumer carries) — design work, per CLAUDE.md's blast-radius rules.
Author
Member

Ruled by agent under ADR 0174 — veto anytime

The ruling: docs/** stays factory-only, and the boundary is stated as a rule
about POINTERS rather than about directories.

A harness prompt string may name a repo-relative path only when the harness
itself puts that path in the consumer's tree — a vendored .sandcastle/…
file — or when the repo DECLARES it in its own identity/policy layer. Factory
doctrine reaches a consumer as vendored CODE that renders text, never as a
doc path the consumer is trusted to have.

Recorded as an ADR 0001 amendment (point 2 said a consumer keeps a thin
identity layer, and vendor-exclude classified docs/** factory-only; neither
said what that meant for live prompt text, which is how three prompts shipped a
dead path — #33, #42, this).

The 404 is verified, not suspected

The ticket left matou-app unverified. The live checkout on this host says it
has a docs/ tree with no docs/agents/ directory at all and no
triage-labels.md anywhere in the repo. Every headless triage run there was
pointed at nothing for the very label vocabulary it was being told to route by.

Option B, and why it is more than a deletion

Applied as filed — drop the path, keep the sentence. What makes it a ruling
rather than a tidy-up is the second clause: the doctrine already travels the
ruled way.
policy-lib.sh's policy_trigger_guidance one-way-door (#14)
states the ## Why human rule in factory-owned, product-literal-free words and
renders into every consumer's prompt.md. So the prompt now reads

…state which in a ## Why human line naming the human residue…

taking that function's wording deliberately, so two statements of one rule
cannot drift into two rules.

A declined on construction, not cost

docs/agents/triage-labels.md opens by saying it maps the canonical roles to
the label strings in this repo's tracker and that "a consumer carries its
own copy of this file for its own tracker"
; its body names a repo slug, a
person ("Ben's hands, Ben's eyes"), this repo's minted label set and this repo's
own ready-for-session scope. Vendoring it byte-identical pushes one repo's
facts into every consumer — the family #14 (idss's label ids in everyone's
prose) and #43 (a product's issue number in everyone's queue filter) exist to
close. The manifest mechanics were checked rather than assumed:
vendor-manifest-coverage-test.sh demands exactly-once classification and its
dir/** match is a prefix match, so docs/agents/** beside docs/** fails as
double-classified — the split would have to enumerate every remaining docs/
subtree, forever, for a subtree that must not be shared.

C declined on a sharper ground than the ticket's

The ticket's reason (factory doctrine, not per-repo doctrine) is right but
incomplete. The operative fact is that this doctrine is already factory-owned
and already rendered, so a knob would point each repo at its own copy of a
rule policy-lib.sh states once — precisely the drift #14's "guidance lives
beside the vocabulary" note exists to prevent.

A fourth option was considered and declined: a run-time [ -f ] probe (link it
where it resolves, drop it where it doesn't). It sniffs an undeclared
per-repo fact, so a repo that renames the file silently loses the pointer with
no signal — the worst of A and C, and against #42's ruling that per-repo
doctrine is DECLARED, never inferred.

The comment references

Ruling applied, ratchet not — keeping #28/#42's precedent that a hazard must
stay explainable next to the code it constrains. A comment may name a factory
doc; it must not read as a path in the consumer's own tree.
forgejo-lib.sh, list-ready-tasks.sh and tui/data/labels.py now say the
doc is the factory's; preflight-triage.sh drops its two pointers and
instead states that its own label strings are the predicate's authority.

Three references named a doc that does not resolve even here —
docs/agents/e2e-driver-contract.md, which never migrated out of its product
repo (CLAUDE.md's "Docs homes") — so evidence-lib.sh,
onboarding/onboard-lib.sh's two operator-facing error strings and
onboarding/README.md name the contract and drop the dead path.


Close report

Landed: 09560a4 on main (pushed).

What Where
Prompt fix run-triage.sh — the path is gone; the rule is stated
Ruling recorded docs/adr/0001-*.md amendment, + the reasoning at the boundary file (onboarding/vendor-exclude)
Ratchet tests/judgement-call-prompts-test.sh 21→31, tests/run-triage-test.sh 5→6
Comments forgejo-lib.sh, list-ready-tasks.sh, preflight-triage.sh, tui/data/labels.py, evidence-lib.sh, onboarding/onboard-lib.sh, onboarding/README.md
State STATUS.md header lead + Prompt-skeletons row + milestone entry

The ratchet (the ticket's actual ask — "extend the .sh scan to the doc
family the ruling settles on"). All THREE of
judgement-call-prompts-test.sh's scans widen from docs/adr/ to the whole
docs/ family:

  • (a) no prompt SKELETON may name a doc path;
  • (c) no harness .sh may name one in EXECUTABLE text (comment lines still
    exempt) — the scan the ticket asked for;
  • (b) every doc path a repo's own rendered prompts/enrichments name must
    RESOLVE there. Deliberately a resolution check, not a ban: the per-repo layer
    may point at its own docs, it just has to have them — which is why this repo's
    heal-prompt.md and classify.md keep their docs/agents/issue-tracker.md
    pointers untouched.

Plus a new run-triage-test.sh scenario asserting the assembled prompt (the
argv a triage agent actually receives, under both policy states) carries no doc
path except the one the repo declared for itself, and still carries the
## Why human bar.

Proof:

  • Both ratchets driven RED against the exact pre-fix line (restored, run,
    restored back) and green after:
    FAIL: the prompt handed a factory doc path to the triage agent (docs/** is vendor-excluded — state the doctrine, do not link it): docs/agents/triage-labels.md
  • Full offline suite green, 67 files (shimmed curl/claude, no docker, no
    network).
  • Vendored-standalone re-proven (#23): the widened test run from a simulated
    consumer layout (<repo>/.sandcastle/tests/, docs one level up) passes its 31
    checks there and still reds on the pre-fix line.

Follow-up filed: #49 (ready-for-session). The widened skeleton scan
surfaced one outstanding occurrence it cannot fix in the same commit:
prompts/rehearsal-report-prompt.md line 3 names Matou/idss's
docs/superpowers/specs/2026-08-09-183-… design spec — dead here and in
matou-app, and inherited by this repo's own rendered copy. It needs #33's
{{ENRICH:<slot>}} treatment, whose cost is a fleet-wide render refusal until
every consumer authors the new file, so it earns its own ticket rather than
being folded in. The test carries that path as a named baseline with a
staleness check: a NEW occurrence reds immediately, and the baseline itself reds
the moment #49 lands, so it cannot outlive its ticket.

Rollout, stated honestly. Root-only. A human re-vendor
(bash onboarding/onboard.sh vendor .sandcastle <sha>) carries run-triage.sh,
the four commented libs and the two tests into .sandcastle/; idss and
matou-app pick the fix up at their next FACTORY_REF bump. Until then
matou-app's triage runs keep the 404
(GOTCHAS 4) — the fix is in the root, not
in any running copy.

## Ruled by agent under ADR 0174 — veto anytime **The ruling: `docs/**` stays factory-only, and the boundary is stated as a rule about POINTERS rather than about directories.** > A harness prompt string may name a repo-relative path only when the harness > itself puts that path in the consumer's tree — a vendored `.sandcastle/…` > file — or when the repo DECLARES it in its own identity/policy layer. Factory > doctrine reaches a consumer as **vendored CODE that renders text**, never as a > doc path the consumer is trusted to have. Recorded as an **ADR 0001 amendment** (point 2 said a consumer keeps a thin identity layer, and `vendor-exclude` classified `docs/**` factory-only; neither said what that meant for live prompt text, which is how three prompts shipped a dead path — #33, #42, this). ### The 404 is verified, not suspected The ticket left `matou-app` unverified. The live checkout on this host says it has a `docs/` tree with **no `docs/agents/` directory at all** and no `triage-labels.md` anywhere in the repo. Every headless triage run there was pointed at nothing for the very label vocabulary it was being told to route by. ### Option B, and why it is more than a deletion Applied as filed — drop the path, keep the sentence. What makes it a ruling rather than a tidy-up is the second clause: **the doctrine already travels the ruled way.** `policy-lib.sh`'s `policy_trigger_guidance one-way-door` (#14) states the `## Why human` rule in factory-owned, product-literal-free words and renders into every consumer's `prompt.md`. So the prompt now reads > …state which in a `## Why human` line **naming the human residue**… taking that function's wording deliberately, so two statements of one rule cannot drift into two rules. ### A declined on construction, not cost `docs/agents/triage-labels.md` opens by saying it maps the canonical roles to the label strings in **this** repo's tracker and that *"a consumer carries its own copy of this file for its own tracker"*; its body names a repo slug, a person ("Ben's hands, Ben's eyes"), this repo's minted label set and this repo's own `ready-for-session` scope. Vendoring it byte-identical pushes one repo's facts into every consumer — the family #14 (idss's label ids in everyone's prose) and #43 (a product's issue number in everyone's queue filter) exist to close. The manifest mechanics were checked rather than assumed: `vendor-manifest-coverage-test.sh` demands exactly-once classification and its `dir/**` match is a prefix match, so `docs/agents/**` beside `docs/**` fails as double-classified — the split would have to enumerate every remaining `docs/` subtree, forever, for a subtree that must not be shared. ### C declined on a sharper ground than the ticket's The ticket's reason (factory doctrine, not per-repo doctrine) is right but incomplete. The operative fact is that this doctrine is *already* factory-owned and *already* rendered, so a knob would point each repo at its own copy of a rule `policy-lib.sh` states once — precisely the drift #14's "guidance lives beside the vocabulary" note exists to prevent. A fourth option was considered and declined: a run-time `[ -f ]` probe (link it where it resolves, drop it where it doesn't). It sniffs an **un**declared per-repo fact, so a repo that renames the file silently loses the pointer with no signal — the worst of A and C, and against #42's ruling that per-repo doctrine is DECLARED, never inferred. ### The comment references Ruling applied, ratchet not — keeping #28/#42's precedent that a hazard must stay explainable next to the code it constrains. A comment may name a factory doc; it must not read as a path in the consumer's own tree. `forgejo-lib.sh`, `list-ready-tasks.sh` and `tui/data/labels.py` now say the doc is the **factory's**; `preflight-triage.sh` drops its two pointers and instead states that its own label strings are the predicate's authority. Three references named a doc that does not resolve **even here** — `docs/agents/e2e-driver-contract.md`, which never migrated out of its product repo (CLAUDE.md's "Docs homes") — so `evidence-lib.sh`, `onboarding/onboard-lib.sh`'s two operator-facing error strings and `onboarding/README.md` name the contract and drop the dead path. --- ## Close report **Landed:** `09560a4` on `main` (pushed). | What | Where | |---|---| | Prompt fix | `run-triage.sh` — the path is gone; the rule is stated | | Ruling recorded | `docs/adr/0001-*.md` amendment, + the reasoning at the boundary file (`onboarding/vendor-exclude`) | | Ratchet | `tests/judgement-call-prompts-test.sh` 21→31, `tests/run-triage-test.sh` 5→6 | | Comments | `forgejo-lib.sh`, `list-ready-tasks.sh`, `preflight-triage.sh`, `tui/data/labels.py`, `evidence-lib.sh`, `onboarding/onboard-lib.sh`, `onboarding/README.md` | | State | `STATUS.md` header lead + Prompt-skeletons row + milestone entry | **The ratchet** (the ticket's actual ask — "extend the `.sh` scan to the doc family the ruling settles on"). All THREE of `judgement-call-prompts-test.sh`'s scans widen from `docs/adr/` to the whole `docs/` family: - **(a)** no prompt SKELETON may name a doc path; - **(c)** no harness `.sh` may name one in EXECUTABLE text (comment lines still exempt) — the scan the ticket asked for; - **(b)** every doc path a repo's **own** rendered prompts/enrichments name must RESOLVE there. Deliberately a resolution check, not a ban: the per-repo layer may point at its own docs, it just has to have them — which is why this repo's `heal-prompt.md` and `classify.md` keep their `docs/agents/issue-tracker.md` pointers untouched. Plus a new `run-triage-test.sh` scenario asserting the **assembled** prompt (the argv a triage agent actually receives, under both policy states) carries no doc path except the one the repo declared for itself, and still carries the `## Why human` bar. **Proof:** - Both ratchets driven **RED against the exact pre-fix line** (restored, run, restored back) and green after: `FAIL: the prompt handed a factory doc path to the triage agent (docs/** is vendor-excluded — state the doctrine, do not link it): docs/agents/triage-labels.md` - Full offline suite **green, 67 files** (shimmed curl/claude, no docker, no network). - **Vendored-standalone re-proven (#23):** the widened test run from a simulated consumer layout (`<repo>/.sandcastle/tests/`, docs one level up) passes its 31 checks there and still reds on the pre-fix line. **Follow-up filed: #49** (`ready-for-session`). The widened skeleton scan surfaced one outstanding occurrence it cannot fix in the same commit: `prompts/rehearsal-report-prompt.md` line 3 names `Matou/idss`'s `docs/superpowers/specs/2026-08-09-183-…` design spec — dead here and in matou-app, and inherited by this repo's own rendered copy. It needs #33's `{{ENRICH:<slot>}}` treatment, whose cost is a fleet-wide render refusal until every consumer authors the new file, so it earns its own ticket rather than being folded in. The test carries that path as a **named baseline** with a staleness check: a NEW occurrence reds immediately, and the baseline itself reds the moment #49 lands, so it cannot outlive its ticket. **Rollout, stated honestly.** Root-only. A human re-vendor (`bash onboarding/onboard.sh vendor .sandcastle <sha>`) carries `run-triage.sh`, the four commented libs and the two tests into `.sandcastle/`; idss and matou-app pick the fix up at their next `FACTORY_REF` bump. **Until then matou-app's triage runs keep the 404** (GOTCHAS 4) — the fix is in the root, not in any running copy.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#47
No description provided.