harness: the pre-push gate has no docs tier, so a bare %% in a .mermaid source only reds in CI (GOTCHAS #143, 2nd time) #2068
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#2068
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Filed by the swarm healer from a
cired on PR #2067 (run 52773, signature93e101f240ab).Symptom
A docs-only push lands on a branch, then
cireds at stageDocs: every mermaid diagram block parses (#343):This is GOTCHAS #143 (bare
%%glues onto the header) happening a second time— first in
docs/ux/flows/p6-members-idip.mermaid(#1071, signature933612b60e72), now in a slice DAG. The hazard is written down, the checkernames the cause in its own hint, and the repo still has no door that stops it
before CI.
Root cause (the harness half)
gate_langs_for_filesin.sandcastle/gate-lib.sh:28maps paths togoandtsonly. A change that touches justdocs/**(*.mermaid,*.md) yields nolanguage token, so
gate_runprintsgate: no gated language touched — nothing to checkand the pre-push hook passes. Every docs-class contract theseam enforces (mermaid parse #343, slice-map YAML #834, and the other
Docs:stages in
scripts/seam-smoke.sh) is therefore CI-only: an agent that writes adiagram discovers the break one full run later, on a branch a human has to
re-open.
What to build
A third
docstier in the push gate: when the pushed diff touchesdocs/architecture/**,docs/slices/**ordocs/ux/flows/**, run the cheapin-repo checkers (
node scripts/check-mermaid.mjs,node scripts/check-slices-yaml.mjs) against the repo, mirroring howgo_tier=gofmtgives the host path a cheap Go door (#1458).
Read GOTCHAS #400 before shipping it. Gate 3b's gofmt scan refused every
Go push from a swarm workdir for days because its input set was wrong; a docs
gate has the same shape of tail risk and a specific trigger for it:
check-mermaid.mjsresolveshappy-domout ofapp/node_modules(
scripts/check-mermaid.mjs:44), and.sandcastle/Dockerfileruns nopnpm install. In a sandbox without an installed app tree the checker exits 2(crash, not a parse failure), which would red every docs push. So the stage
must either run inside the shell that guarantees the dep, or detect a missing
happy-domand fail loudly as a harness fault with that name in the message— never silently skip, and never report a crash as a broken diagram.
Acceptance criteria
docs/slices/*.mermaidruns the mermaidchecker and is REFUSED when a block will not parse.
%%source from this incident is the test fixture: the gate rejectsit, and accepts the same file with line 5 given content.
nothing to checkand passes..sandcastle/tests/gate-lib-test.sh(the existing seam forgate_langs_for_files/gate_run), with a case proving a missinghappy-domis reported as a harness fault, not as a parse failure.docs/GOTCHAS.md#143's Rule gains the pointer that the push gate nowcatches this.
The content fault that triggered the run is NOT part of this ticket — it is one
line on PR #2067's branch and is called out there.
Routed to a session — ruled by agent under ADR 0174 (veto anytime)
This ticket's entire deliverable is a change to protected
.sandcastle/machinery, so a Sandcastle swarm worker cannot land it.
What the ticket asks for, and where it must live:
docstier in the push gate — a new path→token mapping ingate_langs_for_filesand its dispatch ingate_run. Both live in.sandcastle/gate-lib.sh.happy-domharness-fault case) in
.sandcastle/tests/gate-lib-test.sh.The push gate has no implementation surface outside
.sandcastle/: thecheckers it would call (
scripts/check-mermaid.mjs,scripts/check-slices-yaml.mjs) already exist and are non-protected, but thetier that decides when to run them on a docs-only diff is the gate dispatch
itself, which is pure machinery. The per-repo override hooks (
go-gate.sh,ts-gate.sh) also live under.sandcastle/. So every acceptance clause hererequires editing
gate-lib.shand/orgate-lib-test.sh.The protected-paths boundary (#445,
.sandcastle/protected-paths-lib.sh)fingerprints
.sandcastle/before and after each worker run and rolls backplus fails loud on any introduced change. A swarm worker therefore cannot
implement this ticket at all.
Ruling (ADR 0174 — two-way door): relabel
ready-for-agent→ready-for-session. A protected.sandcastle/change needs an interactivesession's standing (ADR 0174 / rule 9 of the worker contract). This is fully
revertible (a relabel) and provable (the deliverable is wholly inside protected
paths), so it is mine to rule; veto anytime by relabelling.
landing-prand the<!-- origin: app-report #2047 -->marker are leftuntouched — this stays a PR-landing ticket; a session works it and lands it by
pull request for a human merge.
No code change was made this iteration (none was possible without editing a
protected path).
docs/GOTCHAS.md#143's Rule pointer is intentionally notupdated, because its acceptance ("the push gate now catches this") would be
false until the gate tier actually lands — the session that builds the tier
should land that pointer in the same change.
Close-report (pr-mode — PR open, a human merges) — Ruled by agent under ADR 0174, veto anytime.
Lands via PR #2109 (
closes #2068, branchagent/issue-2068; the pre-push gate ran clean —no gated language touched).What landed. A third
docstier in the vendored pre-push gate:gate_langs_for_filesemitsdocsfordocs/architecture/**,docs/slices/**,docs/ux/flows/**— the trees whose mermaid (#343) / slice-map YAML (#834) contracts the seam enforces but which carry no go/ts token, so a docs-only change was invisible to the gate and its break was CI-only (this is GOTCHAS #143 a 2nd time, sig93e101f240ab).gate_docs_stageresolvesGATE_DOCS_CMD→ executable.sandcastle/docs-gate.sh→node(gate_docs_default_cmd) and FAILS CLOSED when none resolve — the Go/TS precedence, mirrored.gate_docs_default_cmdruns the in-repocheck-mermaid.mjs+check-slices-yaml.mjsand honours the checker's exit-code contract: exit 1 = a broken diagram (refuse); any other non-zero = a CRASH reported LOUDLY as a harness fault naming happy-dom (the GOTCHAS #400 shape: a sandbox with nopnpm install) — never as a parse failure, never silently skipped.gate_rundispatches it on every push path (cheap, independent ofgo_tier).Acceptance criteria — all met:
docs/slices/*.mermaidruns the mermaid checker and is REFUSED on a parse failure ✓%%incident source is the test fixture — rejected, then accepted with line 5 given content (real-checker test) ✓nothing to checkand passes ✓ (confirmed by this very push's gate output).sandcastle/tests/gate-lib-test.sh, including the missing-happy-dom-is-a-harness-fault case ✓Vendoring (ADR 0180). The gate is factory-vendored, so it landed in
Matou/dev-factoryfirst: branchbackport/idss-2068, SHAf36604c1b02d086a56b15da1316e1e568bced002(off the pin06f65763, #1684 still open). idss re-vendored at that SHA —FACTORY_REF06f65763→f36604c,gate-lib.sh+tests/gate-lib-test.shbyte-identical to the backport,FACTORY_MANIFESTno churn, drift-gate OK inline.Proof.
bash .sandcastle/tests/gate-lib-test.sh→gate-lib: 56 checks passed(53→56; the 3 real-node checks — bare-%%reject/accept + happy-dom harness-fault — skip in the factory's bash-only env, run here).gate_docs_default_cmdover the live docs trees: 78/78 mermaid blocks parse, 17 slice YAMLs clean.Commits. idss
e74457e1; dev-factoryf36604c1.Owed (filed): #2108 — forward-port the docs tier onto dev-factory
main(a reviewed PR; dev-factory isLANDING=pr), carrying the inherited<!-- origin: app-report #2047 -->marker +landing-pr.Two-way door: fully revertible (
git revertthe idss commit + reset the backport branch); provable (the vendored red-before-green suite + the real-checker fixture). Leaving #2068 open with its PR open per pr-mode — the human's merge closes it viacloses #2068.Triage Notes
State:
ready-for-human(categorybugkept,landing-pr+<!-- origin: app-report #2047 -->kept).What's established: the docs-tier push gate this ticket asked for is built and proven (close-report above, idss commit
e74457e1, dev-factoryf36604c1) and lands via PR #2109 (closes #2068, branchagent/issue-2068). No agent work remains on the ticket itself. All acceptance criteria are met per the close-report.Why human
This is a
landing-prticket (inherited app-report policy, ADR 0267): it reachesmainonly by a human-approved merge of PR #2109, never a push. The issue stays OPEN until that merge closes it viacloses #2068. The residue is: Ben reviews + merges idss PR #2109. That merge is the one-way door — no agent lands alanding-prticket onmain.(The forward-port of this tier onto dev-factory
mainis tracked separately as #2108.)Landed on main in
a7483d0e(FACTORY_REF → bbcf34e). Drift check OK; gate-lib, body-marker-lib and session-host-lib tests pass. The real docs gate refuses a bare%%in a slice DAG.