Wire check-harness-drift.sh into ci.yml #602

Closed
opened 2026-08-19 22:06:31 +00:00 by ben · 1 comment
Owner

Follow-up from #571 — the factory-core extraction

check-harness-drift.sh (rewritten in #571 for the pull model — diffs FACTORY_MANIFEST's vendored paths against the commit pinned in FACTORY_REF) runs standalone today (bash .sandcastle/check-harness-drift.sh) but is not wired into ci.yml/scripts/seam-smoke.sh — a hand-edited vendored file currently only reds if someone remembers to run the check manually.

#571 deliberately did not touch seam-smoke.sh in the same pass: it has its own careful verdict/healer wiring (repo-tagged SEAM_VERDICT, stage-banner parsing the healer's incident-signature computation depends on), and adding a stage there risked perturbing that existing, well-tested flow without dedicated attention.

What's needed

Add a stage/step that runs check-harness-drift.sh (either inside scripts/seam-smoke.sh as a new stage, matching its stage()/verdict conventions, or as a separate ci.yml step) so a drifted vendored file goes red on the next push instead of silently rotting until someone runs the check by hand. Two-way door, small and well-scoped — should be swarm-workable once seam-smoke.sh's stage-addition pattern is followed (offline-testable: no network needed beyond the existing drift-check test's local git remote pattern).

.sandcastle/FACTORY_MANIFEST/FACTORY_REF and check-harness-drift.sh are themselves protected-path (.sandcastle/) but this is exactly the same class of change #571 itself required session standing for — a swarm worker touching .forgejo/workflows/ci.yml or scripts/seam-smoke.sh (protected/near-protected) needs the same care. Suggest ready-for-session.

## Follow-up from #571 — the factory-core extraction check-harness-drift.sh (rewritten in #571 for the pull model — diffs FACTORY_MANIFEST's vendored paths against the commit pinned in FACTORY_REF) runs standalone today (bash .sandcastle/check-harness-drift.sh) but is not wired into ci.yml/scripts/seam-smoke.sh — a hand-edited vendored file currently only reds if someone remembers to run the check manually. #571 deliberately did not touch seam-smoke.sh in the same pass: it has its own careful verdict/healer wiring (repo-tagged SEAM_VERDICT, stage-banner parsing the healer's incident-signature computation depends on), and adding a stage there risked perturbing that existing, well-tested flow without dedicated attention. ## What's needed Add a stage/step that runs check-harness-drift.sh (either inside scripts/seam-smoke.sh as a new stage, matching its stage()/verdict conventions, or as a separate ci.yml step) so a drifted vendored file goes red on the next push instead of silently rotting until someone runs the check by hand. Two-way door, small and well-scoped — should be swarm-workable once seam-smoke.sh's stage-addition pattern is followed (offline-testable: no network needed beyond the existing drift-check test's local git remote pattern). .sandcastle/FACTORY_MANIFEST/FACTORY_REF and check-harness-drift.sh are themselves protected-path (.sandcastle/) but this is exactly the same class of change #571 itself required session standing for — a swarm worker touching .forgejo/workflows/ci.yml or scripts/seam-smoke.sh (protected/near-protected) needs the same care. Suggest ready-for-session.

Ruled by agent under ADR 0174 — veto anytime: a two-way-door CI-wiring change (a script edit + a new stage in an existing, teed script; nothing on the ADR 0174 one-way-door list), provable by the drift script's own test suite plus a live red/green proof.

What landed

ea66b6c — added a new stage to scripts/seam-smoke.sh, right after the toolchain stage and before pnpm install (no toolchain dependency, so it's cheapest to run first):

stage "Factory core: vendored .sandcastle files match FACTORY_REF (#571/#602)"
bash .sandcastle/check-harness-drift.sh

Went with the seam-smoke.sh stage option (not a separate ci.yml step) per the ticket's suggestion, since it slots straight into the existing stage()/set -euo pipefail/write_verdict conventions unmodified — a failing bash call aborts seam() exactly like every other bare-command stage (go build, pnpm install), so write_verdict picks up the stage banner and the healer's incident-signature fold sees it like any other stage failure. Nothing in the verdict/healer wiring itself was touched, honouring #571's original reason for leaving this file alone.

Proof

  • bash -n scripts/seam-smoke.sh — syntax OK.
  • Existing .sandcastle/tests/check-harness-drift-test.sh (5 cases, offline, local-git-remote pattern) — still green, unchanged.
  • Ran the wired check directly against the real, in-sync vendored tree: check-harness-drift: OK — every vendored factory file matches https://git.matou.nz/Matou/dev-factory.git@e9aa0bd....
  • Red-path proof: hand-tampered .sandcastle/heal.sh in place, ran the check again — DRIFT: .sandcastle/heal.sh was edited directly here with the diff shown, exit 1 — then restored the file (confirmed via git status --short showing no leftover changes) before committing.

STATUS.md updated in the same commit.

Advances #602.

Ruled by agent under ADR 0174 — veto anytime: a two-way-door CI-wiring change (a script edit + a new stage in an existing, teed script; nothing on the ADR 0174 one-way-door list), provable by the drift script's own test suite plus a live red/green proof. ## What landed `ea66b6c` — added a new stage to `scripts/seam-smoke.sh`, right after the toolchain stage and before `pnpm install` (no toolchain dependency, so it's cheapest to run first): ``` stage "Factory core: vendored .sandcastle files match FACTORY_REF (#571/#602)" bash .sandcastle/check-harness-drift.sh ``` Went with the seam-smoke.sh stage option (not a separate ci.yml step) per the ticket's suggestion, since it slots straight into the existing `stage()`/`set -euo pipefail`/`write_verdict` conventions unmodified — a failing `bash` call aborts `seam()` exactly like every other bare-command stage (`go build`, `pnpm install`), so `write_verdict` picks up the stage banner and the healer's incident-signature fold sees it like any other stage failure. Nothing in the verdict/healer wiring itself was touched, honouring #571's original reason for leaving this file alone. ## Proof - `bash -n scripts/seam-smoke.sh` — syntax OK. - Existing `.sandcastle/tests/check-harness-drift-test.sh` (5 cases, offline, local-git-remote pattern) — still green, unchanged. - Ran the wired check directly against the real, in-sync vendored tree: `check-harness-drift: OK — every vendored factory file matches https://git.matou.nz/Matou/dev-factory.git@e9aa0bd...`. - Red-path proof: hand-tampered `.sandcastle/heal.sh` in place, ran the check again — `DRIFT: .sandcastle/heal.sh was edited directly here` with the diff shown, exit 1 — then restored the file (confirmed via `git status --short` showing no leftover changes) before committing. STATUS.md updated in the same commit. Advances #602.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#602
No description provided.