enroll-configure: config_eval reds on a loose git object that vanished mid-eval #924

Closed
opened 2026-08-28 05:41:39 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260828T051317Z, target device, commit bd9796b5. artifacts/verdict.json:

{"verdict": "red", "firstRedLeg": "standing", "legs": {"total": 10, "green": 8, "red": 2, "skip": 0}}

Eight legs green (wizard-rent → claim → create → image-boot → connect → point-row → seed → supply). The two reds are enroll-configure and its wrapper standing, carrying the same fault verbatim in artifacts/legs.json:

"leg": "enroll-configure", "status": "red", "ms": 16221,
"error": "journey leg \"enroll-configure\" went red: founding: stand up the rented server:
  clan: config_eval on gateway: the node's config does not evaluate: error:
error: path '//home/swarm/swarm/Matou/idss/test-results/standing-rented/state/clan-config/.git/objects/17/7ffd08eaf2d8c3628053a9f00e9605218b41e1' does not exist"

This is not the KNOWN frontier. legs.json records "skip": 0 and carries no skip reasons at all, so nothing in this drive's own records names anything as out of scope. The own-VPS pairing carrier never came into play either — this is the RENTED path, and logs/founding-state.log shows the pairing stage passing by design:

"stage": "pairing", "message": "the app connects to the rented server over its own key — no device-end consent (a fresh server has nothing to erase)"

The drive died two stages later, founding the gateway. Device-add never ran.

The evidence lines

logs/founding-state.log, the last three enroll-configure events in order:

"configuring the gateway on the rented server (clan update, no takeover) — eval preflight, then the machine vars"
"takeover-ready node config committed"
"the node's config does not evaluate: error: path '…/clan-config/.git/objects/17/7ffd08eaf2d8c3628053a9f00e9605218b41e1' does not exist"

