Skip to main content
Every city stores six kinds of state. One is the work ledger — the tasks, epics, bugs, and convoys people and agents actually reason about. The other five are infrastructure: the execution graph, session lifecycle, messaging, orders, and the nudge queue. A city with no [storage] section keeps all six in the work ledger. They do not have to. [storage] in city.toml assigns each class to a named binding, and this build serves one split: work stays on the work ledger, and the five infrastructure classes move to a single SQLite bead engine. A city created by gc init is born split: it carries that section from the start, creates the binding on its first boot, and has nothing to migrate. On a production-scale city that measured 130–250× lower latency for infrastructure-class reads than serving them from the work ledger, because those reads stop competing with the work ledger’s own traffic. This runbook is the whole cutover for a city that predates the split, or that gc init created single-store (--storage=single, a remote session runtime, or a bd a split city does not run). It is short because the design is: swap the config, run one command, start the city.

Before you start

  • Take a backup. The migration proves equality before recording anything, and it backs up every work-store row before clearing it, but it is still the moment your city’s infrastructure state moves between stores. Back up the city directory.
  • Know which side you are on. gc storage status answers it, read-only, and never creates the database it reports on.
  • Rehearse the cutover. gc storage preflight runs every check the migration runs, against a live city, without migrating. Run it before you schedule the window, not inside it — but after Step 1, since it resolves its destination from [storage.classes] and has nothing to check until that section names a binding.
  • Stop the city. The migration refuses while a controller is live, while the city is registered with the supervisor, and while any of its sessions runs, and it asks you to attest that nothing else is writing either. gc stop handles the city; the attestation is yours.
  • Cities on an out-of-tree provider do not take this path. A city born on a provider a downstream fork compiled in creates its binding at first boot and moves nothing. This command’s one source is the work store.

Step 1: author the split

Add the class map and the binding it names. Either half may live in an include fragment — [storage] composes across layers and is validated for completeness only after every layer merges. examples/storage/ ships both halves as a reference.
All six assignments are required once [storage] exists. This build serves the whole split or none of it: either every class names work, or work names work and all five infrastructure classes name one shared binding. Anything else is refused at startup rather than routed halfway. The config swap comes first, and it is deliberate. The migration resolves its destination from [storage.classes], so it cannot run until the config says where the destination is. Between the swap and a proven copy your city is configured to read a binding that does not hold its state — which is exactly why the next thing that happens is a refusal, not a boot.

Step 2: watch the boot refuse

Start the city. It will not start:
This is the design working. Boot never migrates. A booting binary cannot know whether some other process is still writing to the source, so it refuses and names the command an operator runs deliberately, with the city stopped.

Step 3: rehearse it before you take the window

Runs every check the migration runs against a live city — and copies nothing, creates nothing, takes no migration guard or controller lock, and publishes no event. It exists because the migration’s refusals are all correct and all arrive at the worst possible moment: with the fleet stopped and a window running. It also reports, per rig, what gc storage migrate --from-rigs would do there (see “Step 4b: import each rig”). Pass it the --force attestations you will pass to the migration (see “Step 4: run the migration”). What they lift there is lifted here, and the command preflight prints for the window carries them:
The checks that most often stop a real cutover, and what each wants from you: The shared store row judges the city as the migration will, with the city stopped. A store on the Dolt server gc manages for the city is named by the data directory that server serves (<city>/.beads/dolt), not by its port, which can change at every boot and is gone once the city stops. The identity preflight prints on the live city is the one the migration checks inside the window, and another city’s managed server is never the same store, whatever its database is called. It exits non-zero when the migration would refuse for something you have to go and fix. That is a different question from gc storage status, which exits non-zero whenever the city is not yet serving from its binding — the ordinary state of every city with a cutover still ahead of it. A city that preflight clears will still fail a status gate until it has actually migrated. Before Step 1, on a city with no [storage] yet, gc storage preflight --split rehearses the whole split as if the default block (the one gc init --storage split writes) were already in city.toml, and writes nothing. On top of every check above it prints the session reconciler the split city would resolve to (and, under v2, the boot census v2 refuses over), the lane the migration’s window would open the work store on, the id floor it would set, and estimates: how long the copy and the clear take, how much disk the snapshot (of the work store and of every rig with a store of its own), the binding and its WAL need, and how many times --time-budget (default 30m) would pause the run. Each estimate is labeled ESTIMATE and names its basis: the row and edge counts it read, and rates measured on a loaded host (the native-Dolt clear costs about 62 ms an edge in batches; the proxied, bd CLI and exec lanes remove an edge per call, and their figure is a floor). It starts nothing: on a city whose bead-store provider is down, or whose proxied server is stopped, it says so, names what lets a later run read, and runs no check that reads a store, so rehearse on the running city. A suspended rig or city is left stopped and named with the command that resumes it; a proxied server that retired on its idle timeout while the city runs is read, as gc doctor reads it. gc doctor’s storage-split check reports the binding’s verdict on a split city; on an unsplit one it stays cheap (the reconciler the split city would resolve to, and whether the provider is up) and leaves the rehearsal to this command. A city that already carries a convergence marker for the split binding (a migration backed out by removing [storage]) is refused here: restore the block instead of migrating again. Ready names the window’s commands in order, starting with gc storage snapshot --work --fleet-stopped (with --rigs when the city has rigs), which the disk estimate counts and the migration does not take, and running the migration under the --time-budget its pauses were estimated against. It reports rather than refuses what stopping the city ends: a live controller, named by PID; the city’s registration with the supervisor; its running sessions; and, under --force=shared-store:, the other cities on the store, whose controller locks the migration takes. None of them affects the exit code. Stopping them is the next thing you were going to do anyway, and blocking would mean the command for planning a window could only be run from inside one. And --fleet-stopped is never checked, here or anywhere: it is an operator attestation precisely because no process can verify it, and preflight says so rather than letting a clean report read as broader than it is. A split can also release maintenance a large work store was starving. The core reaper runs its steps in order under one run budget, and on a work store holding many infrastructure rows the early steps can spend it every run. Its later steps, such as auto-closing stale issues (step 5), then never run. Once the split moves those rows out, the first reaper run after it reaches those steps and acts on everything that was eligible all along: one city closed 98 stale work beads in a single run. Before the window, look at the reaper’s recent order.skipped events and its summary’s budget_skipped: field, which names each <scope>@<step> the budget kept from running. If later steps have been skipped, expect that burst, and decide beforehand whether to let it run.

Step 4: run the migration

--from-work names the source explicitly. It is the only source this build carries, and passing nothing refuses rather than defaulting, so a source added later cannot inherit this one’s behavior by silence. --fleet-stopped is your attestation. The command proves on its own that no controller is live on the city; it cannot prove anything about a stray bd, a rig-side script, or a second gc process, so it asks you to state it. --force attests a named hazard the command otherwise refuses over. It is repeatable, and a bare --force refuses:
  • --force=remote-runtime: the city runs sessions on a remote runtime, or this host cannot list every session. After the split those sessions refuse infrastructure-class commands until worker-site transport exists, and you attest that no remote host writes infrastructure beads to the work store.
  • --force=shared-store:<identity>: another registered city uses this city’s work store, and this city is the only writer of what the migration moves. The refusal prints the identity. Every other city on the store must be stopped and stay registered: gc supervisor stop --wait stops every supervisor-hosted city and keeps its registration. gc stop unregisters a city, which hides it from this check, and an attestation that finds no registered city on the store refuses. The migration holds each co-tenant’s .gc/controller.lock until it exits, so none of them restarts mid-copy, and rows that name another city’s scope refuse even under the attestation.
The migration appends the attestations it runs under to .gc/storage-attestations.log.
What the command does, in order:
  1. Resolves the same plan boot resolves, so a layout boot would refuse is refused here first rather than migrated toward.
  2. Takes the city’s .gc/controller.lock and holds it until it exits. It refuses while something else holds the lock, while the city is registered with the supervisor, while any of its sessions runs, on a remote stage, and, without the matching --force, on a remote runtime or a shared work store (under --force=shared-store, it takes every co-tenant’s lock). It refuses if a controller answers the city’s socket, and without --fleet-stopped. None of these reads the work store, and a run they refuse never touches the bead-store provider.
  3. Takes a migration guard over the city, so a second migrator cannot run. It reads no store either, and a run it refuses never touches the provider: a dry run or a --purge-type run of gc storage recover-stranded holds the guard without the lock above, and the provider is not started or stopped under it.
  4. Opens the maintenance window, once those checks have passed:
    • gc stop stopped the city’s bead-store provider, and a managed bd/Dolt, proxied or bd-contract exec city has no server to read without it. The window starts the provider the way gc start does (no agents, no nudge pollers), recording that it did in .gc/storage-window.json first, and stops it again before the guard and the lock are released. If that stop fails, the run exits non-zero, keeps the record, and does not tell you to start the city: stop the bead store with gc stop first. A provider that was already up is left as it was, except a bd-owned proxy: bd restarts it on any read, so the window always starts the city’s proxied scope (and, for --from-rigs, the proxied scope of each rig it reads) and stops every provider-owned scope at the end, as gc stop does. A provider a killed run started is stopped by the next run, whoever has started it since: the city is stopped and locked.
    • Inside the window the migration’s own opens of the work store take the native lane: the proxied-native lane is forced on and beads.native_transport = "off" is overridden, for those opens only, with the configuration the command loaded.
    • On a gc-managed Dolt the window started, it lists the server’s client sessions over its published port and refuses while any other client holds one, naming each, or when they cannot be listed. Such a refusal stops the provider only if this run started it; one a killed run started stays running and recorded. A bd-owned proxy or an exec provider cannot be judged that way: the run names it, and --fleet-stopped covers it.
    Under --force=shared-store, it then refuses rows that name another city’s scope, the one check here that reads the work store.
  5. Does not census rig scopes. A rig’s graph rows stay readable through its relic legs and move with gc storage migrate --from-rigs once the binding has converged; the success message names every rig still awaiting that.
  6. Copies every infrastructure bead with its id and within-class dependency topology preserved, and every hold on it (see Holds below).
  7. Closes the destination, reopens it, and proves field-level equality against the bytes on disk — not against the connection that wrote them.
  8. Records a proven-copy manifest, and only then the convergence marker. Before the clear it raises the work store’s bd min_hash_length one past the longest hash suffix among the carried ids of the store’s own prefix (only suffixes bd mints count: base36, 3 to 8 characters, so a cross-store gate’s xsg- id does not; neither setting goes above 8, the longest suffix bd mints; it raises max_hash_length with it when needed, and never lowers either, with one exception: an earlier --from-rigs may have set either above 8, which bd’s minting ignores and a hosted bd serve only pads ids to, and each is brought back down to 8), so bd does not mint a carried id again once the clear removes it: every id it mints has a longer suffix than any carried one. Where a carried suffix already has 8 characters the floor stops at 8, and a new 8-character id only rarely could repeat one. A file store needs no floor and a generic exec store cannot take one; both are reported. A hosted bd store that refuses the write stops the run before the clear and names the value to set on the hosted project out of band; then run the same command again. gc storage repair-sequence --id-floor sets the same floor on its own, under the same lock, and is safe to repeat.
  9. Clears the work store’s copies of the beads it moved. Each row, with every dependency edge touching it and that edge’s payload, is first written to <binding root>/infra.retained-source.jsonl; the file is re-read from disk and proven equal to the rows it records; only then is a row removed.
