feat: deploy through bee's target-managed receiver client #3

Merged
agent-navi merged 3 commits from feat/target-managed-client into main 2026-10-28 11:00:36 -04:00
Contributor

DO NOT MERGE until the coordinator has verified host fencing and exact legacy adoption for this group.

What changed

  • flake.nix: the legacy herculesCI = nix-deploy.lib.mkDeploy (or mkDeployDualStatic) effect is replaced with nix-deploy.lib.mkDeployTargetManaged — the reviewed stateless client.
  • flake.lock: nix flake update nix-deploy only; the direct nix-deploy input moves to the reviewed published main pin 2b81308d5f14b4ef47d25c063bf114368e49cd0b. No other lock node changed (verified node-by-node).
  • docs/deployment.md: documents the installed receiver, the group binding, published ancestry / accepted high-water / hold semantics, and the fence -> operator adopt -> switch-client order. Records that the group is prepared, not converted or live.
  • Agent instructions point at docs/deployment.md.

The client writes a target-managed manifest, copies the candidate package and manifest to bee with nix-copy-closure, and runs ssh deploy@bee sudo -n /run/current-system/sw/bin/nix-deploy activate --manifest .... It carries no engine copy, passes no path overrides, and has no fallback path. Ports, health paths, target membership and rollback policy now come from the root-owned inventory; the effect only runs for pushes to main.

Deployment boundary

This PR does not activate anything: the group is still managed: false in the installed inventory, and activate refuses unmanaged groups. Merge only switches which client future main pushes use, after fencing and adoption.

Checks run locally at this head

  • just --list, just check
  • nix flake check (all checks passed, including the herculesCI output)
  • target effect evaluation: herculesCI { primaryRepo.branch = "main"; } yields the deploy effect; manifest contains the expected group/repository/ref/full source commit/package, and the remote command is the activate-only sudo -n call. Non-main branches produce an empty effect.

Group: jeremyk-net (repository jeremy/jeremyk-net).

DO NOT MERGE until the coordinator has verified host fencing and exact legacy adoption for this group. ## What changed - `flake.nix`: the legacy `herculesCI = nix-deploy.lib.mkDeploy` (or `mkDeployDualStatic`) effect is replaced with `nix-deploy.lib.mkDeployTargetManaged` — the reviewed stateless client. - `flake.lock`: `nix flake update nix-deploy` only; the direct nix-deploy input moves to the reviewed published main pin `2b81308d5f14b4ef47d25c063bf114368e49cd0b`. No other lock node changed (verified node-by-node). - `docs/deployment.md`: documents the installed receiver, the group binding, published ancestry / accepted high-water / hold semantics, and the fence -> operator adopt -> switch-client order. Records that the group is prepared, not converted or live. - Agent instructions point at `docs/deployment.md`. The client writes a target-managed manifest, copies the candidate package and manifest to bee with `nix-copy-closure`, and runs `ssh deploy@bee sudo -n /run/current-system/sw/bin/nix-deploy activate --manifest ...`. It carries no engine copy, passes no path overrides, and has no fallback path. Ports, health paths, target membership and rollback policy now come from the root-owned inventory; the effect only runs for pushes to `main`. ## Deployment boundary This PR does not activate anything: the group is still `managed: false` in the installed inventory, and `activate` refuses unmanaged groups. Merge only switches which client future `main` pushes use, after fencing and adoption. ## Checks run locally at this head - `just --list`, `just check` - `nix flake check` (all checks passed, including the `herculesCI` output) - target effect evaluation: `herculesCI { primaryRepo.branch = "main"; }` yields the deploy effect; manifest contains the expected group/repository/ref/full source commit/package, and the remote command is the activate-only `sudo -n` call. Non-main branches produce an empty effect. Group: `jeremyk-net` (repository `jeremy/jeremyk-net`).
Replace the legacy mkDeploy/mkDeployDualStatic herculesCI effect with
nix-deploy.lib.mkDeployTargetManaged and pin nix-deploy to the reviewed
2b81308 revision.

The client writes a target-managed manifest, copies the candidate package to
bee and calls the root-installed nix-deploy activate entrypoint. It ships no
engine copy and has no fallback path. Group membership, ports, health paths
and rollback policy now live in the root-owned inventory, so this prepares the
client only: the group stays unmanaged until fencing and operator adoption.
docs: describe the target-managed deploy client and its cutover
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
60cef430fd
Add docs/deployment.md covering the installed receiver, the group binding,
published ancestry/high-water/holds semantics, and the fence -> adopt ->
switch-client order. It records that the group is prepared, not converted or
live, and points the agent instructions at it.
docs: state rollout gates and defer shared protocol to nix-deploy
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
6b0b3ea65c
The opening paragraph asserted that the group was unmanaged and that merging
this client alone changed nothing; both go stale once host policy enables the
group and an operator adopts the verified release, because a main merge then
triggers deployment automatically. Describe the durable precondition instead.

Condense docs/deployment.md to app-specific facts: the mkDeployTargetManaged
binding, the sudo submission path, no engine copy or fallback, the rollout
gates, and unchanged build/refresh behavior. Ancestry, accepted high-water,
holds, strict health evidence and recovery are owned by the nix-deploy README,
so link it instead of copying the protocol into every app. Agent instruction
pointers now name the client binding and rollout prerequisites.
agent-navi deleted branch feat/target-managed-client 2026-10-28 11:00:36 -04:00
Sign in to join this conversation.
No reviewers
No labels
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
jeremy/jeremyk-net!3
No description provided.