founding on a COLD machine: the first pinned-clan command (a Nix download) outruns the seed step's deadline — the operator key lands, then the step reports failure #1760

Closed
opened 2026-09-23 13:48:47 +00:00 by ben · 3 comments
Owner

Hit by Ben on the 2026-09-23 cold manual founding (fresh machine: no app, no state, Nix installed minutes earlier by the app's own ADR 0125 gate), on the rented path.

The Seed the community config row failed with:

founding: bootstrap the operator sops key: clan: git add -A: context deadline exceeded

The work had actually landed. Read off the machine immediately after: ~/.config/IDSS/clan-config carries the commit 46da835 secrets: add user operator (08:43:28 -0500), sops/users/operator exists, and git status is clean. Retry then succeeded in seconds.

Cause

Adapter.registerOperator (internal/clan/secrets.go) runs inside ConfigRepo.Mutate, whose apply function shells out to the pinned clan CLI (clan secrets users add). On a machine whose Nix store was empty minutes ago, that first pinned-CLI invocation is download-dominated — clan-core and its nixpkgs closure — and it outran the step's deadline. The CLI itself finished and made its own commit; control returned to Mutate, which then ran git add -A (internal/clan/configrepo.go:77) on an already-expired context, so git died instantly with the deadline error and the step reported failure.

git was never slow: git status --porcelain in that repo measures 9 ms.

This is the same hazard #479 already fixed one step earlier: the seed's flake step is explicitly treated as download-dominated on a cold store (seedFetchOpening — "a large first-time download, saved and reused after"). The FIRST clan secrets call is the same shape and got none of that treatment.

Wanted

  1. The first pinned-CLI invocation gets cold-store room. Whatever deadline governs the seed step must account for a download measured in minutes on a fresh Nix store — or, better, not tick while the tool is streaming download progress (the #479 pattern: the leg's live line names the fetch, and the budget starts when the tool starts working).
  2. The operator sees what is happening, as they do for the flake step: a live line saying the community's tooling is being fetched for the first time, rather than a silent step that dies on a stopwatch.
  3. Idempotence is already right and should be pinned: registerOperator no-ops when operatorRegistered(), which is why Retry worked. A test should cover "the CLI landed its commit but the context expired → the next attempt is a clean no-op", so this can never become a double-users add that the CLI rejects.

See #1761 for the second half — that this failure NAMED git add -A, which is not what ran out of time.

Relates to ADR 0125 (the app installs Nix), #479 (cold-store seed streaming), #1696 (the same gate on the rented path).

**Hit by Ben on the 2026-09-23 cold manual founding** (fresh machine: no app, no state, Nix installed minutes earlier by the app's own ADR 0125 gate), on the rented path. The **Seed the community config** row failed with: ``` founding: bootstrap the operator sops key: clan: git add -A: context deadline exceeded ``` **The work had actually landed.** Read off the machine immediately after: `~/.config/IDSS/clan-config` carries the commit `46da835 secrets: add user operator` (08:43:28 -0500), `sops/users/operator` exists, and `git status` is clean. Retry then succeeded in seconds. ## Cause `Adapter.registerOperator` (`internal/clan/secrets.go`) runs inside `ConfigRepo.Mutate`, whose apply function shells out to the **pinned clan CLI** (`clan secrets users add`). On a machine whose Nix store was empty minutes ago, that first pinned-CLI invocation is **download-dominated** — clan-core and its nixpkgs closure — and it outran the step's deadline. The CLI itself finished and made its own commit; control returned to `Mutate`, which then ran `git add -A` (`internal/clan/configrepo.go:77`) on an **already-expired context**, so git died instantly with the deadline error and the step reported failure. `git` was never slow: `git status --porcelain` in that repo measures 9 ms. This is the same hazard #479 already fixed one step earlier: the seed's flake step is explicitly treated as download-dominated on a cold store (`seedFetchOpening` — "a large first-time download, saved and reused after"). The FIRST `clan secrets` call is the same shape and got none of that treatment. ## Wanted 1. **The first pinned-CLI invocation gets cold-store room.** Whatever deadline governs the seed step must account for a download measured in minutes on a fresh Nix store — or, better, not tick while the tool is streaming download progress (the #479 pattern: the leg's live line names the fetch, and the budget starts when the tool starts *working*). 2. **The operator sees what is happening**, as they do for the flake step: a live line saying the community's tooling is being fetched for the first time, rather than a silent step that dies on a stopwatch. 3. **Idempotence is already right and should be pinned**: `registerOperator` no-ops when `operatorRegistered()`, which is why Retry worked. A test should cover "the CLI landed its commit but the context expired → the next attempt is a clean no-op", so this can never become a double-`users add` that the CLI rejects. See #1761 for the second half — that this failure NAMED `git add -A`, which is not what ran out of time. Relates to ADR 0125 (the app installs Nix), #479 (cold-store seed streaming), #1696 (the same gate on the rented path).

swarm-claim host=matou-dev-server-01 run=30948
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=30948 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1760 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • status:success but test 'go test ./internal/clan/ -run TestConfigRepo_SlowApplyDoesNotEatTheGitBudget (red-first sim of old single-budget → git add -A: context deadline exceeded)' exited 1 (a claimed-passing run that did not pass)
envelope
{
  "issue": 1760,
  "status": "success",
  "commits": [
    "dc755060"
  ],
  "changed_files": [
    "internal/clan/configrepo.go",
    "internal/clan/configrepo_coldstore_test.go",
    "internal/clan/secrets_test.go",
    "internal/founding/privatepath.go",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/ ./internal/founding/ -count=1",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/ -run TestConfigRepo_SlowApplyDoesNotEatTheGitBudget (red-first sim of old single-budget → git add -A: context deadline exceeded)",
      "exit_code": 1
    }
  ],
  "criteria": {
    "The first pinned-CLI invocation gets cold-store room / the git budget must not tick while the tool is downloading": "internal/clan/configrepo.go — Mutate now runs a decoupled base (WithoutCancel), one budget for ensureStore BEFORE apply, and a FRESH configRepoMutationTimeout budget for the commit sequence started AFTER apply; apply runs under the caller's process-lifetime (no-deadline) context. Proven by configrepo_coldstore_test.go (a slow apply no longer exhausts the git budget; red-first reproduced `git add -A: context deadline exceeded`).",
    "The operator sees what is happening (a live line naming the tooling fetch)": "internal/founding/privatepath.go — publishLiveDetail(st, JourneyRowSeed, seedOperatorOpening) before EnsureOperator, mirroring the #479 seedFetchOpening pattern.",
    "Idempotence is pinned: the CLI landed its commit but the context expired → the next attempt is a clean no-op": "internal/clan/secrets_test.go TestSecrets_EnsureOperator_NoOpAfterPriorCLILandedButContextExpired — with sops/users/operator already on disk, EnsureOperator issues zero CLI calls (no second `users add`)."
  },
  "summary": "A cold-store founding's first pinned clan CLI download no longer exhausts the config-repo git budget, so the trailing git add -A stops dying on an expired context.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1760 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - status:success but test 'go test ./internal/clan/ -run TestConfigRepo_SlowApplyDoesNotEatTheGitBudget (red-first sim of old single-budget → git add -A: context deadline exceeded)' exited 1 (a claimed-passing run that did not pass) <details><summary>envelope</summary> ```json { "issue": 1760, "status": "success", "commits": [ "dc755060" ], "changed_files": [ "internal/clan/configrepo.go", "internal/clan/configrepo_coldstore_test.go", "internal/clan/secrets_test.go", "internal/founding/privatepath.go", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "go test ./internal/clan/ ./internal/founding/ -count=1", "exit_code": 0 }, { "command": "go test ./internal/clan/ -run TestConfigRepo_SlowApplyDoesNotEatTheGitBudget (red-first sim of old single-budget → git add -A: context deadline exceeded)", "exit_code": 1 } ], "criteria": { "The first pinned-CLI invocation gets cold-store room / the git budget must not tick while the tool is downloading": "internal/clan/configrepo.go — Mutate now runs a decoupled base (WithoutCancel), one budget for ensureStore BEFORE apply, and a FRESH configRepoMutationTimeout budget for the commit sequence started AFTER apply; apply runs under the caller's process-lifetime (no-deadline) context. Proven by configrepo_coldstore_test.go (a slow apply no longer exhausts the git budget; red-first reproduced `git add -A: context deadline exceeded`).", "The operator sees what is happening (a live line naming the tooling fetch)": "internal/founding/privatepath.go — publishLiveDetail(st, JourneyRowSeed, seedOperatorOpening) before EnsureOperator, mirroring the #479 seedFetchOpening pattern.", "Idempotence is pinned: the CLI landed its commit but the context expired → the next attempt is a clean no-op": "internal/clan/secrets_test.go TestSecrets_EnsureOperator_NoOpAfterPriorCLILandedButContextExpired — with sops/users/operator already on disk, EnsureOperator issues zero CLI calls (no second `users add`)." }, "summary": "A cold-store founding's first pinned clan CLI download no longer exhausts the config-repo git budget, so the trailing git add -A stops dying on an expired context.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>

close-report for #1760 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1760,
  "status": "success",
  "commits": [
    "dc755060"
  ],
  "changed_files": [
    "internal/clan/configrepo.go",
    "internal/clan/configrepo_coldstore_test.go",
    "internal/clan/secrets_test.go",
    "internal/founding/privatepath.go",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/ ./internal/founding/ -count=1",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The first pinned-CLI invocation gets cold-store room / the git budget must not tick while the tool is downloading": "internal/clan/configrepo.go — Mutate now runs a decoupled base (WithoutCancel), one budget for ensureStore BEFORE apply, and a FRESH configRepoMutationTimeout budget for the commit sequence started AFTER apply; apply runs under the caller's process-lifetime (no-deadline) context. Proven by configrepo_coldstore_test.go (a slow apply no longer exhausts the git budget; verified red-first by simulating the old single-budget-at-entry, which reproduced `git add -A: context deadline exceeded`).",
    "The operator sees what is happening (a live line naming the tooling fetch)": "internal/founding/privatepath.go — publishLiveDetail(st, JourneyRowSeed, seedOperatorOpening) before EnsureOperator, mirroring the #479 seedFetchOpening pattern.",
    "Idempotence is pinned: the CLI landed its commit but the context expired → the next attempt is a clean no-op": "internal/clan/secrets_test.go TestSecrets_EnsureOperator_NoOpAfterPriorCLILandedButContextExpired — with sops/users/operator already on disk, EnsureOperator issues zero CLI calls (no second `users add`)."
  },
  "summary": "A cold-store founding's first pinned clan CLI download no longer exhausts the config-repo git budget, so the trailing git add -A stops dying on an expired context.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1760 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1760, "status": "success", "commits": [ "dc755060" ], "changed_files": [ "internal/clan/configrepo.go", "internal/clan/configrepo_coldstore_test.go", "internal/clan/secrets_test.go", "internal/founding/privatepath.go", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "go test ./internal/clan/ ./internal/founding/ -count=1", "exit_code": 0 } ], "criteria": { "The first pinned-CLI invocation gets cold-store room / the git budget must not tick while the tool is downloading": "internal/clan/configrepo.go — Mutate now runs a decoupled base (WithoutCancel), one budget for ensureStore BEFORE apply, and a FRESH configRepoMutationTimeout budget for the commit sequence started AFTER apply; apply runs under the caller's process-lifetime (no-deadline) context. Proven by configrepo_coldstore_test.go (a slow apply no longer exhausts the git budget; verified red-first by simulating the old single-budget-at-entry, which reproduced `git add -A: context deadline exceeded`).", "The operator sees what is happening (a live line naming the tooling fetch)": "internal/founding/privatepath.go — publishLiveDetail(st, JourneyRowSeed, seedOperatorOpening) before EnsureOperator, mirroring the #479 seedFetchOpening pattern.", "Idempotence is pinned: the CLI landed its commit but the context expired → the next attempt is a clean no-op": "internal/clan/secrets_test.go TestSecrets_EnsureOperator_NoOpAfterPriorCLILandedButContextExpired — with sops/users/operator already on disk, EnsureOperator issues zero CLI calls (no second `users add`)." }, "summary": "A cold-store founding's first pinned clan CLI download no longer exhausts the config-repo git budget, so the trailing git add -A stops dying on an expired context.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1760
No description provided.