Skip to content

Migration M2: one declaration for the fleet three (laptop-agent, secrets-broker, queue-broker) #5769

Closed

Description

@dezren39

Migration M2 of the deployment-architecture epic (design: PR #5764 §7). Depends on the deploy tool v1.

The fleet's three laptop daemons have three competing declarations:

  1. darwin-nix homeManagerModules.fleet-brokers (services.fleet-brokers.enable → laptop-agent + secrets-broker + queue-broker) — enabled by no machine config; dead code.
  2. Code flake home/common/default.nix lines 876/889 — raw systemd.user.services running fleet serve secrets-broker / fleet serve queue-broker (this is what actually runs the brokers).
  3. A hand-written ~/.config/systemd/user/laptop-agent.service running the Python daemon from ~/laptop-agent/ — while darwin-nix also carries pkgs/laptop-agent (PR ops(dashboard): daily backups of dashboard/orchestration logs + stores — laptop, Google Drive, R2 #1459).

Work:

  • Land ONE services-layer definition per daemon in the code flake (the fleet packages already live there: pkgs/fleet), rendering to the laptop systemd class.
  • Cut over brokers first (health surfaces + fleet clients verify), laptop-agent last (widest client surface — the laptop-ssh shim delegates to it).
  • Archive (don't delete) the superseded unit files and the darwin-nix module until M2 closes; then remove the dead darwin-nix module or re-point it at the services-layer definition.

Acceptance per daemon: health OK on the new generation; one real client call end-to-end (a fleet secrets get by name; a queue enqueue/claim round-trip; an agent exec batch) matching old-path behavior; deploy <daemon> rollback works. On close, this completes code#5343 phase 3 in corrected form (the agent declared as a service, not a switch passenger) — note it there.

Activity

  1. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  2. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 5, 2026
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up for triage (queue task 10175; worker repo-worker-code; lane c8b9355e-319a-4640-8096-7ad19480d151).\n\n

  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Agent note — task 10175 triaged (M2 scope and ordering recorded)

  5. added
    status/triagedTriaged and routed (see agent note)
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
  6. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor

    Agent note — M2 acceptance amended (from issue #6251)

    Per issue #6251, the M2 acceptance in doc/2026-11-04_deployment-architecture-services-layer.md §7 now also requires, per daemon: (1) an explicit Home Manager unit-ownership handoff — the daemon's systemd.user.services declaration in home/common/default.nix is removed (or replaced by a durable override that survives activation) in the same change that proves the migration; and (2) post-activation survival verification — after a subsequent ordinary Home Manager / system activation, the migrated daemon still serves from its deployed services-layer generation. Replacing the live unit files alone does not relinquish Home Manager's ownership, and a later switch could otherwise restore the old broker binaries over the deployed generations.

  7. 61 remaining items

  8. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Released by felix (outcome: done). Secrets-broker cutover verified (health OK on deploy generation 2, real fleet secrets get by name, rollback verb + precondition state recorded); HM definition removal landed as PR #12737; #5769 closed; #5770 unblocked for M3 task 10501.

  9. added a commit that references this issue on Nov 23, 2026
  10. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: closed
    by: agent felix (kind muse, Muse sandbox seat)
    at: 2026-11-22

    Closed: the secrets-broker live cutover is complete and verified (full record: comment 7088498408; the lane's close call did not take, so Felix closes with the record).

    Generation 2 serves from the deploy-registry profile: health {"ok":true,"serving":true,"secrets":212} on a fresh refresh, NRestarts=0; a real fleet secrets get by name (tailscale.auth-key, name only) exits 0 through the new broker; the secrets list matches pre-cutover at 212. The HM definition removal merged as PR #12737. M2 is complete — all three daemons now run from deploy-registry generations.

    The rollback leg, stated exactly: deploy rollback currently refuses by design ("only one generation recorded; rollback needs a previous generation", §4.6 two-generation retention) — the correct guard state after a first successful activation. The mechanism was proven with this tool on queue-broker and laptop-agent on 2026-11-17; until a second generation exists, the escape hatch is the HM restore from the archived unit symlink (~/archive/m2-5769/), the proven Nov 17 recovery pattern. Felix accepts this as the done state rather than a blocker.

    #5770 (M3) is unblocked: its ready condition is satisfied and queue task 10501 re-dispatches as-is.

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions