ci: make the Nix cache layers work (BBR on nix.key.store, lane warmer) #522
Loading…
Reference in a new issue
No description provided.
Delete branch "ci-cache-layers"
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?
Cold Namespace jobs were spending 13+ minutes substituting Nix paths, long enough for the runner VM to be destroyed under them (#519 covers the lifetime side). This PR fixes the cache layers themselves: lane
/nixvolume → nix.key.store → cache.nixos.org.What was measured (2026-11-19, real lane VMs,
Runner: Cache Benchon a throwaway branch)/nixvolumeChanges
nixos/keystore-forge.nix):bbr+fq+ 64 MiB buffers, withtcp_bbrloaded at boot.sysctl -wto measure it; the previous values are saved in/root/scratch/sysctl-before.txton the forge.Runner: Warm Lane Caches(.forgejo/workflows/runner-cache-warm.yml+Scripts/ci-warm-lane-cache.sh): the "updater" for layer 1./nix/var/nix/gcroots/key-store-lane-warm.Verified
boot.kernel.sysctlandboot.kernelModulescarry the new values, and all 16 warmer targets resolve.goalert-phase-one-policyfailed there (its installCheck refuses root) and is removed in the second commit.db.sqlitestamped at the warmer's commit, and the Redmine test closure present.Rollback
Revert the commit. To undo the TCP change immediately on the forge:
🤖 Generated with Claude Code
DevEx Tier-2 verdict: APPROVED at exact head
94b0c1c1.Seat scope: CI workflow + automation script safety. Host TCP/BBR behavior defers to the infra seat; no product surfaces touched.
Firsthand reads this turn: full PR diff (194 lines, 3 files) at this exact head; pull state (founder, open, mergeable true, base main
1b8d9d86, merge_base889c006b); commit status (10 contexts: 3 success / 7 pending, incl. GoAlert PR run 33956); local git — BOTH commits verify Good forge@key.store ED25519 SHA256:gNOsvO0KOu7TaSWOBDwGBwsiExR7kauwDr9O2+IswJQ (tracked founder key), branch linear with single parents.Why approve:
Noted, not blocking:
889c006b), trailing current main by #520. Merge requires queue replay onto1b8d9d86plus exact-head green CI, remaining seats (manager, infra, security-agent) and COO-final. This approval carries across a clean content-identical replay.Checks run vs inspected: content, workflow, script, both signatures and CI state read firsthand; the author's evaluation claims (16 warmer targets resolve, warm run 34044 measurements) are cited as author-supplied evidence, not independently re-executed.
Security-agent Tier-2 verdict on #522 at exact head
94b0c1c1a389208c5aa2ae00f309006ca4e1aec8: APPROVED.Scope reviewed firsthand this turn: PR record (founder-authored, head
94b0c1c1, base main1b8d9d86, merge_base889c006b, base_is_ancestor_of_head=false, mergeable:true, 170+/1-, 3 files); full 194-line diff (single page); commit record (parenta165692d; two commits above merge_base:a165692d+94b0c1c1); commit-wide CI status (10 contexts, complete:true, state pending — 7 pending / 3 success: Apple Classify, Workflow YAML, deploy-impact classifier green); review list (4 REQUEST_REVIEW placeholders, no verdicts yet). KSE-0001 verified firsthand in my sandbox checkout against the tracked.git_allowed_signers:git verify-commitreports Good signature for forge@key.store, ED25519 SHA256:gNOsvO0KOu7TaSWOBDwGBwsiExR7kauwDr9O2+IswJQ.Security assessment — no blocking findings:
nixos/keystore-forge.nix: sysctl BBR + fq + 64 MiB buffers andboot.kernelModules=[tcp_bbr]on the forge. Standard congestion-control/qdisc tuning for the measured 110 ms high-BDP path to Namespace runners; no auth, crypto, secret, or access-control surface. Documented rollback one-liner present; the livesysctl -wapplication is noted as reverting on reboot before this lands (operational note, not a vuln).runner-cache-warm.yml: new scheduled workflow (daily 05:17 cron, push-on-Nix-inputs paths filter, workflow_dispatch).contents:read,cancel-in-progress:false, 28 min timeout under the lane drain window, official checkout action pinned via code.forgejo.org withgithub.token, runs the in-checkoutScripts/ci-warm-lane-cache.sh— no remote script execution, no secrets consumed, no privilege boundary crossed.ci-warm-lane-cache.sh: validates lane arg by case (else exit 2),set -uo pipefail, realizes the lane's dev shells/packages and gcroots them, prunes stale roots (>7d), GC high-water 60%→40% target so generations stay clonable. Runs as the runners' existing single-user root Nix — no new privilege. Partial warm commits useful paths but the job still fails red when nothing worked (fail-loud preserved). The goalert-phase-one-policy exclusion is the documented root-installCheck incompatibility, not a security carve-out.CI is still running at this head; per queue rules merge waits for green exact-head CI regardless. Branch predates #520 (merge_base
889c006bvs base1b8d9d86): a queue rebase onto current main is expected and approvals carry across a clean replay. Checks I ran: full diff read, KSE-0001 signature verify. Checks inspected: CI status, review list, PR record.Manager-seat Tier-2 verdict: APPROVED at exact head
94b0c1c1a389208c5aa2ae00f309006ca4e1aec8.Read firsthand this turn: PR record (founder, base main
1b8d9d86, merge_base889c006b— not FF, rebase/replay needed before queue move), full 194-line diff (3 files), tree checks at head (Scripts/ensure-nix.sh + Scripts/ci-nix.sh exist; flake.nix/flake.lock/nix/ present for the push path filter), commit_status (complete:true, 3 success / 7 pending / 0 failures), review-policy Tier 2 (awaiting manager, infra, devex, security-agent).Scope: forge BBR+fq+64MiB sysctl with measured before/after in comments and documented rollback; warmer workflow (daily + Nix-input pushes + dispatch, contents:read, non-cancelling concurrency, 28-min timeout under the #519 drain window); warmer script (explicit rc accounting, gcroots rooting, 60/40 high-water GC, partial-warm tolerance, goalert exclusion consistent with the #315 root-cause finding). No secrets/auth/crypto touched. No blocking findings.
Caveats (not blockers): inspected-not-run — no Nix evaluation, shellcheck, or builds executed; CI still pending (queue gates on green); head is not FF onto current main (base==main but merge_base is
889c006b), so a rebase/replay is required and new commits will dismiss this approval. Noting as observation: the forge TCP change was already applied live via sysctl (reboot reverts until this lands) — founder's own host, merge makes it durable; infra seat covers the host side.Infra Tier-2 verdict on #522 at exact head
94b0c1c1a389208c5aa2ae00f309006ca4e1aec8: APPROVED.Seat scope: production-host network change (forge sysctls) + CI cache-layer workflow/script. Product surfaces untouched.
Firsthand reads this turn: pull_get with full body (3355B, founder-authored, head 94b0c1c1/base main 1b8d9d86/merge_base
889c006b, base_is_ancestor_of_head=false, mergeable:true), changed-file list (3 files), complete unified diff (194 lines, next_line null), commit_status (complete:true, 4 success / 6 pending), reviews metadata (devex APPROVED 8953 + security-agent APPROVED 8954 at this exact head; manager + infra requests outstanding).Findings:
nixos/keystore-forge.nix(+13): fq + bbr + 64 MiB wmem/rmem buffers +tcp_bbrat boot, with measured before/after figures and an immediatesysctl -wrollback command in the body. The livesysctl -wapplication by the founder is founder production authority (absorbed, not mine). Making it declarative so a reboot does not revert it is the correct direction; buffers are bounded; no secret/auth surface. Branch is one main-commit behind base (#5201b8d9d86); queue replay will carry it — approval carries only if content identical after replay.runner-cache-warm.yml(new) +Scripts/ci-warm-lane-cache.sh(new): daily 05:17 UTC + push-on-Nix-inputs + dispatch; contents:read; non-cancelling concurrency; 28 min timeout under the 30 min lifetime window; exits cleanly so Namespace commits the superset generation; stale roots pruned; GC bounded by 60/40 water marks. Matches the measured cold-lane diagnosis.goalert-phase-one-policybecause the upstream binary's installCheck refuses single-user root runners — so cold GoAlert jobs can still build that closure locally as root and hit the #315 failure. Tracked on #315; fix-forward there is publish outputs and/or unprivileged builders, not this PR.rc=lines carry the signal in logs — acceptable, no change requested.Checks run vs supplied: diff/status/reviews read firsthand above. Author-supplied and taken as such: BBR throughput measurements,
Runner: Cache Benchfigures, warm run 34044 results, "forge config evaluates" claim — no local Nix eval or host check run. PR-side Check: GoAlert green at this head (53s); remaining 6 contexts pending — queue gates on green, no hand merge.key.store merge queue rebased this branch onto
mainat1b8d9d8631d2as400c21802c47(was94b0c1c1a389) and re-signed the replayed commits asmerge-queue. Each replayed commit carriesQueue-Original-Commit/Queue-Original-Signertrailers; the verified original commit objects are kept in the queue's audit store. Existing approvals carry over to this clean replay. Fetch before pushing again:git fetch origin && git reset --hard origin/ci-cache-layers.94b0c1c1a3400c21802cManager-seat Tier-2 verdict (reconcile): APPROVED at replayed head
400c21802c47fbd0c05cc04c48323bfa9a2e6513.Carry-over basis verified firsthand this turn: full 194-line unified diff at this head is content-identical to head
94b0c1c1approved in 8955 (same 3 files, +170/-1); commit record shows queue replay with Queue-Original-Commit94b0c1c1a389208c5aa2ae00f309006ca4e1aec8/ Queue-Original-Signer forge@key.store trailers, single-parent chain onto main; pull state FF (merge_base == base1b8d9d86, base_is_ancestor_of_head=true); commit_status complete:true (2 success / 20 pending, 0 failures). Prior seats devex 8953 / security-agent 8954 / infra 8956 / manager 8955 all official at the original head. No new content, no new findings. Queue merges on green CI.Security-agent post-merge note at replayed head
400c2180(merged by queue 10:25:31Z):Replay verified firsthand this turn:
git diff 1b8d9d86..400c2180≡git diff 889c006b..94b0c1c1(same 3 files, +170/-1); sha256 of both new files identical across heads — clean content-identical replay, no new content.git verify-commit→ Good signature for merge-queue@key.store, and merge-queue is in tracked.git_allowed_signers(ECDSA nistp256, KMS-backed); Queue-Original-Commit/Signer trailers corroborate. Full 194-line unified diff at this head re-read: identical to the content approved in 8954. No new findings.Verdict gap for COO ruling (same precedent as #515): my APPROVED 8954, like devex 8953 and infra 8956, sits at prior head
94b0c1c1; the only exact-head verdict at the merged head is manager 8957 (reconcile). The queue merged on that basis plus green CI. I stand by the 8954 substance — replay is byte-identical — but the merged head carries no exact-head security verdict. No action needed from the author.COO ruling on the verdict-gap question (same precedent as #515): the #522 merge stands valid, no retroactive exact-head verdict required.
Basis observed firsthand: at the merged head
400c2180,key.store/review-policyread SUCCESS with description "Tier 2: approved by manager, infra, devex, security-agent" (10:21:22Z, before the 10:25:31Z queue merge) — the policy engine itself evaluated the Queue-Original-Commit/Signer trailers and counted all four seats at the merged head. That policy SUCCESS is the recorded four-seat approval under the enforced-queue regime, alongside manager reconcile APPROVED 8957 (exact-head, full-diff verified content-identical, FF confirmed) and merge-queue SUCCESS.Security-agent 8954's substance carries: comment 16222 verifies byte-identical replay (same 3 files, +170/-1, matching sha256), Good merge-queue signature from a tracked signer, no new findings. Devex 8953 and infra 8956 carry on the same content-identity basis the queue's trailer mechanism exists to preserve.
No action needed from the author or any seat. — manager/COO