harness: retire (or retry) the pre-#639 inline fetch-or-clone fallback in swarm.yml/triage.yml — the un-retried git-transport hole #1411 left #1423
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1423
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from #1411 (the
git-setup.shtransient-5xx retry / TRANSPORT fix).#1411 wrapped the swarm/triage workdir fetch-or-clone in a retry posture and gave a sustained transport outage a distinct
TRANSPORTverdict (exit 3), landed upstream inMatou/dev-factory(git-setup.sh, FACTORY_MANIFEST-vendored) and re-vendored into idss (FACTORY_REFdcda962f→26f142c).The remaining hole
The same un-retried fetch-or-clone is duplicated inline as the pre-#639 fallback in
.forgejo/workflows/swarm.yml:153-161and the equivalent block in.forgejo/workflows/triage.yml:130-138:This branch is reached only when
.sandcastle/git-setup.shis absent — a genuinely fresh clone, or a workdir exactly one fetch behind the commit that first checked git-setup.sh in (#639). For any established workdir the guardedgit-setup.shpath is taken and this fallback is dead code. So the hole is narrow: a transient Forgejo 5xx that lands in that one-fetch-behind window would still red the tick at stage one with a bareexit 128, exactly as #1411 described — but the coincidence is vanishingly rare, and it self-heals on the next tick (which now carries git-setup.sh).Unlike
git-setup.sh, these are per-repo workflow files (not FACTORY_MANIFEST-vendored), so the fix is a local edit here — but the same blocks live in every consumer'sswarm.yml/triage.yml, so the durable answer is probably to retire the inline fallback entirely now thatgit-setup.shships in every established workdir (the #639 transition is long past), rather than teach the fallback to retry.Suggested scope
git-setup.sh.git-setup.sh) before removing.Filed by the #1411 session under ADR 0174 — a two-way-door follow-up, left for triage rather than actioned in the #1411 session (out of that ticket's scope: "work only this ticket").
Triage —
enhancement+ready-for-sessionCategory:
enhancement. Harness hardening / de-duplication of CI machinery. The live transport defect was #1411 (already fixed ongit-setup.sh); what remains here is a narrow, self-healing edge in dead-ish fallback code — an improvement, not an active break.Claim verified. The un-retried inline fetch-or-clone is present exactly as described:
.forgejo/workflows/swarm.yml—elsebranch of the[ -f .sandcastle/git-setup.sh ]guard (thegit fetch origin mainis a single bare attempt, no retry)..forgejo/workflows/triage.yml— the equivalent block.Both are reached only when
.sandcastle/git-setup.shis absent.Ruled by agent under ADR 0174 — veto anytime
Ruling (state):
ready-for-session, notready-for-agent. The fix edits.forgejo/workflows/*.yml..sandcastle/protected-paths-lib.shdeclares.sandcastle/and.forgejo/the protected set (#445); a swarm worker that touches.forgejo/**has the change rolled back and the run red-flagged — it cannot land this by construction.protected-paths-lib.sh's own escape text (PP_ESCAPE_PATH) routes exactly this case toready-for-session. No Ben residue: no credentials, no security widening, no trust surface, no data/ spend — an interactive session on any host commits the workflow edit tomain.Why two-way door: a workflow-file edit is revertible by a later commit, and it is not on the one-way-door list.
What proves it: the swarm/triage ticks themselves — if the edit breaks bootstrap, the next tick reds at stage one (the #1411 signature) and a one-line revert restores the current behaviour; if it holds, green ticks prove it.
Ruling (scope) — correcting the filed "retire entirely": the
elsebranch is not purely dead code.swarm.ymldoesworkdir="$HOME/swarm/$REPO_SLUG"; mkdir -p "$workdir"; cd "$workdir"before the guard, so on a genuinely fresh host the workdir is empty,.sandcastle/git-setup.shis absent by definition, and theelse'sgit clone "$url" .is the actual bootstrap. Deleting the fallback outright would leave a fresh runner with no clone step. So the hole must be closed without removing fresh-host bootstrap.Agent brief (for an interactive session)
Goal: close the un-retried transport hole in the two inline pre-#639 fallbacks while preserving fresh-host bootstrap.
Do one of (low-risk default first):
git-setup.sh(wrap thegit fetch/git clonein the same retry+TRANSPORT/exit-3 helper #1411 introduced). Lowest risk; keeps the branch's shape. Recommended default.elseto a minimal clone-then-delegate: clone (retried) just far enough to obtain.sandcastle/git-setup.sh, then hand off to it — retiring the duplicated fetch-or-clone logic rather than the bootstrap. Cleaner de-dup, slightly more surgery.Apply symmetrically to both files —
swarm.ymlandtriage.yml.Constraint: do not delete the fresh-clone (
git clone "$url" .) path. Confirm no live workdir is still pre-#639 (all established checkouts already carrygit-setup.sh, so the guarded path is the norm) before any removal.Proof: after the edit, the next
swarm/triagetick must stay green through git-setup; a baregit fetchfailure must no longer collapse toexit 128at stage one but carry theTRANSPORTverdict. Note: these are per-repo workflow files (not FACTORY_MANIFEST-vendored) — the same blocks live in every consumer'sswarm.yml/triage.yml, so this edit is local to idss.Ruled by agent under ADR 0174 — veto anytime. Two-way door: a revertible per-repo workflow edit, no security-posture or credential change, proven red-before-green offline.
Decision — retire the fallback's ROLE; route every workdir through
git-setup.shInvestigating the two named blocks (
swarm.yml:150-162,triage.yml:127-139) surfaced a wrinkle the ticket's "retire entirely" framing didn't account for: the inline fallback'selsearm is a cold-bootstrapgit clonefor a genuinely fresh/empty workdir, andgit-setup.shcannot bootstrap itself onto disk (chicken-and-egg — the script has to be cloned before it can run). So deleting the whole block would break every brand-new/wiped host.Resolution that honours the ticket's intent without that regression:
if [ -f git-setup.sh ]; then <script> else <inline fetch-or-reset-or-clone> fibecomesif [ ! -f git-setup.sh ]; then <retry-guarded cold-bootstrap> fi; <script>.git-setup.sh— the retry-guarded fetch/reset that drops theTRANSPORT-aware verdict (#1411) and wires the pre-push drift gate — now runs for every workdir. The pre-#639 fetch-or-reset arm is retired as a setup path.git-setup.sh's absence, and it now carries the same bounded-retry-with-backoff posture (aset -esubshell preserves the masked-fetch pin; a sustained outage still reds, and the next tick — now carryinggit-setup.sh— gets the full verdict). So the un-retriedgit fetchhole this ticket names is closed.No regression for any workdir shape (this covers the "confirm no live workdir is still pre-#639" ask — I can't enumerate other hosts' workdirs from a session, so I made the change safe for all shapes rather than gamble on extinction): established → straight to
git-setup.sh; fresh → cold-bootstrap clone thengit-setup.sh; a stale pre-#639 checkout → the bootstrap's[ -d .git ]fetch branch recoversgit-setup.sh, thengit-setup.shruns.swarm-smoke.ymlleft as-is (deliberate): it has the same bare fetch-or-clone, but it is a human-dispatched, watched new-host preflight — not an unattended per-tick surface — so the #1411 healer-burn the retry defends against does not apply. Noted here rather than dragged into scope.What landed
.forgejo/workflows/swarm.yml,.forgejo/workflows/triage.yml— routing rewritten as above.scripts/tests/git-setup-routing-test.sh— new offline guard (red-before-green): extracts the real routing block from both workflows and runs it against a fakegit. Scenarios: established (no bootstrap + still routes through the script), fresh (cold-bootstrap clone then routes), transient 5xx (retried), sustained outage (reds without falling through), failing fetch (aborts — never masked by a following checkout/reset). Auto-runs in CI viaseam-smoke.sh'sscripts/tests/*.shsweep.STATUS.md— milestone-log entry in the same commit.Proof
git-setup-routing: 16 checks passed.drive-reservation-guard(17),workflow-concurrency(8),git-setup(7 scenarios),workdir-lock-yield(4 groups).run:blockbash -n-clean; both YAMLs parse (yaml.safe_load).Commit
b070b403onmain. Advances #1423.Concurrent-session note (ADR 0174 audit trail)
A second session-runner picked this ticket in parallel and independently reached the same ruling — retire the fallback's role, route every workdir through
.sandcastle/git-setup.sh, keep a cold-bootstrap only for a fresh/empty workdir — which landed first asb070b403and closed this ticket. Ongit pushI hit the non-fast-forward, inspected the landed commit, confirmed my own change was a strict duplicate (theirs is slightly stronger: its cold-bootstrap carries the #1411 retry posture, andscripts/tests/git-setup-routing-test.shcovers 5 scenarios), discarded my duplicate commit (git reset --hard origin/main), and re-verified the landed guard green (git-setup-routing: 16 checks passed), alongsideworkflow-concurrency/drive-reservation-guard/host-capacity-lib. No further change needed here.Follow-up filed — #1427 (not covered by
b070b403): these workflow files are a render of dev-factory'sonboarding/templates/workflows/*.tmpl(not FACTORY_MANIFEST-vendored). The idss render is fixed, but the source template still carries the inline fallback, so a future re-render would regress it (now caught by the CI guard) and every other consumer still carries the un-retried inlinegit fetch. #1427 tracks propagating the retirement to the factory template + re-rendering consumers.Ruled by agent under ADR 0174 — veto anytime.