Operate

Updating and channels

cmd
hev update

hev update moves a host’s hev to another build published by the official repository, hev/kit. It verifies the build, installs it beside the one it replaces, switches over atomically and restarts what runs from it. hev dispatch hosts update asks every host you own to do the same.

Channels

A host follows one channel, set in its own config:

ChannelWhat it is
releaseThe latest published release. The default. Nothing changes for a host that never opts in.
edgeThe newest edge build: the tip of the open release train branch vX.Y, built and tested on every push like a release, and published as a pre-release tagged edge-X.Y.Z-edge.<sha>. Versions read X.Y.Z-edge.<sha>.

Edge is for an operator who wants their own hosts to run each merged feature before it is released. Users install releases.

Each edge build also pushes the kit container image from the same commit, for linux/amd64 and linux/arm64: hevlayer/kit:X.Y.Z-edge.<sha>, and hevlayer/kit:edge, which follows the newest edge build (the tip of the newest train; a re-run of an older build never moves it back). Edge never pushes hevlayer/kit:latest or a bare hevlayer/kit:X.Y.Z; those are releases only. The image’s entrypoint is hev and its default command is the dashboard (serve). To run another subcommand, such as hev collect as a sidecar, replace the arguments (docker run IMAGE collect ..., or args: ["collect", ...] in a Kubernetes container) or the whole command (docker run --entrypoint hev IMAGE collect ..., or command: ["hev", "collect", ...] in Kubernetes). docker run IMAGE hev collect runs hev hev collect, which prints the top-level help and exits instead of running collect.

hev update

CommandWhat it does
hev updateMove to the newest build on this host’s channel.
hev update --channel edgeRecord edge as this host’s channel and move to the newest edge build. --channel release records release; the host moves once a release is newer than what it runs, or now with --to.
hev update --to VERSIONMove to a named build: X.Y.Z or X.Y.Z-edge.<sha>. This may move backwards; the channel alone never does.
hev update --checkReport the newest build on the channel and whether this host is behind. Changes nothing.
hev update --rollbackReturn to the build the last update replaced. Running it again goes forward again.
hev update hold [--for DUR] [--reason TEXT]Hold the daemon’s automatic updates on this host, until --for runs out or you release it. See Holds and deferral.
hev update releaseRelease the hold.

--json prints the report. A host already on the newest build reports so and changes nothing.

What an update does

  1. Reads the build’s manifest.json (a release published before manifests: its checksums.txt), checks it names the version asked for, and downloads the archive for this OS and architecture.
  2. Checks the archive’s sha256 against the manifest. A mismatch stops the update. Nothing has been replaced.
  3. Unpacks hev into ~/.hev/versions/VERSION/ and runs it once (hev version) to check that it starts.
  4. Keeps the build being replaced under ~/.hev/versions/ too, then switches the hev you ran (and ~/.local/bin/hev, which hev up installs for the daemon, if present) to the new build atomically. On macOS and Linux that path becomes a symbolic link to the versioned file, swapped in with one rename. On Windows, see below.
  5. Restarts the capture daemon through its service manager and waits for it to stay up. If it does not, the update switches back to the previous build, restarts it again, and says so.
  6. Refreshes bundled skills from the new binary (hev skills sync), where a Claude Code, Codex or shared agents skills directory exists.
  7. Runs the host’s own post_update commands, if any.

Runs in progress are never signalled. Each keeps the binary it started with to the end, and new runs start on the new build. The current build, the previous one and the three most recent others stay under ~/.hev/versions/, so a long run’s binary is still there when it next executes itself.

What restarts

PlatformRestartedHow
macOShevd, the LaunchAgent com.hev.hevd, if hev up installed itlaunchctl kickstart -k, then checks it keeps one running process, waiting up to the job’s ThrottleInterval plus 15s (at least 20s)
macOSthe secrets cache, the LaunchAgent com.hev.secrets, if installed and loadedas for hevd
Linuxhevd, the systemd user unit hevd.service, if hev up installed itsystemctl --user restart, then checks it stays active
Linuxthe secrets cache, the systemd user unit hev-secrets.service, if installed and activeas for hevd
Windowshevd, the scheduled task hev\hevd, if installedends and runs the task, then waits for the daemon to report

launchd will not start a job again sooner than its ThrottleInterval (10s unless the plist sets one) after its last start, so a new build whose first start fails gets its second try only after that interval. The wait is read from the job’s plist for that reason; a plist with ThrottleInterval 30 waits 45s before the update gives up and rolls back.

