close-report gates: a declared symbol must be implemented or owed, and mirrored contracts must move together (#1929 retro) #1940
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1940
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?
Why
Two tickets in the #1929 set closed gate-clean while leaving a hole one level out:
mintSealingKey()andunlockFromSealedBox()on the steward bundle's interface and built the whole panel state machine against them. Nothing implemented them — the only references on main were the interface,signingSession.tsand three test files, so the phone unlock would have found both verbs undefined in a real browser. Filled in later by #1938.appdoor_seam_test.go, but never extendedinternal/idp/testdata/app-door-golden.json— the fixture whose own note says "matou-app copies THIS file so neither side guesses the wire". matou-app#663's claiming agent read the golden, searched its repo, found nothing, and stopped. Filled in later by #1939.Neither run misbehaved.
close-report-lib.sh's five gates re-derive claims from git: commits reachable,changed_files⊆ union diff, success needs a commit or ano_code_changereason, a non-zerotests[]exit refutes success, verdict consistency. That is provenance, and it works. But thecriteriamap is free text nothing checks, so "proven by " is indistinguishable from "proven end to end". Completeness in general is undecidable and should not be gated — but the two shapes above are mechanically checkable, and both cost a human a catch.Precedent for the second shape already exists in prose:
.sandcastle/prompt-enrichments/rules.mdrequires apackage.jsondependency change to ship itspnpm-lock.yamlupdate in the same commit, after #142 broke every swarm run for six hours. #1933 is the same class of miss, and shows prose does not hold when the consumer is another repo that cannot see this one.What to build
1.
binds:— a declared symbol must be implemented or explicitly owedNew task-manifest field. For every symbol the ticket's
interfacedeclares:Gate: per entry, either the union diff defines
symbolunder a non-test path, orowed_bynames an open issue. Neither → violation. This refuses #1934's exact envelope while still permitting the legitimate interface-first slice (#1930 shipped a verb #1934 consumed) — it only forces "who implements this" to be written down.2.
.sandcastle/mirrors.tsv— files that must change togetherA repo-level registry, deliberately not a per-ticket field: the ticket that forgets the mirror is the ticket that forgets to declare it.
Gate: a
changed_filesentry matching a trigger with its mirror absent → violation, waivable only by an explicitmirror_waiver: "<reason>"in the envelope, which then sits in the posted comment for a human to read. Seeding it with thepackage.json→pnpm-lock.yamlpair promotes today's prose rule to a checked one and proves the mechanism on a case we already know.3.
unproven_by_seam:— name what the seam cannot seeProse, not gated. It is the field whose absence let #1929's own breakdown ship #1934 without noticing the bundle half;
triagecan route on a non-empty value anddesign-verifycan read it as a to-do list.Where it lands
docs/slices/README.md— the manifest shape gains all three fields, with the worked examples above.~/.claude/skills/to-tickets/SKILL.mddesign-tier section — so future manifests carry them (note: a global skill, outside this repo; if it cannot be edited from the run, say so in the close-report and file the follow-up)..sandcastle/prompt.md— what a worker must emit, beside the existing envelope schema..sandcastle/close-report-lib.sh(gates 6 and 7) + cases in.sandcastle/tests/close-report-lib-test.sh, which drives the library offline over a throwaway repo.Acceptance criteria
defined_inin the diff nor anowed_by, when the gates run, then the close is refused naming that symbol.bindsentry carriesowed_bypointing at an open issue, when the gates run, then it passes; and given the issue is closed or does not exist, then it is refused.mirror_waiver, when the gates run, then it passes and the waiver text appears in the posted comment.bindsand no registry trigger touched, when the gates run, then behaviour is unchanged — every existing passing envelope still passes (the new gates are additive and default-open).binds/ a malformed registry line, when the gates run, then it fails closed as a violation, per the library's existing discipline.#1933's and#1934's real envelopes replayed as fixtures, when the gates run, then both are refused — the regression test for this ticket's whole reason to exist.docs/slices/README.mdand.sandcastle/prompt.mddocument all three fields; the registry ships seeded with the appdoor/golden and package.json/pnpm-lock pairs..sandcastle/tests/close-report-lib-test.shandpreflight-swarm.sh's self-test still pass; STATUS.md updated in the same commit.Out of scope
tests[]passes clean. Same root — the agent chooses its evidence — but the fix is a per-area required-suite set, which is a different change. File separately if wanted.Why
ready-for-session.sandcastle/**is protected from swarm workers (#445), and this ticket's core isclose-report-lib.sh— the machinery that gates every other run. An interactive session makes the change and watches the preflight self-test.Blocked by
None — can start immediately.
Task manifest
(carrying the fields it introduces, as the worked example)
Filed from the #1929 retro (Ben, 2026-09-27): two closed tickets in that set passed their gates with a hole one level out, and both cost a human or a blocked agent the catch.
🤖 Generated with Claude Code
https://claude.ai/code/session_015es4bpK4qRqZhrRYQBWCiY
close-report — advances #1940 (DONE)
Both close-report holes from the #1929 retro are now mechanically refused. Ruled by agent under ADR 0174 — veto anytime (two-way: every change is a revertible commit/config, proven by an offline test + the live drift check; no one-way door — no spend, no security widening, no member-facing trust accept).
What landed
84b58522(this repo, pushed tomain; pre-push drift gate green) — the re-vendor + repo-local files.117a6cfd591f1ce830c55e17bc5f94eea38df163(Matou/dev-factorymain) — the vendored source.close-report-lib.sh,close-report.sh,preflight-swarm.sh,tests/close-report-lib-test.share FACTORY-VENDORED (ADR 0180, #932 drift gate), so the gate logic had to land upstream first, then idss bumpedFACTORY_REFand re-vendored byte-identical (the factory-vendored-sandcastle-fix-path). The 2 commits idss was behind touched no vendored files, so the re-vendor was surgical.The two gates (both additive + default-open — every existing passing envelope still passes)
binds) — per declared symbol the union diff must DEFINE it under a non-testdefined_inpath (inchanged_files), orowed_bymust name a still-open issue. Neither → refused, naming the symbol; owed_by-closed / owed_by-missing → refused. This refuses #1934's exact envelope (two verbs declared, implemented nowhere) while leaving the legitimate interface-first slice legal. The open-issue check rides acr_issue_stateseam (CR_ISSUE_STATE_CMDin tests,forgejo_getin production — the library stays pure/offline; verified live: 1940→open, 1939→closed, 99999→missing)..sandcastle/mirrors.tsv(trigger<TAB>mirror) registry, seeded withappdoor.go/golden,appdoorpage.go/golden, andpackage.json/pnpm-lock.yaml(promoting rules.md's #142 prose rule to a checked one). Achanged_filesentry touching a trigger without its mirror → refused naming both, waivable ONLY by a non-emptymirror_waiver(surfaced in the posted comment byclose-report.sh). Kept repo-local (not vendored) so idss-specific pairs never leak to sibling consumers.unproven_by_seam— documented as prose (not gated) for triage/design-verify.binds, non-object entries, and malformed registry lines all fail closed.Proof (acceptance criteria)
.sandcastle/tests/close-report-lib-test.sh— 30 checks (11 new) green: unbound symbol refused naming it; owed_by-open passes / owed_by-closed / owed_by-missing refused; test-pathdefined_inrefused; non-list & non-objectbindsfail closed; trigger-without-mirror refused naming both;mirror_waiverpasses; malformed registry line fails closed; #1933 and #1934 real envelopes replayed as fixtures → both refused; and the additive check (a no-binds/no-trigger envelope still passes with the registry present).close-report-test.sh95 green (thepost_commentwaiver change is safe);preflight-swarm.sh'sguard_close_reportself-test gains gate-6/7 fixtures and passes.check-harness-drift.shOK againstFACTORY_REF; the stale-render advisory cleared (the prompt change lives in the source enrichmentprompt-enrichments/workflow-verify.md, re-rendered intoprompt.md).docs/slices/README.md+.sandcastle/prompt.mddocument all three fields;STATUS.mdupdated in the same commit.Residue (filed, not skipped)
to-ticketsSKILL.md(in scope per the ticket) could NOT be edited from this run:~/.claude/skills/was absent from the session-runner host. The fields are documented in-repo and the gates enforce them; #1942 closes the authoring loop. This is the exactunproven_by_seamthis ticket named for itself.No steering text was involved (this ticket carries no app-report origin marker).