enroll-configure: stop handing clan's flake ingest the live .git — swap path:<dir> for git+file://<dir> at the nine call sites (deeper fix behind #923) #925
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#925
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 to #923 (settle-retry landed; this is the deeper, structural fix — option 1 in the #923 diagnosis).
Problem
flakeRef(dir, "")returnspath:<dir>, which makes nix ingest the config repo's WHOLE tree — its live.gitincluded (verified:nix flake prefetch --json path:/tmp/heal-coldcopied 117 loose-object fanout dirs into the store). So every clan invocation copies the entire git history — mutable state the same command is concurrently writing — and any git housekeeping (a repack) mid-ingest reds the read. #923 absorbs the race with a bounded settle-retry + agc.auto=0pin; this issue removes the hazard entirely.The change
Swap
path:<dir>forgit+file://<dir>(no?rev=), which excludes.gitand honours the working tree, at the nine call sites:internal/clan/vars.go:161,:229;internal/clan/enrollment.go(the generate ref),:1006,:1256;internal/clan/supply.go:55,:79;internal/clan/seedcommunity.go:109;internal/clan/store_count.go:155.Why this needs a session / live clan run (not a swarm two-way door)
clan writes files and commits them mid-run (its
CLAN_NO_COMMIT/--intent-to-adddance exists for exactly this).git+file://without a rev honours the working tree, but untracked-file visibility has to be proven against a real clan run before the swap — an untracked generated.nixor a staged-but-uncommittedflake.lockthatpath:currently sees could vanish from the ingest and breakvars generate/machines update. So this is not a seam-provable two-way door; it needs a clan-lab drive on both the rented and self-hosted paths.Filed under ADR 0174 as the residue #923 could not prove in a headless session.
path:<config-repo>flake ref makes nix ingest the live.git, so a mid-run repack redsvars generate(drive 20260828T051317Z, sig 25304f657c24) #923oc_droplet_evidencemust use the per-runrent-operator/id_ed25519(seen on drive 20260828T051317Z) #926Agent Brief
Category: bug
Summary: Swap
path:<dir>forgit+file://<dir>(no?rev=) at the clan flake-ingest call sites so nix stops ingesting the config repo's live.gitCurrent behavior:
flakeRef(dir, "")returnspath:<dir>, which makes nix ingest the config repo's whole working tree — its live.gitincluded (verified:nix flake prefetch --json path:/tmp/heal-coldcopied 117 loose-object fanout dirs into the store). Every clan invocation copies the entire git history — mutable state the same command is concurrently writing — so any git housekeeping (a repack) mid-ingest reds the read. #923/#924 absorbed the race (bounded settle-retry +gc.auto=0pin); the hazard remains.Desired behavior:
Clan flake ingest uses
git+file://<dir>without a?rev=, which excludes.gitand honours the working tree — at the flake-ref call sites that pass a config-repo dir to clan (theflakeRef(dir, "")uses in the vars, enrollment/generate, machines-update, supply/archive, seed-community lock, and store-count paths). The store no longer ingests the live.git;vars generate/machines updatestill see every file they need, including untracked generated.nixand staged-but-uncommittedflake.lock.Key interfaces:
flakeRef(dir, revision string)— therevision == ""(working-tree) case must emitgit+file://<dir>rather thanpath:<dir>. Confirm every caller that passes a config-repo dir gets the working-tree form; leave any?rev=-pinned uses (if any) as-is.CLAN_NO_COMMIT/--intent-to-adddance). This is the risk the drive must prove.Acceptance criteria:
.gitinto the store (probe:nix flake prefetch --json <ref>shows no loose-object fanout dirs).vars generateandmachines update— proving untracked generated.nixand a staged-but-uncommittedflake.lockremain visible after the swap.Out of scope:
gc.auto=0pin from #923/#924 (keep as defence-in-depth).20260828T051317Zdefects (#926, #927, #928).Why this is
ready-for-session, notready-for-agentThe swap's safety hinges on untracked-file visibility under a real clan run — an untracked generated
.nixor a staged-but-uncommittedflake.lockthatpath:currently sees could vanish from agit+file://ingest and silently breakvars generate/machines update. That is not seam-provable offline; the issue body itself scopes it to "a clan-lab drive on both the rented and self-hosted paths." A live clan-lab drive is an interactive session's standing (live infra doors), so a swarm worker must not pick it up.Ruled by agent under ADR 0174 — veto anytime.
Ruling:
ready-for-session(notready-for-human). This is a two-way door — the swap is revertible by a single commit, and it is provable, but only by a live clan-lab drive, which needs a session's live-infrastructure standing, not Ben's. It is not on the one-way-door list: no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend, no physical hardware. There is no human residue — henceready-for-session, so the swarm queue (ready-for-agent-only) correctly skips it while an interactive session can run the drive.Close-report — landed + proven on a real clan run (ADR 0174)
Ruled by agent under ADR 0174 — veto anytime. This ran as a session (not a swarm two-way door) exactly because the ticket's premise had to be proven against a live clan, which it was.
What landed
Commit
131e1854onmain.flakeRef(dir, "")now returnsgit+file://<dir>(no?rev=) instead ofpath:<dir>, swapping the ingest at eight of the nine call sites — every enrollment/eval/supply site (vars generate@enrollment.go:752 & vars.go:161,vars set@enrollment.go:771,vars get@vars.go:229,machines update@enrollment.go:1038 & :1288,flake archive@supply.go:55 & :79, the store-counttopleveleval @store_count.go:155). OneflakeRefedit covers all eight — it was the sole producer ofpath:. So nix no longer copies the config repo's live.gitinto the store, removing #923's hazard at source (path:snapshotted the whole.git/objects/**while the single writer was committing into it — ADR 0102 — which is what a mid-run repack raced).What the real clan run proved (why this was
ready-for-session)nix flake prefetch --json git+file://…probe):.gitexcluded; committed files included with working-tree content; staged andgit add -Nintent-to-add files included; only purely-untracked, unstaged files fall out.TestOwnVPSGateway_EvalSmoke(self-hosted) andTestRentedGateway_EvalSmoke(rented),IDSS_EVAL_SMOKE=1, against real clan-core + nixpkgs: each droveclan vars generate --flake git+file://<dir> --no-sandbox(sealed kanidm-tls vars, committed by clan itself) then a real toplevelnix eval— passed.The one site that must NOT swap (caught by the live run)
SeedCommunity's seed-legnix flake lock(seedcommunity.go) locks aflake.nixit wrote but has not yet committed (pre-commit, inside the single-writer closure, to land both in one commit). Those files are purely untracked, so undergit+file://the lock redsPath 'flake.nix' … is not tracked by Git— reproduced on both the own-VPS and rented eval-smokes before the fix. That call site keepspath:deliberately, with an inline note carrying the evidence; #925's hazard cannot reach it (the seed runs once, single-threaded, with git gc pinned off per #924). This is precisely the untracked-file residue the ticket said needed a live clan run to settle.Defense-in-depth retained, comments corrected
#923's
generateRepackAttemptssettle-retry and #924's gc pins stay — nix's dirty-tree fetcher still reads.gitvia git plumbing (ls-files/status + HEAD-tree read) during ingest, so the repack race is narrowed, not eliminated.GOTCHAS #111and the four now-stalepath:<dir>comments (adapter.go×2, configrepo.go, enrollment.go) updated.Proof / discipline
go build ./...,go vet,go test ./...— all green.TestSeedCommunity_LocksTheFlakeItWritesassertion updated to expect the seed lock's deliberatepath:(with rationale).STATUS.mdheader updated in the same commit.Out-of-scope observation, filed not smuggled
The private + own-VPS eval-smokes also trip a pre-existing
assertDrvPathBaselinedrift (the toplevel eval itself passes). Confirmed on stock main with #925 stashed → not caused by this change. Filed as #935 (likely a non-deterministic generated cert embedded at eval); not touched here (the test forbids blind re-baselining).