Skip to content

Standing auto-update system: laptop (NixOS rectifier) + sandbox seats + Cloudflare — design + tracking #14134

Backlog

Description

@developing-today-fleet

Standing auto-update system — design + tracking

Drew's order (2026-11-24 00:22 CST): "ensure all daemons in laptop and muse agent and cloudflare are always automatically kept updated. ideally nixos should update laptop but allow override. perhaps home manager override temporarily and rectified in nixos build. all binaries and services nix pkgs."

Design of record: dated record doc/2026-11-24T06-25-30Z_design_auto-update-system/ (PR linked in the comments when landed).

The model in brief

"Always updated" = for every daemon/binary/service: a pin names the intended version, an automatic gated path converges the running thing to the pin, a drift census verifies running == pin, and a failed update never replaces the running version.

  • Laptop — the NixOS build is the rectifier. Pin = the flake on main (github:developing-today/code/main#amd, already the build source per mcpx e2e: TestFileScriptPrefixRunsBeforeTopLevelCode fails on main — amd system build blocked #12428). A scheduled gated rebuild (build → checks → switch → health probes) converges the whole machine; Nix generations are the retained rollback. Today system.autoUpgrade is set nowhere and rebuilds are run by hand.
  • Overrides — home-manager first, the build rectifies. An override (a fast user-level fix applied ahead of the system build) is recorded in a ledger in the repo at apply time, with a probe proving the fix is live. The rebuild cycle rectifies: if the flake on main now expresses the change, the build absorbs it and the probe verifies it survived; if not, the fix is landed on main first or re-applied on top. Hard rule: a switch that would silently revert a recorded live fix is held and surfaced loudly — never applied.
  • Muse sandbox — converge to the pin at safe windows. Seat binaries (fleet, tailscale, bws, op, restic) are hand-placed drops today; init/heal gains an update leg that fetches + hash-verifies the pinned build and swaps at safe restart windows (never mid-refresh; liveness is automated today, versions are not).
  • Cloudflare — every Worker on the pipeline. Pin = main. The console-edge pattern (CI build → health gate on deployed commit → promote) generalises to every production Worker; PM Workers join via PM stack: migrate fully to Cloudflare hosting (fallbacks: CF Tunnel, then Tailscale DNS) #14107's M-slices. By-hand wrangler deploy retires Worker by Worker. (pm-aggregator deployment is 4,687 commits behind main (2026-11-15 build) — PM apps must follow main #14059 — a deploy 4,687 commits stale, unalarmed — is what this prevents.)

Slice map (ordered, independently landable; queued by Archer — not yet)

  • U1 — Drift census v1. Read-only pinned-vs-running census across the three planes, scheduled, one report. Foundation for verifying everything after.
  • U2 — Laptop auto-rebuild. Gated scheduled rebuild+switch from GitHub main; health probes; generation retention; hold-and-surface on failure.
  • U3 — Fleet as the flake package. pkgs/fleet/default.nix exists but the laptop runs a hand-copied binary (+ a pile of .bak files); U3 makes laptop fleet + brokers the flake package and rebases the sandbox pin on the same output.
  • U4 — Override protocol. Ledger, home-manager apply recording, pre-switch divergence gate (no silent revert), post-switch probes, escalation window.
  • U5 — Sandbox pin convergence. init-ensure update leg + heal-safe swap windows.
  • U6 — Cloudflare pipeline generalisation (non-PM). Publish → health-gate → promote for every remaining production Worker; standard commit-reporting snippet.
  • U7 — Exception burn-down. Package or formally exception-list each remaining offender (see below).

What contradicts the model today (from the 2026-11-24 inventory)

  • fleet: package exists, deployment doesn't use it — hand-copied binary on the laptop, hand-placed drops in the sandbox.
  • Vendor self-updaters (claude, codex): update outside Nix entirely; cannot be packages without abandoning vendor channels. Design exception-lists them (version-probed, lag reported). Package-or-not is an open decision for Drew (needed at U7, not before).
  • clef-proxy runs from a checkout; fff-mcp and a stale atlas-search-6788 sit as side binaries beside managed ones; codebase-memory-mcp is an npm-global install.
  • Docker products (pm-grist, pm-pad): images outside the flake build — bridge is digest-pinning in flake-defined config; their store programmes own the rest.
  • pm-console redeploys from a live checkout by timer — the checkout is the pin, not the flake (PM stack: migrate fully to Cloudflare hosting (fallbacks: CF Tunnel, then Tailscale DNS) #14107 addresses the PM tier specifically).

Existing work this composes with (not duplicates)

#14107 / PR #14124 (PM Cloudflare pipeline + commit-age drift), #12428 (laptop rebuild record), #14099 (gh-cache ensure leg), daily flake sync + flake-inputs-update workflow (input freshness — this design adds convergence of running systems to those pins), #8546 (id world update channels — a different plane, name collision only).

Activity

  1. developing-today commented on Nov 24, 2026

    @developing-today
    Contributor
  2. added a commit that references this issue on Nov 24, 2026
  3. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    ContributorAuthor

    Design landed: PR #14144 — #14144 (merged 9af025f471f7). Record: doc/2026-11-24T06-25-30Z_design_auto-update-system/, indexed in doc/README.md.

    Summary of what the design settles:

    • Guarantee shape: pin → converge → verify → fail safe, on all three planes. One daily drift census is the evidence; silence means converged.
    • Laptop: the flake on main is the pin; a gated scheduled rebuild+switch is the converger (health probes, generation retention, automatic rollback on a failed probe, hold-and-surface instead of retry loops). system.autoUpgrade is set nowhere today — this is the gap U2 closes.
    • Override protocol: home-manager overrides are ledger entries written at apply time, each carrying a probe that proves the fix is live. The rebuild rectifies (flake absorbs → probe verifies → entry closes) or lands the fix on main first / re-applies on top. A switch that would silently revert a recorded live fix is held and surfaced, never applied. Unrectified after N cycles (suggested 3) escalates to needs-you.
    • Sandbox: seats converge to the bootstrap pin at boot / heal-safe windows — fetch, hash-verify, swap at a daemon's next safe restart, never mid-flight (the secrets broker's swap queues past any in-progress refresh).
    • Cloudflare: every production Worker onto CI build → health gate (deployed commit == merge commit) → promote; PM Workers arrive via PM stack: migrate fully to Cloudflare hosting (fallbacks: CF Tunnel, then Tailscale DNS) #14107's M-slices; by-hand deploys retire per Worker.
    • Package-everything: the migration list and exception list are in §6 of the design. Headline contradiction: pkgs/fleet/default.nix exists, but the laptop runs a hand-copied fleet binary with hand-kept .bak predecessors, and the sandbox runs hand-placed drops — U3 fixes the deployment, not the packaging.

    Slices U1–U7 stand as listed in the issue body — named and ordered, not queued (Archer queues U1 from here).

    Open decisions recorded in the design (§8): vendor self-updaters package-or-exception (Drew, needed at U7); U2 cadence/window and the override escalation N (Archer at slice time).

  4. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    ContributorAuthor

    Slice U1 packetised — task 21690

    Per the slice map in the design of record (PR #14144; summary in comment 7123988057 above), slice U1 — drift census v1 is now queued:

    • Task 21690 on queue repo-health-code-pilot, priority 40, kind feature_slice, dedupe key repo-health:v1:slice:developing-today/code:issue:14134:slice-1. Packet validated (fleet queue validate: valid), dry-run clean, enqueued via the laptop client, and verified by read-back (fleet queue show 21690). It has already been claimed by a build lane.
    • Packet scope, per the design's census section: one scheduled, read-only census comparing pinned vs running versions across all three planes — laptop (flake on main vs live generation + service versions), Muse sandbox (bootstrap pin vs seat binary/daemon versions), Cloudflare (main vs each production Worker's deployed commit, consuming PM stack: migrate fully to Cloudflare hosting (fallbacks: CF Tunnel, then Tailscale DNS) #14107's commit-age machinery rather than building a second drift system). Per service: pinned version, running version, lag age, state (converged / pending / held / drifted), open overrides, held updates. One report per run filed here (or on a successor); silence when converged; a PM needs-you summary only when an update is held or drift exceeds its window.
    • Hard rule carried in the packet: the census never fixes — no restarts, swaps, deploys, or writes to any running system. It is the evidence the converge paths are judged by.
    • U1 is named in the packet as the foundation slice: U2–U7 are each verified by this census, and its state vocabulary is the one they must report in.

    Slices U2–U7 are not queued — U1 only, as directed.

    — Lane AUTO-UPDATE-U1-PACKET, 2026-11-24.

  5. dezren39 commented on Nov 24, 2026

    @dezren39
    Member

    U1 is checkpointed without code changes. The prerequisite review found that #14107/#14124 are design-only: no deployed-commit/commit-age input exists in this checkout for the Cloudflare plane. The scheduled three-plane acceptance also cannot be verified from this seat: fleet shell targets reports laptop and Codespace unreachable, and no reachable Muse sandbox read-only version probe is available. I am parking rather than adding a mock-only core that cannot produce the specified report. Resume when #14107 M1 exposes the deployed-commit input and laptop + Muse sandbox read-only probes are reachable; then implement the scheduled report and update doc/fleet-schedule-registry.md in the same change.

  6. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    ContributorAuthor

    U1 — Drift census v1, run 2026-11-24T09:45Z

    First run of the §4 census (design of record: doc/2026-11-24T06-25-30Z_design_auto-update-system/). Read-only throughout — nothing was restarted, swapped, deployed, or written on any plane. Per service: pinned version, running version, lag age, state (converged / pending / held / drifted), open overrides, held updates.

    Reference points at census time. Main HEAD: a838068cbf89 (2026-11-24 03:41 CST). Sandbox pin source: scripts/muse/bootstrap.sh on main. Laptop pin: the flake on main (#amd). Cloudflare pin: main, per Worker.

    Blocker re-check against the 06:43Z park note: the laptop was reachable this run (fleet shell targets reports it reachable via the laptop-agent, and direct probes answered promptly — its state changed since the park). The sandbox plane is probed from the seat itself. The Cloudflare deployed-commit input does exist in one place — wrangler deployment annotations (below) — but only one Worker writes them.

    Plane 1 — Muse sandbox (this seat, muse, 100.107.76.35)

    Component Pinned Running State
    fleet (~/tools/fleet) release fleet-static-74eee89, rev 74eee892e (2026-11-23 21:21 CST), sha256 27eedcf9… rev 7b54ce5d6a2e (2026-11-24 00:18 CST), sha256 abcd1116… drifted — running is ~3h of history AHEAD of the pin; the seat was updated by hand and the bootstrap pin has not been moved yet
    bws 2.1.0 2.1.0 converged
    restic 0.20.0 0.20.0 converged
    tailscale / tailscaled 1.104.7 1.104.7 (the :3130 outbound-proxy relay is tailscaled itself) converged
    op (1Password CLI, ~/tools/bin/op) no pin exists in bootstrap.sh 2.41.0 unpinned — pin gap; the design's §2.2 inventory lists op as a seat binary but the bootstrap script pins only fleet/bws/restic/tailscale
    Seat daemons (secrets broker, session proxy broker) fleet pin run from ~/tools/fleet (7b54ce5) drifted, follows fleet
    gh cache daemon (seat-local :4802) — not running on this seat (connection refused); fleet gh falls back to in-process resolution n/a — the cache leg lives on the laptop

    Open overrides: none (no ledger exists until U4). Held updates: none.

    Plane 2 — Laptop (amd-6) — reachable this run

    system.autoUpgrade is set nowhere in the flake on main (grep: no matches) — there is no converger yet, so drift here is the expected pre-U2 condition.

    Component Pinned Running Lag State
    NixOS system (amd) flake @ main a838068c (2026-11-24 03:41 CST) generation built 2026-11-23 04:12 CST; NixOS 26.11.20261102.f9887a8. configurationRevision is unset, so the exact source rev of the running generation is not recorded by the system itself — build time is the evidence ~23.5 h drifted (rebuilds are manual until U2)
    fleet (~/.local/bin/fleet, hand copy) pkgs/fleet from the flake @ main rev 74eee892e (0.1.0-dev+g74eee89), file dated 2026-11-23 21:36 CST ~6 h 20 m behind main HEAD drifted — this is U3's subject
    tailscale flake 1.104.4 (seat pin is 1.104.7, for comparison) — noted
    Generation retention floor set by U2 21 system generations present — ok

    Open overrides: none recorded (ledger arrives with U4). Held updates: none.

    Plane 3 — Cloudflare (pin = main a838068c for every Worker)

    Read access: wrangler deployments list per Worker via ~/tools/cloudflare/wrangler-authed.py with the broker-cached token named cloudflare.api-token-account-wide (piped on stdin; value never printed or stored).

    Converged (1). pm-console-edge — the only Worker whose deployments annotate the source commit: deployed commit b740ff9883a4 at 2026-11-24T09:40:27Z, an ancestor of main, 6 commits behind HEAD (~3 min of commit time). The publish → health-gate → promote pipeline is live and current.

    Deployed, but deployed commit unmeasurable (14). These Workers have deployments but write no commit annotation, so pinned-vs-running cannot be computed until they gain the standard commit-reporting snippet (U6) or #14107's commit-age machinery lands. Last deployment before the census, as the only available signal:

    Worker Last deployed (UTC) Age at census
    message-bridge 2026-11-24 06:07 3 h 37 m
    mcpx 2026-11-23 21:09 12 h 36 m
    desktop-commander 2026-11-23 17:11 16 h 33 m
    atlas-search 2026-11-23 03:04 1 d 7 h
    muse-agent-handoff 2026-11-22 04:33 2 d 5 h
    queue-transport-alert 2026-11-19 05:46 5 d 4 h
    voice-line 2026-11-16 10:33 7 d 23 h
    github-ci 2026-11-14 14:21 9 d 19 h
    decision-events 2026-11-13 05:28 11 d 4 h
    developing-today-backup 2026-11-04 15:22 19 d 18 h
    pkarr 2026-10-31 23:25 23 d 10 h
    cf-container-hello 2026-10-26 14:52 28 d 19 h
    lab-ops-hub 2026-10-26 01:24 29 d 8 h
    cold-store-rehydrator 2026-10-26 01:16 29 d 8 h

    Not deployed (5). Repo wrangler configs exist, but the Cloudflare API answers 10007 "This Worker does not exist on your account" (verified individually for each): pm-notify (pm-stack/notify-relay), fleet-hosted, id-hosted-worker, id-d1-journal-poc (PoC), id-worker-poc (PoC). State: config-only, nothing running to drift.

    Summary

    • Converged: sandbox bws, restic, tailscale; Cloudflare pm-console-edge.
    • Drifted: sandbox fleet + its daemons (ahead of pin — pin needs its reviewed move, U5/U3); laptop system generation (~23.5 h, no converger until U2); laptop fleet (~6 h behind main, U3).
    • Unmeasurable: 14 Cloudflare Workers (no deployed-commit annotation); laptop generation's exact source rev (configurationRevision unset).
    • Unpinned: seat op has no bootstrap pin.
    • Not deployed: 5 repo-configured Workers do not exist on the account.
    • Held updates / open overrides: none on any plane (the override ledger does not exist until U4).

    Not yet stood up by this run: the daily scheduling of the census itself (this is the v1 report the schedule will produce; the schedule-registry entry belongs with the scheduling change). The census never fixes — every drift item above routes to its slice (U2/U3/U5/U6), not to this report.

    — Lane for task 21690 (worker felix), 2026-11-24.

  7. added
    queue/claimed
    work/assigned
    status/in-progress
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    queue/claimedstatus/in-progressstatus:in-reviewwork/assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions