close-report: a per-area required-suite set (gate 4 only refutes LISTED failing tests) #1943

Closed
opened 2026-09-27 23:02:18 +00:00 by matou-build-agent · 2 comments

Split out of #1940 (named there under "Out of scope").

Close-report gate 4 refutes status:success only on a listed failing test (tests[] with a non-zero exit_code). An agent that simply omits a required suite from tests[] passes gate 4 clean — the same root as the #1934/#1933 holes #1940 closed (the agent chooses its own evidence), but a different fix: a per-area required-suite set (e.g. touching internal/idp/** requires the internal/idp go test in tests[]), checked in close-report-lib.sh the way gate 7's mirrors.tsv is a repo-level registry.

Not judging completeness in general — just refusing a close whose changed_files touch an area whose required suite is absent from tests[].

Advances the #1929-retro line. Ref #1940.

Split out of #1940 (named there under "Out of scope"). Close-report gate 4 refutes `status:success` only on a **listed** failing test (`tests[]` with a non-zero `exit_code`). An agent that simply **omits** a required suite from `tests[]` passes gate 4 clean — the same root as the #1934/#1933 holes #1940 closed (the agent chooses its own evidence), but a different fix: a **per-area required-suite set** (e.g. touching `internal/idp/**` requires the `internal/idp` go test in `tests[]`), checked in `close-report-lib.sh` the way gate 7's `mirrors.tsv` is a repo-level registry. Not judging completeness in general — just refusing a close whose changed_files touch an area whose required suite is absent from `tests[]`. Advances the #1929-retro line. Ref #1940.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Category: enhancement · State: ready-for-session

Ruling: ready to build — but for an interactive agent session, not the swarm.

