rehearsal auto-healer's git push has no non-interactive credential — validated fixes never reach the repo #676

Closed
opened 2026-08-22 18:10:04 +00:00 by matou-build-agent · 1 comment

Symptom

The rehearsal auto-healer (/home/swarm/rehearsal-heal/idss) computes correct fixes, commits them, but the push step fails:

fatal: could not read Username for 'https://git.matou.nz': No such device or address

Observed in logs/healer-claude.out for rehearsal-183 (#675): the healer validated commit e920f9e7 (widening tests/e2e/fixtures/wizard.ts:166) with tsc/eslint/regex checks, but it never reached Matou/idss, so the drive kept re-failing on the same stale assertion run after run — every future rehearsal re-diagnoses an already-solved defect.

Cause

The healer's git invocation has no non-interactive credential for https://git.matou.nz (no token in the URL, no credential helper, no GIT_ASKPASS), so git push blocks on a username prompt and dies on a headless host.

Proposed fix

Give the auto-heal loop the same token-in-URL push path the swarm workers use:
git push "https://swarm:$(cat /run/secrets/forgejo_token)@git.matou.nz/Matou/idss.git" HEAD:refs/heads/main
(or wire a credential helper / GIT_ASKPASS for the healer's checkout).

Found while working #675 (landed the healer's already-computed fixture fix by hand because it never pushed). The healer config lives in Sandcastle/rehearsal machinery (protected path per #445), so this needs an interactive session's standing to change.

**Symptom** The rehearsal auto-healer (`/home/swarm/rehearsal-heal/idss`) computes correct fixes, commits them, but the push step fails: ``` fatal: could not read Username for 'https://git.matou.nz': No such device or address ``` Observed in `logs/healer-claude.out` for rehearsal-183 (#675): the healer validated commit `e920f9e7` (widening `tests/e2e/fixtures/wizard.ts:166`) with tsc/eslint/regex checks, but it never reached `Matou/idss`, so the drive kept re-failing on the same stale assertion run after run — every future rehearsal re-diagnoses an already-solved defect. **Cause** The healer's git invocation has no non-interactive credential for `https://git.matou.nz` (no token in the URL, no credential helper, no `GIT_ASKPASS`), so `git push` blocks on a username prompt and dies on a headless host. **Proposed fix** Give the auto-heal loop the same token-in-URL push path the swarm workers use: `git push "https://swarm:$(cat /run/secrets/forgejo_token)@git.matou.nz/Matou/idss.git" HEAD:refs/heads/main` (or wire a credential helper / `GIT_ASKPASS` for the healer's checkout). **Found while working** #675 (landed the healer's already-computed fixture fix by hand because it never pushed). The healer config lives in Sandcastle/rehearsal machinery (protected path per #445), so this needs an interactive session's standing to change.
Author
Member

Ruled by agent under ADR 0174 — veto anytime. This is a two-way door: a revertible commit/config change, proved by the offline .sandcastle/tests/*.sh suite (real-checkout push exercises included) and check-harness-drift.sh.

What landed

The healer's dedicated checkout (REHEARSAL_CHECKOUT, cloned from REHEARSAL_HEAL_REPO) had a bare https://git.matou.nz/... origin with no username, credential helper, or GIT_ASKPASS — so heal_push's git push origin HEAD:main blocked on a headless username prompt and died. That's exactly the fault that stranded #675's already-computed, already-validated fix (e920f9e7) until it was landed by hand.

This is factory-core machinery (ADR 0180), vendored byte-identical into idss — not an idss-local file — so the fix was landed upstream first, not hand-edited here:

  1. Matou/dev-factory root commit bd48fd6: new rehearsal_heal_authed_url() (rehearsal-heal-lib.sh) injects the same swarm:$FORGEJO_TOKEN credential git-setup.sh's worker checkouts already use for git.matou.nz. Wired into rehearsal-report.sh's try_heal at the first clone, and as a git remote set-url origin refresh before every heal's fetch — so the existing stale checkout at /home/swarm/rehearsal-heal/idss (cloned before this fix) self-heals on its next heal attempt, no manual host fix-up needed. A no-op for anything that isn't a bare https://git.matou.nz/... origin (a local test fixture, an already-credentialed URL), so it can't touch the local-bare-origin test checkouts. tests/rehearsal-heal-lib-test.sh gains 3 cases for the new helper; full offline suite green (tests/*.sh + onboarding/tests/*.sh).
  2. Matou/dev-factory self-vendor commit 1b3b665 — dev-factory's own running .sandcastle/ copy carries the fix too.
  3. idss commit c9b81b81 — re-vendored .sandcastle/ at the new pin (FACTORY_REF → bd48fd6) with --force (idss's working tree carried the identical local edit already proven against these same tests, expected by onboard_vendor's local-edit guard). check-harness-drift.sh: OK. Offline .sandcastle/tests/rehearsal-heal-lib-test.sh, rehearsal-healer-test.sh (the real-checkout push exercise), and rehearsal-report-test.sh all green.

Proof

$ bash .sandcastle/check-harness-drift.sh
check-harness-drift: OK — every vendored factory file matches https://git.matou.nz/Matou/dev-factory.git@bd48fd62181e7663c741975b65517c0dd7bab7d1.

$ bash .sandcastle/tests/rehearsal-heal-lib-test.sh   # OK: 14 cases (was 11)
$ bash .sandcastle/tests/rehearsal-healer-test.sh     # OK: 12 cases
$ bash .sandcastle/tests/rehearsal-report-test.sh     # PASS (32 cases)

STATUS.md updated in the same commit (idss c9b81b81, dev-factory bd48fd6/1b3b665).

Ruled by agent under ADR 0174 — veto anytime. This is a two-way door: a revertible commit/config change, proved by the offline `.sandcastle/tests/*.sh` suite (real-checkout push exercises included) and `check-harness-drift.sh`. **What landed** The healer's dedicated checkout (`REHEARSAL_CHECKOUT`, cloned from `REHEARSAL_HEAL_REPO`) had a bare `https://git.matou.nz/...` origin with no username, credential helper, or `GIT_ASKPASS` — so `heal_push`'s `git push origin HEAD:main` blocked on a headless username prompt and died. That's exactly the fault that stranded #675's already-computed, already-validated fix (`e920f9e7`) until it was landed by hand. This is factory-core machinery (ADR 0180), vendored byte-identical into idss — not an idss-local file — so the fix was landed upstream first, not hand-edited here: 1. `Matou/dev-factory` root commit [`bd48fd6`](https://git.matou.nz/Matou/dev-factory/commit/bd48fd62181e7663c741975b65517c0dd7bab7d1): new `rehearsal_heal_authed_url()` (`rehearsal-heal-lib.sh`) injects the same `swarm:$FORGEJO_TOKEN` credential `git-setup.sh`'s worker checkouts already use for `git.matou.nz`. Wired into `rehearsal-report.sh`'s `try_heal` at the first clone, **and** as a `git remote set-url origin` refresh before every heal's fetch — so the *existing* stale checkout at `/home/swarm/rehearsal-heal/idss` (cloned before this fix) self-heals on its next heal attempt, no manual host fix-up needed. A no-op for anything that isn't a bare `https://git.matou.nz/...` origin (a local test fixture, an already-credentialed URL), so it can't touch the local-bare-origin test checkouts. `tests/rehearsal-heal-lib-test.sh` gains 3 cases for the new helper; full offline suite green (`tests/*.sh` + `onboarding/tests/*.sh`). 2. `Matou/dev-factory` self-vendor commit [`1b3b665`](https://git.matou.nz/Matou/dev-factory/commit/1b3b665) — dev-factory's own running `.sandcastle/` copy carries the fix too. 3. idss commit `c9b81b81` — re-vendored `.sandcastle/` at the new pin (`FACTORY_REF` → `bd48fd6`) with `--force` (idss's working tree carried the identical local edit already proven against these same tests, expected by `onboard_vendor`'s local-edit guard). `check-harness-drift.sh`: OK. Offline `.sandcastle/tests/rehearsal-heal-lib-test.sh`, `rehearsal-healer-test.sh` (the real-checkout push exercise), and `rehearsal-report-test.sh` all green. **Proof** ``` $ bash .sandcastle/check-harness-drift.sh check-harness-drift: OK — every vendored factory file matches https://git.matou.nz/Matou/dev-factory.git@bd48fd62181e7663c741975b65517c0dd7bab7d1. $ bash .sandcastle/tests/rehearsal-heal-lib-test.sh # OK: 14 cases (was 11) $ bash .sandcastle/tests/rehearsal-healer-test.sh # OK: 12 cases $ bash .sandcastle/tests/rehearsal-report-test.sh # PASS (32 cases) ``` STATUS.md updated in the same commit (idss `c9b81b81`, dev-factory `bd48fd6`/`1b3b665`).
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#676
No description provided.