7 .sandcastle/ vendored files have drifted from Matou/dev-factory since before #664 — port the local fixes upstream + re-vendor #666

Closed
opened 2026-08-22 13:20:38 +00:00 by matou-build-agent · 1 comment

Context

While fixing #664's consumer half properly (landing the fix in Matou/dev-factory and re-vendoring, instead of the prior commit's direct hand-edit of vendored files), re-vendoring .sandcastle/ at the new Matou/dev-factory pin surfaced 7 files already hand-edited directly in idss — drifted from the OLD pin (b913089) before this session touched anything:

  • .sandcastle/limit-lib.sh
  • .sandcastle/preflight-swarm.sh
  • .sandcastle/rehearsal-report.sh
  • .sandcastle/run-swarm.sh
  • .sandcastle/sweep-lib.sh
  • .sandcastle/tests/preflight-swarm-test.sh
  • .sandcastle/tests/sweep-lib-test.sh

All 7 are FACTORY_MANIFEST entries — vendored byte-identical from Matou/dev-factory per ADR 0180. Editing them directly here is the exact ownership-inversion bug class that ADR retired: bash .sandcastle/check-harness-drift.sh fails red naming each one.

These are almost certainly genuine local bug fixes that landed as swarm/session commits into the protected .sandcastle/ path directly (rather than via Matou/dev-factory + a FACTORY_REF bump) — e.g. run-swarm.sh's diff includes real auth-refusal-classification logic (CLAUDE AUTH FAILED on account...), not a trivial change. They were deliberately left untouched while landing #664 (backed up before a forced onboard.sh vendor --force, restored after) — out of scope for that ticket, and risky to blindly overwrite without understanding what each local edit fixes.

What to build

For each of the 7 files: diff the local idss copy against Matou/dev-factory's copy at the current pin (.sandcastle/FACTORY_REF), understand what the local edit does, and land it properly:

  1. Port the fix into the corresponding root file in Matou/dev-factory (with its own test coverage, TDD).
  2. Bump Matou/dev-factory's own self-pin (.sandcastle/FACTORY_REF there) and push.
  3. Re-vendor idss's .sandcastle/ at the new ref (onboard.sh vendor .sandcastle <new-sha> from a Matou/dev-factory checkout).
  4. Confirm bash .sandcastle/check-harness-drift.sh is fully clean (all files, not just these 7).

Why this is a separate issue

