close-report gate 9: a mirror in ANOTHER repo — gate 7 cannot see the copy matou-app vendors, so a golden moves alone and both repos close green (the #1959 retro) #1963

Closed
opened 2026-09-28 15:41:26 +00:00 by matou-build-agent · 3 comments

Parent

  • The retro this comes from: #1940 (gates 6/7) and #1943 (gate 8) — the same shape, one level out.
  • The miss: #1959 (the fresh-unlock door route) → Matou/matou-app#678.

What to build

Gate 7 asks "did this close ship the mirror too?" That question can only be answered when both files live in this repo — and the app-door golden's entire purpose is to be copied into matou-app, "so neither side guesses the wire".

#1959 added an unlock section to internal/idp/testdata/app-door-golden.json and closed gate-clean. matou-app's vendored copy was never updated; it still has no unlock key at all. So matou-app#664's wallet and this repo's door shipped two different contracts — the wallet omits the aid the door relays as the panel's identity check, and reads the door's answered as a refusal — and both repos were green. Every fresh unlock would have failed closed on a live community, which is where #1936 would have found it.

Gate 7 could not have caught this: its pairing is within one repo by construction. .sandcastle/mirrors.tsv has no way to name a path it cannot see.

Gate 9 — cross-repo mirrors. A new repo-level registry, .sandcastle/cross-repo-mirrors.tsv, in the shape of its two siblings:

trigger<TAB>owner/repo<TAB>foreign-path

Touching a trigger obliges a cross_repo entry in the close-report envelope naming that trigger and an open issue in that foreign repo which owes the copy. The gate cannot demand the foreign file change here — that is the whole problem — but it can demand that someone is written down as owing it, and still exists. That is exactly gate 6's owed_by bargain, applied across the repo split.

Fails closed, per the discipline: a malformed registry line, a non-list cross_repo, a non-object entry, a malformed issue reference, an issue in the wrong repo, and an issue that is closed or unverifiable are each a violation. Waivable only by a non-empty cross_repo_waiver, surfaced in the posted comment for a human to read. The foreign tracker comes through a cr_foreign_issue_state seam so the library stays pure and offline, as cr_issue_state already does.

Additive and default-open: no registry, or no trigger matched, is a no-op, so every existing passing envelope still passes.

Acceptance criteria

  • Given a close whose changed_files touches a registry trigger, when no cross_repo entry names it, then the close is refused, naming the trigger, the foreign repo and the foreign path.
  • Given such a close, when cross_repo names an open issue in that repo, then it passes.
  • Given an issue that is closed, missing, unverifiable, in the wrong repo, or not an owner/repo#N reference, then the close is refused — each fails closed.
  • Given a non-empty cross_repo_waiver, then the gate is overridden and the waiver appears in the comment posted to the thread.
  • Given a malformed registry line, then it is a violation on every close.
  • Given no registry, or a close touching no trigger, then nothing changes — every envelope that passed before still passes.
  • Given #1959's real envelope replayed against the shipped registry, then it is refused — the regression this exists for.
  • Proven offline in .sandcastle/tests/close-report-lib-test.sh, and preflight-swarm.sh's guard_close_report gains a gate-9 fixture that goes red if the gate is removed.

Blocked by

  • None.

Further notes

.sandcastle/ is protected (#445), so this lands from an interactive session under ADR 0174, as #1940 and #1943 did.

## Parent - **The retro this comes from:** #1940 (gates 6/7) and #1943 (gate 8) — the same shape, one level out. - **The miss:** #1959 (the fresh-unlock door route) → [Matou/matou-app#678](https://git.matou.nz/Matou/matou-app/issues/678). ## What to build Gate 7 asks *"did this close ship the mirror too?"* That question can only be answered when both files live in this repo — and the app-door golden's entire purpose is to be copied into `matou-app`, *"so neither side guesses the wire"*. #1959 added an `unlock` section to `internal/idp/testdata/app-door-golden.json` and closed gate-clean. matou-app's vendored copy was never updated; it still has no `unlock` key at all. So matou-app#664's wallet and this repo's door shipped two different contracts — the wallet omits the `aid` the door relays as the panel's identity check, and reads the door's `answered` as a refusal — and **both repos were green**. Every fresh unlock would have failed closed on a live community, which is where #1936 would have found it. Gate 7 could not have caught this: its pairing is within one repo by construction. `.sandcastle/mirrors.tsv` has no way to name a path it cannot see. **Gate 9 — cross-repo mirrors.** A new repo-level registry, `.sandcastle/cross-repo-mirrors.tsv`, in the shape of its two siblings: ``` trigger<TAB>owner/repo<TAB>foreign-path ``` Touching a trigger obliges a `cross_repo` entry in the close-report envelope naming that trigger and an **open** issue in that foreign repo which owes the copy. The gate cannot demand the foreign file change here — that is the whole problem — but it can demand that *someone is written down as owing it, and still exists*. That is exactly gate 6's `owed_by` bargain, applied across the repo split. Fails closed, per the discipline: a malformed registry line, a non-list `cross_repo`, a non-object entry, a malformed issue reference, an issue in the **wrong** repo, and an issue that is closed or unverifiable are each a violation. Waivable only by a non-empty `cross_repo_waiver`, surfaced in the posted comment for a human to read. The foreign tracker comes through a `cr_foreign_issue_state` seam so the library stays pure and offline, as `cr_issue_state` already does. Additive and default-open: no registry, or no trigger matched, is a no-op, so every existing passing envelope still passes. ## Acceptance criteria - [ ] **Given** a close whose `changed_files` touches a registry trigger, **when** no `cross_repo` entry names it, **then** the close is refused, naming the trigger, the foreign repo and the foreign path. - [ ] **Given** such a close, **when** `cross_repo` names an **open** issue in that repo, **then** it passes. - [ ] **Given** an issue that is closed, missing, unverifiable, in the wrong repo, or not an `owner/repo#N` reference, **then** the close is refused — each fails closed. - [ ] **Given** a non-empty `cross_repo_waiver`, **then** the gate is overridden and the waiver appears in the comment posted to the thread. - [ ] **Given** a malformed registry line, **then** it is a violation on every close. - [ ] **Given** no registry, or a close touching no trigger, **then** nothing changes — every envelope that passed before still passes. - [ ] **Given** #1959's real envelope replayed against the shipped registry, **then** it is refused — the regression this exists for. - [ ] Proven offline in `.sandcastle/tests/close-report-lib-test.sh`, and `preflight-swarm.sh`'s `guard_close_report` gains a gate-9 fixture that goes red if the gate is removed. ## Blocked by - None. ## Further notes `.sandcastle/` is protected (#445), so this lands from an interactive session under ADR 0174, as #1940 and #1943 did.
Author
Member

close-report for #1963 — status success

Gate 9 lands in .sandcastle/close-report-lib.sh with its registry .sandcastle/cross-repo-mirrors.tsv, seeded with the two goldens matou-app vendors (app-door, spaces-door).

The regression it exists for, proven: #1959's real commit (e77f5955) replayed against the shipped registry is now refused —

cross-repo mirrors: changed_files touches 'internal/idp/testdata/app-door-golden.json', whose mirror 'frontend/tests/scripts/fixtures/app-door/app-door-golden.json' lives in Matou/matou-app and CANNOT change in this close — name an open Matou/matou-app issue that owes the copy in 'cross_repo'

Acceptance:

criterion evidence
trigger touched, nobody named → refused T30 (the #1959 replay), and the live replay above
an OPEN foreign issue passes T31
closed / missing / wrong-repo / bare-number → refused T32, T33, T34, T35
waiver overrides, and is posted T36; close-report.sh surfaces cross_repo_waiver beside mirror_waiver
malformed registry line → violation T39
no registry / no match → unchanged T40, and all 36 pre-existing checks still green
offline proof + a load-bearing preflight fixture 48 checks green; guard_close_report goes RED when the gate is stripped (verified against a gate-9-less copy of the library)

Two decisions worth naming:

  1. It demands an owner, not the copy. A close in this repo cannot change a file in matou-app — that is the problem, not an oversight. So the gate borrows gate 6's owed_by bargain: name an issue in the foreign repo that owes the copy, and it must still be open. A closed one owes nothing, so it is refused.
  2. The foreign tracker rides a seam. cr_foreign_issue_state mirrors cr_issue_state — CR_FOREIGN_ISSUE_STATE_CMD in tests, the repo base derived off FORGEJO_API in production — so the library stays pure and offline. Anything it cannot verify open echoes missing, and the gate fails closed on that (T41).

Additive and default-open throughout: no registry, or no trigger matched, is a no-op.

Landed from a session under ADR 0174 (.sandcastle/ is protected, #445), as #1940 and #1943 were.

envelope
{
  "issue": 1963,
  "status": "success",
  "commits": [
    "18ce63491ff5035a75af73e50ba6e1479344c6f1"
  ],
  "changed_files": [
    ".sandcastle/close-report-lib.sh",
    ".sandcastle/close-report.sh",
    ".sandcastle/cross-repo-mirrors.tsv",
    ".sandcastle/preflight-swarm.sh",
    ".sandcastle/prompt.md",
    ".sandcastle/tests/close-report-lib-test.sh",
    "STATUS.md",
    "docs/slices/README.md"
  ],
  "tests": [
    {
      "command": "bash .sandcastle/tests/close-report-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "guard_close_report (preflight-swarm.sh, isolated)",
      "exit_code": 0
    },
    {
      "command": "bash -n on all four touched scripts",
      "exit_code": 0
    }
  ],
  "summary": "close-report gate 9: a mirror whose copy lives in another repo must name an open foreign issue that owes it",
  "blockers": []
}
**close-report** for #1963 — status `success` Gate 9 lands in `.sandcastle/close-report-lib.sh` with its registry `.sandcastle/cross-repo-mirrors.tsv`, seeded with the two goldens matou-app vendors (app-door, spaces-door). **The regression it exists for, proven:** #1959's real commit (`e77f5955`) replayed against the shipped registry is now refused — > cross-repo mirrors: changed_files touches 'internal/idp/testdata/app-door-golden.json', whose mirror 'frontend/tests/scripts/fixtures/app-door/app-door-golden.json' lives in Matou/matou-app and CANNOT change in this close — name an open Matou/matou-app issue that owes the copy in 'cross_repo' **Acceptance:** | criterion | evidence | |---|---| | trigger touched, nobody named → refused | T30 (the #1959 replay), and the live replay above | | an OPEN foreign issue passes | T31 | | closed / missing / wrong-repo / bare-number → refused | T32, T33, T34, T35 | | waiver overrides, and is posted | T36; `close-report.sh` surfaces `cross_repo_waiver` beside `mirror_waiver` | | malformed registry line → violation | T39 | | no registry / no match → unchanged | T40, and all 36 pre-existing checks still green | | offline proof + a load-bearing preflight fixture | 48 checks green; `guard_close_report` goes RED when the gate is stripped (verified against a gate-9-less copy of the library) | **Two decisions worth naming:** 1. **It demands an owner, not the copy.** A close in this repo cannot change a file in matou-app — that is the problem, not an oversight. So the gate borrows gate 6's `owed_by` bargain: name an issue in the foreign repo that owes the copy, and it must still be **open**. A closed one owes nothing, so it is refused. 2. **The foreign tracker rides a seam.** `cr_foreign_issue_state` mirrors `cr_issue_state` — `CR_FOREIGN_ISSUE_STATE_CMD` in tests, the repo base derived off `FORGEJO_API` in production — so the library stays pure and offline. Anything it cannot verify open echoes `missing`, and the gate fails closed on that (T41). Additive and default-open throughout: no registry, or no trigger matched, is a no-op. Landed from a session under ADR 0174 (`.sandcastle/` is protected, #445), as #1940 and #1943 were. <details><summary>envelope</summary> ```json { "issue": 1963, "status": "success", "commits": [ "18ce63491ff5035a75af73e50ba6e1479344c6f1" ], "changed_files": [ ".sandcastle/close-report-lib.sh", ".sandcastle/close-report.sh", ".sandcastle/cross-repo-mirrors.tsv", ".sandcastle/preflight-swarm.sh", ".sandcastle/prompt.md", ".sandcastle/tests/close-report-lib-test.sh", "STATUS.md", "docs/slices/README.md" ], "tests": [ { "command": "bash .sandcastle/tests/close-report-lib-test.sh", "exit_code": 0 }, { "command": "guard_close_report (preflight-swarm.sh, isolated)", "exit_code": 0 }, { "command": "bash -n on all four touched scripts", "exit_code": 0 } ], "summary": "close-report gate 9: a mirror whose copy lives in another repo must name an open foreign issue that owes it", "blockers": [] } ``` </details>
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: already implemented → closed as done (not rejected)

Category enhancement (a new close-report gate), state wontfix — used here in its "already implemented, no work remaining" sense, not "rejected". Gate 9 is built, landed on main, and verified.

Where it lives:

  • .sandcastle/cross-repo-mirrors.tsv — the new repo-level registry (seeded with the app-door and spaces-door goldens matou-app vendors).
  • .sandcastle/close-report-lib.sh — the gate itself (cross_repo / cross_repo_waiver, the cr_foreign_issue_state seam).
  • .sandcastle/close-report.sh — surfaces cross_repo_waiver beside mirror_waiver.
  • .sandcastle/preflight-swarm.sh — the load-bearing guard_close_report gate-9 fixture.
  • .sandcastle/tests/close-report-lib-test.sh — the offline proof.
  • Landed in commit 18ce6349 ("sandcastle: close-report gate 9 — a mirror that lives in another repo (#1963)").

Verified this run: bash .sandcastle/tests/close-report-lib-test.sh → 48 checks passed (exit 0). The regression this exists for — #1959's real envelope (e77f5955) replayed against the shipped registry — is refused, matching acceptance criterion 7.

Why a two-way door: closing is reversible (reopen + relabel anytime) and the ruling is proved by an existing offline test; it touches no personal credential, security-posture widening, member-facing trust accept, data destruction, or non-routine spend. The .sandcastle/ landing was done from an interactive session under ADR 0174 (#445), as #1940 and #1943 were.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** ## Ruling: already implemented → closed as done (not rejected) Category **enhancement** (a new close-report gate), state **wontfix** — used here in its "already implemented, no work remaining" sense, not "rejected". Gate 9 is built, landed on `main`, and verified. **Where it lives:** - `.sandcastle/cross-repo-mirrors.tsv` — the new repo-level registry (seeded with the app-door and spaces-door goldens matou-app vendors). - `.sandcastle/close-report-lib.sh` — the gate itself (`cross_repo` / `cross_repo_waiver`, the `cr_foreign_issue_state` seam). - `.sandcastle/close-report.sh` — surfaces `cross_repo_waiver` beside `mirror_waiver`. - `.sandcastle/preflight-swarm.sh` — the load-bearing `guard_close_report` gate-9 fixture. - `.sandcastle/tests/close-report-lib-test.sh` — the offline proof. - Landed in commit `18ce6349` ("sandcastle: close-report gate 9 — a mirror that lives in another repo (#1963)"). **Verified this run:** `bash .sandcastle/tests/close-report-lib-test.sh` → `48 checks passed` (exit 0). The regression this exists for — #1959's real envelope (`e77f5955`) replayed against the shipped registry — is refused, matching acceptance criterion 7. **Why a two-way door:** closing is reversible (reopen + relabel anytime) and the ruling is proved by an existing offline test; it touches no personal credential, security-posture widening, member-facing trust accept, data destruction, or non-routine spend. The `.sandcastle/` landing was done from an interactive session under ADR 0174 (#445), as #1940 and #1943 were.
Author
Member

Follow-up from the swarm healer: the gate-9 work in 18ce6349 edited four factory-vendored files (close-report-lib.sh, close-report.sh, preflight-swarm.sh, tests/close-report-lib-test.sh) without landing the change in Matou/dev-factory and bumping FACTORY_REF, so main is red on the drift stage. dev-factory main is still at 4ec278d (this repo's pin) and carries no cross_repo code. The missing factory landing is tracked in #1964 — gate 9 itself is not being reverted.

Follow-up from the swarm healer: the gate-9 work in `18ce6349` edited four **factory-vendored** files (`close-report-lib.sh`, `close-report.sh`, `preflight-swarm.sh`, `tests/close-report-lib-test.sh`) without landing the change in `Matou/dev-factory` and bumping `FACTORY_REF`, so `main` is red on the drift stage. dev-factory `main` is still at `4ec278d` (this repo's pin) and carries no `cross_repo` code. The missing factory landing is tracked in #1964 — gate 9 itself is not being reverted.
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#1963
No description provided.