Factory drift on main: close-report gate 9 (#1963) was written into four vendored .sandcastle files but never landed in dev-factory — land it there, bump FACTORY_REF, re-vendor #1964

Closed
opened 2026-09-28 15:48:27 +00:00 by matou-build-agent · 2 comments

The fault

ci / the seam drift stage is red on main at 18ce6349:

check-harness-drift: FAILED — vendored factory copies drifted from
https://git.matou.nz/Matou/dev-factory.git@4ec278d297995c78b7d41a760e5680c6e753d237
DRIFT: .sandcastle/close-report-lib.sh
DRIFT: .sandcastle/close-report.sh
DRIFT: .sandcastle/preflight-swarm.sh
DRIFT: .sandcastle/tests/close-report-lib-test.sh

Root cause

18ce6349 ("close-report gate 9 — a mirror that lives in another repo (#1963)")
wrote gate 9 directly into four factory-vendored files in this repo. All four
are listed in .sandcastle/FACTORY_MANIFEST, so they are owned by
Matou/dev-factory and byte-compared against FACTORY_REF (ADR 0180).

Gate 9 was never landed in dev-factory: a fresh clone of Matou/dev-factory
has main at exactly 4ec278d (= this repo's FACTORY_REF, the gate-8 commit),
and grep cross_repo close-report-lib.sh there returns nothing. There is no
newer factory commit to bump to.

The drift is exactly 18ce6349's hunks — the four pinned files are byte-identical
to their state at fe7c308f (its parent), so the repo was drift-clean before it.

This breaks the precedent set by the sibling gates: #1940 (gates 6/7, 84b58522)
and #1943 (gate 8, 04dcedae) each landed in dev-factory first and bumped
FACTORY_REF in the same idss commit. #1963 skipped that step, was closed, and
triage ruled it wontfix/"already implemented" — so nothing is currently tracking
the missing factory landing.

What needs doing

  1. Land the gate-9 change in Matou/dev-factory: the hunks 18ce6349 added to
    close-report-lib.sh, close-report.sh, preflight-swarm.sh and
    tests/close-report-lib-test.sh.
  2. Bump .sandcastle/FACTORY_REF here and re-vendor (onboarding/onboard.sh vendor),
    so the four files come back byte-identical from the pin.
  3. Keep the consumer-owned parts here (cross-repo-mirrors.tsv, prompt.md,
    docs/slices/README.md, STATUS.md) — only the four vendored files move.
  4. Re-run the drift check: bash .sandcastle/check-harness-drift.sh → OK.

Do not "fix" this by dropping the four files from FACTORY_MANIFEST (that forks
the factory core, against ADR 0180) or by reverting 18ce6349 — gate 9 guards a
real shipped cross-repo regression (#1959 → Matou/matou-app#678). Either of
those is a human call.

Secondary (worth a look while here)

The pre-push drift gate (.sandcastle/git-hooks/pre-push, #932) did not block this
push. The gate is fail-open by design: it only emits DRIFT_BLOCK when
check-harness-drift.sh prints a DRIFT:/FAILED line, so a sandbox worker whose
factory fetch cannot reach git.matou.nz exits 3 (TRANSPORT) and the push proceeds.
Unconfirmed — the #1963 worker log is not in this incident's evidence. If that
is what happened, the drift gate can never stop a sandbox-authored vendored edit, and
the seam stage on main is the only real gate.


Filed by the swarm healer. Incident: ci run
https://git.matou.nz/Matou/idss/actions/runs/35086, signature 60539fe3c068,
heal run heal-Matou-idss-1790610233-2976017. Evidence:
/tmp/matou-heal-Matou-idss.jA0uYY.

## The fault `ci` / the `seam` drift stage is red on `main` at `18ce6349`: ``` check-harness-drift: FAILED — vendored factory copies drifted from https://git.matou.nz/Matou/dev-factory.git@4ec278d297995c78b7d41a760e5680c6e753d237 DRIFT: .sandcastle/close-report-lib.sh DRIFT: .sandcastle/close-report.sh DRIFT: .sandcastle/preflight-swarm.sh DRIFT: .sandcastle/tests/close-report-lib-test.sh ``` ## Root cause `18ce6349` ("close-report gate 9 — a mirror that lives in another repo (#1963)") wrote gate 9 **directly into four factory-vendored files** in this repo. All four are listed in `.sandcastle/FACTORY_MANIFEST`, so they are owned by `Matou/dev-factory` and byte-compared against `FACTORY_REF` (ADR 0180). Gate 9 was never landed in dev-factory: a fresh clone of `Matou/dev-factory` has `main` at exactly `4ec278d` (= this repo's `FACTORY_REF`, the gate-8 commit), and `grep cross_repo close-report-lib.sh` there returns nothing. There is no newer factory commit to bump to. The drift is *exactly* `18ce6349`'s hunks — the four pinned files are byte-identical to their state at `fe7c308f` (its parent), so the repo was drift-clean before it. This breaks the precedent set by the sibling gates: `#1940` (gates 6/7, `84b58522`) and `#1943` (gate 8, `04dcedae`) each landed in dev-factory first and bumped `FACTORY_REF` in the same idss commit. `#1963` skipped that step, was closed, and triage ruled it `wontfix`/"already implemented" — so nothing is currently tracking the missing factory landing. ## What needs doing 1. Land the gate-9 change in `Matou/dev-factory`: the hunks `18ce6349` added to `close-report-lib.sh`, `close-report.sh`, `preflight-swarm.sh` and `tests/close-report-lib-test.sh`. 2. Bump `.sandcastle/FACTORY_REF` here and re-vendor (`onboarding/onboard.sh vendor`), so the four files come back byte-identical from the pin. 3. Keep the consumer-owned parts here (`cross-repo-mirrors.tsv`, `prompt.md`, `docs/slices/README.md`, `STATUS.md`) — only the four vendored files move. 4. Re-run the drift check: `bash .sandcastle/check-harness-drift.sh` → OK. **Do not** "fix" this by dropping the four files from `FACTORY_MANIFEST` (that forks the factory core, against ADR 0180) or by reverting `18ce6349` — gate 9 guards a real shipped cross-repo regression (`#1959` → `Matou/matou-app#678`). Either of those is a human call. ## Secondary (worth a look while here) The pre-push drift gate (`.sandcastle/git-hooks/pre-push`, `#932`) did not block this push. The gate is **fail-open by design**: it only emits `DRIFT_BLOCK` when `check-harness-drift.sh` prints a `DRIFT:`/`FAILED` line, so a sandbox worker whose factory fetch cannot reach `git.matou.nz` exits `3` (TRANSPORT) and the push proceeds. **Unconfirmed** — the `#1963` worker log is not in this incident's evidence. If that is what happened, the drift gate can never stop a sandbox-authored vendored edit, and the seam stage on `main` is the only real gate. --- *Filed by the swarm healer. Incident: ci run https://git.matou.nz/Matou/idss/actions/runs/35086, signature `60539fe3c068`, heal run `heal-Matou-idss-1790610233-2976017`. Evidence: `/tmp/matou-heal-Matou-idss.jA0uYY`.*
Author
Member

Blocked — this ticket's whole deliverable is protected-path + cross-repo machinery a sandcastle worker cannot land

I verified the fault and it is exactly as filed:

  • bash .sandcastle/check-harness-drift.sh → check-harness-drift: FAILED — vendored factory copies drifted from …@4ec278d.
  • All four drifted files (close-report-lib.sh, close-report.sh, preflight-swarm.sh, tests/close-report-lib-test.sh) are in .sandcastle/FACTORY_MANIFEST, so they are byte-compared against FACTORY_REF (ADR 0180).
  • git ls-remote https://git.matou.nz/Matou/dev-factory.git HEAD → 4ec278d… — identical to this repo's FACTORY_REF (the gate-8 commit). Gate 9 was never landed in the factory; there is no newer commit to bump to.

Why an agent cannot do this work

The prescribed fix is entirely protected-path and cross-repo:

  1. Land gate 9's hunks in Matou/dev-factory — a write to a separate repository. A Matou/idss sandbox worker has no authorized push path to another repo, and cross-repo landing is not a sandcastle capability.
  2. Bump .sandcastle/FACTORY_REF and re-vendor the four .sandcastle/ files (onboarding/onboard.sh vendor) — every one of these is under .sandcastle/, a protected path (Rule 9). The protected-paths fence (#445) attributes, rolls back, and fails any .sandcastle/ edit a worker makes, so I cannot even stage this change.

There is no consumer-side remainder I can land in isolation: the consumer-owned parts named in the ticket (cross-repo-mirrors.tsv, prompt.md, docs/slices/README.md, STATUS.md) are already correct on main at 18ce6349 — the only thing wrong is the four pinned files being ahead of the pin, which is precisely the part I'm fenced out of.

Why ready-for-session (not ready-for-human)

Per ADR 0174 / #445, a protected .sandcastle/ machinery change needs an interactive session's standing rather than Ben — a session rules on the machinery change itself and escalates to ready-for-human only if it finds a genuine one-way door. This is that case. #1964 already is the machinery-change ticket, so I'm handing it to a session directly rather than filing a duplicate.

What a session must do (unchanged from the filed plan)

  1. In a clone of Matou/dev-factory: apply the hunks 18ce6349 added to close-report-lib.sh, close-report.sh, preflight-swarm.sh, tests/close-report-lib-test.sh; commit; note the new SHA.
  2. Here: set .sandcastle/FACTORY_REF to that SHA, run onboarding/onboard.sh vendor, confirm the four files return byte-identical.
  3. Leave the consumer-owned parts (cross-repo-mirrors.tsv, prompt.md, docs/slices/README.md, STATUS.md) as-is.
  4. bash .sandcastle/check-harness-drift.sh → OK.

Do not drop the files from FACTORY_MANIFEST (forks the factory core, against ADR 0180) or revert 18ce6349 (gate 9 guards the shipped #1959 → matou-app#678 regression) — the ticket already flags both as human calls.

The secondary observation (the fail-open pre-push drift gate, .sandcastle/git-hooks/pre-push, #932) is itself a protected-path concern and belongs with the session handling this.

## Blocked — this ticket's whole deliverable is protected-path + cross-repo machinery a sandcastle worker cannot land I verified the fault and it is exactly as filed: - `bash .sandcastle/check-harness-drift.sh` → `check-harness-drift: FAILED — vendored factory copies drifted from …@4ec278d`. - All four drifted files (`close-report-lib.sh`, `close-report.sh`, `preflight-swarm.sh`, `tests/close-report-lib-test.sh`) are in `.sandcastle/FACTORY_MANIFEST`, so they are byte-compared against `FACTORY_REF` (ADR 0180). - `git ls-remote https://git.matou.nz/Matou/dev-factory.git HEAD` → `4ec278d…` — identical to this repo's `FACTORY_REF` (the gate-8 commit). Gate 9 was never landed in the factory; there is no newer commit to bump to. ### Why an agent cannot do this work The prescribed fix is *entirely* protected-path and cross-repo: 1. **Land gate 9's hunks in `Matou/dev-factory`** — a write to a *separate* repository. A Matou/idss sandbox worker has no authorized push path to another repo, and cross-repo landing is not a sandcastle capability. 2. **Bump `.sandcastle/FACTORY_REF`** and **re-vendor the four `.sandcastle/` files** (`onboarding/onboard.sh vendor`) — every one of these is under `.sandcastle/`, a protected path (Rule 9). The protected-paths fence (#445) attributes, rolls back, and fails any `.sandcastle/` edit a worker makes, so I cannot even stage this change. There is no consumer-side remainder I can land in isolation: the consumer-owned parts named in the ticket (`cross-repo-mirrors.tsv`, `prompt.md`, `docs/slices/README.md`, `STATUS.md`) are already correct on `main` at `18ce6349` — the *only* thing wrong is the four pinned files being ahead of the pin, which is precisely the part I'm fenced out of. ### Why `ready-for-session` (not `ready-for-human`) Per ADR 0174 / #445, a protected `.sandcastle/` machinery change needs an interactive session's standing rather than Ben — a session rules on the machinery change itself and escalates to `ready-for-human` only if it finds a genuine one-way door. This is that case. #1964 already *is* the machinery-change ticket, so I'm handing it to a session directly rather than filing a duplicate. ### What a session must do (unchanged from the filed plan) 1. In a clone of `Matou/dev-factory`: apply the hunks `18ce6349` added to `close-report-lib.sh`, `close-report.sh`, `preflight-swarm.sh`, `tests/close-report-lib-test.sh`; commit; note the new SHA. 2. Here: set `.sandcastle/FACTORY_REF` to that SHA, run `onboarding/onboard.sh vendor`, confirm the four files return byte-identical. 3. Leave the consumer-owned parts (`cross-repo-mirrors.tsv`, `prompt.md`, `docs/slices/README.md`, `STATUS.md`) as-is. 4. `bash .sandcastle/check-harness-drift.sh` → OK. **Do not** drop the files from `FACTORY_MANIFEST` (forks the factory core, against ADR 0180) or revert `18ce6349` (gate 9 guards the shipped `#1959` → `matou-app#678` regression) — the ticket already flags both as human calls. The secondary observation (the fail-open pre-push drift gate, `.sandcastle/git-hooks/pre-push`, #932) is itself a protected-path concern and belongs with the session handling this.
Author
Member

close-report for #1964 — status success

What landed

The seam drift stage was red on main at 18ce6349 because #1963 wrote close-report gate 9 directly into four factory-vendored files without landing it in Matou/dev-factory, so the pinned copies no longer matched FACTORY_REF (4ec278d, the gate-8 commit).

  1. Landed gate 9 in its factory home — Matou/dev-factory@78db030b198b97f25668decc6249fbdba567d8db, the exact 18ce6349 hunks for close-report-lib.sh, close-report.sh, preflight-swarm.sh, tests/close-report-lib-test.sh (only those four files change vs 4ec278d: +222/−3, verified byte-for-byte against the idss working tree). This follows the #1940 (gates 6/7, 84b58522) / #1943 (gate 8, 04dcedae) precedent of land-in-factory-then-bump.
  2. Re-vendored idss — onboard.sh vendor .sandcastle 78db030 --force (run with a token-less FACTORY_REPO so no credential leaks into the regenerated FACTORY_MANIFEST; verified clean). FACTORY_REF 4ec278d → 78db030; the four gate-9 files return byte-identical from the pin (no working-tree change — already at 18ce6349's content).
  3. Consumer-owned parts untouched: cross-repo-mirrors.tsv, prompt.md, docs/slices/README.md, STATUS.md (STATUS got a new milestone line only). Did not drop files from FACTORY_MANIFEST and did not revert 18ce6349.
  4. Incidental sync: the re-vendor also pulled in tests/guide-labels-test.sh — a factory test present at both pins that a prior partial FACTORY_REF bump had left out of this repo's tree and manifest (the old manifest never listed it, so check-harness-drift.sh never saw the gap). A proper onboard.sh vendor regenerates the manifest from the pin's tests/** glob, so it is now correctly in sync. Dropping it would mean hand-editing the manifest — the anti-pattern this class of ticket forbids.

Proof

  • Matou/dev-factory tests green at 78db030: tests/close-report-lib-test.sh 48/48 (12 new gate-9 checks); preflight-swarm.sh's guard_close_report fires on gate 9 (run in isolation).
  • idss .sandcastle/tests/close-report-lib-test.sh → 48/48 on the vendored copies.
  • bash .sandcastle/check-harness-drift.sh on the committed HEAD f2dde647 → OK (exit 0), every vendored file matches dev-factory@78db030.
  • The only non-OK line is a non-fatal NOTE that prompt.md is stale against the pinned skeleton — pre-existing (the skeleton is identical between 4ec278d and 78db030, so this bump did not introduce it) and not read by the seam/pre-push gates, which only act on DRIFT:/FAILED.

Commits

  • Matou/dev-factory@78db030b198b97f25668decc6249fbdba567d8db — gate 9 in the factory core.
  • Matou/idss@f2dde647 — FACTORY_REF bump + re-vendor + STATUS.

Secondary (the fail-open pre-push gate)

Confirmed from the shipped hook: .sandcastle/git-hooks/pre-push gate 1 emits DRIFT_BLOCK only on rc != 0 and a DRIFT:/FAILED line, so a factory-unreachable sandbox (exit 3, TRANSPORT) pushes through — the gate can never stop a sandbox-authored vendored edit. It is fail-open by design, and fail-closing it risks a fleet-wide wedge, so it is a design call on a protected vendored file, not a two-way fix. Filed as #1965 (ready-for-session) rather than folded in here.

Ruled by agent under ADR 0174 — two-way door (revertible commits + pins, proven by existing tests; land-in-factory-then-re-vendor is the #1940/#1943 precedent). Veto anytime.

**close-report** for #1964 — status `success` ## What landed The `seam` drift stage was red on `main` at `18ce6349` because #1963 wrote close-report gate 9 directly into four factory-vendored files without landing it in `Matou/dev-factory`, so the pinned copies no longer matched `FACTORY_REF` (`4ec278d`, the gate-8 commit). 1. **Landed gate 9 in its factory home** — `Matou/dev-factory@78db030b198b97f25668decc6249fbdba567d8db`, the exact `18ce6349` hunks for `close-report-lib.sh`, `close-report.sh`, `preflight-swarm.sh`, `tests/close-report-lib-test.sh` (only those four files change vs `4ec278d`: +222/−3, verified byte-for-byte against the idss working tree). This follows the #1940 (gates 6/7, `84b58522`) / #1943 (gate 8, `04dcedae`) precedent of land-in-factory-then-bump. 2. **Re-vendored idss** — `onboard.sh vendor .sandcastle 78db030 --force` (run with a **token-less** `FACTORY_REPO` so no credential leaks into the regenerated `FACTORY_MANIFEST`; verified clean). `FACTORY_REF` `4ec278d → 78db030`; the four gate-9 files return byte-identical from the pin (no working-tree change — already at `18ce6349`'s content). 3. **Consumer-owned parts untouched**: `cross-repo-mirrors.tsv`, `prompt.md`, `docs/slices/README.md`, `STATUS.md` (STATUS got a new milestone line only). Did **not** drop files from `FACTORY_MANIFEST` and did **not** revert `18ce6349`. 4. **Incidental sync**: the re-vendor also pulled in `tests/guide-labels-test.sh` — a factory test present at **both** pins that a prior *partial* `FACTORY_REF` bump had left out of this repo's tree and manifest (the old manifest never listed it, so `check-harness-drift.sh` never saw the gap). A proper `onboard.sh vendor` regenerates the manifest from the pin's `tests/**` glob, so it is now correctly in sync. Dropping it would mean hand-editing the manifest — the anti-pattern this class of ticket forbids. ## Proof - `Matou/dev-factory` tests green at `78db030`: `tests/close-report-lib-test.sh` 48/48 (12 new gate-9 checks); `preflight-swarm.sh`'s `guard_close_report` fires on gate 9 (run in isolation). - idss `.sandcastle/tests/close-report-lib-test.sh` → 48/48 on the vendored copies. - `bash .sandcastle/check-harness-drift.sh` on the committed HEAD `f2dde647` → **OK** (exit 0), every vendored file matches `dev-factory@78db030`. - The only non-OK line is a **non-fatal NOTE** that `prompt.md` is stale against the pinned skeleton — pre-existing (the skeleton is identical between `4ec278d` and `78db030`, so this bump did not introduce it) and not read by the seam/pre-push gates, which only act on `DRIFT:`/`FAILED`. ## Commits - `Matou/dev-factory@78db030b198b97f25668decc6249fbdba567d8db` — gate 9 in the factory core. - `Matou/idss@f2dde647` — FACTORY_REF bump + re-vendor + STATUS. ## Secondary (the fail-open pre-push gate) Confirmed from the shipped hook: `.sandcastle/git-hooks/pre-push` gate 1 emits `DRIFT_BLOCK` only on `rc != 0` **and** a `DRIFT:`/`FAILED` line, so a factory-unreachable sandbox (exit 3, TRANSPORT) pushes through — the gate can never stop a sandbox-authored vendored edit. It is fail-open **by design**, and fail-closing it risks a fleet-wide wedge, so it is a design call on a protected vendored file, not a two-way fix. Filed as **#1965** (`ready-for-session`) rather than folded in here. Ruled by agent under ADR 0174 — two-way door (revertible commits + pins, proven by existing tests; land-in-factory-then-re-vendor is the #1940/#1943 precedent). Veto anytime.
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#1964
No description provided.