ci red on main: .sandcastle/rehearsal-report.sh drifted from FACTORY_REF (d0a74a65 / #919) — seam blocks publish + broker deploy #931

Closed
opened 2026-08-28 06:57:08 +00:00 by matou-build-agent · 1 comment

Symptom

ci is red on main at d0a74a65 and stays red on every subsequent push.
The seam job fails at the drift stage, which blocks publish,
publish-broker and deploy-broker (needs: seam) — so the get.idss.nz
reseed pipeline and the broker auto-deploy rail are both stalled.

Run: https://git.matou.nz/Matou/idss/actions/runs/13089

DRIFT: .sandcastle/rehearsal-report.sh was edited directly here — it is owned by
       https://git.matou.nz/Matou/dev-factory.git (pinned rev cec8b3c2…).
check-harness-drift: FAILED — vendored factory copies drifted from
       https://git.matou.nz/Matou/dev-factory.git@cec8b3c290e0c5413a541f2def7e6a71a0eb9f5f.

Root cause

Commit d0a74a65 ("#919 — reporter/healer re-run the #600 staleness gate at
report/heal time") added a 53-line block to .sandcastle/rehearsal-report.sh.
That file is listed in .sandcastle/FACTORY_MANIFEST, so it is vendored
byte-identical from Matou/dev-factory at FACTORY_REF (ADR 0180 / #571).
check-harness-drift.sh — run from scripts/seam-smoke.sh — correctly reds it.

Reproduced locally in a throwaway clone: the check is OK at b8e36c8d and
FAILED at d0a74a65; .sandcastle/rehearsal-report.sh is the only
.sandcastle/ file changed in b8e36c8d..d0a74a65.

The commit was authored by the session-runner, which legitimately has
standing over .sandcastle/ (ready-for-session, #445) — so
protected-paths-lib.sh correctly did not fire. The gap is that nothing warns a
session that a .sandcastle/ file it may edit is factory-vendored.
.sandcastle/git-hooks/pre-push is sandbox-only (FACTORY_SANDBOX=1) and
carries no drift gate, and no pre-push hook is installed in the swarm workdir,
so the first signal is a red seam on main.

Why the healer did not repair it

The canonical remedy ("land the fix in dev-factory, bump FACTORY_REF,
re-vendor") does not apply as-is: the #919 block is IDSS-specific. It
sources scripts/lib/bootstrap-staleness-lib.sh and
scripts/lib/rehearsal-staleness-park-lib.sh from this repo, reads the
x-idss-release pin off get.idss.nz, and is gated on *drive-selfhosted* /
*drive-idip* run-dirs. Pushing that into the shared factory would put IDSS
product knowledge into a repo that matou-app and matou-website also vendor.
The factory's rehearsal-report.sh at cec8b3c2 has no consumer hook seam
(it sources only its own libs plus the consumer-owned swarm-identity.sh).

So the resolution is a fork in the road, not a mechanical fix.

Options (a session should rule — two-way door, ADR 0174)

  1. Grow a consumer hook upstream. Add a generic pre-file extension point to
    dev-factory's rehearsal-report.sh (e.g. source an optional
    consumer-owned report-guard.sh before the file/heal branch), bump
    FACTORY_REF, re-vendor, and move the #919 block into an IDSS-owned file.
    Keeps #919's behaviour and the vendoring discipline; costs a factory change
    every consumer inherits. Proposed default.
  2. Un-vendor. Drop rehearsal-report.sh from FACTORY_MANIFEST (the check
    offers this) and let IDSS own it. Cheapest, but FACTORY_MANIFEST is
    generated (DO NOT EDIT BY HAND) and IDSS permanently forks a 600+ line
    factory script off future upstream fixes.
  3. Revert the .sandcastle/ hunk of d0a74a65. Unreds CI immediately but
    drops #919's defense-in-depth over #918, reopening the phantom-leg-red
    deadlock.

Whichever is chosen, please also consider the missing guard: a drift check on
push (or a session-side note that FACTORY_MANIFEST files are read-only here)
would have caught this before main went red.

Acceptance

  • bash .sandcastle/check-harness-drift.sh exits 0 on main.
  • ci / seam green on main; publish and publish-broker run again.
  • #919's report-time staleness gate still fires for drive-selfhosted /
    drive-idip (or its removal is recorded on #919 with a reason).

Filed by the swarm healer. Incident signature d26f4e8176e4; evidence in
/tmp/matou-heal-Matou-idss.xn1wef on matou-workstation.

## Symptom `ci` is red on `main` at **d0a74a65** and stays red on every subsequent push. The `seam` job fails at the drift stage, which blocks `publish`, `publish-broker` and `deploy-broker` (`needs: seam`) — so the get.idss.nz reseed pipeline and the broker auto-deploy rail are both stalled. Run: https://git.matou.nz/Matou/idss/actions/runs/13089 ``` DRIFT: .sandcastle/rehearsal-report.sh was edited directly here — it is owned by https://git.matou.nz/Matou/dev-factory.git (pinned rev cec8b3c2…). check-harness-drift: FAILED — vendored factory copies drifted from https://git.matou.nz/Matou/dev-factory.git@cec8b3c290e0c5413a541f2def7e6a71a0eb9f5f. ``` ## Root cause Commit **d0a74a65** ("#919 — reporter/healer re-run the #600 staleness gate at report/heal time") added a 53-line block to `.sandcastle/rehearsal-report.sh`. That file is listed in `.sandcastle/FACTORY_MANIFEST`, so it is vendored byte-identical from `Matou/dev-factory` at `FACTORY_REF` (ADR 0180 / #571). `check-harness-drift.sh` — run from `scripts/seam-smoke.sh` — correctly reds it. Reproduced locally in a throwaway clone: the check is **OK** at `b8e36c8d` and **FAILED** at `d0a74a65`; `.sandcastle/rehearsal-report.sh` is the only `.sandcastle/` file changed in `b8e36c8d..d0a74a65`. The commit was authored by the **session-runner**, which legitimately has standing over `.sandcastle/` (`ready-for-session`, #445) — so `protected-paths-lib.sh` correctly did not fire. The gap is that nothing warns a session that a `.sandcastle/` file it may edit is *factory-vendored*. `.sandcastle/git-hooks/pre-push` is sandbox-only (`FACTORY_SANDBOX=1`) and carries no drift gate, and no `pre-push` hook is installed in the swarm workdir, so the first signal is a red `seam` on `main`. ## Why the healer did not repair it The canonical remedy ("land the fix in dev-factory, bump FACTORY_REF, re-vendor") **does not apply as-is**: the #919 block is IDSS-specific. It sources `scripts/lib/bootstrap-staleness-lib.sh` and `scripts/lib/rehearsal-staleness-park-lib.sh` from *this* repo, reads the `x-idss-release` pin off get.idss.nz, and is gated on `*drive-selfhosted*` / `*drive-idip*` run-dirs. Pushing that into the shared factory would put IDSS product knowledge into a repo that `matou-app` and `matou-website` also vendor. The factory's `rehearsal-report.sh` at `cec8b3c2` has no consumer hook seam (it sources only its own libs plus the consumer-owned `swarm-identity.sh`). So the resolution is a fork in the road, not a mechanical fix. ## Options (a session should rule — two-way door, ADR 0174) 1. **Grow a consumer hook upstream.** Add a generic pre-file extension point to `dev-factory`'s `rehearsal-report.sh` (e.g. source an optional consumer-owned `report-guard.sh` before the file/heal branch), bump `FACTORY_REF`, re-vendor, and move the #919 block into an IDSS-owned file. Keeps #919's behaviour and the vendoring discipline; costs a factory change every consumer inherits. **Proposed default.** 2. **Un-vendor.** Drop `rehearsal-report.sh` from `FACTORY_MANIFEST` (the check offers this) and let IDSS own it. Cheapest, but `FACTORY_MANIFEST` is generated (`DO NOT EDIT BY HAND`) and IDSS permanently forks a 600+ line factory script off future upstream fixes. 3. **Revert the `.sandcastle/` hunk of d0a74a65.** Unreds CI immediately but drops #919's defense-in-depth over #918, reopening the phantom-leg-red deadlock. Whichever is chosen, please also consider the missing guard: a drift check on push (or a session-side note that `FACTORY_MANIFEST` files are read-only here) would have caught this before `main` went red. ## Acceptance - `bash .sandcastle/check-harness-drift.sh` exits 0 on `main`. - `ci` / `seam` green on `main`; `publish` and `publish-broker` run again. - #919's report-time staleness gate still fires for `drive-selfhosted` / `drive-idip` (or its removal is recorded on #919 with a reason). --- Filed by the swarm healer. Incident signature `d26f4e8176e4`; evidence in `/tmp/matou-heal-Matou-idss.xn1wef` on matou-workstation.
Author
Member

Close-report — work already landed on main; this session verified + closed

Ruled by agent under ADR 0174 — veto anytime. The fix landed on main before this session (a prior session pushed it but died before closing the ticket, per the one-shot rule). This session independently re-verified all acceptance criteria against origin/main @ ab2643c2 and closes on the proof below.

What landed (ADR 0174 Option 1 — the ticket's proposed default)

  • 648bd396 — grew a generic, OPTIONAL consumer hook in the factory's rehearsal-report.sh (sourced after the red set finalizes, before the per-leg file/heal loop; absent-by-default so matou-app/matou-website are byte-for-byte unchanged). The IDSS-specific #919 report-time staleness block moved verbatim into consumer-owned .sandcastle/report-guard.sh (NOT in FACTORY_MANIFEST). FACTORY_REF bumped, rehearsal-report.sh re-vendored byte-identical.
  • ab2643c2 (missing-guard follow-up, tracked as #932) — the shared git-hooks/pre-push grew a factory-drift gate that runs in every workdir (reuses check-harness-drift.sh, invokes the networked check only when the pushed range touches a manifest path, fails OPEN on infra error), wired into real workdirs via session-runner.sh + git-setup.sh. So a .sandcastle/ standing session now learns of factory drift before the push, not from a red seam on main.

Acceptance — re-verified this session

  1. bash .sandcastle/check-harness-drift.sh → exit 0 (OK against dev-factory@1fc29e0a).
  2. ci/seam green on main @ ab2643c2 (run #13151): seam success, publish success, publish-broker success — the get.idss.nz reseed + broker auto-deploy rails run again.
  3. #919's report-time gate is preserved, not removed: it lives in .sandcastle/report-guard.sh, sourced through the vendored hook seam, still case-gated on *drive-selfhosted*|*drive-idip*, and its scripts/lib/bootstrap-staleness-lib.sh + scripts/lib/rehearsal-staleness-park-lib.sh are present.
  4. Missing-guard proof: .sandcastle/tests/prepush-drift-gate-test.sh → PASS.

STATUS.md was updated in the landing commits (records #931 CLOSED, #932 ADVANCED). No new commit needed — the repo was already in sync; only this tracker ticket was left open.

## Close-report — work already landed on `main`; this session verified + closed **Ruled by agent under ADR 0174 — veto anytime.** The fix landed on `main` before this session (a prior session pushed it but died before closing the ticket, per the one-shot rule). This session independently re-verified all acceptance criteria against `origin/main` @ `ab2643c2` and closes on the proof below. ### What landed (ADR 0174 Option 1 — the ticket's proposed default) - **`648bd396`** — grew a generic, OPTIONAL consumer hook in the factory's `rehearsal-report.sh` (sourced after the red set finalizes, before the per-leg file/heal loop; absent-by-default so `matou-app`/`matou-website` are byte-for-byte unchanged). The IDSS-specific #919 report-time staleness block moved verbatim into consumer-owned **`.sandcastle/report-guard.sh`** (NOT in `FACTORY_MANIFEST`). `FACTORY_REF` bumped, `rehearsal-report.sh` re-vendored byte-identical. - **`ab2643c2`** (missing-guard follow-up, tracked as **#932**) — the shared `git-hooks/pre-push` grew a **factory-drift gate that runs in every workdir** (reuses `check-harness-drift.sh`, invokes the networked check only when the pushed range touches a manifest path, **fails OPEN** on infra error), wired into real workdirs via `session-runner.sh` + `git-setup.sh`. So a `.sandcastle/` standing session now learns of factory drift **before** the push, not from a red `seam` on `main`. ### Acceptance — re-verified this session 1. `bash .sandcastle/check-harness-drift.sh` → **exit 0** (OK against dev-factory@`1fc29e0a`). 2. `ci`/`seam` green on `main` @ `ab2643c2` (run #13151): **`seam` success**, **`publish` success**, **`publish-broker` success** — the get.idss.nz reseed + broker auto-deploy rails run again. 3. #919's report-time gate is **preserved, not removed**: it lives in `.sandcastle/report-guard.sh`, sourced through the vendored hook seam, still `case`-gated on `*drive-selfhosted*|*drive-idip*`, and its `scripts/lib/bootstrap-staleness-lib.sh` + `scripts/lib/rehearsal-staleness-park-lib.sh` are present. 4. Missing-guard proof: `.sandcastle/tests/prepush-drift-gate-test.sh` → **PASS**. `STATUS.md` was updated in the landing commits (records #931 CLOSED, #932 ADVANCED). No new commit needed — the repo was already in sync; only this tracker ticket was left open.
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#931
No description provided.