A daemon you started by hand (hev d) is named in the report, not killed; restart it yourself. Dispatched runs and their supervisors are not restarted. The dashboard container is not restarted; run hev up for it.

The secrets cache runs inside hevd, or, on a host without hevd, as hev daemon --secrets-only under the job from Secrets. Restarting it sends no request: it fills again on demand, and a rate-limit cooldown on disk still holds.

Package managers

hev update never replaces a file a package manager owns. On a Homebrew install it stops and says what to do instead: brew upgrade hev/tap/hev for releases. Homebrew installs releases only. To follow edge on such a machine, brew uninstall hev, install from a release archive into a directory you own that is on your PATH (~/.local/bin, where hev up already puts the daemon’s copy), and run hev update --channel edge from there. Nix, Scoop and system package directories (/usr/bin) are treated the same way.

Windows

A running hev.exe cannot be overwritten. hev update renames it aside (hev.exe.old-…), moves the new build into its name, and removes the old file on a later update, once nothing runs it. The scheduled task is ended and run again. A daemon that updates itself exits and the task restarts it within a minute.

The [update] table

In the host’s own config (~/.hev/config.toml, or $HEV_CONFIG):

[update]
channel = "edge"        # release (default) or edge
auto = false            # let the daemon update this host on a schedule
interval = "1h"         # how often the daemon checks; at least 1m
max_defer = "24h"       # longest an automatic update waits for running work or a hold
post_update = [         # run after each successful update or rollback
  "systemctl --user restart my-wrapper.service",
]
Set how this host updates: in ~/.hev/config.toml (or the file $HEV_CONFIG names), add an [update] table with channel = "edge", auto = false and interval = "1h". Use channel release, auto = true or another interval of at least 1m if I asked for them. Add post_update commands only if I gave them; each runs through the shell after an update or rollback. Show me the file before and after, then run `hev update --check` and report the newest build on the channel and whether this host is behind.
Docs: https://hevkit.com/docs/updating#the-update-table (all pages: https://hevkit.com/llms.txt)

post_update is for an operator’s own services that wrap hev. Each command runs through the shell with HEV_UPDATE_FROM, HEV_UPDATE_TO and HEV_UPDATE_CHANNEL set. A failing hook is reported; it does not undo the update. Hooks come only from this file: never from a sender or the network.

hev update --channel edits only the channel line, so comments and other settings stay as they are.

Automatic updates

With auto = true and a channel set, the capture daemon checks on its interval and updates the host by the same path as hev update. Both are needed; automatic updates are off by default.

  • It checks only between its own scan cycles, never in the middle of one.
  • After switching it re-executes itself from the same path, now the new build, and the new daemon confirms the update after a clean cycle. If the new build fails to start three times, the next start switches back.
  • A failed check backs off: the interval doubles with each failure, up to a day, and resets on success.
  • It never moves a host backwards.
  • It waits while a dispatch run or an orchestrator round runs on the host, or while an update hold is set; see below.
  • Everything it does is recorded in ~/.hev/update/state.json (history, last and next check, failures) and in ~/.hev/hev.log.

Holds and deferral

When a check is due, the daemon first looks for reasons to wait:

  • a dispatch run on this host whose session, supervisor or admission is live, or an orchestrator in the middle of a round (an orchestrator between rounds does not count);
  • an update hold, set with hev update hold here or hev dispatch hosts update --hold from the machine you dispatch from.

If there is one, it records the deferral (once per reason) in ~/.hev/update/state.json and the log, and tries again in five minutes (or at the interval, if shorter). hev s shows the hold and the deferral (Update: ...), and hev dispatch hosts shows both in its UPDATE column.

The daemon looks again after the new build has downloaded, right before it switches. A run admitted or a hold set during the download still defers the update, and the host stays on its build. While that last look and the switch happen, the daemon holds an exclusive lock on ~/.hev/update/switching (flock, or LockFileEx on Windows). A run’s admission, an orchestrator round and hev update hold each register first and then take and drop the same lock. Either the daemon sees them, or they start after the switch. The lock is the daemon process’s until the switch ends or the process exits, so a slow or stalled daemon keeps it however long that takes, and a crashed one leaves nothing to clean up. The file itself stays; only the lock matters.

The wait for the lock lasts at most a minute. If the switch is still under way then, admission fails with “an automatic update is still switching this host’s build” and the run does not start; send it again once hev update status shows the update finished. An orchestrator round fails the same way and the next tick tries again. hev update hold keeps the hold it set but warns that the update may still move the host.

