the swap moment for the gigantic primitives
Zero-downtime upgrades—hotswap moves a running
tool to its next release and back, from inside the tool. packslip verifies and unpacks a
release; hotswap keeps the versions and owns the moment between: drain, swap, smoke, then
settle or roll back. One crate inside each tool, no daemon; a consumer needs no mise.
Why
The gigantic tools — grove, sandman, stele, routines, voice, bifrost, … — are independent primitives. bifrost, the desktop app, plugs them into one UI the way mise plugs in runtimes: install one and its UI appears — a routines tab, sandman's report page. A remote Mac runs the night shift and needs the releases the dev box gets.
jdx tooling first: jdx's standalone packslip CLI — "a vendor-neutral signed release manifest" — verifies and unpacks a release. It keeps no versions side by side and swaps nothing on a host where the tool is running: hotswap.
Release
Every tool's contract; hotswap relies on it, never owns it.
- a GitHub Release per merge to main — trunk is the latest release, so every host follows one line.
- versions are
YYYY.M.N— mise's calendar form, N the count of the month's earlierv*tags, so a month opens at.0(2026.11.0). packslip requires semver; four-part dates do not parse. - the release job builds
<bin>-<target>.tar.gzforaarch64-apple-darwin(routines addsx86_64-unknown-linux-gnufor its CI tick), then runsjdx/packslip@v1withartifacts,bin(the name an install exports: routines'routine),tagandversion: it attests the archives and signspackslip.sigstore.jsonwith the workflow identity. - private repos — whether
packslip installfetches private assets is unverified (2026-11-01 · no private tool release on packslip yet). - a signed release list —
.well-known/packslip.jsonmay recommend or withdraw a version.
permissions: attestations: write # packslip attests each archive contents: write # upload release assets id-token: write # keyless sigstore, the workflow identity
The two-job form builds and uploads in one job and keeps
the packslip job at contents: read.
Install and upgrade
A consumer of our tools needs no mise (owner, 2026-11-17, reversing
2026-10-30's "Components stay on the machine's mise"): packslip verifies and unpacks,
hotswap owns the versions, and a tool installs and upgrades with nothing else on the
machine. Trigger: on a Mac with mise 2026.8.5, which has no packslip backend, bifrost showed
mise ERROR [jgeschwendt/grove] plugin not installed for grove,
routines and sandman.
HOME.| job | how |
|---|---|
| install | hotswap::install(tool, &m), for bifrost (next) or a bare bootstrap: packslip bootstrapped if absent, the latest installed into the layout, then <tool> setup, whose hotswap::ensure points current and ~/.local/bin/<bin> at it and records it; a failed setup leaves the record unverified (not ok, failed the setup, nothing red), so the next tick runs the steps again |
| active version | the target of <root>/<tool>/current; the record is its cache |
| latest | curl -q -fsSIL -w %{url_effective} https://github.com/<repo>/releases/latest → …/tag/v<V>, a renamed repo's 301 followed and ~/.curlrc ignored: only "anything newer than current?"; packslip chooses the version |
| fetch, verify | packslip install github.com/<repo> --pin <signer> --install-dir <root>/packslip/<tool>/stage --bin-dir <root>/packslip/<tool>/bin, killed with its process group past the manifest's fetch_timeout (600 s) |
| activate, roll back | current repointed: a fresh link renamed over it; no network |
| what runs the version | ~/.local/bin/<bin> → <root>/<tool>/current/<bin>: the agents' program and the head of every step's PATH; it needs only HOME, which every entry point refuses to run without |
| trust state | packslip's, per tool, under <root>/packslip/<tool>/; only the pinned binary is shared |
| prune | after a green swap, current and previous kept |
| uninstall | <tool> setup --remove, whose hotswap::forget, under the tool's lock, also deletes <root>/<tool> and <root>/packslip/<tool>; the pinned packslip, shared, stays |
<root> is always
~/.local/share/hotswap (hotswap::root()),
never $XDG_DATA_HOME: the agent's plist carries only
HOME and PATH, so a shell, an agent and
bifrost agree on it only if HOME decides.
- packslip, as probed (v1.11.4, macOS arm64, 2026-11-17) — verifies
packslip.sigstore.json(a Sigstore bundle over an in-toto statement, predicatehttps://packslip.dev/release/v1), size and sha256, then unpacks: ≈3 s for grove. Without--install-dirit keeps one tree per project, so hotswap installs into a stage and moves the tree to<root>/<tool>/<V>/, where it runs. No list, latest, upgrade, uninstall or JSON;installalways refetches (≈4 GitHub API calls and the archive), never retries, and fails hard on a 403 or a network error. It readsXDG_STATE_HOME,XDG_CONFIG_HOMEandXDG_DATA_HOME(notXDG_CACHE_HOMEorTMPDIR), and holds blocking locks on its state, bin and install dirs for a whole install, whose download may run 24 h on a trickle. hotswap points all three into the tool's own<root>/packslip/<tool>/, so neither the user's packslip use nor another tool's stalled install touches or blocks ours (run 2026-11-17: grove and routines alone 6.1 s and 5.2 s, together 4.6 s), and kills the call at a deadline; an admin's/etc/packslip/pins.dcan only narrow it. No minimum release age. - packslip itself — pinned by a constant in the crate, its version and a
sha256 per platform from jdx's published install script (each checked by download,
2026-11-17); a hotswap change bumps it. Its sha256 is checked before each use
(
shasum -a 256, which every macOS ships;sha256sumon Linux); absent or wrong, hotswap fetcheshttps://packslip.dev/v1.11.4/packslip-v1.11.4-<platform>withcurl -qinto a temp file of its own pid, checks it, fsyncs it and renames it to<root>/packslip/1.11.4/packslip, so two tools bootstrapping at once never run a half-written binary (run 2026-11-17: grove and routines together); never one found on PATH. Platforms: darwin-arm64, linux-arm64, linux-x64. Intel Macs are unsupported: an install or upgrade there says so in one line. - the signer — each tool's manifest carries its
ps1_…fingerprint and every install passes it as--pin; a release signed otherwise is refused (run 2026-11-17:signer does not match constraint 0's signer fingerprints). No reliance on first-use memory. - the version — packslip chooses it: the redirect only answers "anything
newer than current?" and keeps a tick off the API. On yes,
packslip installruns without--version, so a withdrawn release is skipped; itsInstalled <project> <V> at …line names V, and a V not newer than current is discarded.~/.local/state/hotswap/<tool>.latest, written whole, remembers which V a redirect resolved to. For an hour after, the agent's own tick (launchd names it inXPC_SERVICE_NAME) spends no install while the redirect says the same and V is not newer than current, or is red, and--checkreports the same:<tool> <cur>: up to date; <L> pending verification. A run by hand, bifrost's or--retryalways installs. The hour bounds a release public before its signed bundle (grove v2026.11.4: release 18:10:54, bundle 18:11:05), when packslip skips it. The export goes to<root>/packslip/<tool>/bin, never~/.local/bin, and names where the release keeps its binary: kept deeper, it gets a<V>/<bin>link. - failures before the swap — a GitHub rate limit, a network failure, or a
failed, stalled (past the deadline) or killed bootstrap or install during a tick prints one
line and exits 2 before the drain, leaving no stage:
currentand the record are as they were (a fetched version may sit beside them) and nothing is held red; the next tick tries again. Only a release that installed and then failed a step is red. A record that cannot be saved does not stop a rollback: the run rolls back, then exits 2 naming each failed save. - migration —
hotswap::ensure, run from mise's install of a version newer than the active one (or with none active), copies every version in mise'sinstalls/<key>/(found byMISE_DATA_DIR, else$XDG_DATA_HOME/mise, else~/.local/share/mise) into the layout and makes the running one current, recorded: no network, so no rate limit can fail it, and the bytes are the ones mise verified. An unreadable version stops it, named, before anything is repointed; a stage that will not go is made writable, else named. It relinks~/.local/bin/<bin>, and when the loaded upgrade agent runs another program, rewrites its plist and starts one detached waiter (its pid in<tool>.reloadbeside the record; a pid whose command line does not name the plist, reused after a logout killed the waiter, is not one). The same waiter starts when the agent is loaded from this plist and carries a managed launch constraint (below, under Swap). The waiter waits out the agent's running job, then reloads it: boots it out, waits up to 30 s for launchd to let go, then bootstraps it, five tries 2 s apart, appending one line to the agent's log: reloaded, or not and why (run 2026-11-17 against a throwaway label: three failed bootstraps, the fourth loaded). After five failed bootstraps the agent stays unloaded until a latersetupor the next login loads it from whatever plist is on disk (the shim's, after a rolled-back migration); nothing heals it unattended, and its log says why. A run launchd starts between the waiter's last look and its bootout is killed at its start, before any swap; launchd offers no check-and-bootout. mise's dirs and the user'spackslip:jgeschwendt/<tool>line are left alone: its copy and shim go stale, a stale copy never moves the layout back, and removing the line is the user's. A migration lists, in~/.local/state/hotswap/<tool>.mise, the copies that predate this crate (all but the running one); their setup needs mise's shim, so mise's copy must stay while one is on disk. The green swap whose prune drops the last of them — or the migration, when none was copied — says once, on stderr and in the agent's log,<tool>: no version here needs mise any more; run `mise unuse -g packslip:<repo>` to drop mise's copy, since a shell with mise's shims ahead of~/.local/binstill runs it; the list then goes, andforgetdrops it too. - the migration, in sequence — the old release's upgrade agent runs
through mise's shim and bumps mise first, then drains, runs setup, kickstarts and smokes.
The new release's
setupstep, through the shim, runsensurefrom mise's install dir; the reload waits out the old run and loads the plist on disk:~/.local/bin/<bin> upgradeafter a green, the shim again if the old release rolled back and rewrote it. Interrupted after the bump — a refused drain, a kill, a reboot — no setup ran; the next tick runs the new binary through the shim, and itsupgrade, finding no usablecurrent, runsensureitself, recording nothing, and swaps: a refused drain, a failed check or install, a kill mid-steps leave the record as the tick found it, naming another version, so the next tick runs the steps. No hand-run setup is needed.upgradecallsensureonly run from mise's installs or to repair acurrentwhose version is gone; run from anywhere else (a checkout) with no layout it touches nothing and saysrun <bin> setup. - the first release goes red after migrating — its rollback target is
mise's copy of a pre-hotswap release, whose setup relinks
~/.local/bin/<bin>and the plists onto mise's shim. So a rollback or--backonto a version that predates this crate (the.miselist) runsmise use -g packslip:<repo>@<V>after repointingcurrentand before that setup, and the shim runs the good version; onto a version that links this crate it never touches mise's pin. When that call fails the shim still runs the red version, and the run says so:rolled back to <O>, but mise still runs <N>: mise use … failed: <reason>, exit 1, and a record on O, red N, not held, itsfailednaming the call. This is the one place the crate still calls mise, and it retires once no machine's rollback target predates the crate. The host is then back on mise: the old release's tick holds the red version (it reads the same record), and the next release it bumps runs its setup through the shim, whoseensuremoves the host into the layout again past the stale versions.ensurenever movescurrentforward onto the version the record holds red;--retrytakes it deliberately. - a manual setup during an upgrade — not serialised:
ensureruns as the old release's setup step while that release holds the lock, so it cannot take it. Its writes are atomic renames: relinking~/.local/bin/<bin>is idempotent and safe; run from a newer mise copy it can repointcurrentunder a running swap, whose record, saved after, names another version: stale until the next tick runs the steps on the active version. Safe: any setup from the layout. Unsafe: a setup from a newer mise copy while an upgrade runs. - the upgrade agent —
dev.gigantic.<tool>.upgrade, hotswap's alone:ensurewrites its plist, loads it when it is not loaded and not disabled, and reloads it through the waiter when it is loaded from a stale plist;forgetboots it out (when loaded from this HOME's plist) and removes the plist. A tool never writes, loads or boots it out, so no tool's bootstrap can land in the waiter's bootout window. A label loaded from another plist is said and left alone; a HOME that is not the account's (its passwd entry's) never loads it, so a scratch HOME cannot claim the label in the real domain; with nolaunchctlon PATH (Linux) there is no agent, no plist and no log. To pause upgrades,launchctl disable gui/<uid>/dev.gigantic.<tool>.upgrade: hotswap leaves a disabled agent alone, while a bootout alone is undone by the next setup. It runs~/.local/bin/<bin> upgradeevery 900 s on aPATHof~/.local/binand the system dirs, never at load (a load-time upgrade would race the swap that ran setup), logging to~/Library/Logs/<label>.log. The link resolves throughcurrenton every exec, so the agent survives its own swap, which never kickstarts it.
Rejected
| alternative | why not (measured 2026-11-16 → 17) |
|---|---|
| a private mise | ≈40 MB download, a 138 MB binary; its shims need mise's dirs, so a bare shell cannot run the command; releases arrive through jdx's version index, which lagged one on 2026-11-16 |
| mise linked as a crate | its lib.rs: the binary "is the only intended consumer; this is not a stable public API"; 128 direct dependencies |
| Sigstore verification in hotswap | sigstore-verify 0.16 with ring: 84 crates, +0.85 MB per tool against sandman's 1.4 MB; the trust root is baked into each tool, so a rotation strands its upgrade path; signer memory and no-downgrade would be ours to write |
| migration by a fresh fetch | it re-verifies, but runs inside the old release's swap: a rate limit there fails setup, rolls the host back onto mise and holds the new release red until the next one |
bifrost's app layer on hotswap::upgrade | the shell already does the job for a different shape: two layers under Application Support, run as the shell's child, not one binary in ~/.local/bin restarted by launchd; this crate would gain a layers model and a second restart path for one consumer, and Sigstore's crates cost nothing beside Tauri's |
Mechanism
One function, hotswap::upgrade, inside the tool.
It reads the active version from current, speaks curl for the
latest check, packslip only for install and mise only to move it
back with a rollback onto mise's copy (§ install), and acts
when the version to run differs from its record's; a red record stays put until a new
version or --back.
<tool> upgrade # fetch the latest, then drain, swap, smoke, settle or roll back <tool> upgrade --check # report what would happen; fetch nothing, touch nothing <tool> upgrade --back # a deliberate rollback to the previous version, no network <tool> upgrade --retry # a plain upgrade past the red hold
- Fetch — when the redirect names a release newer than current, packslip installs the one it chooses into the layout (§ install); one already there is kept.
- Drain — the manifest's drain commands (§ contract), before
currentmoves; a refusal aborts: nothing swapped, nothing rolled back. A version never overwrites another's files, so only new processes see the new version; a green swap prunes all but current and previous, and a process still running from an older tree keeps its loaded binary but loses anything it opens or execs from that tree by path. - Swap —
currentrepointed, then<tool> setup, then a kick of each manifest agent except the tool's upgrade agent, whose kick would kill the running swap; setup first, since it bootstraps an agent a release adds and kicking an unloaded label fails. The kick is one shell step that reads the agent when it runs (so--checkruns nolaunchctland a rollback decides again). An agent loaded at login carries a managed launch constraint (launchctl printshowsmanaged LWCR); one loaded bybootstrapnever does. A swap changes the binary the constraint was made for, so the first spawn after it is killed for a code-signing launch-constraint violation, launchd repairs the constraint once through the background-task manager, and a later re-key of that item leaves the job inspawn failed, exit 78, for good. A kickstart keeps the constraint; a bootout, a wait untilprintfails, then a bootstrap removes it until the next login. So an agent loaded from a plist path (the print's ownpath =line) with the constraint, and not disabled, is reloaded from that path by the waiter's reload (five bootstrap tries, none succeeding fails the step and rolls back); anything else, a disabled one included, is kickstarted with-k. - Smoke — the manifest's smoke commands, against the new processes.
- Settle or roll back — green: record the swap in
~/.local/state/hotswap/<tool>.jsonand prune to current and previous. Red: record the version red, so a crash from here on reads red; repoint to the previous version, then setup, kickstart and smoke under the same manifest; exit 1 naming the failing probe. A previous version no longer in the layout is never recorded, and one whose record is red is never rolled back onto unless it held (passed its own steps as a rollback target); the failed version then stays current, red.
- the red hold — the record's
rednames the version a run failed on, rolled back from, or left by--back. While the redirect's latest is that version, or packslip's choice for it is (a withdrawn latest),upgradeprints<tool>: <v> is red; waiting for a newer releaseand exits 1 without swapping (--checkshows it, exit 0). A newer release goes through, a green swap clears it,--retrypasses it. Without it every tick would move back onto the red release. - the manifest is the running binary's — the upgrading version supplies
agents, drain and smoke for the new version and the rollback;
setup, resolved through~/.local/bin, is the new version's. - the record — the last swap:
at,ok,smokeoutput, version and previous; a rollback's names the failing probe (and the rollback's own, if red too), keepspreviousoff the failed version, names it inred, and setsheldwhen the rolled-back-onto version passed its steps. A lock beside it keeps two upgrades of one tool apart. The disk is the truth and the record its cache:ensurerecords a version it makes current (a first install, a migration; never the repair insideupgrade, whose own result is the record) unless the record names it already, green with no smoke, the red hold kept, its previous the version active before, else the record's, when on disk. So a host holding an older record (sandman's, from its mise days) never swaps onto the version it runs. A record still naming another version is stale, left by a run that died past its repoint:upgraderuns the steps on the active version, its previous the record's version when on disk, and--backreturns to that version. So does an unverified record, one naming the active version not ok and holding nothing red, which a failedinstallleaves: the steps run again, the record's previous the rollback target. - exit codes — 0 green or settled, 1 red or refused by a drain or the
hold, 2 unable to try (no version in the layout and none
ensurecan bring, the lock held, a failed latest check, bootstrap or install) or unable to save the record. - no daemon — the upgrade agent, a person or bifrost decides when to call.
The tool contract
Two verbs, owned by the tool; hotswap is a git dependency,
hotswap = { git = "https://github.com/jgeschwendt/hotswap" }.
<tool> setup [--remove]— the idempotent install duties, run byhotswap::installand after every swap: firsthotswap::ensure(tool, &manifest), which returns~/.local/bin/<bin>for the agents to run (§ install); then render the launchd templates and bootstrap the tool's own service agents — never the upgrade agent, which isensure's (§ install); install routine docs into~/.routines, leaving an edited copy alone; register MCP servers; print what it did.--removeinverts it and callshotswap::forget(tool), which drops what is the tool's alone (§ install) so a reinstall starts clean; the tool's data stays.<tool> upgrade [--check | --back | --retry]—hotswap::upgrade(tool, &manifest, &args), its return the exit code (§ mechanism).- three names, one identity — the tool name is the label stem
(
dev.gigantic.routines.*), the layout dir (<root>/routines/) and the record (~/.local/state/hotswap/routines.json), and the manifest'srepoits release's (jgeschwendt/routines).binnames the executable when it differs — routines shipsroutine, whose upgrade agent runs~/.local/bin/routine upgrade; empty, the tool name stands in.
| tool | on this crate | latest | signer | kickstarted | drain | smoke |
|---|---|---|---|---|---|---|
| bifrost | next | planned (§ bifrost) | — | — | quiet | /health |
| grove | grove#39, open; unreleased | 2026.11.4 | ps1_rahbrmrvyrwx2q75yvkfebgfzy | dev.gigantic.grove | grove off | grove --version · GET /api/health (curl, retried while the server boots) |
| routines | routines#30, open; unreleased | 2026.11.0 | ps1_t5o72jatmrlk56zmnxvdyjrvry | dev.gigantic.routines.due | no routine's lock held | routine status |
| sandman | next, with its cutover | 2026.11.1 | ps1_nensfiggtc7n6uctbniwf7q4am | dev.gigantic.sandman.report | none: a shift keeps its binary | sandman version · sandman shift status (a report-page probe would move its read cursor) |
Latest releases and the fingerprints packslip install
printed for them, observed 2026-11-17.
The manifest, in code
Every field may be empty; ..Default::default()
swaps with nothing to run, though an install needs repo and
signer.
let m = hotswap::Manifest {
agents: vec!["dev.gigantic.sandman.report".into()], // kickstarted on swap
repo: "jgeschwendt/sandman".into(), // its GitHub releases
setup: vec!["sandman".into(), "setup".into()], // run after every swap
signer: "ps1_nensfiggtc7n6uctbniwf7q4am".into(), // every install pins it
smoke: vec![vec!["sandman".into(), "version".into()], vec!["sandman".into(), "shift".into(), "status".into()]],
timeout: Some(120), // seconds per step, the default; expiry kills the step's process group
..Default::default() // no drain: a shift keeps the binary it started on
};
let exe = hotswap::ensure("sandman", &m)?; // in setup: the path the agents run
std::process::exit(hotswap::upgrade("sandman", &m, &args));
A step that exits while a background child holds its output is waited out to the deadline, then judged by its own exit code — detach daemons from stdout.
bifrost
The Components tab installs into hotswap's layout and reads each tool's record; hotswap is never a component, and no tool needs bifrost.
| action | today | next |
|---|---|---|
| components | grove, routines, sandman | |
| install | mise use -g packslip:jgeschwendt/<tool>, then mise x <spec> -- <tool> setup | hotswap::install(tool, &m), its manifest's repo, bin, signer and setup from bifrost's component table |
| no mise | ~/.local/bin/mise absent: the row says so and offers nothing | nothing to say: install needs no mise |
| status | ~/.local/state/hotswap/<tool>.json — version, ok, the failing step, the red version held off | |
| tab shown | an active install in mise ls --json | hotswap::root()'s <tool>/current resolves |
| upgrade | mise x <spec> -- <tool> upgrade | ~/.local/bin/<bin> upgrade |
bifrost's own update stays the shell's (decided
2026-11-18): the shell links the packslip crate, verifies each release against
bifrost-releases' signer and installs its two layers, the app and the Erlang runtime it pins,
itself — staged, held until the app is quiet, swapped, gated on
/health, rolled back, recovered after a crash. It calls no mise, and
the 2026-10-30 plan of a private mise was never built. The shell .app stays on the Tauri
updater. Why not this crate: § install, rejected.
Non-goals
- A daemon — callers decide when to swap.
- Signature code of its own — packslip verifies.
- A package manager — no dependencies, no third-party tools; a tool's current and previous version, nothing more.
- A release format — that is packslip.
- Signing beyond packslip's keyless sigstore, until the owner says otherwise.
Gate spans
Every run of mise run check is one OpenTelemetry trace through
floodgate span: a check span with each step nested under it
(fmt, clippy, cover,
stele.check and stele.emit), so floodgate's page shows which
steps cost the time and CPU.
check only wraps check:steps in its root span; the
steps live there. A step is wrapped in mise run span -- <name> [--attr k=v]… -- <cmd…>
(.mise/tasks/span): it execs floodgate span when
floodgate is on PATH, else the command after the second --, so
a machine without floodgate, CI included, gates as before. To add a step, put it in the
check:steps task's run list wrapped the same way; a step left
bare is time no span explains.
Next
What the next shift does first; a landing that changes it edits it here.
- Nothing open in this crate: grove, routines, sandman and bifrost's Components all run on it.
Landed: routines 2026.11.1, grove 2026.11.5 and sandman 2026.11.2 carry this design. A host on an older release finds them through mise's version index, which can trail a release by hours, and migrates on that upgrade; from then on the latest check asks GitHub directly.
Owner-only: bifrost's first packslip release that carries a shell bundle.