session-runner-prompt.md / .sandcastle prompt-enrichments point at Matou/idss's docs/adr/0174-*.md, which does not exist in dev-factory #33

Closed
opened 2026-08-23 14:19:44 +00:00 by matou-build-agent · 2 comments

Why

Found while landing #1 (the prompt-skeleton templating/render pipeline). .sandcastle/prompt-enrichments/rules.md (this repo's own committed enrichment for prompts/prompt.md's {{ENRICH:rules}} slot) still says:

Then try to rule it yourself under the two-way-door rule (ADR 0174 in Matou/idss, which this factory inherited — see docs/adr/0001-*.md)

That text is carried forward byte-identical from the pre-#1 .sandcastle/prompt.md — #1's cutover proof explicitly requires byte-identical reproduction of the CURRENT rendered content, so it could not be fixed as part of that ticket without breaking the proof.

Separately, session-runner-prompt.md (root skeleton, and this repo's own already-rendered .sandcastle/session-runner-prompt.md, byte-identical to root before #1 too) says:

The rules (ADR 0174 — read docs/adr/0174-*.md and docs/agents/*.md first)

docs/adr/0174-*.md does not exist in this repo (dev-factory only has docs/adr/0001-0003) — ADR 0174 is Matou/idss's own decision record. This is the literal file this session's own governing prompt pointed at, and following it literally would 404.

Ask

Fix the pointer text so it names this repo's own docs/adr/0001-*.md (mirroring the rules.md enrichment's already-correct phrasing) instead of a path that only exists in Matou/idss. In scope:

  • .sandcastle/prompt-enrichments/rules.md's ADR-0174 parenthetical (already has a correct pattern to copy from within the same file — it's only the session-runner-prompt.md case that's newly discovered here).
  • prompts/session-runner-prompt.md's ## The rules (...) header line and this repo's own .sandcastle/session-runner-prompt.md — decide whether this becomes a new {{ENRICH:...}} slot (consistent with #1's convention) or stays a literal skeleton line if the phrasing is judged generic enough. This is prompt-file design work (CLAUDE.md rule 2c) — treat it as such.
  • Re-run the cutover-proof style test after the change (the byte-identical assertions will need updating to match the corrected text, deliberately, not silently).

ready-for-session: edits a prompt skeleton/enrichment (protected-path-adjacent, needs an interactive session's standing, not a swarm worker).

## Why Found while landing #1 (the prompt-skeleton templating/render pipeline). `.sandcastle/prompt-enrichments/rules.md` (this repo's own committed enrichment for `prompts/prompt.md`'s `{{ENRICH:rules}}` slot) still says: > **Then try to rule it yourself under the two-way-door rule** (ADR 0174 in `Matou/idss`, which this factory inherited — see `docs/adr/0001-*.md`) That text is carried forward byte-identical from the pre-#1 `.sandcastle/prompt.md` — #1's cutover proof explicitly requires byte-identical reproduction of the CURRENT rendered content, so it could not be fixed as part of that ticket without breaking the proof. Separately, `session-runner-prompt.md` (root skeleton, and this repo's own already-rendered `.sandcastle/session-runner-prompt.md`, byte-identical to root before #1 too) says: > ## The rules (ADR 0174 — read `docs/adr/0174-*.md` and `docs/agents/*.md` first) `docs/adr/0174-*.md` does not exist in this repo (dev-factory only has `docs/adr/0001-0003`) — ADR 0174 is `Matou/idss`'s own decision record. This is the literal file this session's own governing prompt pointed at, and following it literally would 404. ## Ask Fix the pointer text so it names this repo's own `docs/adr/0001-*.md` (mirroring the `rules.md` enrichment's already-correct phrasing) instead of a path that only exists in `Matou/idss`. In scope: - `.sandcastle/prompt-enrichments/rules.md`'s ADR-0174 parenthetical (already has a correct pattern to copy from within the same file — it's only the `session-runner-prompt.md` case that's newly discovered here). - `prompts/session-runner-prompt.md`'s `## The rules (...)` header line and this repo's own `.sandcastle/session-runner-prompt.md` — decide whether this becomes a new `{{ENRICH:...}}` slot (consistent with #1's convention) or stays a literal skeleton line if the phrasing is judged generic enough. This is prompt-file design work (CLAUDE.md rule 2c) — treat it as such. - Re-run the cutover-proof style test after the change (the byte-identical assertions will need updating to match the corrected text, deliberately, not silently). `ready-for-session`: edits a prompt skeleton/enrichment (protected-path-adjacent, needs an interactive session's standing, not a swarm worker).
Author
Member

Ruling — the pointer becomes an enrichment slot, not a generic literal line

Ruled by agent under ADR 0174 — veto anytime.

The ticket asks me to decide whether prompts/session-runner-prompt.md's ## The rules (...) heading becomes a new {{ENRICH:...}} slot or stays a literal skeleton line "if the phrasing is judged generic enough".

It cannot be generic enough. The heading's whole job is to name the record a session must read. That record is per-repo: ADR 0174 in Matou/idss, ADRs 0001-0005 here, something else again in matou-app. Every literal phrasing I tried is wrong for someone — docs/adr/0174-*.md 404s everywhere but idss (the bug), docs/adr/0001-*.md is right here but points idss's sessions at an unrelated record, and "this repo's founding decision record" is true here and false in idss (0174 is idss's two-way-door record, not its founding one). Dropping the path entirely leaves a session with nothing local to read.

So: new slot {{ENRICH:session-rules-heading}}, consistent with #1's convention and with #14's precedent that no product's decision-record numbers may sit in text that renders into every consumer (CLAUDE.md's blast-radius rule).

Three sub-rulings inside that:

  1. The slot takes the WHOLE heading line, not just its parenthetical — an {{ENRICH:<slot>}} must sit alone on its line (prompt-render-lib.sh), so an inline splice would need new machinery. This is not a compromise, it is what makes the cutover proof survive: idss's fixture enrichment carries idss's original heading byte-for-byte, so render_prompts (idss): session-runner-prompt.md is byte-identical to the reference copy still passes unchanged. The ticket anticipated spending that assertion ("deliberately, not silently"); it turns out not to need spending. The only byte-identical assertion that moves is this repo's own, and it moves because .sandcastle/session-runner-prompt.md is the file being corrected — one line.

  2. The bare phrase "ADR 0174" stays in skeleton rule 3 ("Ruled by agent under ADR 0174 — veto anytime"). It is the factory's inherited audit-trail vocabulary — docs/agents/triage-labels.md, this repo's own ADR headers (0003/0004/0005) and its rendered rules.md all use it, and an operator greps that exact phrase across repos. It names no path and cannot 404. The path is the hazard, not the number; the ratchet is scoped accordingly, and says so in a comment so a later session does not re-open it.

  3. .sandcastle/prompt-enrichments/rules.md needed no change. Its parenthetical already reads "(ADR 0174 in Matou/idss, which this factory inherited — see docs/adr/0001-*.md)" — the correct pattern this ticket asked me to copy. The premise in STATUS.md's #1 entry (that it "still says docs/adr/0174-*.md verbatim") is stale: the file that says that is the frozen idss fixture, where it is correct.

Why this is a two-way door: it is a commit-revertible text change to a rendered prompt plus one new consumer-owned enrichment file; nothing is credential-bearing, nothing widens security posture, and a consumer that dislikes the wording edits its own enrichment without touching the harness. What proves it: the cutover proof (onboarding/tests/onboard-lib-test.sh, 158 checks) re-renders both idss's reference copies and this repo's real committed .sandcastle/*.md byte-identical, and the new ratchet in tests/judgement-call-prompts-test.sh was proven red against the exact pre-fix text before the fix landed.

Residue named honestly, not silently absorbed: consumers must author prompt-enrichments/session-rules-heading.md at their next pin bump. The render refuses and names the missing file (it never ships a half-filled prompt), and the slot joins the list onboarding/README.md now carries. It is one more file in a set idss and matou-app must author anyway when they first render.

## Ruling — the pointer becomes an enrichment slot, not a generic literal line Ruled by agent under ADR 0174 — veto anytime. The ticket asks me to decide whether `prompts/session-runner-prompt.md`'s `## The rules (...)` heading becomes a new `{{ENRICH:...}}` slot or stays a literal skeleton line "if the phrasing is judged generic enough". **It cannot be generic enough.** The heading's whole job is to name the record a session must read. That record is per-repo: ADR 0174 in `Matou/idss`, ADRs 0001-0005 here, something else again in `matou-app`. Every literal phrasing I tried is wrong for someone — `docs/adr/0174-*.md` 404s everywhere but idss (the bug), `docs/adr/0001-*.md` is right here but points idss's sessions at an unrelated record, and "this repo's founding decision record" is true here and false in idss (0174 is idss's two-way-door record, not its founding one). Dropping the path entirely leaves a session with nothing local to read. So: **new slot `{{ENRICH:session-rules-heading}}`**, consistent with #1's convention and with #14's precedent that no product's decision-record numbers may sit in text that renders into every consumer (CLAUDE.md's blast-radius rule). Three sub-rulings inside that: 1. **The slot takes the WHOLE heading line**, not just its parenthetical — an `{{ENRICH:<slot>}}` must sit alone on its line (`prompt-render-lib.sh`), so an inline splice would need new machinery. This is not a compromise, it is what makes the cutover proof *survive*: idss's fixture enrichment carries idss's original heading byte-for-byte, so `render_prompts (idss): session-runner-prompt.md is byte-identical to the reference copy` still passes unchanged. The ticket anticipated spending that assertion ("deliberately, not silently"); it turns out not to need spending. The only byte-identical assertion that moves is this repo's own, and it moves because `.sandcastle/session-runner-prompt.md` is the file being corrected — one line. 2. **The bare phrase "ADR 0174" stays** in skeleton rule 3 ("Ruled by agent under ADR 0174 — veto anytime"). It is the factory's inherited audit-trail vocabulary — `docs/agents/triage-labels.md`, this repo's own ADR headers (0003/0004/0005) and its rendered `rules.md` all use it, and an operator greps that exact phrase across repos. It names no path and cannot 404. **The path is the hazard, not the number**; the ratchet is scoped accordingly, and says so in a comment so a later session does not re-open it. 3. **`.sandcastle/prompt-enrichments/rules.md` needed no change.** Its parenthetical already reads "(ADR 0174 in `Matou/idss`, which this factory inherited — see `docs/adr/0001-*.md`)" — the correct pattern this ticket asked me to copy. The premise in `STATUS.md`'s #1 entry (that it "still says `docs/adr/0174-*.md` verbatim") is stale: the file that says that is the frozen idss *fixture*, where it is correct. **Why this is a two-way door:** it is a commit-revertible text change to a rendered prompt plus one new consumer-owned enrichment file; nothing is credential-bearing, nothing widens security posture, and a consumer that dislikes the wording edits its own enrichment without touching the harness. **What proves it:** the cutover proof (`onboarding/tests/onboard-lib-test.sh`, 158 checks) re-renders both idss's reference copies and this repo's real committed `.sandcastle/*.md` byte-identical, and the new ratchet in `tests/judgement-call-prompts-test.sh` was proven red against the exact pre-fix text before the fix landed. **Residue named honestly, not silently absorbed:** consumers must author `prompt-enrichments/session-rules-heading.md` at their next pin bump. The render refuses and names the missing file (it never ships a half-filled prompt), and the slot joins the list `onboarding/README.md` now carries. It is one more file in a set idss and matou-app must author anyway when they first render.
Author
Member

Close report — #33

Landed: bd8c5e4 on main (root + this repo's own per-repo layer; no consumer push — ADR 0001, pull-only).

What changed

File Change
prompts/session-runner-prompt.md line 9 ## The rules (ADR 0174 — read \docs/adr/0174-*.md` …)→{{ENRICH:session-rules-heading}}`
.sandcastle/prompt-enrichments/session-rules-heading.md new — this repo's own heading: "(ADR 0174 in Matou/idss, inherited by this factory — read docs/adr/0001-*.md and docs/agents/*.md first)"
.sandcastle/session-runner-prompt.md re-rendered from the working-tree skeleton — exactly one line differs
onboarding/tests/fixtures/idss-prompts/prompt-enrichments/session-rules-heading.md new — idss's original heading verbatim, so the idss cutover render stays byte-identical
tests/judgement-call-prompts-test.sh the ratchet, 14 → 18 checks
onboarding/README.md the eight enrichment slots a consumer must author, and why this one is a whole heading line
STATUS.md header + Prompt-skeletons row + milestone entry

.sandcastle/prompt-enrichments/rules.md is unchanged: it already carried the correct phrasing (see the ruling comment, sub-ruling 3 — the ticket's premise there was stale).

Proof

  • Red before green, both halves of the ratchet:
    • (a) skeleton check, before the fix: FAIL: a prompt skeleton names a decision-record path … prompts/session-runner-prompt.md:9:## The rules (ADR 0174 — read \docs/adr/0174-*.md` …)`
    • (b) live-pointer check, proven independently by restoring the old line into the rendered copy with the skeleton already fixed: FAIL: session-runner-prompt.md points at docs/adr/0174-*.md, which does not exist in this repo
    • After the fix: judgement-call-prompts-test: 18 checks passed.
  • Cutover proof re-run: onboarding/tests/onboard-lib-test.sh → 158 passed, 0 failed, including render_prompts (idss): session-runner-prompt.md is byte-identical to the reference copy (unchanged, not re-baselined) and render_prompts (dev-factory): session-runner-prompt.md is byte-identical to the committed .sandcastle copy (now the corrected text — the one byte-identical assertion that moved, deliberately).
  • Vendored-standalone (#23): the test was run from a consumer-shaped scratch tree (<repo>/.sandcastle/tests/, docs one level up) built for an idss-shaped consumer whose own slot file keeps docs/adr/0174-*.md — 18 checks passed, and it went red the moment that ADR was removed from the scratch repo. Per-repo correctness is what the slot buys.
  • Full offline suite green: 67 files, 0 failures.

Live effect

This repo's own .sandcastle/session-runner-prompt.md — the text the next session on this host reads — is corrected now, ahead of the pin. Safe: the pinned bd48fd6 carries no prompts/ dir, so check-harness-drift.sh's render advisory does not exist in the running copy and cannot go stale-noisy. The skeleton reaches consumers at their next FACTORY_REF bump, at which point idss and matou-app must author prompt-enrichments/session-rules-heading.md (the render refuses, naming it).

Follow-up filed

#42 (ready-for-session, bug) — run-triage.sh:99's /triage prompt string carries the same docs/adr/0174-*.md path inside a harness shell script, where no {{ENRICH}} slot reaches and this ratchet (markdown only) does not scan. It names the three mechanism options and records that protected-paths-lib.sh:69's bare "ADR 0174:" is deliberately fine.

No human residue: everything here was revertible and provable. Closing.

## Close report — #33 **Landed:** `bd8c5e4` on `main` (root + this repo's own per-repo layer; no consumer push — ADR 0001, pull-only). ### What changed | File | Change | |---|---| | `prompts/session-runner-prompt.md` | line 9 `## The rules (ADR 0174 — read \`docs/adr/0174-*.md\` …)` → `{{ENRICH:session-rules-heading}}` | | `.sandcastle/prompt-enrichments/session-rules-heading.md` | **new** — this repo's own heading: "(ADR 0174 in `Matou/idss`, inherited by this factory — read `docs/adr/0001-*.md` and `docs/agents/*.md` first)" | | `.sandcastle/session-runner-prompt.md` | re-rendered from the working-tree skeleton — **exactly one line differs** | | `onboarding/tests/fixtures/idss-prompts/prompt-enrichments/session-rules-heading.md` | **new** — idss's original heading verbatim, so the idss cutover render stays byte-identical | | `tests/judgement-call-prompts-test.sh` | the ratchet, 14 → 18 checks | | `onboarding/README.md` | the eight enrichment slots a consumer must author, and why this one is a whole heading line | | `STATUS.md` | header + Prompt-skeletons row + milestone entry | `.sandcastle/prompt-enrichments/rules.md` is **unchanged**: it already carried the correct phrasing (see the ruling comment, sub-ruling 3 — the ticket's premise there was stale). ### Proof - **Red before green, both halves of the ratchet:** - (a) skeleton check, before the fix: `FAIL: a prompt skeleton names a decision-record path … prompts/session-runner-prompt.md:9:## The rules (ADR 0174 — read \`docs/adr/0174-*.md\` …)` - (b) live-pointer check, proven independently by restoring the old line into the rendered copy with the skeleton already fixed: `FAIL: session-runner-prompt.md points at docs/adr/0174-*.md, which does not exist in this repo` - After the fix: `judgement-call-prompts-test: 18 checks passed`. - **Cutover proof re-run:** `onboarding/tests/onboard-lib-test.sh` → `158 passed, 0 failed`, including `render_prompts (idss): session-runner-prompt.md is byte-identical to the reference copy` (unchanged, not re-baselined) and `render_prompts (dev-factory): session-runner-prompt.md is byte-identical to the committed .sandcastle copy` (now the corrected text — the one byte-identical assertion that moved, deliberately). - **Vendored-standalone (#23):** the test was run from a consumer-shaped scratch tree (`<repo>/.sandcastle/tests/`, docs one level up) built for an idss-shaped consumer whose own slot file keeps `docs/adr/0174-*.md` — 18 checks passed, and it went red the moment that ADR was removed from the scratch repo. Per-repo correctness is what the slot buys. - **Full offline suite green:** 67 files, 0 failures. ### Live effect This repo's own `.sandcastle/session-runner-prompt.md` — the text the next session on this host reads — is corrected now, ahead of the pin. Safe: the pinned `bd48fd6` carries no `prompts/` dir, so `check-harness-drift.sh`'s render advisory does not exist in the running copy and cannot go stale-noisy. The skeleton reaches consumers at their next `FACTORY_REF` bump, at which point idss and matou-app must author `prompt-enrichments/session-rules-heading.md` (the render refuses, naming it). ### Follow-up filed **#42** (`ready-for-session`, `bug`) — `run-triage.sh:99`'s `/triage` prompt string carries the same `docs/adr/0174-*.md` path inside a harness **shell script**, where no `{{ENRICH}}` slot reaches and this ratchet (markdown only) does not scan. It names the three mechanism options and records that `protected-paths-lib.sh:69`'s bare "ADR 0174:" is deliberately fine. No human residue: everything here was revertible and provable. Closing.
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#33
No description provided.