The commit into the config repo succeeded, and the very next clan step failed reading a file out of that same repo's .git/objects/. Two things follow from the path alone: the thing nix could not find is a loose git object file, not a nix expression or a store path — so this is git plumbing, not a config defect; and nix was reading the repo's .git directory at all, which only happens if the flake ref handed to it ingests the working directory wholesale (path:<dir>) rather than the git tree (git+file://<dir>).

A loose object referenced by the just-written commit disappearing between the commit and the read is the signature of a concurrent git repack collapsing loose objects into a pack underneath a reader.

The eval target is the shared standing-rented state dir, not this run's: test-results/standing-rented/state/clan-config. This run's own state/ is empty, and logs/state-logs.log reads:

ERROR: no state logs directory at …/standing-rented/state/logs: ENOENT: no such file or directory

Suspected layer

Product — the clan seam in the operator app (internal/clan), aggravated by shared cross-drive state on the harness side. The failure is a race between clan's own git writes/housekeeping in the config repo and nix's ingest of that same directory; nothing about the node's configuration is wrong.

This drive's in-run healer (logs/healer-claude.out) reached the same conclusion and recorded verifications it ran on the live host. I quote these as its claims, not as facts I re-checked:

"Revision ebb865a of the drive's own config repo evaluates cleanly right now — I ran the exact eval and got /nix/store/qgvjha73pi5nff6028wkq9p12qydzfb2-nixos-system-gateway-….drv, exit 0. git fsck is clean and the 'missing' object 177ffd08… is present (a tree, now packed)."

"nix flake prefetch --json path:/tmp/heal-cold produced a store path that contains .git, with 117 loose-object fanout directories copied in."

pack mtimes 05:17:11.957 → 05:17:12.005, "~30 ms after the final vars commit and inside the failing command"; git count-objects -v → count: 0, in-pack: 133.

it places the failing call at clan vars generate rather than the eval preflight, on the grounds that the preflight branch would have appended "— fix it so the node evaluates, then re-drive" and blocked resumably, which this fault did not — and that generate call site has no retry, while the #461/#542 transient hardening covers only evalReadiness.

I could not re-run any of it. This session is sandboxed to the run directory: test-results/standing-rented/state/clan-config and the internal/clan sources are both unreadable from here, so the healer's line references, the repack timing, and the path: prefetch result are all unverified by me. They should be re-checked by whoever picks this up.

One detail worth a second look when someone does have the sources: nix prints the path with a doubled leading slash — path '//home/swarm/…' — consistent with a ref built by concatenating a scheme onto an already-absolute path.

What plugging it needs

A human ruling first, because the candidate fixes are not interchangeable and each has a cost:

  1. Stop handing .git to nix — swap the path:<dir> ref for git+file://<dir>. Excludes .git from the ingest and kills the race at the root, but changes untracked-file visibility, which matters because clan writes files and commits them mid-run. Must be proven against a real clan run, and touches every call site that builds this ref.
  2. Give the failing call the transient hardening the eval preflight already has — needs a discriminator scoped to <repo>/.git/objects/**; a bare does not exist match would retry genuine config errors, which print the same shape, and that would trade a loud red for a silent spin.
  3. Find and stop the repacker. This is the open question: the healer reports ruling out nix, clan-cli, and git auto-maintenance by test on that box, so nothing yet owns the repack. Until it is named, options 1–3 are all partly guesswork. Pinning gc.auto=0 / maintenance.auto=false where the config repo is created is cheap belt-and-braces but unproven on its own.

Preserve the evidence before re-driving. The repo this red is about survives only at the shared path test-results/standing-rented/state/clan-config; a trial-reset or the next drive destroys the only copy.

Also in this run (separate, and concrete)

  1. No live-box section was appended to this task, so I diagnosed from the harvested logs alone. The gateway was still up — logs/gateway-do-forensics.txt: "tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did", droplet 595802091 status: active — but the harness's own harvest could not authenticate to it. All four gateway files are one line: "root@209.38.87.90: Permission denied (publickey,keyboard-interactive)." (gateway-journal.txt, gateway-caddy.txt, gateway-stall.txt, gateway-units.txt). So this red carries zero gateway-side evidence. The healer traces this to the evidence harvester dialling with no identity while the rented gateway trusts only the app's per-run key at state/rent-operator/id_ed25519 — a small, self-contained fix, unlike the main fault.
  2. artifacts/journey.json is {"rows": null, "fault": null} — no founding rows captured, despite the fault being fully recorded in legs.json and founding-state.log.
  3. logs/droplet-journal.txt does not exist in this drive under that name. The equivalents present are device-journal.txt (the added device, 134.199.151.161, healthy: sshd listening, no failed units) and the empty gateway-journal.txt above. logs/broker-journal.txt is also a permission-denied stub, which #681 says is by design off-mesh.
  4. The healer records this signature (25304f657c24) as having redded three consecutive drives, with two prior self-fixes landing on evidence-harvest surfaces rather than on this fault.

drive 20260828T051317Z red at enroll-configure: journey leg "enroll-configure" went red: founding: stand up the rented server: clan: config_eval on gateway: the node's config does not evaluate: error: error: path '//home/swarm/swarm/Matou/idss/test
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T051317Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure Drive `20260828T051317Z`, target `device`, commit `bd9796b5`. `artifacts/verdict.json`: ```json {"verdict": "red", "firstRedLeg": "standing", "legs": {"total": 10, "green": 8, "red": 2, "skip": 0}} ``` Eight legs green (`wizard-rent` → `claim` → `create` → `image-boot` → `connect` → `point-row` → `seed` → `supply`). The two reds are `enroll-configure` and its wrapper `standing`, carrying the same fault verbatim in `artifacts/legs.json`: ``` "leg": "enroll-configure", "status": "red", "ms": 16221, "error": "journey leg \"enroll-configure\" went red: founding: stand up the rented server: clan: config_eval on gateway: the node's config does not evaluate: error: error: path '//home/swarm/swarm/Matou/idss/test-results/standing-rented/state/clan-config/.git/objects/17/7ffd08eaf2d8c3628053a9f00e9605218b41e1' does not exist" ``` **This is not the KNOWN frontier.** `legs.json` records `"skip": 0` and carries no skip reasons at all, so nothing in this drive's own records names anything as out of scope. The own-VPS pairing carrier never came into play either — this is the RENTED path, and `logs/founding-state.log` shows the pairing stage passing by design: > `"stage": "pairing", "message": "the app connects to the rented server over its own key — no device-end consent (a fresh server has nothing to erase)"` The drive died two stages later, founding the gateway. Device-add never ran. ## The evidence lines `logs/founding-state.log`, the last three `enroll-configure` events in order: > `"configuring the gateway on the rented server (clan update, no takeover) — eval preflight, then the machine vars"` > `"takeover-ready node config committed"` > `"the node's config does not evaluate: error: path '…/clan-config/.git/objects/17/7ffd08eaf2d8c3628053a9f00e9605218b41e1' does not exist"` The commit into the config repo **succeeded**, and the very next clan step failed reading a file out of that same repo's `.git/objects/`. Two things follow from the path alone: the thing nix could not find is a **loose git object file**, not a nix expression or a store path — so this is git plumbing, not a config defect; and nix was reading the repo's `.git` directory at all, which only happens if the flake ref handed to it ingests the working directory wholesale (`path:<dir>`) rather than the git tree (`git+file://<dir>`). A loose object referenced by the just-written commit disappearing *between the commit and the read* is the signature of a concurrent `git repack` collapsing loose objects into a pack underneath a reader. The eval target is the **shared** standing-rented state dir, not this run's: `test-results/standing-rented/state/clan-config`. This run's own `state/` is empty, and `logs/state-logs.log` reads: > `ERROR: no state logs directory at …/standing-rented/state/logs: ENOENT: no such file or directory` ## Suspected layer **Product — the clan seam in the operator app** (`internal/clan`), aggravated by shared cross-drive state on the harness side. The failure is a race between clan's own git writes/housekeeping in the config repo and nix's ingest of that same directory; nothing about the node's configuration is wrong. This drive's in-run healer (`logs/healer-claude.out`) reached the same conclusion and recorded verifications it ran on the live host. I quote these as **its claims, not as facts I re-checked**: > "Revision `ebb865a` of the drive's own config repo evaluates cleanly right now — I ran the exact eval and got `/nix/store/qgvjha73pi5nff6028wkq9p12qydzfb2-nixos-system-gateway-….drv`, exit 0. `git fsck` is clean and the 'missing' object `177ffd08…` is present (a tree, now packed)." > "`nix flake prefetch --json path:/tmp/heal-cold` produced a store path that **contains `.git`**, with 117 loose-object fanout directories copied in." > pack mtimes `05:17:11.957 → 05:17:12.005`, "~30 ms after the final vars commit and inside the failing command"; `git count-objects -v` → `count: 0, in-pack: 133`. > it places the failing call at `clan vars generate` rather than the eval preflight, on the grounds that the preflight branch would have appended "— fix it so the node evaluates, then re-drive" and blocked resumably, which this fault did not — and that `generate` call site has no retry, while the `#461`/`#542` transient hardening covers only `evalReadiness`. **I could not re-run any of it.** This session is sandboxed to the run directory: `test-results/standing-rented/state/clan-config` and the `internal/clan` sources are both unreadable from here, so the healer's line references, the repack timing, and the `path:` prefetch result are all unverified by me. They should be re-checked by whoever picks this up. One detail worth a second look when someone does have the sources: nix prints the path with a doubled leading slash — `path '//home/swarm/…'` — consistent with a ref built by concatenating a scheme onto an already-absolute path. ## What plugging it needs A human ruling first, because the candidate fixes are not interchangeable and each has a cost: 1. **Stop handing `.git` to nix** — swap the `path:<dir>` ref for `git+file://<dir>`. Excludes `.git` from the ingest and kills the race at the root, but changes untracked-file visibility, which matters because clan writes files and commits them mid-run. Must be proven against a real clan run, and touches every call site that builds this ref. 2. **Give the failing call the transient hardening the eval preflight already has** — needs a discriminator scoped to `<repo>/.git/objects/**`; a bare `does not exist` match would retry genuine config errors, which print the same shape, and that would trade a loud red for a silent spin. 3. **Find and stop the repacker.** This is the open question: the healer reports ruling out nix, clan-cli, and git auto-maintenance by test on that box, so nothing yet owns the repack. Until it is named, options 1–3 are all partly guesswork. Pinning `gc.auto=0` / `maintenance.auto=false` where the config repo is created is cheap belt-and-braces but unproven on its own. **Preserve the evidence before re-driving.** The repo this red is about survives only at the shared path `test-results/standing-rented/state/clan-config`; a `trial-reset` or the next drive destroys the only copy. ## Also in this run (separate, and concrete) 1. **No live-box section was appended to this task**, so I diagnosed from the harvested logs alone. The gateway was still up — `logs/gateway-do-forensics.txt`: `"tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did"`, droplet `595802091` `status: active` — but **the harness's own harvest could not authenticate to it**. All four gateway files are one line: `"root@209.38.87.90: Permission denied (publickey,keyboard-interactive)."` (`gateway-journal.txt`, `gateway-caddy.txt`, `gateway-stall.txt`, `gateway-units.txt`). So this red carries **zero gateway-side evidence**. The healer traces this to the evidence harvester dialling with no identity while the rented gateway trusts only the app's per-run key at `state/rent-operator/id_ed25519` — a small, self-contained fix, unlike the main fault. 2. **`artifacts/journey.json` is `{"rows": null, "fault": null}`** — no founding rows captured, despite the fault being fully recorded in `legs.json` and `founding-state.log`. 3. **`logs/droplet-journal.txt` does not exist** in this drive under that name. The equivalents present are `device-journal.txt` (the added device, `134.199.151.161`, healthy: sshd listening, no failed units) and the empty `gateway-journal.txt` above. `logs/broker-journal.txt` is also a permission-denied stub, which #681 says is by design off-mesh. 4. The healer records this signature (`25304f657c24`) as having **redded three consecutive drives**, with two prior self-fixes landing on evidence-harvest surfaces rather than on this fault. drive `20260828T051317Z` red at `enroll-configure`: `journey leg "enroll-configure" went red: founding: stand up the rented server: clan: config_eval on gateway: the node's config does not evaluate: error: error: path '//home/swarm/swarm/Matou/idss/test` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T051317Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: a26965b5356b -->
Author
Member

Close report — ADR 0174 ruling (veto anytime)

This was a duplicate. While this session was diagnosing, the swarm's #923 landed a fix for the same bug (same drive 20260828T051317Z, same sig 25304f657c24) and is already closed on main. I hit it as a rebase conflict on internal/clan/configrepo.go, reconciled cleanly, and kept only the piece #923 was missing.

The diagnosis (confirmed against sources the failing session couldn't read)

The failing session was sandboxed away from internal/clan; this standing session read it. The fault is a git-auto-maintenance race on the config repo, exactly as the ticket's "suspected layer" reasoned:

  • internal/clan/configrepo.go:ensureStore git inited the repo with git's background housekeeping on.
  • clan vars generate reads the working tree via a path:<dir> flake ref (flakeRef(dir, ""), adapter.go:778) — which copies the whole .git/objects/** into the nix store.
  • clan-cli's own commit inside that same vars generate triggers git's post-command run_auto_maintenance, which repacks the loose objects out from under that concurrent copy → nix dies reading …/.git/objects/17/177ffd… does not exist.
  • The healer's placement at vars generate (not the eval preflight) is correct and now explained by code: evalReadiness (adapter.go:657) retries any non-zero eval up to 3× (#461/#542), so the eval preflight survives this race; the fault only ever lands at the no-retry path: sites (vars generate, flake archive, flake lock). That the drive did not recover is itself the proof it wasn't the preflight.
  • The doubled-slash detail (path '//home/…') is consistent with the path: copy of the live .git (clan-cli's own re-emitted ingest path), not load-bearing for the fix.

What landed (f618a6ce)

#923 fixed it two ways: (1) a bounded settle-retry on generate scoped to the .git/objects/** signature (isTransientGitRepack), and (2) a gc pin applied only on fresh git init.

The gap #924 closes: (2) never hardens the persistent standing-rented config repo — it was git inited long before either pin existed, so a fresh-init-only pin leaves the exact repo that redded retry-only until a trial-reset recreates it. My change moves the pin into pinOffAutoMaintenance, called on every ensureStore (idempotent git config --local; #923's duplicate inline block folded in), adds gc.autoDetach=false, and hardens that persistent repo in place on its next mutation, no state wipe.

  • Red-first: internal/clan/configrepo_provision_test.go — TestConfigRepo_ProvisionDisablesGitAutoMaintenance, TestConfigRepo_HardensAPreExistingUnpinnedRepo.
  • CGO_ENABLED=0 go build ./... && go vet ./internal/clan && go test ./internal/clan all green (coexists with #923's generate_repack_retry_test.go / configrepo_repack_test.go).
  • GOTCHAS #111; STATUS.md updated (#924 lead, #923 prior lead).

Honest residue

  • Live confirmation is deferred, not skipped. The bug is intermittent (3 consecutive reds, not every drive), so a single green re-drive would not be conclusive proof, and re-driving destroys the only preserved copy of the evidence at test-results/standing-rented/state/clan-config. The fix is seam-proven (the pin is applied) and the mechanism is now fully explained; the retry (#923) is the load-bearing backstop and the pin is belt-and-braces. Preserve that path before the next drive/trial-reset if a live post-mortem is still wanted.
  • Separate same-run residues, filed: the evidence-harvester dialling the rented gateway with no SSH identity (zero gateway-side evidence) is already tracked as #926; artifacts/journey.json serialising {"rows":null,"fault":null} is now #928.
  • Not acted on: droplet 595802091 (209.38.87.90) was still active at harvest time — a lab-spend/cleanup item outside this ticket, left to the reaper / a clan-lab sweep rather than destroyed blind from here.
  • #923's own follow-up (Option 1 — swap path: for git+file:// to drop .git from the ingest at nine call sites; needs a live clan run to prove untracked-file visibility) stands as the deeper root fix.

Ruled by agent under ADR 0174 — a revertible config change on an ephemeral repo, proven-set by the seam tests; veto anytime. Closing as resolved (a completion of #923).

## Close report — ADR 0174 ruling (veto anytime) **This was a duplicate.** While this session was diagnosing, the swarm's **#923** landed a fix for the *same* bug (same drive `20260828T051317Z`, same sig `25304f657c24`) and is already closed on `main`. I hit it as a rebase conflict on `internal/clan/configrepo.go`, reconciled cleanly, and kept only the piece #923 was missing. ### The diagnosis (confirmed against sources the failing session couldn't read) The failing session was sandboxed away from `internal/clan`; this standing session read it. The fault is a **git-auto-maintenance race on the config repo**, exactly as the ticket's "suspected layer" reasoned: - `internal/clan/configrepo.go:ensureStore` `git init`ed the repo with git's background housekeeping **on**. - `clan vars generate` reads the working tree via a `path:<dir>` flake ref (`flakeRef(dir, "")`, `adapter.go:778`) — which copies the whole `.git/objects/**` into the nix store. - clan-cli's own commit inside that same `vars generate` triggers git's post-command `run_auto_maintenance`, which **repacks the loose objects out from under that concurrent copy** → nix dies reading `…/.git/objects/17/177ffd… does not exist`. - The healer's placement at `vars generate` (not the eval preflight) is **correct and now explained by code**: `evalReadiness` (`adapter.go:657`) retries any non-zero eval up to 3× (#461/#542), so the eval preflight *survives* this race; the fault only ever lands at the **no-retry `path:` sites** (`vars generate`, `flake archive`, `flake lock`). That the drive did not recover is itself the proof it wasn't the preflight. - The doubled-slash detail (`path '//home/…'`) is consistent with the `path:` copy of the live `.git` (clan-cli's own re-emitted ingest path), not load-bearing for the fix. ### What landed (`f618a6ce`) #923 fixed it two ways: (1) a bounded settle-retry on `generate` scoped to the `.git/objects/**` signature (`isTransientGitRepack`), and (2) a gc pin applied **only on fresh `git init`**. The gap #924 closes: (2) never hardens the **persistent** `standing-rented` config repo — it was `git init`ed long before either pin existed, so a fresh-init-only pin leaves *the exact repo that redded* retry-only until a `trial-reset` recreates it. My change moves the pin into `pinOffAutoMaintenance`, called on **every** `ensureStore` (idempotent `git config --local`; #923's duplicate inline block folded in), adds `gc.autoDetach=false`, and hardens that persistent repo **in place on its next mutation, no state wipe**. - Red-first: `internal/clan/configrepo_provision_test.go` — `TestConfigRepo_ProvisionDisablesGitAutoMaintenance`, `TestConfigRepo_HardensAPreExistingUnpinnedRepo`. - `CGO_ENABLED=0 go build ./... && go vet ./internal/clan && go test ./internal/clan` all green (coexists with #923's `generate_repack_retry_test.go` / `configrepo_repack_test.go`). - GOTCHAS **#111**; STATUS.md updated (#924 lead, #923 prior lead). ### Honest residue - **Live confirmation is deferred, not skipped.** The bug is intermittent (3 consecutive reds, not every drive), so a single green re-drive would not be conclusive proof, and re-driving destroys the only preserved copy of the evidence at `test-results/standing-rented/state/clan-config`. The fix is seam-proven (the pin is applied) and the mechanism is now fully explained; the retry (#923) is the load-bearing backstop and the pin is belt-and-braces. **Preserve that path before the next drive/trial-reset** if a live post-mortem is still wanted. - **Separate same-run residues, filed:** the evidence-harvester dialling the rented gateway with no SSH identity (zero gateway-side evidence) is already tracked as **#926**; `artifacts/journey.json` serialising `{"rows":null,"fault":null}` is now **#928**. - **Not acted on:** droplet `595802091` (`209.38.87.90`) was still `active` at harvest time — a lab-spend/cleanup item outside this ticket, left to the reaper / a clan-lab sweep rather than destroyed blind from here. - **#923's own follow-up** (Option 1 — swap `path:` for `git+file://` to drop `.git` from the ingest at nine call sites; needs a live clan run to prove untracked-file visibility) stands as the deeper root fix. Ruled by agent under ADR 0174 — a revertible config change on an ephemeral repo, proven-set by the seam tests; veto anytime. Closing as resolved (a completion of #923).
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.

Reference
Matou/idss#924
No description provided.