Once the deferral has lasted max_defer (24h by default) the daemon updates anyway, and the report, the log and the history say it was deferred since when, and why. That includes work or a hold that first shows up during the download: past max_defer it does not stop the switch, but it is named in the warning, with “arrived during the download”. A hold with no --for therefore lasts at most max_defer of deferred checks; release it when you are done.

A manual hev update does not defer. It warns, as the first line of its report, when the daemon would have: warning: updating although the daemon's automatic update would defer: ....

A one-host-at-a-time rollout:

hev dispatch hosts update --all --hold --for 4h --reason "0.7 rollout"
hev dispatch hosts update --host oven --ignore-hold   # one host, checked before the next
hev dispatch hosts update --host mini --ignore-hold
hev dispatch hosts update --all --release
Roll a new kit build out to my hosts one at a time. First hold every host's automatic updates with `hev dispatch hosts update --all --hold --for 4h --reason "rollout"`. Then, for each host in the order I give, run `hev dispatch hosts update --host HOST --ignore-hold`, report its version before and after and any warning in the report (a dispatch run running there), and check it with `hev dispatch hosts` before moving to the next. Stop and tell me if a host fails or rolls back. At the end run `hev dispatch hosts update --all --release`.
Docs: https://hevkit.com/docs/updating#holds-and-deferral (all pages: https://hevkit.com/llms.txt)

Updating every host

From the machine you dispatch from:

hev dispatch hosts                                   # VERSION, CHANNEL and BEHIND per host
hev dispatch hosts update --all --check              # what would change
hev dispatch hosts update --all                      # each host to the newest build on its channel
hev dispatch hosts update --host HOST --channel edge # one host, moved to edge
hev dispatch hosts update --all --to X.Y.Z           # every host to a named build
Update the hosts I own from this machine. Run `hev dispatch hosts` and report each host's VERSION, CHANNEL and BEHIND, then `hev dispatch hosts update --all --check` and show me what would change. After I confirm, run `hev dispatch hosts update --all`, or `--host HOST --channel edge` for one host, or `--all --to X.Y.Z` for a named build, as I ask. Report each host's version before and after, or why it did not update. Finish with `hev dispatch hosts` to show none is behind.
Docs: https://hevkit.com/docs/updating#updating-every-host (all pages: https://hevkit.com/llms.txt)

Each host runs the update on itself and the command prints, per host, the version before and after, or why not. hev dispatch hosts shows each host’s channel and whether it is behind it (for edge, by how many commits).

  • Owner only. A host accepts the request only from its owner. An invited member’s request is refused by the host.
  • Holds. A host whose automatic updates are held refuses to update unless you pass --ignore-hold; --check still answers. --hold [--for DUR] [--reason TEXT] and --release set and remove holds instead of updating. A host whose hev predates holds says it has none; set auto = false in its config instead.
  • The request carries a channel and a version, nothing else. The host fetches the build from the official repository and verifies it itself. A sender cannot supply a binary, a URL, a digest or a command.
  • Older hosts. A host on a release from before this command answers with an error that says so; move it by hand once (below). Hosts update at different moments, so each build talks to the build before it, both ways.

Trust model

What hev update fetches, and from where, is fixed in the binary: the releases of github.com/hev/kit, over HTTPS (api.github.com to find the newest build, GitHub release downloads for the files). No flag, config key or request field changes it.

WhoCanCannot
Someone on the networkBlock or slow the download: the update fails and nothing changes.Substitute a file or an older listing: TLS with the system’s certificate authorities stops that, and a corrupted or truncated download fails the digest check.
A sender with dispatch accessAn owner can move a host to any published build, including an older one with --to. An invited member can do nothing: the host refuses.Supply a binary, a URL, a digest or a hook. Name anything but a published hev/kit version.
Whoever controls the repository’s releasesPublish a build that every host following that channel will install.Nothing more is needed: this is the same trust as installing a release.

The manifest and the archive come from the same release, so the digest proves the release is consistent and the download intact. It does not prove who built it. Edge builds come only from pushes to a train branch, which are reviewed pull requests, and every archive carries a signed GitHub build provenance attestation naming the workflow and commit that built it. Check one by hand with:

gh attestation verify kit_X.Y.Z-edge.SHA_linux_amd64.tar.gz --repo hev/kit
Check the build provenance of a kit release archive: run `gh attestation verify kit_X.Y.Z-edge.SHA_linux_amd64.tar.gz --repo hev/kit`, with the archive file I downloaded. It needs the GitHub CLI, logged in. Tell me whether it verified and which workflow and commit the attestation names.
Docs: https://hevkit.com/docs/updating#trust-model (all pages: https://hevkit.com/llms.txt)

