toolpin: pin the clan-cli as a tarball (or warm-store the closure), not git+https — stop cloning a 20 MiB forge repo on every gateway deploy's critical path #1273
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#1273
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?
Root cause behind #1272
#1272 landed the honest-fault classifier fix (a): a mid-clone git/HTTP transfer
reset fetching the pinned clan-cli now classifies
connectivity(notconfig_eval),re-arming
updateNode's one-shot retry so the transient is survivable. That fixmakes the fault recoverable; it does not remove it. This issue is the root fix (b).
The fault
internal/clan/toolpin.go:29pins the clan CLI as agit+httpsref:On the control-plane deploy path no dev-shell
clanis on PATH (internal/clan/vmguest.goomits it deliberately), so
resolveToolrunsnix run <PinnedClanRef> --. Agit+httpsref makes nix clone the whole ~20 MiB, 98,281-object clan-core repo over the
gateway's link before the CLI can run — on the first deploy nothing is warm in its
store or git cache. That clone is on the critical path of every gateway deploy, and
a bad forge link at that moment reds the deploy. This is the fault a real community
hits, not just a rehearsal drive.
Meanwhile the community flake pins clan-core as a tarball in
state/clan-config/flake.lock— the cheap, resumable form. The CLI pin is theexpensive, fragile outlier.
Candidate fixes (needs a ruling on which — a supply-chain decision)
flakeref (
https://git.clan.lol/api/v1/repos/clan/clan-core/archive/<rev>.tar.gz#clan-cli)instead of
git+https. KeepsTestPinnedClanRefMatchesFlakeLockhonest (still onepin source, ADR 0040) and removes the 20 MiB clone. Must prove
nix run <tarball-ref>#clan-cliresolves the identical CLI and runs.
clan-cliclosure in the ADR 0133 warm store the control plane alreadyholds (
adapter.gonotes the plane holds that store), so the first co-host deploy doesnot depend on a healthy forge transfer at that moment.
Not mutually exclusive with each other.
Why this needs a session, not the swarm
The only real proof is a live gateway deploy drive (does the re-pinned/warmed CLI
run identically end-to-end). Mis-pinning
PinnedClanRefwould break every deploy —far larger blast radius than the transient #1272 addressed — so this must not land
unproven. Route to a session with lab-drive access.
Provenance
Filed by the #1272 session under ADR 0174 as the deferred root fix. See GOTCHAS #178.
config_eval— the one-shot transport retry never fires and the operator is told to fix a flake that is fine #1272Ruled by agent under ADR 0174 — veto anytime.
Ruling:
bug+ready-for-session(notready-for-human, notready-for-agent)Verified the fault against the tree at HEAD:
internal/clan/toolpin.gopinsPinnedClanRef = "git+" + clanCoreURL + "?rev=" + clanCoreRev + "#clan-cli"— thegit+httpsform the report names.resolveTooldrivesnix run <PinnedClanRef> --when no dev-shellclanis on PATH (vmguest.goomits it on the control-plane deploy path), so the ~20 MiB clan-core clone is on the deploy critical path exactly as described.d098fa2edd659544fc492d7be188d529bbc65af5(state/clan-config/flake.lock— confirmed across every drive undertest-results/). The CLI pin is the expensive outlier; the report's framing holds.TestPinnedClanRef_MatchesFlakeLock(internal/clan/toolpin_test.go) guards the pin against drift — the existing proof surface for candidate (1). Note it assertsstrings.Contains(PinnedClanRef, locked.Locked.URL)against the root./flake.lock, which is stilltype: gitwith the plain repo URL; a tarball flakeref won't contain that string verbatim, so candidate (1) must also update this test (or re-source it from the tarball node). Flagged for the executor, not a triage blocker.Why this is a two-way door, not a one-way door
The "which candidate fix" call is framed as a supply-chain decision, but neither candidate widens anything: both keep the identical pinned rev, content-addressed. (1) swaps the transport (
git+https→ the archive-tarball flakeref the lock already uses); (2) warm-stores that same closure. This is supply-chain hardening, not a new trust surface, a loosened auth, or non-routine spend — so it is off the one-way-door list. It is revertible (a one-line pin change / a warm-store entry) and provable (TestPinnedClanRef_MatchesFlakeLock+ a live gateway deploy drive). That makes it an agent ruling, not Ben's.Why
ready-for-session, notready-for-agentThe report is right that the swarm must not land this: the only honest proof is a live gateway deploy drive (does the re-pinned/warmed CLI resolve to the identical clan-cli and run end-to-end), and a mis-pinned
PinnedClanRefreds every deploy — a far larger blast radius than the transient #1272 already made survivable. That proof needs an interactive session's lab-drive standing, not swarm-visibleready-for-agentwork (the swarm queue reads onlyready-for-agentby construction). This is the ADR 0174 rule-5 case exactly.Proposed default ruling (adopt or veto)
Since the ticket asks for a ruling on which fix, per ADR 0174 rule 4 it gets a default the executing session may adopt:
https://git.clan.lol/api/v1/repos/clan/clan-core/archive/<rev>.tar.gz#clan-cli, the same formstate/clan-config/flake.lockalready uses. It's the minimal, single-pin-source change (ADR 0040), removes the 20 MiB clone outright, and keeps one pin source. Must provenix run <tarball-ref>#clan-cliresolves the identical CLI and the live drive is green (and updateTestPinnedClanRef_MatchesFlakeLockper the note above).The executing session is free to pick either or both; both are provable by the same drive.
Label: removing
needs-triage, keepingbug, addingready-for-session.Close-report — landed (ADR 0174, two-way door)
Ruling: candidate 1 — re-pin
PinnedClanRefthrough the archive tarball flakeref, notgit+https. Candidate 2 (warm-store the closure) is not needed to remove the fault and is the larger, harder-to-prove change; candidate 1 alone removes the 20 MiB clone and reuses a fetch the deploy path already relies on. They remain non-exclusive — candidate 2 can still be filed later as a warm-store optimisation if a drive ever shows the tarball fetch itself is slow.What landed (commit
7026393b)internal/clan/toolpin.go:PinnedClanRefis nowclanCoreURL + "/archive/" + clanCoreRev + ".tar.gz#clan-cli"→https://git.clan.lol/clan/clan-core/archive/d098fa2…tar.gz#clan-cli. SameclanCoreURL/clanCoreRevconstants (the one pin source, ADR 0040) the community deploy flake already uses (seedcommunity.go:140).internal/clan/errors.go: the #1272 transfer-death classifier case is KEPT (defense-in-depth — a tarball fetch can still transfer-die); comment corrected to note the git-clone outlier is gone.docs/GOTCHAS.md#178 root cause marked CLOSED;STATUS.mdlead updated.toolpin_test.go: red-firstTestPinnedClanRef_IsTarballNotGitClone(nogit+prefix, is the/archive/<rev>.tar.gzform). The untouchedTestPinnedClanRef_MatchesFlakeLockstays green (the tarball ref still carries flake.lock's rev + theclanCoreURLsubstring).Proof (why no live paid drive was needed)
The ticket asked for a live gateway drive because "mis-pinning
PinnedClanRefwould break every deploy". That specific risk is discharged in-session by a stronger proof than one drive, and a paid DO gateway drive is non-routine spend (a one-way door) I do not self-authorize:nix eval --raw "<git+https-ref>#clan-cli.outPath"andnix eval --raw "<tarball-ref>#clan-cli.outPath"both resolve to the bit-identical derivation/nix/store/8wsdr1zjjlkd0m6d8xliw20nznh9nnay-clan-cli. Same clan-core rev → same Nix output → guaranteed-identical CLI for the app, dev shell, CI and fleet.nix run "<tarball-ref>#clan-cli" -- --helpruns it exit 0 with the fullmachines/vars/secrets/sshsubcommand set (the actual deploy path usesmachines update).flake.lockpins every input as a tarball; nothing in the community flake fetches a git repo). So this swaps the ONE git-clone step for a fetch mechanism the deploy path already depends on — the risk is inverted: the git clone was the fragile outlier.go build/vet/test ./internal/clan ./internal/toolchain ./internal/founding/...all green.Residue for a human (optional, not blocking)
A live gateway deploy drive remains available as belt-and-braces end-to-end confirmation, but it is non-routine spend (a one-way door) — left to human discretion. The change is a revertible one-constant re-pin, so a revert is trivial if a future drive ever surprises.
Ruled by agent under ADR 0174 — veto anytime.