Holds. A bead parked in the work store stays parked in the binding, and no cross-store edge is ever written. The copy plans every edge between a moved bead and one that stays the way --from-rigs does (the same planner). An open infrastructure bead with a blocks edge onto an unfinished work bead (a parked mol-dog wisp blocked on an open work bead, say), or onto an unfinished bead a rig store holds, waits in the binding on a cross-store gate: a gate bead in the binding that names the blocker, which the controller’s gate lane closes once the blocker closes. The migrate output names each one, and the manifest lists it (#gc:gate). An external: reference a moved bead holds is carried as it is, and the split city enforces it: an external:<id> blocker holds its bead until some store holds <id> and it closes, and an external:<rig>:<capability> reference never blocks. gc storage preflight names, under external refs, every open bead the copy moves that waits on an external:<id> whose bead no store holds: it arrives blocked, so close or re-point the edge first if it should not wait. Every other edge between a moved bead and one that stays is dropped and recorded on the moved bead (gc.migrated_cross_edges). A hold the binding cannot express makes the migration refuse, before anything is copied, naming each bead and its fix; gc storage preflight reports the same refusal under holds:
  • an undated deferral (bd status deferred with no future defer_until): give the bead a dated deferral, bd defer <id> --until <date>, which the copy carries as defer_until, or undefer it;
  • any other status bd parks a bead with (blocked, pinned, hooked, or a custom status): the binding stores only open, in_progress and closed, and the bead would arrive open and ready. Keep it parked with a dated deferral (bd defer <id> --until <date>), release it (bd update <id> --status open), or close it;
  • a waits-for or conditional-blocks edge onto unfinished work: a cross-store gate encodes only blocks. Finish the work bead, close the infrastructure bead, or replace the edge with a blocks edge;
  • an open work bead blocked by an unfinished infrastructure bead (the v1 cook --attach graft is the known producer): a work store cannot hold a cross-store gate. Finish or cancel the infrastructure bead’s workflow, or remove the edge with gc bd dep remove <work> <infra>;
  • a tracks or parent-child edge with both ends open, in either direction: a membership edge cannot cross stores. Close the workflow or convoy, or the other bead;
  • a blocker no readable store holds while a rig store cannot be read: restore access to the rig store and run this again.
An infrastructure bead blocked on open work needs no manual deferral before the migration. What the backup holds, and what it does not. The backup records each bead as gc models it: id, title, status, type, description, priority, assignee, sender, parent, ref, labels, metadata, the ephemeral and no-history bits, timestamps, defer-until, and every dependency edge touching the bead with its payload. That is exactly the set of fields the copy carried into the binding and the equality stage proved. It does not hold the fields only bd models: notes, comments, close reason and closed-at, design, acceptance criteria, the event history, and the indefinitely-deferred state. Those were never copied into the binding either (an open bead in the indefinitely-deferred state is refused, see Holds). On a native-Dolt work store each removal is a Dolt commit, so until Dolt garbage-collects that history, dolt (AS OF a commit before the clear) is the full-fidelity backstop for them. Batches, the time budget, and resuming. The copy and the clear run in batches: rows are created 500 to a transaction, edges 2,000 to one, the edges and their payloads are read in batches of 1,000 rows, and the clear removes 1,000 rows per batched delete (a store without batched deletes removes them one at a time). Before a chunk is deleted, every edge touching it is removed, 250 edges to a transaction where the work store can, so the delete rewrites no work bead’s text. On a native-Dolt work store a chunk therefore costs one commit for its delete plus one per 250 of its edges: a chunk with no edges is one commit, and a chunk of 1,000 pour steps of a formula (about 2,000 edges) is nine. On an MC-sized city (40,000 rows, 18,662 edges) with a SQLite work store the whole run takes 30 to 40 seconds, about 20 of them in the clear. A native-Dolt work store’s clear is much slower: each edge removal re-derives the blocked state of the beads it touches, about 60 ms an edge even inside a transaction on a loaded host, so the clear of an MC-sized city takes on the order of 20 to 30 minutes there, and a default budget may pause it once. A work store reached through the proxied lane or a hosted bd server removes edges one at a time, one commit each (about 130 ms an edge): about 50 minutes for an MC-sized city, so the default budget pauses it once and a second run finishes it. --time-budget (default 30m, 0 for none) is checked between the copy’s batches and between the clear’s chunks, never inside one. A clear chunk runs to its end once started, so a dense one (1,000 pour steps of a formula) can overrun the budget by about 2.5 minutes on a native-Dolt work store and 4 to 5 minutes on the proxied or hosted-bd lanes. When it is spent, the run stops at the next boundary and exits 75 with paused in <phase> at <n>/<N>:
  • before a first cutover’s marker, the city is unconverged and boot refuses it, as for any copy still under way. Running the same command again keeps every row an earlier run copied that still equals the work store, and every edge between kept rows that already carries the right payload. It deletes and copies again any row the work store changed since, or that the binding holds an edge of the work store no longer has.
  • after the marker, the clear is pending and boot refuses it as retained copies. Running the same command again finishes the clear from the rows it had not yet removed. The clear re-adds no edge, so nothing waits on the finishing run; every run checks the edges from work beads onto the rows it is about to remove again before it removes one (see step 9 below).
  • in the re-copy of a binding whose database is gone (--from-backup, or --from-work on a city whose work store was never cleared), the old marker is still in place, so before the re-copy creates the database it writes infra.recopying beside the marker. Until the re-copy’s own marker lands and removes that record, the binding is stale whatever its database holds: boot refuses it, gc storage status reports it unconverged, and running the same command again resumes the re-copy, keeping every row already copied that still equals its source. A re-copy that fails or is killed part way stays stale the same way.
In every case the proof is unchanged: the copy is proven against a re-read of its source before the marker, and the clear deletes only rows the manifest proves the binding holds. Nothing in the work store changes before the marker: until step 8 the source is exactly as you left it, and the cutover can still be abandoned by a config edit. Past the marker the binding is the only authoritative copy, which is why step 9 exists — a copy left behind in the work store is served to every reader that reaches the work store first (bd, gc hook, the demand and claim surfaces), and a workflow step closed in the binding stays open there and is dispatched again and again. Step 9 never writes a cross-store edge. Every dependency from a work bead into a moved bead is removed with it, recorded, and not re-added. Before the first row goes, the clear runs the copy’s rules against the binding’s copy of each moved bead, and refuses, removing nothing, while an edge still matters: an open work bead blocked by a moved bead the binding has not finished, or a tracks or parent-child edge with both ends open. Finish the moved bead in the binding or remove the edge (gc bd dep remove <work> <infra>), then run the same command again. A copy by this build has refused those shapes already; the check is what holds a city an earlier build converged with its copies retained, and it runs again on every resumed run. Step 8 never changes a work bead’s text. bd delete --force (and the native Dolt delete) rewrites every mention of a deleted id in the text of each bead still linked to it, to [deleted:<id>]. The beads step 8 removes were moved, not deleted, so every edge touching a moved row is removed from the work store (and recorded in the backup) before the row is, and the delete finds no neighbor to rewrite. No pre-removal of work-to-infrastructure edges is needed before the migration. What the clear records of each edge it drops. On every work store:
  • gc storage preflight lists every such edge under cross-store edges before the window, as a note that does not block;
  • the migrate output lists every one before the first row is removed;
  • each is recorded on its work bead, as a dropped entry in gc.migrated_cross_edges (the shape --from-rigs uses: dir, type, other, other_status_at_import, payload, action), so gc bd show <id> still names the bead a bug was discovered from;
  • every one stays in the backup (dependents on the moved bead’s entry, marked dropped).
A clear by an earlier build re-added such edges and recorded the ones a bd or native-Dolt work store refused in .gc/storage-infra-cleared.json; gc storage status still lists those under lost cross-store edges, and every storage.binding.* event that reads the note carries them as lost_cross_edges. This build adds none to that list. On a work store served by the city’s managed Dolt server, the clear’s deletes stay in the database’s Dolt history, and the migrate output ends with a reminder to run gc dolt compact. Compaction reclaims that space and also ends AS OF recovery from before the clear, so run it only once you no longer need that backstop. The migration never compacts on its own. The command is idempotent. Run it again on a converged city and it re-proves convergence and finishes any clear that did not complete, from the session the note names until the clear finishes; that is also how a city migrated by gc 1.5.0, which kept the work store’s copies, is repaired (see below).

Step 4b: import each rig

Before S4 a rig’s convergence loops, cook --attach grafts and their control trees were written to the rig’s own store. On a split city graph beads live in the city binding at every scope, so those rows move too, rig by rig, with the fleet stopped:
Each row keeps its id and is stamped gc.root_store_ref = rig:<rig> (wisps and steps included). Edges inside the moved set are copied; an open blocks edge onto rig work becomes a cross-store gate in the binding; every other boundary edge is dropped and recorded on the row (gc.migrated_cross_edges) and in the rig’s backup. A gate minted before the import onto one of the rig’s graph beads (by the city copy in Step 4, or by another rig’s import) keeps working once the import moves that bead: the gate lane reads the binding too, and closes the gate once the bead closes there. Shapes that would need a cross-store edge are refused by bead, with the fix. Per rig it writes infra.rig.<rig>.migrated.beads (the manifest) and infra.rig.<rig>.migrated beside infra.migrated, backs the rows up to infra.rig.<rig>.retained-source.jsonl, raises the rig’s min_hash_length so a later short id cannot re-mint an imported one, then clears the rig’s copies and marks .gc/storage-infra-cleared.rig.<rig>.json complete. A rig with no graph row is recorded infra.rig.<rig>.clean. Suspended rigs are imported without being resumed; a rig that cannot be read blocks only itself. Every step resumes: run the command again after any failure. A pending clear makes boot refuse until the re-run finishes it. gc storage status exits non-zero while any rig awaits import, holds a pending clear, or holds rows written after its import. A rig whose store holds no infrastructure bead never needs this step: gc rig add (a new rig, --adopt, or a re-add) and the rig census the city runs at each boot record it infra.rig.<rig>.clean once the city binding has converged, so a rig added before a born-split city’s first start, or an adopted store holding only work, does not wait for an import. A rig suspended at boot is not opened then: the controller censuses it when it resumes. Neither records a store the import refuses as shared (see below): that rig stays awaiting import, and gc rig add and the census’s storage.rig_residue event say why. The import refuses, before writing anything, a rig store another registered city also uses or that it cannot rule out as one (a shared or company store imports under --force=shared-store:<identity>, with every other city on it stopped and registered as in Step 4; a Dolt rig whose endpoint does not resolve and that pins no database name cannot be compared), rows scoped to another rig or city, open rows another city’s agent claims, rows its manifest says it carried that the binding no longer holds, and a rig whose store cannot read the payload of an edge the import copies or backs up. A bd CLI rig with an edge on a row it moves is such a rig, and so is a generic exec rig with one: the city migration copies a generic exec store’s edges carrying no payload, as its protocol declares, but the rig import does not take that declaration yet. The import runs in the same maintenance window as the city migration (Step 4), so a managed rig is read natively. A proxied-server rig is read on the proxied-native lane, which the window forces on. When the window starts the city’s provider it also starts the proxied scope of every rig the import reads, and a rig scope that will not start refuses the run; at the end it stops every provider-owned scope, as gc stop does. A rig whose proxy is down anyway (the window found the provider up and started nothing) is read through the bd CLI instead, silently: a rig with no edge on the rows the import moves imports as before, and one with such an edge is refused by the payload-read refusal above. Bring that rig’s proxy up (any bd read in the rig does) and run the import again. While an import is in flight (infra.rig.<rig>.importing beside the binding) boot and every gc command refuse; re-run the import to finish it. If a rig store is gone for good after its import wrote its marker, gc storage migrate --from-rigs --rig <rig> --abandon-rig-store --fleet-stopped proves the binding holds every row the manifest records and then records the clear complete. It refuses while the rig store is still reachable, while an import is in flight, and while the binding holds rows of that rig its manifest does not record. Rig records name the store they speak for: a new store under a reused rig name is not taken for the old one.

Step 5: start, and verify

status reports the class map, the binding, the marker and manifest paths, how many infrastructure beads the work store still holds, the retained-source backup and how many beads it records, how many the binding itself holds right now, and — once converged — the proven-copy size, the stranded count, and the number of retained copies still in the work store. It exits non-zero while the city is unconverged, while it holds a stranded write, and while the work store still holds copies of beads the binding owns, so a deployment script can gate on it. On a converged city source: reads 0 and binding: carries the count. On an unconverged city binding: reads zero without the database being created to learn it. A work row that blocks on a malformed <type>:<id> literal (such as discovered-from:<id>, a typed edge written as a blocks target) reads as ready on a single-store city, because bd reads the literal as no blocker. On a split city gc ready holds the row, because no store resolves the literal, whether or not the split moved <id>. gc storage preflight lists every such row of the city’s work store under malformed edges before the window, with where its <id> ends up. It does not read the rigs’ stores: gc doctor --check dangling-blocking-edges names their rows after the split. After the split, gc doctor --check dangling-blocking-edges --fix repairs each literal:
  • one whose <id> is still in the row’s store is rewritten as that typed edge;
  • one whose <id> only the binding holds (the split moved it there, or the binding minted it) is removed, and the edge it meant is recorded on the row with the literal’s payload (gc.migrated_cross_edges, action: "dropped"). It writes no edge, because no edge crosses stores. --fix keeps the literal and says why when the row’s store cannot report the payload, or when the row already records that edge without it. For the first, bring the scope’s proxy up (any bd read in the scope does) and run --fix again. Either way you can remove the literal yourself with gc bd dep remove <row> <literal>, which drops its payload;
  • one whose <id> no store holds is removed;
  • one whose <id> another work store holds (a rig’s, or the city’s for a rig’s row) is left for you.

gc bd on split cities

On a split city, gc bd is an allowlist. bd writes whatever it is told into the work store. A bead that lands there with an infrastructure class (a gc:session label, a gc.root_bead_id, a message type, and so on) is stranded: no reader of its class sees it until it is repaired. The city serves degraded around it and says so (see “Stranded writes: degraded serving” below). Plain bd, run in the city directory, is NOT judged by any of this. It writes the work store directly, so on a split city create every bead with gc bd create, and never put a class key on a bead you create (gc.root_bead_id, gc.kind, gc.formula_contract, gc.synthetic*, a gc:* label, or an infrastructure type). On 2026-11-09 an agent’s plain bd create carrying gc.root_bead_id (copied from its claimed formula step as provenance) stranded three ordinary work beads on substrate. How a command gets through:
  • The bd binary’s command tree must match a pinned inventory. gc does not trust the version string: every Enterprise build reports 1.3.0, and an OSS build from main reports 1.3.2 with a tree that differs from the 1.3.2 tag’s. Instead gc walks the binary’s --help for every visible command and compares the commands, aliases and flags (shorthand, type, default, no-value default, usage) with the visible projection of each pinned inventory: bd 1.3.2, bd 1.3.4 (bd 1.3.3 has the same tree), and the bd 1.3.0 Enterprise build at commit 77612097cec0. A binary that matches one is judged against that inventory; any other is refused, with a gc_bd.refused event and a gc doctor error (check bd-command-inventory, which gc start also warns about). The inventory is bd’s own command tree, hidden flags included, dumped from source by internal/bdflags/inventorygen/generate.sh with its provenance (commit, build tags, Go, cobra and pflag versions). Hidden commands and flags are not in --help, so for those gc relies on the pinned inventory of the build whose visible tree matched.
  • The walk is isolated and must be conclusive. gc runs each bd <path> --help in a scratch directory under .gc/cache/tmp that is also bd’s HOME and TMPDIR, with only PATH besides, so a caller’s environment (CLICOLOR_FORCE, BD_NAME, BEADS_DIR, TMPDIR) cannot change what it reads. The walk stops at the first level of the tree that no inventory matches, and never runs a command no inventory knows. On a city whose .gc is read-only the cache is read but not written. Each run is killed with its process group after 20 seconds, and the whole walk after two minutes; stale scratch dirs are removed on the next walk. The binary must also be a Go build of bd’s cmd/bd with the cobra and pflag versions the matched inventory records, which rejects a mise or asdf shim or a wrapper script: point PATH at the real binary.
  • Only conclusive verdicts are cached. gc keys a verdict by the binary’s resolved path, device, inode, size, modification time and change time, and by the set of inventories this gc embeds, in .gc/cache/bd-inventory.json (locked across processes, so a cold cache costs one walk). Any replacement (cp, cp -p, install -p, rsync -t, tar, a rename into place) and any gc upgrade that changes the inventories re-judges the binary. A walk that fails, times out or reads a root with no commands is reported as an error and remembered for a minute; it is never cached as a refusal.
  • The vouch is a convenience. gc storage vouch-bd (with --rig <rig> for a rig’s bd) walks the binary for real, never trusting a cached verdict or an existing vouch, and, only if its tree matches, records the binary’s path, its bytes (sha256), the inventory and this gc’s inventory set in .gc/bd-inventory-vouch.json. That binary is then admitted without a walk. The first admission by a vouch in each gc process (from the vouch or from the cached verdict it produced) records a gc_bd.vouch_used event. A binary that matches nothing is refused and nothing is written. A gc whose pinned inventories differ (an upgrade) ignores the vouch and walks the binary again. The vouch never goes in city.toml, so every gc version still loads the city, and you never edit a file to vouch.
  • Neither the vouch nor the cache is a security boundary. Anyone who can write .gc can forge either. gc doctor therefore walks each distinct bd binary for real once per run and reports a binary whose cached or vouched verdict the walk contradicts (the walk also corrects the cache). An unreadable vouch file is ignored with a doctor warning. gc start’s warm-up reports from the cache only: a binary gc has not judged yet is “pending”, not a failure.
  • gc resolves the command exactly as bd does, with a mirror of that tree under the same cobra and pflag versions. It refuses any argv where cobra’s command lookup and pflag’s flag parse disagree about which arguments name the command. It also refuses any short-flag run that ends in a flag taking the next argument (-qC x); spell such a flag on its own.
  • Only the commands and flags below are forwarded. Anything else is refused, and nothing is written. The refusal names the command and the gc alternative. --help on any command is allowed, because bd only prints help.
Single-store cities are unaffected: there gc bd forwards everything unchanged. Reads: show, list, ready, search, query, count, children, blocked, stale, status, statuses, types, where, info, context, version, help, human, prime, history, graph, export, state, state list, comments, comments list, label list, label list-all, dep list, dep tree, dep cycles, mol current, mol show, mol progress, formula list, formula show, gate list, config get, config list, config show, backup status, dolt status, dolt show. gc serves its own release-if-current itself. Writes that change no field the class depends on: close, reopen, assign, priority, note, comment, comments add, heartbeat, unclaim, reclaim, defer, undefer, dep remove, dep unrelate, promote, gate resolve, gate check, backup sync, backup init, dolt start, dolt stop, dolt push, dolt commit, and init (only --prefix, --non-interactive, --skip-hooks, --skip-agents, --init-if-missing and --recreate-missing). Writes gc judges:
  • create and q: the new bead’s type, labels and metadata are classified, including a --metadata @file, which gc reads, and the labels bd copies from a --parent (unless --no-inherit-labels). bd copies the labels of the parent its own store holds, so a parent that store’s read does not find exactly is refused. An --id inside a class binding’s reserved namespace is refused, and so is an --id the class binding holds: gc storage migrate keeps a moved bead’s id and clears the work store’s copy, so bd would mint that id again while every by-id gc command answers from the binding’s bead. create --graph: gc reads the plan (relative to the directory bd runs in) and judges it node by node, a dry run exactly like the live call. Each node’s type, labels and metadata are classified as bd writes them (bd never copies a parent’s labels onto a graph node, and writes over each metadata_refs key the id of the node it names: that node’s id, or the id bd mints for it); a node id refused for --id above, a field outside bd’s graph-plan schema, and a plan gc cannot read are refused.
  • delete (positionals and --from-file): every id must name exactly one bead of the work store (bd would delete whatever bead a short id prefixes). Refused when a class-binding bead depends on one of the beads, or an open cross-store drain gate waits on it (gc.cross_store_blocker), because that edge or gate would dangle; --gc-allow-dangling-edges (gc’s own flag; bd never sees it) overrides that check, not the id check. --cascade is refused.
  • init: a --prefix inside a class binding’s reserved namespace is refused.
  • update, label add, label remove, tag and set-state: the write is judged against the bead its id resolves to. If the id resolves to no bead, to a different bead (a short or partial id), or cannot be read, a write that touches type, labels or metadata is refused.
  • Metadata (create and update --metadata, update --set-metadata, the nodes of a create --graph plan, the rows of an import) is classified as each of the city’s stores reads it back once bd has stored it. They agree on a string value, but a JSON null reads as empty to the bd CLI and as the text null to a native Dolt store, and gc.root_bead_id set to null is a graph marker. A write is refused when either reading moves the bead out of the classes its store holds. An import row is kept when its store holds the row’s class under both readings, and is handled like any row of a class the store does not hold (refused, or left out with --skip-infra) when it holds neither; a row its store holds under one reading only is refused, even with --skip-infra. Write such a key as a string, leave it out, or clear it with update --unset-metadata.
  • label propagate: a class-marker label is refused.
  • import: rows of a class the store does not hold are refused, or left out with --skip-infra. gc reads the file the way bd’s import does: a line with a _schema key is the export header, a line whose _type key is exactly "memory" is a memory record, and a row whose status is tombstone is skipped. bd imports every other line as an issue, whatever else its _type says, so gc classifies every other line. A row the store keeps is refused when a class binding holds a bead with its id, as create --id is: gc storage migrate keeps a moved bead’s id, so every by-id gc command would answer from the binding’s bead. A dry run writes nothing and is not checked.
  • mol burn (the gastown patrols): every id must name exactly one bead of the work store, as for delete. The burn is refused when a class-binding bead depends on, or an open cross-store drain gate waits on, the molecule or any bead bd lists below it (bd list --parent, recursively), because bd deletes all of them at once. For a persistent (non-wisp) molecule it is also refused when one waits on a bead that depends on any of those, through any edge (bd dep list --direction=up, transitively): on a proxied-server store bd’s burn deletes those beads too. --dry-run deletes nothing.
  • mol wisp gc (the deacon prompt): gc first asks bd which wisps the same command would delete (it runs it with --dry-run --json). It refuses when a class-binding bead depends on, or an open cross-store drain gate waits on, any of them. Otherwise gc has bd delete exactly the wisps it checked (bd delete --force, which prints delete’s report) instead of running the gc, which would select again: a wisp that becomes a candidate after the check is left for the next gc, and a checked wisp that a second dry run no longer selects is left out. --closed --force, which deletes every closed wisp whatever its age, is refused. So is an --age under an hour (bd’s default): a shorter age reaches wisps closed so recently that the gate sweep may not yet have released the class-binding gates waiting on them, and gc would refuse the whole gc while one of those gates is open.
  • purge and prune (the core reaper’s purge and session prune): bd deletes the closed beads it selects all at once, and its dry run counts them without naming them, so gc cannot check each one against the class binding as it does for delete. gc holds a run that deletes (--force without --dry-run) to age instead: it must give --older-than, which gc reads as bd does (7, 7d, 1w, 168h), and an age under a week (168h) is refused, as is prune --ignore-references. The gate sweep, which runs every 30 seconds, releases a class-binding gate once its work blocker closes, so a bead closed a week ago is clear of the open cross-store drain gates unless the sweep has not run since then. The reaper’s default ages (GC_REAPER_PURGE_AGE 168h, GC_REAPER_SESSION_PURGE_AGE 720h) meet that floor. Set either one under 168h and that reaper step’s gc bd call is refused each time the step runs: the reaper records an anomaly, and gc records a gc_bd.refused event. Age does not cover a dependency edge that a class-binding bead itself holds on a closed work bead (a migration can carry such edges into the binding): purge and prune can delete that work bead and leave the edge dangling.
  • batch: every create line is classified.
  • A file gc judges (batch --file, delete --from-file, a --metadata @file, a create --graph plan, the import source) is copied, under its own file name, into a private directory under TMPDIR (or /tmp) once judged, and bd is pointed at the copy, which is removed when gc bd returns. bd writes exactly what gc judged: a file rewritten after gc read it changes nothing. A pipe (<(...), /dev/stdin) given to batch --file, delete --from-file, create --graph or import is drained by gc’s read, and bd gets the drained bytes. bd prints the copy’s path; where it records only a file name (an import’s history entry), that is your file’s name. A write gc cannot copy (TMPDIR missing, unwritable or full) is refused. Every spelling of the import source bd accepts (a short-flag run such as -qia.jsonl, a name after --) is pointed at the copy. On every city, single-store or split, a --metadata @file of create, new or update is read once, before any check, so every check and bd read the same bytes and a pipe works there too.
  • sql: only a single plain read is allowed: no comments, no Dolt procedures, no backtick-quoted Dolt names.
  • config set and config unset: only types.custom, types.infra, types.retained, and keys under custom. (bd’s namespace for user-defined integration keys, which no class route and no create reads).
  • mol wisp and mol wisp create: only with --root-only (the gastown patrols’ shape). That creates a single bead, and gc judges every bead bd could clone for it before bd runs.
  • cook: only without --persist.
  • No edge ever crosses stores. dep add (positionals, --blocked-by, --depends-on), dep relate, link, duplicate (--of), supersede (--with), gate create (--blocks), create/q/update --parent, create --deps and --waits-for, the id-named endpoints of a create --graph plan (a node’s parent_id when it names no parent key, a deps target that is not a plan key, and an edge’s from_id, to_id, spawner_id and thread_id; an id that is a node’s own id names that node of the plan, and bd writes the others exactly as spelled, so one with leading or trailing whitespace is refused), the dep add lines of a batch, and the dependencies of an import must each name beads of the city’s work stores that no class binding holds. Each endpoint is read in the work store its id prefix names, so a dependency between a rig’s bead and the city’s (or another rig’s) is allowed. An external: reference is not a bead and is allowed. Through the by-id door, update --parent of a binding resident must name a parent the same binding holds. dep add --file is refused.
Aliases forwarded: new (create), done (close), view (show), hb (heartbeat), stats (status), dep rm (dep remove). Every other alias is refused, mol fart and protomolecule included. Notable refusals and what to use instead: There is no override flag for these. gc cannot verify a backup’s age or a merged revision’s contents against the split, so these commands stay refused. No refusal sends you around gc: going around it would skip every check above. Every refusal also writes a gc_bd.refused event to the city’s event log, with the command path, the verb, the scope, the caller (GC_AGENT) and the session, so a script’s || true cannot hide one. Requesting an addition. The allowlist lives in cmd/gc/bd_split_allowlist.go. To add a command, open an issue or a PR that names the workflow that needs it and says why the command cannot change a bead’s class or write a cross-store edge, or how a judge would decide it. Add a row and its tests, and add it to this section; TestGcBdSplitAllowlistIsDocumented checks that this section lists every allowlisted command. Until then the command is not available through gc bd on a split city.

Upgrading a city migrated by gc 1.5.0

gc 1.5.0’s migration kept the work store’s copies of every bead it moved. A city in that state refuses to start under this build:
That is the whole repair:
The command re-proves convergence, then runs step 9 above. Copies the binding’s own garbage collection has since removed from the binding are cleared too: they are the frozen rows the demand surface would otherwise serve forever. If the city also holds a stranded write, the command names it and clears nothing; run gc storage recover-stranded --from-work --fleet-stopped first, then the migration again.

Stranded writes: degraded serving

A converged city whose work store holds infrastructure beads the binding does not serve is stranded. Before this build, one stranded row refused every infrastructure class in every gc process: workers could not claim, close, drain-ack or send mail, while the controller (which checks only at boot) kept dispatching, and the writer that stranded the row, which never consults the gate, kept writing. Now the city serves degraded, as long as no stranded id is held in the binding by a different bead and the work store holds no retained copy of a bead the binding owns (and no clear is left unfinished):
  • the stranded rows stay invisible to their class readers until repaired; a by-id read of one misses the binding and the work store answers with the only copy;
  • every gc process prints one WARNING: serving degraded line naming the ids;
  • gc storage status exits 1 and prints serving: degraded, with the repair;
  • gc doctor reports the city as an error;
  • the controller publishes storage.binding.stranded (see “Watching a cutover from outside”).
A stranded id the binding holds for a different bead still refuses the whole city, with the ids in the refusal; resolve it with recover-stranded’s per-id choices (below). So do retained copies beside a strand, because a reader that reaches the work store first is served the frozen copy and re-dispatches finished steps (#5987): the refusal and gc storage status name the clear, gc storage migrate --from-work --fleet-stopped, and recover-stranded prints it even when it exits 1.

Repair in place: a work bead that carries a class key

The common strand is ordinary work that a plain bd create stamped with gc.root_bead_id, naming the workflow the writer was running. When that is the row’s only class key (no gc.kind, gc.formula_contract or other class key, no class-deciding type or label, and no gc.step_id, which marks a real formula step), gc storage status names it as infrastructure class “only because of metadata”, with the exact repair. Run it on the running city; no stop is needed:
gc bd judges that write and allows it, because it returns the bead to the work class its store holds. Do NOT copy such a row into the binding: it would become a member of that workflow, the workflow’s cleanup would close it, it could take no comments, and work readers would stop seeing it. gc storage recover-stranded therefore leaves these work-shaped rows in the work store by default, lists them apart with the same repair, and exits 1 while any is left. If one really is a workflow step a writer gc could not fence created, name it with --move <id> to copy it into the binding.

Upgrading a city whose storage check refuses

Before gc hook claims work for a session, it reads that session’s drain state from the binding. On a city whose storage check refuses (gc storage status exits non-zero), that read fails and the hook fails closed: it claims nothing, prints GC_HOOK_STORE_UNAVAILABLE on stderr, and exits 2. Builds before this behavior kept claiming from the work store, so a city can have been refused for a long time while its sessions kept working. Deploying onto it stops every session’s claims at its next hook. So stop such a city before the new gc is installed, and repair it with the new gc before you start it. The gc you are replacing cannot finish the repair: its migrate refuses a converged city over infrastructure beads that rig scopes still hold, its recover-stranded has no per-id choices, and its clear matches the copy manifest by bare id, so it can delete a bead the copy never carried. A stopped city runs no gc hook, so installing the new gc while it is stopped stops no claims.
Recovery copies every stranded bead into the binding as it is, so an open message there is delivered and an open wait or session comes back to life. Read the dump first, and close in the work store, with bd close <id> from the city directory, any bead that must not: stale handoff mail, for example. A store that only timed out does not stop claims; the hook goes on and names the fault. On a city that already converged, the migrate step copies nothing: it clears the retained copies, and infrastructure beads that rig scopes still hold from before the split do not stop it.

Stranded mail nobody will read: purge it instead

When the stranded beads are mail that must never be delivered, such as weeks of unread auto-handoff mail, purge them instead of recovering them. --purge-type message backs up, then deletes, every row the storage check calls stranded whose type is message. It selects rows by that check, never by manifest id, because bd reuses short wisp ids. The purge never deletes:
  • a row the binding holds as the same bead (the same id and creation time);
  • a stranded row of another type, which you must still recover;
  • a stranded message row that the classifier puts in another class, which is not mail and which you must still recover too.
The run names the stranded rows it leaves. Recover them with gc storage recover-stranded --from-work once the mail is purged: run before the purge, that copy would carry the stranded mail into the binding too. It also refuses, dry run included, a work store that cannot list relations, such as bd’s Postgres backend: the restore reads every edge back through that listing, so a purge there could not be undone.

1. Rehearse

The dry run is read-only and safe on a running city:
It prints the count, a digest of the selection, the id range, the creation dates, the title histogram, the number of edges, and one line per row. Its last line is the confirmation the delete needs, for example --fleet-stopped --confirm-purge --expect-count 791 --expect-digest 3f2a.... The delete needs both the count and the digest, and refuses when the selection it computes is not the one you reviewed. The count alone does not pin the selection: one stranded row leaving and another arriving keeps it.

2. Take a full export of the work store first

The purge writes its own backup, but take an independent one with the bd the city pins, from the city directory, with the city stopped:
--all includes the wisp tier and the infrastructure rows. Check the line count before you go on.

3. Purge, with the city stopped

Every row is first written to infra.purged-stranded-<time>.jsonl at the binding root, with its metadata, labels and every edge touching it. For an edge to a row outside the purge, the backup also records which bead that row is (its id and creation time). The dry run and the run name every edge whose other end the work store does not hold, such as an external: reference: no restore could put it back. The file is synced and read back before anything is deleted. The edges are removed before the rows, because bd delete --force rewrites every mention of a deleted id in the text of rows still linked to it. The run is recorded in infra.purged-stranded.jsonl. If a run stops partway, gc storage status reports purge: INTERRUPTED, names only the purge’s remedies, and exits non-zero. Until the run is finished, restored or closed, gc storage recover-stranded refuses to copy, and refuses its per-id answers too: the run may have removed the edges of rows a copy would carry, and its backup is their only copy. Rehearse the purge again with --dry-run, which refuses wherever the run would and prints what is left and the flags that finish it, then run the same purge again. It finishes the interrupted run over that run’s own rows:
  • if rows of the run are left, it resumes from the same backup;
  • if every row of the run is already gone, it records them and exits 0;
  • a row stranded since the backup, or a new bead under an id the run deleted (bd minted it again), is not part of the run: it is named and left in place, and the next purge selects it;
  • it refuses when a row of the run changed since the backup, or is still in the work store but no longer selected, for example because it was carried into the binding. Restore the run, or close it (below), and start again.

Restoring purged mail

This puts every row of the backup back into the work store as it was, with its id, creation time, tier, labels and metadata, and adds back the edges in both directions. It refuses, before writing anything:
  • an id the work store now holds for a different row (bd minted it again). The refusal names the id. While the run is interrupted, finish it by running the purge again, which leaves the new row in place; otherwise move the new row out of the work store first;
  • a row the binding now holds as the same bead. It was carried into the binding after the purge, by an older build’s recover-stranded or by hand, so the binding serves it, and this command writes only the work store.
An edge comes back only when its other end is a row of the backup or the bead the backup recorded there. An edge whose other end no longer exists, or is a different bead under the same id now (bd minted it again), is left out and named, and the rest of the backup is restored. The backup keeps that edge. When the edge left out is a row’s parent-child edge, the row comes back without that parent, and the line naming the edge says so. While a purge run is interrupted, it restores only that run’s backup. The rows are stranded again afterwards, and gc storage status names them. --dry-run shows what it would do, and refuses wherever the restore would. Running it again skips what is already back. If a restore stops partway, gc storage status reports purge: INTERRUPTED, and recover-stranded refuses until the run is settled: the restored rows may lack edges the restore had not added yet. Run the same restore again to finish it. If the work store cannot import rows verbatim, or cannot list relations, the command says so, in the dry run too. Restore with the city’s own bd instead, from the city directory:
First check that no id in the backup is now held by a different row: bd import overwrites an existing id. When the restore refused a row the binding holds as the same bead, leave that row out of the import (start the first jq with select(.entry.bead.id != "<id>") |), and add the backup’s edges of that row to the binding’s copy where it lacks them. Also leave out an edge whose other end is outside the backup and is gone, or is now a bead with a creation time other than the one its record lists under .entry.endpoints: bd dep add would attach it to whatever holds the id now. If the run is interrupted, close it after a raw restore with gc storage recover-stranded --from-work --fleet-stopped --purge-type message --abandon-purge. That command refuses while any row of the run, or any edge the restore would put back, is still missing, or is back without the payload it carried.

Example: maintainer-city

Read-only rehearsal, with the fleet running and the new gc at a path no agent runs:
The window. Stop the city with the deployed gc, then check that nothing can write the work store:
Export the work store with MC’s pinned bd, and check the message rows:
Install the new gc. With it:
Copy the backup and the ledger off the host before you start the city:
If gc storage status still reports retained or unrecorded rows, resolve them as described in the following sections before gc start. Rollback, with the city stopped:
If the restore cannot run, use the raw bd fallback above with MC’s pinned bd. First check that no id in the backup is now held by another row. This must print nothing:

A reused id the binding still holds

The work store can mint a short id again once its own bead under that id is gone. If an infrastructure bead lands under such an id while the binding still holds the bead the migration carried under it, no copy can carry the new one: the id is taken. Boot and gc storage status name these ids, and recover-stranded lists them under NOT RECORDED with both beads side by side. Two beads are told apart by when they were created: a bead the binding holds under the id with the same creation time is the same bead, changed since it was carried, and recover-stranded records it instead of asking. A work-store bead with no creation time is the same bead when the binding’s row under its id was copied from the work store, which the copy marks on the row. Decide per id which bead keeps it: Each choice first writes the bead it removes, with every dependency edge touching it, to infra.recover-choices.jsonl at the binding root, re-reads the file, and only then removes anything. Those edges go with the bead: kept, they would point at the other bead under the same id. --dry-run shows both beads of each id without writing, and repeating a choice that already took effect is a no-op.

A bead the copy manifest lists by id alone

A manifest written by an earlier gc lists some beads by id alone. When the binding no longer holds such a bead, the manifest may not say whether the work-store row is the bead the copy carried: it records no time to judge it by, the row has no creation time, or the row is younger than the manifest. An earlier recover-stranded added the id of every bead it copied, so the binding may since have delivered, closed and collected that very bead. recover-stranded moves such a row when it is closed. An open one it refuses and lists with its status, type, times and title, because moving a bead the binding already delivered would deliver it again. Decide per id: --dry-run and --dump list these rows without writing.

A bead prefix in a reserved namespace

The binding mints ids under the reserved prefixes gcg, gcm, gcs, gco, gcn and gcnq. A split city whose bead prefix, or a rig’s, is one of them, or starts with one before its first hyphen (gcg-alpha), shares the binding’s id namespace, so their ids collide. Ordinary names derive such a prefix: a city named gas-city-ops derives gco. Earlier builds only warned. This build refuses gc start, boot, a config reload and gc storage migrate, and gc storage status exits 1 and names the prefix:
The refusal is standing, so from deploy on every gc hook in the city fails closed and claims nothing, and the repair steps above do not clear it. Fix it before you install the new gc, with a prefix whose first segment is outside the reserved set: The new prefix applies to beads minted from then on. Work beads already minted under the reserved prefix keep their ids, which the split city looks up in the binding: the new prefix does not move them.

Watching a cutover from outside

A boot that reaches a verdict about the binding publishes one storage.binding.* event carrying that verdict and, on a serving outcome, the size of the proven copy it rests on: The last one is a verdict, not the absence of one, and it is why a subscriber can gate on these events at all: silence would otherwise be indistinguishable from a gate that crashed before deciding. outcome is finer than the event type. The refusals unconverged, born-split-blocked, genesis-blocked, retained-copies and identity-mismatch all arrive as storage.binding.unconverged, because a subscriber branches on “is this city serving” and all of them answer no. The outcome field says which no it was and invariant says why, so a consumer that switches on outcome must handle every value, not only the type names. stranded has its own type because it answers both ways. serving is set only by a boot gate (a controller boot, or a gc process resolving its routes) and says what that gate did; it is absent on operator-command and recheck events and on events older builds recorded, and absent means “not stated”, never false. A stranded event also carries stranded, held_different, presumed_reused and retained (each up to 50 ids) with stranded_count, held_different_count, presumed_reused_count and retained_count. Alert on storage.binding.stranded. A stranded city no longer announces itself by refusing to start. The controller publishes the event at boot and from a read-only recheck it runs every 10 minutes (events marked recheck: true), whenever the definitive verdict changes, and publishes storage.binding.converged once the set is empty again. A recheck whose read fails transiently publishes nothing; one that cannot run for a standing reason publishes storage.binding.uncheckable once. Neither stops anything: the running controller keeps serving. proven_beads is zero on every refusal, where it means the size was not established rather than that the copy is empty. On genesis the zero is real. It is also real on a born-split converged, where it means something else again: no copy ever ran, and the discipline being reported is that the work store holds nothing the binding would need. Those two are told apart by database, which a born-split event leaves empty. Some refusals publish nothing, on purpose or otherwise. A [storage.classes] arrangement this build cannot serve at all, a plan that does not resolve, and a binding whose provider opens no bead engine are all refused before any verdict about the binding exists — the last deliberately, so a permanently unservable binding does not publish converged on every boot. Gate on the events for the cutover states above; read the exit code and stderr for the config states, which no event describes.

gc bd ready stops answering, on purpose

After the split, gc bd ready is refused with exit 1 on this city no matter what arguments it is given, and the refusal names the relocated class and the binding. gc bd list --ready is refused the same way, because bd documents that flag as “same semantics as bd ready” and runs the same query. It is not a bug and it is not scoped to the arguments: bd ready computes a frontier over the one ledger bd resolves from the working directory, and takes no selector that could reach the binding, so its answer is the work-class subset of the city’s ready set and nothing distinguishes that from the whole of it. Use gc ready instead. It federates the city store, the binding and the store of every rig that is not suspended, and exits non-zero naming the leg it could not read rather than returning a short array. A rig suspended with gc rig suspend, or declared suspended_on_start and not resumed, is skipped just as the controller skips it: what its own store holds comes back on gc rig resume, and routed graph work in the binding stays visible throughout (see gc ready). Every worker’s generated work query is already swapped onto it, so this affects operators and ad-hoc scripts, not the work loop. The core orphan-sweep order also reads in-progress claims through it. gc ready is flag-compatible with the bd ready invocation that generated work query builds — not with all of bd ready. It takes --assignee, --unassigned, --metadata-field, --exclude-type, --exclude-label, --sort, --limit, --include-ephemeral, --status and --json, and rejects the rest of bd’s ready surface (--label, --label-any, --parent, --type, --priority, --offset, --has-metadata-key, --mol, --include-deferred, --gated, --claim, and every single-letter shorthand such as -u or -n). Its --sort takes oldest|newest, not bd’s priority|hybrid|oldest. If your query needs a flag only bd has, narrow with --metadata-field or read the relocated class directly from the binding — GC_BD_ALLOW_RELOCATED_CLASS_READ=1 runs the one-ledger read anyway when the work-class subset is genuinely the answer you want. Make sure the gc on every agent’s PATH is the build that has gc ready: the generated work query shells out to it by name, and an older gc on PATH fails every hook with running work query: exit status 1.

Snapshots and restoring the binding

gc storage snapshot writes a snapshot of the city’s stores into a new directory, .gc/snapshots/<id>/ by default (--to DIR to put it elsewhere):
Each store gets an exact copy where its kind has one, and a JSONL of every row with its edges and their payloads: Know what each one can bring back:
  • The JSONL is a record, not a restore source. No tool imports it yet (the manifest says "jsonl_restorable": false). For a generic exec store, which has no exact copy, a snapshot is therefore not a way back to the store.
  • A Dolt tag holds the committed tables only. bd keeps wisps in dolt_ignore’d tables, so they are not in the tag; the JSONL holds them. A working set with uncommitted changes is noted in the manifest.
  • The binding is restorable (below). A work store is restored by hand: CALL DOLT_RESET('--hard', '<tag>') on its Dolt, or bd import of the snapshot’s work/export.jsonl. gc storage migrate --to-work is the automated rollback.
A snapshot directory holds manifest.json only once every file in it has been re-read and proven, so a directory without one is an interrupted snapshot: --verify refuses it, and the next snapshot into the same directory removes it. --keep N (default 2) keeps the newest N of this city’s snapshots; snapshots of another city or work store in a shared --to are left alone. A snapshot with a pinned file in its directory is never counted or removed. On a split city the core binding-snapshot order snapshots the binding every 6 hours into the core pack’s state directory, <city>/.gc/runtime/packs/core/binding-archive/, and keeps the newest 4 (--keep 4). On a city with no binding it does nothing. Its snapshots are not in the default directory, so pass that directory as --to to verify or restore one:

Restoring the binding

With the city stopped, and --to naming the directory the snapshot is in (.gc/snapshots when it is left out):
An id that is not in that directory is reported as missing, with the snapshots that are there. It installs the snapshot’s database in WAL mode, raises the id floor past every id the replaced database held (a wrapped range included), and keeps the replaced database, with its -wal, -shm and -journal, beside it as *.pre-restore-<ts>. A live database too damaged to open is restored over too: the restore warns that it could not check that database for rig imports (below), and keeps it aside like any other.
Do not copy a snapshot’s beads.sqlite into place by hand. It is in rollback-journal mode, so a binding served from it makes every reader stall the controller’s writers, and a copy put down next to the live database’s -wal can have that WAL replayed into it. The restore command switches it to WAL and moves the old files aside first.
From the moment the restore starts copying until it finishes, the binding counts as stale (infra.restoring beside it): every gc that boots refuses it and names the restore. A refusal before the live database moves changes nothing. A restore interrupted after that holds the city stale until you run the same command again. If one was interrupted before it moved anything, the stale message says the database is still in place; remove infra.restoring to keep it. A re-run that fails before it moves anything puts back the record the earlier run left, so the stale message still names the files that run moved aside. A binding whose re-copy (gc storage migrate --from-backup) never finished can be restored instead. The installed snapshot is a whole binding, so the restore removes the re-copy’s infra.recopying along with its own record. The restore refuses a snapshot of another work store (compared as boot compares a marker: the project id, else the database; never the path), and one taken before the binding’s records changed: a migration, a recovery or a rig import since. A rig marked clean since, and a marker that only gained its work-store identity line, are compatible. Rolling back past a rig import. A snapshot from before gc storage migrate --from-rigs imported a rig refuses, naming the rig’s records (infra.rig.<rig>.migrated and its cleared note). The binding’s database is only half of the rollback: the rig’s rows left the rig’s store. To go back:
Step 1 must come first. Moving the rig’s records aside without first restoring the rig’s store would make the binding restore drop the rows the import carried (they are in the binding and no longer in the rig), so they would end up in neither store. The restore refuses that case: it checks the live binding for rows stamped as imported from a rig that the snapshot lacks (not the cross-store gates the import minted in the binding, which the rig never held), reads the rig’s own store for them (starting the city’s bead-store provider for the read when it is stopped), and refuses the rows the rig does not hold under the same id and created_at, naming the rig and the rows, and which of them are ephemeral or no-history rows.
  1. With the city stopped, put every row the import carried back into the rig’s own store, under its id and created_at. The import moved rows of both tiers: the rig’s committed rows, and the ephemeral and no-history rows bd keeps out of Dolt history, in its dolt_ignore’d tables. By default gc stores sessions, waits, nudges, order tracking and mail that way, and, under [beads] bd_compatibility = "bd-1.0.5", its wisp and workflow rows too. Two sources hold both tiers:
    • The import’s own backup, infra.rig.<rig>.retained-source.jsonl beside the binding: every row it cleared from the rig, with its edges. Import it with plain bd: gc bd import cannot do it on a split city, because the binding holds these rows’ class and their ids, so it refuses them. Run every bd command of this step in the rig’s directory, in a shell with no BEADS_*, BD_* or GC_* variable set. bd takes its store from BEADS_DIR, its Dolt server from the BEADS_DOLT_* variables and its settings from BD_* before it looks at the directory it runs in, and a gc agent session sets them for its own store: a bd run from one writes the rig’s rows into that store instead, and every re-run writes them again. gc, in turn, takes its city from GC_CITY, GC_CITY_PATH or GC_RIG before the directory it runs in, and a gc agent session sets them for its own city: gc rig list run from one lists that city’s rigs, and a rig of the same name there passes the check below. bd reads no GC_* variable. So open a shell of its own for this step, clear them there, name the city, and check where bd points before anything is imported:
      Then, in that shell, run step 4 of Restoring the work store from the backup with B set to this file’s full path, bd in place of gc bd, and from the rig’s directory, not the city’s. Run bd where again in the same block, just before its bd import, and stop if its first line is not <rig path>/.beads. bd’s import keeps each row’s created_at, which the restore matches on, and the transform’s wisp_plane marker puts each ephemeral and no-history row back in bd’s dolt_ignore’d tables; without it, bd imports a no-history row among the committed rows. bd 1.3.2 to 1.3.4 leave out of the import each edge between a row they put in those tables and one they do not, a parent link included, and print Skipped dependency: <row> -> <row>: cross-bucket dependency … for it; the 1.3.0 Enterprise build keeps them. Add them back, still in that shell (an edge bd kept is left as it is):
    • A Dolt backup of the rig synced before the import and not since (dolt backup restore).
    A Dolt tag holds the committed tables only: CALL DOLT_RESET('--hard', '<tag>') to the tag a --rigs snapshot took brings back the committed rows and none of the others, and the restore in step 3 refuses while those are missing, naming the import’s backup. A Dolt backup synced since the import holds neither. A reset or a backup restore also undoes every write to the rig since then, its work included; the import’s backup adds back only the rows the import cleared.
  2. Move the rig’s records aside, its backup included once step 1 has used it: infra.rig.<rig>.* beside the binding, and .gc/storage-infra-cleared.rig.<rig>.json.
  3. Restore the binding: gc storage snapshot restore <id> --binding --fleet-stopped --to <dir>.
  4. Check with gc storage status: the rig shows as awaiting import again.

Reversing the split

gc storage migrate --to-work is the automated rollback after cutover. It copies the binding’s current rows back, so nothing written since the cutover is lost, and then retires the split:
In order (each phase is recorded in .gc/storage-reverse.json, and a run killed or paused at any point is continued by the same command): Before R3, and before the binding is archived, the binding is read again and compared with the one the copies were planned from; a binding that changed (a writer still reaches it) puts the reverse back to R0, and the next run copies again. Before R4 and before the archive, each store it wrote is listed again under its stamp against its manifest: a row gone puts it back to R0 the same way. Once a --to-rigs has begun clearing the binding, it never goes back: a row a rig lost that the binding still holds is copied back from the binding, with the stamp and its edges: before its first delete, the clear records in the journal every edge that touches a row it removes, in the binding and in the rig, so an edge from a row the clear already removed is restored too. A recorded edge whose other end neither store holds any longer is reported as not restored, and one whose other end the binding keeps is recorded on the row as dropped (gc.migrated_cross_edges), as the reverse records any edge it cannot carry. A row an interrupted re-copy wrote that differs from the binding’s is written again. A row gone from both refuses, nothing changed: put it back into its rig by hand carrying gc.infra_reversed_from=<stamp> (the refusal prints the stamp; the snapshot taken before the reverse holds the row as it was), then run the reverse again. A re-copy never deletes a stamped row the binding no longer holds; it refuses, since that row may be the only copy. Inspect it in that store (bd show <id>), then delete it with bd delete <id> if it is not wanted and run the reverse again, or abandon the reverse with --abort-reverse. Every row it writes carries gc.infra_reversed_from=<binding>/<run>, the run being its start to the nanosecond and a random suffix. Before it writes anything it records, in the journal, the stores it writes and every edge those stores already held onto a row it is about to write (an older clear re-added W -> D edges with D only in the binding). From the first phase until the last, boot, gc doctor and every other storage command refuse the city and name both ways out:
  • gc storage migrate --to-work --fleet-stopped finishes the reverse;
  • gc storage migrate --abort-reverse --fleet-stopped abandons it: it deletes exactly the rows carrying that stamp from the stores the journal names, puts back the edges those stores held onto them, puts back city.toml, the renamed records and the version floor, removes the reverse’s records, and unpins the snapshot (which it keeps). The binding was not written, so the city is split again as it was. A store that would refuse one of those edges back (native Dolt, for an edge onto its own prefix, or for any edge payload) refuses the abort before anything is deleted; finish the reverse instead. If you changed city.toml after R4 edited it, the abort keeps your change: it refuses, before it deletes anything, until the file declares the split’s [storage] again. Put [storage] back as the split had it (the journal .gc/storage-reverse.json holds the earlier file as city_toml_before) and run the abort again. Once the abort has begun deleting, the reverse cannot be resumed: run the abort again to finish it. Once R5 has renamed the binding root the reverse can only be finished.
Like the forward migration, the reverse and its abort refuse a work or rig store another registered city also uses, until --force=shared-store:<token> attests it, and refuse while that city holds its controller lock. --time-budget bounds a reverse as it bounds the copy: it stops at a batch boundary, exits 75, and the next run continues. It refuses, writing nothing, and names each bead and the fix:
  • an open cross-store gate: a single store has no release lane, so it would hold its owner forever. Close the work it waits on, or cancel the owner’s workflow (gc workflow delete <root>);
  • a cross-store gate an operator closed, where the edge it stood for would hold an open row again: the close released the rows that waited on the gate whatever its blocker does, and a single store has no gate to keep that. The refusal names each row, the gate’s unfinished blocker it would land with, and the gate. Finish or close the blocker, or close the row. To let a drain’s item run while its blocker stays open, remove each named row’s edge onto the gate and the drain’s convoy member’s edge onto the blocker, which a drain on one store projects onto its item on every pass;
  • an open row the binding minted for a rig’s scope (D8): no reader reaches it on a single-store city. Finish or cancel its workflow; closed ones move to the city store;
  • an edge whose rows would land in different stores while it still joins them, since no cross-store edge is ever written. A blocking edge (blocks, waits-for, conditional-blocks) holds its open row until the blocker is finished: a blocker that is open, or closed with gc.work_outcome=blocked, still holds it, so dropping the edge would release the row. Finish the blocker, or close the dependent. Any other edge joins two open rows: close one side;
  • an edge payload (a waits_for gate’s) going into a store that cannot write one: native Dolt has no edge-payload writer yet. That includes an edge such a store already holds onto a row the reverse writes, which a resume or an abort would have to put back;
  • a generic exec work store whose provider has no import op (listed by its capabilities op): it cannot take a bead under its own id. Roll back by restoring the snapshot instead;
  • an explicit session_reconciler = "v2", which would refuse the reverted city’s boot. --reconciler=legacy rewrites the key in R4’s edit;
  • a binding whose root is or holds the city’s .gc or a rig (a path of .gc or ., or any directory above the city), or is, holds or lies inside a directory a store keeps its files in: the city’s .beads (bd’s files, and the managed Dolt server’s data in .beads/dolt) and each rig’s .beads and .gc. R5 renames the binding root with everything under it, so it would take the city’s own state, a rig, or a store the reverse just copied rows into. Keep the city split, or roll back by restoring the snapshot instead. A root inside the city’s .gc, such as the default .gc/store, is not refused;
  • an id the work store already holds as another bead, a rig import that has not finished, and a rig the city no longer configures.
Before those, --to-work checks the work store with the containment check boot runs (see “Stranded writes: degraded serving”). Once the split is retired the work store serves every class, so no row it holds stays hidden from its readers. The rows the reverse wrote carry its stamp and are left out, so a resumed run is not refused for them. While one of these is left, the plan lists no other refusal:
  • an open stranded row, an infrastructure row the work store holds that the binding does not serve: an open message would be delivered, and an open session or wait would run again. Close each one that must not come back with bd close <id>, run from the city directory. Purge stranded mail nobody will read instead (see “Stranded mail nobody will read: purge it instead”). Or carry them on: gc storage recover-stranded --from-work --fleet-stopped copies every stranded row into the binding as it is, gc storage migrate --from-work --fleet-stopped clears their work-store copies, and the reverse then brings them back;
  • a stranded id the binding holds for a different bead, open or closed: the id would name two beads. Decide each with recover-stranded’s --replace-binding-row or --drop-work-row;
  • retained pre-migration copies (see “Upgrading a city migrated by gc 1.5.0”): one refusal names the clear, gc storage migrate --from-work --fleet-stopped, as boot does. The clear refuses while a stranded row is left, so settle those first.
A closed stranded row, and a row that is infrastructure class only because of metadata (see “Repair in place: a work bead that carries a class key”), stay in the work store as they are, which is where a single-store city keeps them: the plan names them and the reverse goes on. A binding that converged before its copy manifest was recorded cannot be checked; the plan says so. Both reverses check each rig they return the same way, and these come first too: --to-work every rig with a store of its own, --to-rigs the rigs it names. A rig that was imported, or recorded clean, is relic-free: readers of its graph, orders and sessions rows skip its store, so an infrastructure row a raw writer put there afterwards is hidden from them, and gc storage status calls the rig stranded. The reverse gives the rig’s store every class back (--to-work) or gives the rig its relic legs back (--to-rigs), so it classifies the rig’s rows as gc storage status does, leaves out the rows it wrote, and refuses:
  • an open stranded row in the rig of the graph, orders or sessions class: an open session or wait would run again, and an open workflow or order row would run again. Close each one that must not come back with bd close <id>, run from the rig’s directory. Or carry them on: gc storage migrate --from-rigs --rig <rig> --fleet-stopped copies them into the binding, and the reverse brings them back with the rig’s other rows;
  • a row under an id the rig’s import moved for a different bead, of any class, open or closed: the reverse returns that bead under its id. Re-create the rig’s row under a new id.
A closed stranded row, a row that is infrastructure class only because of metadata, and open stranded mail or nudges stay in the rig as they are, and the plan names them. Mail, external messaging and the nudge queue read only the city’s store, split or not, so nothing delivers a message or a nudge from a rig’s store. A rig still awaiting import hides nothing, because its relic legs serve it, so the reverse does not check it. A reverse resumed before R3 plans and checks again, and a row a raw writer put in a store since is refused the same way. While the reverse is open, every gc storage command these fixes run refuses, recover-stranded included, so on a resume the refusal names --abort-reverse first: abandon the reverse, settle the rows, then start it again. bd close works either way. Closed cross-store gates are not carried. Each row that waited on one gets back the edge the gate stood for, row -> blocker, from the gate’s own metadata, where the row and the blocker land in one store; where they do not, the row records the edge as one the reverse drops. For a gate a migration minted, that row is the gate’s owner. For a drain gate the runtime minted, it is each of the drain’s items: the drain’s control bead owns the gate but waits only on its items, so it gets no edge. A gate gc closed itself (released or retired by the gate lane, or closed by a workflow teardown) can open again: a live drain reopens it when its blocker holds again, so its edge comes back. An operator’s close is final, so where the gate’s edge would hold an open row on an unfinished blocker in one store, the reverse refuses instead (see above). --to-rigs takes out of the binding the closed gates of the rows it returns, those the rig’s import minted and those the runtime minted for them since, which carry no import stamp, and refuses an open one. A gate that a row the binding keeps still waits on stays there with that row, and a gate whose owner stays in the binding stays there as it is. Records the clear wrote on work beads stay on them. An edge the reverse drops (one that would cross stores once it no longer joins its rows, or one onto a row no store holds) is recorded as gc.migrated_cross_edges on the row it moves, so a later import can restore it. Fields the destination store does not hold are not carried: a native Dolt work store keeps no step ref (the reverse copies it into gc.step_ref when that is absent, and prints how many), stamps its own updated_at, holds a parent as a parent-child edge (the reverse writes that edge for a row whose parent lands with it), and puts bd’s infrastructure types (message, agent, role unless types.infra says otherwise) in its wisp tables, exactly as for a row created there. A proxied work store whose write leaf cannot keep a bead’s id, status and timestamps is refused.

Returning one rig: --to-rigs

gc storage migrate --to-rigs --rig <rig> --fleet-stopped undoes one rig’s import (--from-rigs) and keeps the city split. Each --rig must name a rig this city configures with a store of its own, whose import marker and manifest are beside the binding. It snapshots the binding and the rigs, copies the rig’s imported rows back into its store and proves them, then removes them from the binding (with their closed gates, those the import minted and those the runtime minted for them since, but not a gate a row the binding keeps still waits on) and renames the rig’s import records, so the rig reads as awaiting import again and its relic legs serve it. --from-rigs imports it again. The same refusals apply, and --abort-reverse abandons it until the binding clear has begun; a rig whose clear has begun is finished by running --to-rigs again. A snapshot taken before a --to-rigs no longer restores: its records name the rig’s import.

Rolling back

Before cutover, rollback is free — nothing moved, so nothing is lost. How you spell it still matters.
Danger: deleting the [storage] section is not a rollback. A city with no [storage] short-circuits at the top of the startup gate: no plan is resolved, no binding is named, no marker is read, and no convergence check runs at all. On a city that never cut over, that is harmless. On one that did, the city starts cleanly against a work store that no longer holds its infrastructure beads, while everything the city has is in the binding, unread. Nothing says so.
Spell the rollback as a class map instead (on a city whose work store was cleared, restore the work store first; see below):
Drop the [storage.bindings.infra] block in the same edit — a binding no class selects is refused at startup rather than quietly ignored. Because [storage] stays in the file, the section is still resolved and validated on every boot: a half-finished revert that leaves one class pointing at the binding is refused as an arrangement this build cannot serve rather than routed halfway, and gc storage status still prints the class map you are reading. Pointing the map back at infra then puts the convergence checks — marker, manifest, and the stranded-write re-check — back in play in one edit. After cutover it is not, short of gc storage migrate --to-work (above), which copies the binding back first. The binding is the live infrastructure store, and everything written since the marker exists only there. The gc refusal messages make that decision for you rather than leaving it to judgment: the sentence telling you to revert appears only when the binding has been read and proven to hold nothing. If gc cannot see the binding — an unmounted volume, a permission fault, a root it could not list — it says so and withholds the instruction, because an absence nobody could look at is not evidence of emptiness. The check to run by hand is the marker: if <binding path>/infra.migrated exists, the city has cut over, and a config revert abandons whatever the binding holds. Once the work store has been cleared, a revert also starts the city with no infrastructure state at all: the pre-cutover rows are in infra.retained-source.jsonl, not in the work store. The clear also leaves .gc/storage-infra-cleared.json in the city directory. It holds two edits that would otherwise start a city with no infrastructure state:
  • a binding whose volume is not mounted: with the note present, a missing marker refuses the boot instead of creating an empty binding;
  • a revert — [storage.classes] pointed back at work, or [storage] deleted: boot refuses. It names gc storage migrate --to-work first (put [storage] back, then reverse; see “Reversing the split”), which keeps every bead written since the cutover, and the restore below as the fallback.
Removing the note is your attestation that the work store holds the state you want served, or that the binding’s contents are deliberately abandoned.

Restoring the work store from the backup

This puts the pre-cutover infrastructure rows back into a bd work store, for a rollback after the clear. It restores the state as of the cutover: beads written to the binding since then are not in the backup and are lost by the rollback, and the fields listed under “What the backup holds” are not restored. That includes progress: a workflow step that was open at the cutover and finished in the binding afterwards comes back open, and the restored city dispatches it again. Check the binding (gc bd show <id> before the revert) for any step whose work must not run twice. Edge payloads (a waits_for gate’s {"gate":"any-children"}) are not carried by bd import; a restored gate reads as the default, all-children. Verified with bd 1.3.2-rc.1. The transform marks every ephemeral and no-history row "wisp_plane": true, which puts it back in bd’s dolt_ignore’d tables: bd 1.3.2, 1.3.4 and the 1.3.0 Enterprise build import a no-history row without the marker into the committed issues table. Verified with the Enterprise build 77612097cec0. The order matters, because gc refuses to serve a reverted city while the notes stand — that refusal is what sent you here:
  1. gc stop.
  2. Point [storage.classes] back at work and drop the binding block.
  3. Remove .gc/storage-infra-cleared.json and .gc/storage-served-binding.json. This is the attestation, and from here until step 5 the city must not be started: it would run with no infrastructure state.
  4. Restore, from the city directory, with B set to the backup the boot refusal named:
  1. gc start.
gc bd import needs the city’s custom bead types, which a gc city’s work store already has (gc bd config get types.custom).

If this city cut over before edge payloads were carried

A city that converged under an earlier build has a binding whose within-infra dependency edges arrived without their payloads. The copy re-added every edge with its endpoints and type intact and dropped the JSON sidecar. The fix is in the copy; it does nothing for a city that already ran it. The payload-carrying edges are the waits_for fanout gates between formula step beads, and the payload records which gate the formula asked for — {"gate":"any-children"}. A gate whose payload is gone reads as the default, all-children. The consequence is one-directional: such a gate waits for every child where the formula asked it to release on the first. It never releases a gate early, and an all-children gate — the default, and the common case — lands on the value it started with. Both endpoints are infrastructure beads, so no cross-class edge is involved. Nothing detects this state. The convergence re-check compares the beads the proven-copy manifest names, and the manifest records ids, not edges. gc storage recover-stranded writes only the edges the binding is missing; a present-but-payloadless edge counts as one the binding already holds, so the repair skips exactly the edges that are wrong. gc storage preflight returns at the convergence step on a converged city and never reaches the edge-payload check. Detection and a non-destructive repair are tracked as ga-67pm3. What is not lost. The original payload of every pre-cutover edge is still readable in the work store until it is cleared, and in infra.retained-source.jsonl after that — the clear records every edge with its payload. Every edge written to the binding after cutover went through the normal writer and carries its payload. The damage is bounded to the edge set the old copy carried.

Re-converging, and what it costs

The only remedy this build offers is running the copy again, and the marker is in the way: a marker whose database is present is a converged city, and the migration re-proves convergence instead of re-copying. Removing the component directory the database lives in — and leaving the marker where it is — is the state the code calls stale. The marker’s claim about the past still holds and its claim about the present does not, so the migration reports <marker> claims convergence but <database> is gone; re-running the copy and falls through to the copy. The manifest is replaced by the same atomic rename that writes it, so it needs no deletion.
--from-backup re-copies from infra.retained-source.jsonl. On a city whose work store was never cleared (one migrated by gc 1.5.0 and not yet repaired), use --from-work instead; the backup does not exist yet, and the re-copy ends by clearing the work store. With the backup present, --from-work refuses: the work store no longer holds the slice, and re-copying from it would rebuild an empty binding.
Danger: this destroys every binding write made since cutover. The re-copy reads the state as of the original cutover. Every infrastructure bead created since — and every edge among them — exists only in the directory being removed. Take a filesystem copy of the binding root first, and treat this as worth doing only where the gate kinds matter more than that history.
Leave the marker alone. The procedure does not need it gone — a marker with no database is precisely the state that re-runs the copy — and it is the binding’s own record that this city has been in service, which the post-cutover refusals key on. If the re-copy stops part way (it exits 75 when --time-budget is spent, or it fails, or it is killed), run the same command again, and leave infra.recopying alone too: until the re-copy finishes, that record is what keeps boot from serving the partly re-copied database, and a rerun of --from-backup from refusing it as a binding that is not stale.

What a later boot keeps checking

Convergence is not asserted once. Every boot re-checks that the work store holds no infrastructure bead, and classifies any it finds against the recorded proven-copy manifest.
  • A bead the copy never carried is a write that landed in the work store after the equality proof. The city serves degraded: the boot names the ids in a storage.binding.stranded event and a warning, and the beads are intact in the work store. It never becomes silence. If the binding holds one of those ids for a DIFFERENT bead, the boot is refused instead, because the id would name two beads.
  • A bead the copy delivered that the work store still holds — a city migrated by gc 1.5.0, or a clear that was interrupted — is a second row under an id the binding owns. It becomes a blocked boot that names the repair command.
  • A check that could not run is reported as a failed check, not as a city that never converged, and the boot refuses rather than serving from a binding it could not verify.
The manifest also records which rules decided what counts as infrastructure when the copy ran, and every later check classifies the work store by those rules. A newer gc that counts more kinds of bead as infrastructure, such as startup-health episodes, does not report the ones an earlier copy left in the work store as stranded. They stay where that copy left them, and no check names them.
Last modified on November 12, 2026