A swarm worker cannot land this — every file lives inside the .sandcastle/+.forgejo/ protected boundary (#445), and the Matou/dev-factory half needs push access to that repo too. Needs an interactive agent session's standing (ADR 0174 rule 5), same as #664.

Two-way door

Revertible by commit (both repos), provable by check-harness-drift.sh going clean plus each ported fix's own tests. No credential, security-posture, member-trust, data-destruction, or spend surface.

Filed by the #664 consumer-half-fix agent (session) while working #664 — see that ticket's close-report for the full account of how this was found.

## Context While fixing #664's consumer half properly (landing the fix in `Matou/dev-factory` and re-vendoring, instead of the prior commit's direct hand-edit of vendored files), re-vendoring `.sandcastle/` at the new `Matou/dev-factory` pin surfaced 7 files **already** hand-edited directly in `idss` — drifted from the OLD pin (`b913089`) **before this session touched anything**: - `.sandcastle/limit-lib.sh` - `.sandcastle/preflight-swarm.sh` - `.sandcastle/rehearsal-report.sh` - `.sandcastle/run-swarm.sh` - `.sandcastle/sweep-lib.sh` - `.sandcastle/tests/preflight-swarm-test.sh` - `.sandcastle/tests/sweep-lib-test.sh` All 7 are `FACTORY_MANIFEST` entries — vendored byte-identical from `Matou/dev-factory` per ADR 0180. Editing them directly here is the exact ownership-inversion bug class that ADR retired: `bash .sandcastle/check-harness-drift.sh` fails red naming each one. These are almost certainly genuine local bug fixes that landed as swarm/session commits into the protected `.sandcastle/` path directly (rather than via `Matou/dev-factory` + a `FACTORY_REF` bump) — e.g. `run-swarm.sh`'s diff includes real auth-refusal-classification logic (`CLAUDE AUTH FAILED on account...`), not a trivial change. They were deliberately **left untouched** while landing #664 (backed up before a forced `onboard.sh vendor --force`, restored after) — out of scope for that ticket, and risky to blindly overwrite without understanding what each local edit fixes. ## What to build For each of the 7 files: diff the local `idss` copy against `Matou/dev-factory`'s copy at the current pin (`.sandcastle/FACTORY_REF`), understand what the local edit does, and land it properly: 1. Port the fix into the corresponding root file in `Matou/dev-factory` (with its own test coverage, TDD). 2. Bump `Matou/dev-factory`'s own self-pin (`.sandcastle/FACTORY_REF` there) and push. 3. Re-vendor idss's `.sandcastle/` at the new ref (`onboard.sh vendor .sandcastle <new-sha>` from a `Matou/dev-factory` checkout). 4. Confirm `bash .sandcastle/check-harness-drift.sh` is fully clean (all files, not just these 7). ## Why this is a separate issue A swarm worker cannot land this — every file lives inside the `.sandcastle/`+`.forgejo/` protected boundary (#445), and the `Matou/dev-factory` half needs push access to that repo too. Needs an interactive agent session's standing (ADR 0174 rule 5), same as #664. ## Two-way door Revertible by commit (both repos), provable by `check-harness-drift.sh` going clean plus each ported fix's own tests. No credential, security-posture, member-trust, data-destruction, or spend surface. _Filed by the #664 consumer-half-fix agent (session) while working #664 — see that ticket's close-report for the full account of how this was found._
Author
Member

Ruled by agent under ADR 0174 — veto anytime. Two-way door as scoped (revertible by commit in both repos, provable by check-harness-drift.sh + each ported fix's own tests, per the ticket's own door analysis) — no credential, security-posture, member-trust, data-destruction, or spend surface touched.

What landed

  1. Matou/dev-factory (root, its own history):

    • a8026c6 — ported both idss-local hotfixes into the factory root, each with its own test coverage (TDD, red before green):
      • Claude auth-refusal detection (#632): limit-lib.sh gains CLAUDE_AUTH_RE/claude_auth_failed; preflight-swarm.sh gains guard_auth_detection as guard 9 (+ mangled-regex red-and-named scenario); rehearsal-report.sh's healer/reporter loops fail over once then announce loudly (forgejo comment + mattermost) and file a named "NO DIAGNOSIS" body instead of the misleading "unparseable" one, plus capture the call's env; run-swarm.sh's worker guard mirrors the check.
      • ADR 0184 worktree-sweep age floor: sweep-lib.sh's sweep_worktrees now spares anything younger than a run-lifetime (mirroring reap_containers's existing floor) and skips branches still checked out in a surviving worktree, so a live sibling swarm under the two-slot host-capacity pool is never unlinked mid-flight; run-swarm.sh's sweep comment updated to match.
    • abd1c6e — bumped the factory's own self-vendored .sandcastle/ copy to a8026c6 (onboard.sh vendor .sandcastle a8026c6), STATUS.md updated.
    • Full offline suite green in both commits (root tests/*.sh, onboarding/tests/*.sh, and the self-copy's .sandcastle/tests/*.sh).
  2. Matou/idss (8734b3a1):

    • onboard.sh vendor .sandcastle a8026c6e81f7856bf86bc126a17f4be3d8c6d570 --force from a Matou/dev-factory checkout (idss's FACTORY_REF had been stuck at 1b7abc2 since before #664, so this also carries forward everything the factory grew in between — landing-lib.sh/policy-lib.sh, PR-landing knobs, #19's git-identity layer — all additive, gated off by default).
    • bash .sandcastle/check-harness-drift.sh → OK, no drift (all files, not just the original 7).
    • Two side effects from the pin jump, fixed in the same commit: idss's own non-vendored swarm-identity.sh (a per-repo template file, deliberately excluded from vendoring) predated #19's swarm_git_identity helper the freshly-vendored session-runner.sh/heal.sh now call — brought current by hand; and tests/policy-lib-test.sh (newly in-manifest) turned out to source ../onboarding/onboard-lib.sh, a path onboarding/** deliberately excludes from every consumer — a pre-existing dev-factory vendor-manifest defect, unrelated to this ticket's local hotfixes, filed as its own follow-up rather than fixed here: Matou/dev-factory#23.
    • Offline .sandcastle/tests/*.sh suite green except that one pre-existing, out-of-scope gap (policy-lib-test.sh).
    • STATUS.md updated in the same commit.

Proof

  • bash .sandcastle/check-harness-drift.sh → check-harness-drift: OK — every vendored factory file matches https://git.matou.nz/Matou/dev-factory.git@a8026c6e81f7856bf86bc126a17f4be3d8c6d570.
  • Full .sandcastle/tests/*.sh offline suite green (48/49; the one red is Matou/dev-factory#23, tracked separately).
  • Matou/dev-factory's own offline suite (root + onboarding + self-vendored .sandcastle/) green at both a8026c6 and abd1c6e.

Closing.

Ruled by agent under ADR 0174 — veto anytime. Two-way door as scoped (revertible by commit in both repos, provable by check-harness-drift.sh + each ported fix's own tests, per the ticket's own door analysis) — no credential, security-posture, member-trust, data-destruction, or spend surface touched. ## What landed 1. **Matou/dev-factory** (root, its own history): - `a8026c6` — ported both idss-local hotfixes into the factory root, each with its own test coverage (TDD, red before green): - Claude auth-refusal detection (#632): `limit-lib.sh` gains `CLAUDE_AUTH_RE`/`claude_auth_failed`; `preflight-swarm.sh` gains `guard_auth_detection` as guard 9 (+ mangled-regex red-and-named scenario); `rehearsal-report.sh`'s healer/reporter loops fail over once then announce loudly (forgejo comment + mattermost) and file a named "NO DIAGNOSIS" body instead of the misleading "unparseable" one, plus capture the call's env; `run-swarm.sh`'s worker guard mirrors the check. - ADR 0184 worktree-sweep age floor: `sweep-lib.sh`'s `sweep_worktrees` now spares anything younger than a run-lifetime (mirroring `reap_containers`'s existing floor) and skips branches still checked out in a surviving worktree, so a live sibling swarm under the two-slot host-capacity pool is never unlinked mid-flight; `run-swarm.sh`'s sweep comment updated to match. - `abd1c6e` — bumped the factory's own self-vendored `.sandcastle/` copy to `a8026c6` (`onboard.sh vendor .sandcastle a8026c6`), STATUS.md updated. - Full offline suite green in both commits (root `tests/*.sh`, `onboarding/tests/*.sh`, and the self-copy's `.sandcastle/tests/*.sh`). 2. **Matou/idss** (`8734b3a1`): - `onboard.sh vendor .sandcastle a8026c6e81f7856bf86bc126a17f4be3d8c6d570 --force` from a Matou/dev-factory checkout (idss's `FACTORY_REF` had been stuck at `1b7abc2` since before #664, so this also carries forward everything the factory grew in between — `landing-lib.sh`/`policy-lib.sh`, PR-landing knobs, #19's git-identity layer — all additive, gated off by default). - `bash .sandcastle/check-harness-drift.sh` → **OK, no drift** (all files, not just the original 7). - Two side effects from the pin jump, fixed in the same commit: idss's own non-vendored `swarm-identity.sh` (a per-repo template file, deliberately excluded from vendoring) predated #19's `swarm_git_identity` helper the freshly-vendored `session-runner.sh`/`heal.sh` now call — brought current by hand; and `tests/policy-lib-test.sh` (newly in-manifest) turned out to source `../onboarding/onboard-lib.sh`, a path `onboarding/**` deliberately excludes from every consumer — a **pre-existing dev-factory vendor-manifest defect**, unrelated to this ticket's local hotfixes, filed as its own follow-up rather than fixed here: [Matou/dev-factory#23](https://git.matou.nz/Matou/dev-factory/issues/23). - Offline `.sandcastle/tests/*.sh` suite green except that one pre-existing, out-of-scope gap (`policy-lib-test.sh`). - STATUS.md updated in the same commit. ## Proof - `bash .sandcastle/check-harness-drift.sh` → `check-harness-drift: OK — every vendored factory file matches https://git.matou.nz/Matou/dev-factory.git@a8026c6e81f7856bf86bc126a17f4be3d8c6d570.` - Full `.sandcastle/tests/*.sh` offline suite green (48/49; the one red is Matou/dev-factory#23, tracked separately). - Matou/dev-factory's own offline suite (root + onboarding + self-vendored `.sandcastle/`) green at both `a8026c6` and `abd1c6e`. Closing.
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#666
No description provided.