Why ready-for-session, not ready-for-agent: the whole change lives in
.sandcastle/close-report-lib.sh (and its test .sandcastle/tests/close-report-lib-test.sh) —
a protected .sandcastle/ path (#445). A swarm worker must never edit the machinery that judges
its own work, and .sandcastle/list-ready-tasks.sh reads only ready-for-agent, so this label
keeps the ticket out of the queue and in reach of a session — exactly the rail #1940 itself
landed on (a sandcastle: commit).

Why this is a two-way door: the new check is additive and default-open (an envelope whose
changed_files touch no registered area is unaffected, so every currently-passing close still
passes), and it is fully revertible by a later commit. Provable by the existing
.sandcastle/tests/close-report-lib-test.sh (where gates 4/6/7 already live) plus
preflight-swarm.sh's guard_close_report self-test. Not on the one-way-door list.

Brief

What: close the gate-4 omission hole. Gate 4 refutes status:success only against a listed
failing test; an agent that simply omits a required suite from tests[] passes clean. Add a
per-area required-suite set: if changed_files touch a registered area, its required suite must
be present in tests[] (independent of whether other listed tests pass).

Where: .sandcastle/close-report-lib.sh, following the shape of gate 7 (mirrors.tsv) — a
repo-level registry file mapping an area glob → required suite id, read by the library the same way
mirrors.tsv is. Keep the library pure/offline (no network); the area→suite map is a static file.

Acceptance:

  • A close whose changed_files match a registered area but whose tests[] omit that area's
    required suite is refused, naming the area and the missing suite.
  • An envelope touching no registered area is unaffected (default-open — every existing passing
    envelope still passes).
  • A malformed registry line fails closed (mirror gate 7's discipline).
  • New fixtures in .sandcastle/tests/close-report-lib-test.sh cover: area-touched-suite-present
    (pass), area-touched-suite-omitted (refuse), no-area (pass), malformed-registry (fail closed);
    guard_close_report self-test extended.

Scope guard: this is not general completeness judging (that's unproven_by_seam, prose only) —
only a required-suite-presence check keyed on touched areas. Seed the registry conservatively
(e.g. internal/idp/** → the internal/idp go suite) so it never over-refuses.

Ref: #1940 (gates 4/6/7), STATUS.md 2026-09-27 #1940 entry. Advances the #1929-retro line.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Category:** `enhancement` · **State:** `ready-for-session` **Ruling:** ready to build — but for an interactive agent session, not the swarm. **Why `ready-for-session`, not `ready-for-agent`:** the whole change lives in `.sandcastle/close-report-lib.sh` (and its test `.sandcastle/tests/close-report-lib-test.sh`) — a protected `.sandcastle/` path (#445). A swarm worker must never edit the machinery that judges its own work, and `.sandcastle/list-ready-tasks.sh` reads only `ready-for-agent`, so this label keeps the ticket out of the queue and in reach of a session — exactly the rail #1940 itself landed on (a `sandcastle:` commit). **Why this is a two-way door:** the new check is additive and default-open (an envelope whose `changed_files` touch no registered area is unaffected, so every currently-passing close still passes), and it is fully revertible by a later commit. Provable by the existing `.sandcastle/tests/close-report-lib-test.sh` (where gates 4/6/7 already live) plus `preflight-swarm.sh`'s `guard_close_report` self-test. Not on the one-way-door list. ## Brief **What:** close the gate-4 omission hole. Gate 4 refutes `status:success` only against a *listed* failing test; an agent that simply omits a required suite from `tests[]` passes clean. Add a **per-area required-suite set**: if `changed_files` touch a registered area, its required suite must be present in `tests[]` (independent of whether other listed tests pass). **Where:** `.sandcastle/close-report-lib.sh`, following the shape of gate 7 (`mirrors.tsv`) — a repo-level registry file mapping an area glob → required suite id, read by the library the same way `mirrors.tsv` is. Keep the library pure/offline (no network); the area→suite map is a static file. **Acceptance:** - A close whose `changed_files` match a registered area but whose `tests[]` omit that area's required suite is **refused**, naming the area and the missing suite. - An envelope touching no registered area is unaffected (default-open — every existing passing envelope still passes). - A malformed registry line fails closed (mirror gate 7's discipline). - New fixtures in `.sandcastle/tests/close-report-lib-test.sh` cover: area-touched-suite-present (pass), area-touched-suite-omitted (refuse), no-area (pass), malformed-registry (fail closed); `guard_close_report` self-test extended. **Scope guard:** this is *not* general completeness judging (that's `unproven_by_seam`, prose only) — only a required-suite-presence check keyed on touched areas. Seed the registry conservatively (e.g. `internal/idp/**` → the `internal/idp` go suite) so it never over-refuses. **Ref:** #1940 (gates 4/6/7), STATUS.md 2026-09-27 #1940 entry. Advances the #1929-retro line.
Author
Member

Close-report — #1943 DONE (gate 8: required-suites)

Ruled by agent under ADR 0174 — veto anytime.

What landed. Close-report gate 8 (required-suites): on a status:success close, a changed_files entry matching an area in a new repo-local .sandcastle/required-suites.tsv (area-glob<TAB>suite-token[|alt…]) demands that at least one tests[] command contains one of that area's |-separated suite tokens — else the close is refused, naming the area and the suite it never ran. Gate 4 only refutes a listed test that exited non-zero; an agent that simply omits a required suite from tests[] passed gate 4 clean (the #1934/#1933 evidence-choosing root, a different hole). The area-glob is a bash pattern (* spans /, so internal/idp/*.go matches nested Go files incl. _test.go); a malformed registry line fails closed for every close, exactly as gate 7's mirrors.tsv does. Additive + default-open: no registry / no area match / status != success → no-op, so every existing passing envelope still passes.

Seeded with the area the retro named: internal/idp/*.go → go test ./internal/idp/|go test ./... — a whole-module run from the repo root exercises the same package, so it is a valid alternative to the targeted run.

Where it lives. The gate logic is in the vendored close-report-lib.sh (+ its test + preflight-swarm.sh), which is drift-gated byte-identical to Matou/dev-factory. So it landed upstream first and was re-vendored (the #1940 shape):

  • dev-factory: 4ec278d297995c78b7d41a760e5680c6e753d237 (direct push to main).
  • idss: 04dcedae4d4dbeec2bde33c8e63a14d722080ec3 on main — FACTORY_REF 117a6cfd→4ec278d, the three vendored files byte-identical, plus the repo-local pieces (required-suites.tsv, the {{ENRICH:workflow-verify}} enrichment re-rendered into prompt.md item 8, STATUS.md).

Proof (two-way door).

  • Red→green: the omitted-suite envelope (touches internal/idp/appdoor.go, lists only go test ./broker/...) passes clean on the pre-gate-8 lib (rc=0, the hole) and is refused on the new lib (rc=1).
  • Shipped registry validated against a real internal/idp commit: go test ./internal/idp/... ✅, go test ./... ✅, go test ./broker/... ❌, npm test ❌.
  • close-report-lib-test.sh — 36 checks (6 new: omitted / targeted / whole-module-alt / blocked-exempt / malformed-fails-closed / default-open) green.
  • close-report-test.sh — 95 green. preflight-swarm.sh's guard_close_report gains a gate-8 fixture. check-harness-drift green at 4ec278d.

Revertible by commit/config; nothing one-way was touched.

Not done here (follow-up already tracked): the global to-tickets SKILL.md field carry is #1942 (a ~/.claude/skills/ skill absent from this host).

**Close-report — #1943 DONE (gate 8: required-suites)** Ruled by agent under ADR 0174 — veto anytime. **What landed.** Close-report gate 8 (`required-suites`): on a `status:success` close, a `changed_files` entry matching an area in a new repo-local `.sandcastle/required-suites.tsv` (`area-glob<TAB>suite-token[|alt…]`) demands that at least one `tests[]` command contains one of that area's `|`-separated suite tokens — else the close is refused, naming the area and the suite it never ran. Gate 4 only refutes a **listed** test that exited non-zero; an agent that simply **omits** a required suite from `tests[]` passed gate 4 clean (the #1934/#1933 evidence-choosing root, a different hole). The area-glob is a bash pattern (`*` spans `/`, so `internal/idp/*.go` matches nested Go files incl. `_test.go`); a malformed registry line **fails closed** for every close, exactly as gate 7's `mirrors.tsv` does. Additive + default-open: no registry / no area match / `status != success` → no-op, so every existing passing envelope still passes. Seeded with the area the retro named: `internal/idp/*.go → go test ./internal/idp/|go test ./...` — a whole-module run from the repo root exercises the same package, so it is a valid alternative to the targeted run. **Where it lives.** The gate logic is in the **vendored** `close-report-lib.sh` (+ its test + `preflight-swarm.sh`), which is drift-gated byte-identical to `Matou/dev-factory`. So it landed **upstream first** and was re-vendored (the #1940 shape): - dev-factory: `4ec278d297995c78b7d41a760e5680c6e753d237` (direct push to main). - idss: `04dcedae4d4dbeec2bde33c8e63a14d722080ec3` on `main` — `FACTORY_REF 117a6cfd→4ec278d`, the three vendored files byte-identical, plus the repo-local pieces (`required-suites.tsv`, the `{{ENRICH:workflow-verify}}` enrichment re-rendered into `prompt.md` item 8, `STATUS.md`). **Proof (two-way door).** - Red→green: the omitted-suite envelope (touches `internal/idp/appdoor.go`, lists only `go test ./broker/...`) passes clean on the pre-gate-8 lib (`rc=0`, the hole) and is **refused** on the new lib (`rc=1`). - Shipped registry validated against a real `internal/idp` commit: `go test ./internal/idp/...` ✅, `go test ./...` ✅, `go test ./broker/...` ❌, `npm test` ❌. - `close-report-lib-test.sh` — 36 checks (6 new: omitted / targeted / whole-module-alt / blocked-exempt / malformed-fails-closed / default-open) green. - `close-report-test.sh` — 95 green. `preflight-swarm.sh`'s `guard_close_report` gains a gate-8 fixture. `check-harness-drift` green at `4ec278d`. Revertible by commit/config; nothing one-way was touched. **Not done here (follow-up already tracked):** the global `to-tickets` `SKILL.md` field carry is #1942 (a `~/.claude/skills/` skill absent from this host).
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/idss#1943
No description provided.