hev update does not verify attestations itself: that needs a Sigstore verifier and its trust root inside the binary, a large dependency for a check that would not stop a malicious change merged through review.

Moving a cluster to edge the first time

Hosts on 0.6.2 or earlier have no hev update and do not know the request, so each moves by hand once. After that, one command moves them all.

On each host, including the one you dispatch from:

  1. Find the newest edge build on the releases page (pre-releases tagged edge-X.Y.Z-edge.SHA). Download the archive for the host’s OS and architecture and checksums.txt, and check it:

    V=X.Y.Z-edge.SHA; OS=linux; ARCH=amd64         # or darwin, arm64
    curl -fLO "https://github.com/hev/kit/releases/download/edge-$V/kit_${V}_${OS}_${ARCH}.tar.gz"
    curl -fLO "https://github.com/hev/kit/releases/download/edge-$V/checksums.txt"
    sha256sum --check --ignore-missing checksums.txt   # macOS: shasum -a 256 --check --ignore-missing
    tar -xzf "kit_${V}_${OS}_${ARCH}.tar.gz" hev
    Download and check an edge build of hev on this host. Find the newest pre-release tagged edge-X.Y.Z-edge.SHA on https://github.com/hev/kit/releases and set V to its version, OS to linux or darwin and ARCH to amd64 or arm64 for this machine. Download kit_${V}_${OS}_${ARCH}.tar.gz and checksums.txt from that release with curl, run `sha256sum --check --ignore-missing checksums.txt` (on macOS `shasum -a 256 --check --ignore-missing checksums.txt`) and stop if it fails. Extract only hev with `tar -xzf "kit_${V}_${OS}_${ARCH}.tar.gz" hev`, then run `./hev version` and show me the version.
    Docs: https://hevkit.com/docs/updating#moving-a-cluster-to-edge-the-first-time (all pages: https://hevkit.com/llms.txt)
  2. Put it where the host runs hev from: the hev on the PATH that SSH sees, and ~/.local/bin/hev if hev up installed the daemon there. install replaces the file without disturbing a running one:

    install -m 0755 hev "$(command -v hev)"
    [ -e ~/.local/bin/hev ] && install -m 0755 hev ~/.local/bin/hev
    Install the hev binary I just downloaded and checked in this directory over the one this host runs: run `install -m 0755 hev "$(command -v hev)"`, and if ~/.local/bin/hev exists, `install -m 0755 hev ~/.local/bin/hev` too. If `command -v hev` points into Homebrew, a system directory or another package manager's path, stop and tell me. Verify with `hev version` that the new build runs.
    Docs: https://hevkit.com/docs/updating#moving-a-cluster-to-edge-the-first-time (all pages: https://hevkit.com/llms.txt)

    A Homebrew host: see Package managers. On Windows, end the task (schtasks /End /TN hev\hevd), extract hev.exe over the old one, and run it again (schtasks /Run /TN hev\hevd).

  3. Restart the daemon, refresh skills and record the channel:

    launchctl kickstart -k gui/$(id -u)/com.hev.hevd   # macOS
    systemctl --user restart hevd.service              # Linux
    hev skills sync
    hev update --channel edge                          # records the channel; reports it is current
    Finish moving this host to the edge channel: restart the capture daemon with `launchctl kickstart -k gui/$(id -u)/com.hev.hevd` on macOS or `systemctl --user restart hevd.service` on Linux, refresh skills with `hev skills sync`, then run `hev update --channel edge` to record the channel. Show me that it reports this host current, and check with `hev s` that the daemon is running.
    Docs: https://hevkit.com/docs/updating#moving-a-cluster-to-edge-the-first-time (all pages: https://hevkit.com/llms.txt)

Then, from the machine you dispatch from, check that every host answers:

hev dispatch hosts
hev dispatch hosts update --all --check
After moving my hosts to edge by hand, check them from the machine I dispatch from: run `hev dispatch hosts` and `hev dispatch hosts update --all --check`. Report each host's version, channel and whether it is behind, and name any host that does not answer or reports an error.
Docs: https://hevkit.com/docs/updating#moving-a-cluster-to-edge-the-first-time (all pages: https://hevkit.com/llms.txt)

Keeping it there. Either let each host follow edge itself, by adding auto = true under [update] in its config, or move them all after merges with hev dispatch hosts update --all. hev dispatch hosts shows any host behind. To leave edge, hev dispatch hosts update --all --channel release moves each host to the latest release once it is newer than what it runs, or --to X.Y.Z moves them now.

esc