carlos / platform Public

feat: carry stateless mode on routes and generations

Add the additive route projection, SQLite migration, shared scans and insert arguments, and declarative forward classification. Carry it over the existing gob RPC transport and invalidate registry fingerprints when it changes. Add generation storage mode for later verified wake integration.

This plumbing does not authorize database-free launch; wake must derive that decision from the selected verified canonical manifest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 52e210f378d60389160d3cb7da98362c387beb99 parent e17ff09
9 files changed, +146 −20
  • docs/superpowers/notes/census-proposal-stateless-replicas-1.md +11 −3
  • internal/activator/generations.go +2 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv +14 −3
  • internal/registry/forward.go +3 −1
  • internal/registry/registry.go +18 −9
  • internal/registry/registry_test.go +1 −1
  • internal/registry/remote_test.go +2 −2
  • internal/registry/stateless_test.go +94 −0

Intent

Human

<task-notification> <task-id>bb163mp59</task-id> <tool-use-id>toolu_01L3WagikQyKioLYf4Rv2i4e</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/bb163mp59.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 2 fix round 1" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a3e0a7edc29c309c8</task-id> <tool-use-id>toolu_01LFU4BcKTquUSJG21pSApSY</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/a3e0a7edc29c309c8.output</output-file> <status>completed</status> <summary>Agent "Re-review Task 2 fix round 1" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**I1..I4 verdicts** **I1: ADDRESSED.** `internal/provision/replicacoordinator.go:49-56`: `replicaFieldsFixed` now exits early only when `isTombstoneOf(before, nextFields)`. That check (`runtime.go:167-177`) needs the next body to equal `TombstoneBody(before)` field for field, ignoring only `record_seq`. Its fields are schema, host, account, app, incarnation and `retired:true`, so only the exact retirement projection gets past the guard. The witness is `TestCoordinatedRecordRetiresThroughTheTombstone` (`internal/console/lifetimes_retire_test.go:1320-1342`). It acquires a coordinator, writes a pending deploy, then retires the record through the real delete door. I checked the other `WriteRecord` callers: - `provision.go:3002` marshals the whole decoded `Record`, so both fields are kept. - The hostops and lifetimes callers decode and re-marshal the record, replay its raw bytes, or create with a `{}` before. None of them needs an exemption. **I2: ADDRESSED.** `internal/activator/statelessrelease.go:161-176`: after a failed `released` write it calls `change("released")` again. That replays the same ID, target, revision and term, because `change` only updates them on success (`:79-86`). The writer accepts an exact `released` replay before its term and revision checks and returns `errRecordUnchanged` (`replicadeploy.go:28-31`). The frozen-carrier re-read is gone. The test now runs the production `ObservedReplicaRelease` with a frozen carrier (`statelessrelease_test.go:269-296`). **I3: ADDRESSED.** `internal/provision/replicadeploy.go:41-45`: the writer replays an identical pending begin (same phase, ID, term, incarnation, target and previous build). The check sits after `replicaIdentity` and after the live-coordinator check (current term, not expired, fleet box). It sits before the revision check, so a lost begin reply carrying the pre-commit revision now succeeds. The witness is `TestReplicaReleaseBeginRetry` (`statelessrelease_test.go:298-326`). It has lost-reply and cancel-before-exec cases, both on the production observer, and in both no command runs before the interruption. **I4: NOT ADDRESSED on the fleet path. ADDRESSED on the trusted-store path.** - `internal/activator/coordinator.go:62-72`: authority is now lost only on `ErrFenced`, `ErrInvalid`, `CoordinatorHeldError`, close, or expiry (via `errLocked`, `:209-214`). A transient error leaves `until` and `renewAt` unchanged, so the next tick retries. - `internal/host/replicacoordinator.go:432-434`: the HTTP adapter turns 5xx, 429 and 408 into a non-fenced error. - **The gap:** the console handler never sends 5xx. `internal/console/replicacoordinator.go:92-94` (`handleReplicaCoordinator`) answers any non-held error from `SetRecordCoordinator` with `jsonError(w, http.StatusConflict, …)`, and that includes a deployment-store (S3) timeout during `renew`. The adapter maps 409 to `replicas.ErrFenced` (`host/replicacoordinator.go:443`), and `Tick` treats that as definitive. - **Effect:** on a fleet box, a single console-side store hiccup during renewal still drops authority and kills a long migration. That is exactly I4's failure on that path. The new adapter test only covers statuses the console never actually sends. - **Fix:** have the console send 5xx (or 503) for errors that are not `ErrFenced`, `ErrInvalid` or held, and add a witness through the real handler. **New breakage (fix diff only)** - **Can a non-tombstone write erase coordinator or replica_deploy?** No. The exemption needs the exact `TombstoneBody` projection. Any other field, missing field or changed value fails `sameFieldsButSeq`. - **Can the same-term begin replace a live pending of another ID or target?** No. It needs `old.Phase == pending`, the same ID, term, incarnation, target and previous build, and it runs after the live-term check. A different ID still goes through the revision check and `ErrInvalid` (`:49-52`). A changed target gets `ErrFenced` (tested at `replicadeploy_test.go:601-605`). It returns unchanged and never bumps revision or sequence. - **Can renewal retry keep authority past the safety deadline or a definitive fence?** No. `errLocked` drops authority at `now &gt;= until` whatever the renewal result. The renew context is capped at `oldUntil`, only a successful renew extends `until`, and fenced, invalid or held errors drop it at once. The only leak is the reverse one: the 409 gap above loses authority too early. - **Can replaying `released` publish released without exit-zero proof?** No. The replay is only reached when `phase == "released"`, which needs `runErr == nil` from `runReleaseAdmitted`'s proof path, or from `VerifyStaged` plus the gate for a binary with no command. The replay can only succeed if the first write committed, or if a fresh write passes the full term and revision gates. No new Critical or Important breakage. **Out of scope (minor)** 1. If authority expires between a committed `released` and its replay, `ReleaseState` refuses before the call (`coordinator.go:151`) and the attempt returns Unknown even though the durable state says released. The next attempt observes released and finishes. This errs on the safe side. 2. The fleet `handleReplicaRelease` checks `current.Coordinator.Term == req.Term` before the writer (`console/replicacoordinator.go:131`). So a `released` replay after a successor acquires is refused, although the writer itself would accept it. Also on the safe side. 3. On the trusted-store path, a renew against a retired record now returns not-exist, which counts as transient. Authority is held until the local deadline (bounded by the TTL) rather than dropped at once. This is liveness only. 4. Retiring a record while a release command is running drops the coordinator. The command keeps running until its authority deadline, and its later writes fail as Unknown. That is the design the brief asked for, but it is worth a line in Task 3. **Census: approve.** The changed units do no new reads: - `replicaFieldsFixed` and `isTombstoneOf` parse only the before and body bytes already in hand. - `SetRecordReplicaRelease` only adds a comparison of decoded fields. - The HTTP adapter classifies a response status. - `PrepareStatelessRelease` drops a read site (`whole:Route@4366`, the removed re-observation) and adds none. No root read now opens, runs, queries or follows a path or input that a tenant, app or box agent can create, write or name. **Verdict: open findings.** I4 is still open on the fleet path: the console sends 409 for transient store errors, so a renewal failure on a fleet box still counts as a definitive fence. I ran no tests and did not modify any files.</result> <usage><subagent_tokens>103951</subagent_tokens><tool_uses>11</tool_uses><duration_ms>118035</duration_ms></usage> </task-notification>

diff --git a/docs/superpowers/notes/census-proposal-stateless-replicas-1.md b/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
index 35faf6772..86e9c16d4 100644
--- a/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
+++ b/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
@@ -1,6 +1,6 @@
# Census approval: stateless-replicas-1
-Ruling `census-ruling-stateless-replicas-1`. The independent reviewer approves or rejects every change below, 4 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-stateless-replicas-1`. The independent reviewer approves or rejects every change below, 8 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
@@ -11,12 +11,14 @@ Ruling `census-ruling-stateless-replicas-1`. The independent reviewer approves o
| `internal/host/agent.go` `fastTick` | body | unchanged (1) | Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. |
| `internal/host/agent.go` `haRecordFacts` | body | unchanged (3) | Return RecordFacts with lifetime identity, Coordinator and ReplicaDeploy from the same judged record object; same store and record reads, no extra GET. |
| `internal/host/agent.go` `runAgent` | body | unchanged (6) | Construct coordination with existing fleet API credentials on fleet boxes, trusted deployment store otherwise; invalid fleet identity leaves it unarmed. Assign production observation callback, close after service shutdown with a five-second context. Existing read sites unchanged. |
+| `internal/registry/registry.go` `Registry.Fingerprint` | body | unchanged (33) | Read the additive stateless projection in the existing registry SELECT and hash only when set; no new read source. |
+| `internal/registry/registry.go` `upsertRoute` | body | unchanged (3) | Persist the stateless projection in the existing guarded upsert; no new read. |
| `internal/rollout/failures.go` `FailureBook.saveLocked` | body | unchanged (0) | Persist the additive replica_releases selection carrier in the existing failure-book atomic write; no new path, record writer or authority. IDs are returned only after a successful save. |
| `internal/rollout/failures.go` `OpenFailureBook` | body | unchanged (1) | Load the additive replica_releases carrier from the same existing failure-book ReadFile; unchanged schema acceptance, identity recovery, reconciliation and read site. No additional read. |
| `ship_check.go` `rootfsCheck.runArgs` | body | unchanged (2) | Stateless local checks mount only the run volume and omit the database mount; same probe read, no new read. |
| `internal/activator/rootfsrelease.go` `Service.runRelease` | sites | -registry:Host, -whole:Route ×10 | Delegate unchanged stateful admission and stop/proof behavior to runReleaseAdmitted with no durable admission hook; reads moved to that method. |
-Envelopes re-pinned: `.`, `internal/activator`, `internal/host`, `internal/provision`, `internal/release`, `internal/replicas`, `internal/rollout`.
+Envelopes re-pinned: `.`, `internal/activator`, `internal/host`, `internal/provision`, `internal/registry`, `internal/release`, `internal/replicas`, `internal/rollout`.
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
@@ -29,6 +31,8 @@ Recorded dispositions, which each change must still satisfy:
- `internal/host/agent.go` `fastTick`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved
- `internal/host/agent.go` `haRecordFacts`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (region HA P1a), the agent as carlos: activator.Config.Record, the closure the HA classification calls on a lifetime index miss: opens the deployment store once (openDeployStore, kept under a mutex) and reads the host's record through judgedRecord(store, judge, release.RouteAccount(rt), rt.App, rt.Host) (CI fix: provision.ReadRecordJudged under the box's lifetime judge, which also GETs the host's incarnation slot control/host-incarnations/<host>.json from the same deployment store; a record the slot no longer vouches for, or a tombstone, reads as os.ErrNotExist; a nil judge, host claims on, is provision.GetRecord exactly), turned into a lifetime entry by provision.LifetimeEntryOf; the reads are the row it is handed (registry:App, registry:Host, whole:Route); the record is the console-written deployment record the reconcile passes already read; an open or read error is returned and the wake fails closed; root never calls it
- `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind
+- `internal/registry/registry.go` `Registry.Fingerprint`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user); the remote arm, unchanged, in the process that holds a remote handle: census-ruling-seeded-instances's body with the row's lifetime pair (incarnation, serving_seq) folded into the edge's change poll, each only when non-zero, so a registry with no pair digests as before; self-serve moves 1 Task 7;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: hashes regional_domains (host, target, account, app, region; created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no regional rows digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; no file path read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R1 finding 1: the routes SELECT also reads host, kind, account, app, platform and fingerprintForwardInert (one CASE over the ForwardForbidden columns), and every row folds host, kind, account and app (tagged, quoted), platform when set, and forward_inert=0 for a forward row that is not inert, so a rowid reused by another hostname, an in-place account or app rewrite, or a stray forbidden column moves the edge's change poll. Same one SELECT per table on the same fresh connection to the box's own registry database, as carlos; no table, file or bucket read added; a digest, never a decision.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5): the SELECT also reads fleet_label and, only when it is set, hashes "fleet_label=<q>" into the digest, so labelling a row moves the edge's reload fingerprint. Read sites unchanged (33). Registry side, not root; an unlabelled registry's digest is byte-identical.
+- `internal/registry/registry.go` `upsertRoute`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-alias-socket-follow-338;basis=#338: Upsert's unchanged statement moved into a helper so it can run on the database or inside a transaction;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 2 (runtimeFixed in the registry): takes a guard appended to the ON CONFLICT WHERE (UpsertUnlessRootfs passes routes.runtime = ''); a stored row with a runtime keeps its region and hibernate unless the tenant changed; replication is cleared only when the effective runtime is empty; no new read source, same SQLite table;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 3: on a refused conflict, the forward check reads the host (+registry:Host) to answer ErrForwardRow; the statement carries kind <> 'forward'. A refusal only.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 2): the conflict arm gains fleet_assigned (the excluded value on a re-tenanted host, else kept when the writer carries '') and fleet_moved (excluded on a re-tenanted host, else MAX of stored and excluded). Read sites unchanged (3). The same statement guard (claim ownership, kind <> 'forward') applies.
- `internal/rollout/failures.go` `FailureBook.saveLocked`: authority, task E3. Basis: rev3=PROPOSED-p3;run=8;identity=root adoption uid 0 or legacy rollout uid carlos;basis=root instance uses checked store writer; legacy instances retain the original atomic file writer and epoch semantics
- `internal/rollout/failures.go` `OpenFailureBook`: authority, task E1,E3,J1,J4. Basis: fix1-merge-review;basis=Loads schema-three durable generations and refuses unsafe identity recovery on entropy failure.
- `ship_check.go` `rootfsCheck.runArgs`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-1;basis=root-input (J4, as main's db.go units); the carlos CLI on a person's machine, as the person (no box unit): new (rootfs Plan 1), builds the docker or podman run argv for one check container; the scanner matches the word Command, here a field of release.Process (a process's argv), not os/exec; reads no file; decides nothing for root;rev3=census-ruling-rootfs-check-volumes;basis=R2 P1: the data and run volume mounts (-v) now carry :nocopy through rootfsCheck.volumeMount, so Docker and Podman never fill an empty check volume from the image directory at the mount point (which would reset the prepared owner and mode); same volumes, same paths, same probe mount, nothing else in the argv changed. Runs on the person's machine as the person; no box unit; no read added.
@@ -40,7 +44,11 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/activator/rootfsrelease.go:Service.runReleaseAdmitted`: reads +registry:Host, +whole:Route ×11; written legacy, accepted-legacy, frozen
- new `internal/activator/statelessrelease.go:Service.PrepareStatelessRelease`: reads +registry:Account, +registry:App, +registry:GoodDemand, +registry:GoodDigest, +registry:GoodVersion, +registry:Host ×7, +whole:Route ×4; written legacy, accepted-legacy, frozen
- new `internal/replicas/coordinator.go:ChangeCoordinator`: reads +file:Read; written legacy, accepted-legacy, frozen
+- other `changed registry schema`: closed only if it is the registry schema (re-pinned)
+- reads `internal/registry/forward.go:Registry.PutForward`: +registry:Stateless; keeps legacy, task accepted-legacy
+- reads `internal/registry/registry.go:routeArgs`: +registry:Stateless; keeps authority, task E3
+- reads `internal/registry/registry.go:scanRoute`: +registry:Stateless; keeps legacy, task accepted-legacy
-Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `3662d8acc9934f1fce67719cbe5b70001c5d849ad724659995dc3d30f96b6f4b`.
+Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `e7792d4d8ebec186a1f07e797cfa76993673adb465214b730dc6f21482b30927`.
Overlay: `internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/activator/generations.go b/internal/activator/generations.go
index fce7a7fce..f351cf58b 100644
--- a/internal/activator/generations.go
+++ b/internal/activator/generations.go
@@ -52,6 +52,8 @@ func nextGen() uint64 { return genCounter.Add(1) }
// StagedPath, Digest and Demand stay empty until plans 3 and 4 exec by
// staged path.
type Gen struct {
+ // Stateless is the storage mode of this generation's verified release.
+ Stateless bool
N uint64 // process-wide, never reused (spec §7.1)
Socket string // generation app socket (spec §7.1, rev 19: the flag-off file name in a directory of its own)
Control string // Socket + ".control"
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 05280a697..45e03c1aa 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -56,4 +56,4 @@ plan14-root-reads-fix-set-aside-exdev.tsv f9d3016cc6803338f9db19311f3f598e20c37c
plan14-root-reads-durability-3a-escrow.tsv 03a92257beb9b8aac421559e247d191bd69f28a0b26243397a1344a90d59fc2a
plan14-root-reads-rootfs-default-home.tsv 7a0a3da3d6fe7e3c77abb22676db000af2a276c3d13ccae0f038190f51287ed5
plan14-root-reads-probe-burst-limit.tsv 5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc
-plan14-root-reads-stateless-replicas-1.tsv 3662d8acc9934f1fce67719cbe5b70001c5d849ad724659995dc3d30f96b6f4b
+plan14-root-reads-stateless-replicas-1.tsv e7792d4d8ebec186a1f07e797cfa76993673adb465214b730dc6f21482b30927
diff --git a/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv b/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
index 3025bf738..29cff468c 100644
--- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
+++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
@@ -1,15 +1,19 @@
# Census overlay stateless-replicas-1, written by census-propose (#369). census-ruling-stateless-replicas-1, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-stateless-replicas-1.md.
-# 10 body, 1 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 4 new dispositions: 0 reads re-frozen at their disposition with the claim, 4 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+# 12 body, 1 sites, 8 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 8 new dispositions: 3 reads re-frozen at their disposition with the claim, 4 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other.
@legacy 8532ad0b6523e01bb6548e7a0ff565615b99e39a8921c338db522812368899a3 cli.go runShip legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-1;basis=rootfs Plan 1 Task 9: takes --rootfs, --processes, --hibernate, --jit and --check and hands a rootfs ship to runShipRootfs (ship_rootfs.go) before the binary path; the --notes-file ReadFile moved into shipNoteText (its own row, the same read of the file the person named) and the direct-mode version mint into mintDirectVersion; one read site fewer, none added; Task 12: the --hibernate flag help is RFS-1-C32's new text, the same reads;rev3=census-ruling-edge-asset-cache-1;basis=takes --assets (repeatable), checks the folders with checkShipAssets (release.ValidAssetPaths; refused on a static site) before the mode split, carries them into the API meta (sess.shipAssets) and the direct-mode manifest (shipAssetsBlock), and passes them to runShipRootfs (rootfsShipOpts.assets), which runs the same check and carries them the same two ways; after a direct-mode ship has stored a release declaring folders, directShipAssetGens runs the console ship door's backfill (provision.MintMissingAssetGens: lists the app's record keys and gives each record without an asset generation one, a CAS write in the deployment bucket as the person running the CLI) and fails naming any record it could not mint; read sites unchanged (2), none added;rev3=census-ruling-rootfs-apps-4;basis=adds the repeatable --env flag and refuses it before anything else unless --check is given (shipEnvRefusal, parseShipCheckEnv); the parsed values go into rootfsShipOpts.checkEnv. --env values reach the check's local container runtime as -e argv only, never root, never a box. No read added; read sites unchanged (2).;rev3=census-ruling-stateless-replicas-1;basis=Carry --stateless into binary/API and rootfs ship options; same two read sites, no new read. file:ReadFile@7899,file:ReadFile@8123 d6f244d2c3bcae95eb8ec0fa7e57c52e9b50c7e9e2e00dda85f930b643731a51
@legacy 6cdd33926c20f85e6eeb7e15d78d04842cb9d59acbd6cb3fdde202c361a08d3e internal/activator/hawake.go ExecBackend.isHA legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: the one HA classification: a legacy route is not HA and reads nothing; else the lifetime index, and on a miss the record (Config.Record, the deployment store's console-written record via haRecordFacts); a failed read is an error; the row's sticky HA (+registry:HA) and the index's marks only add HA; +registry:Host x2, +whole:Route x2;rev3=census-ruling-stateless-replicas-1;basis=Extract LifetimeEntry from the extended Config.Record result; existing HA classification and read/error gates unchanged. registry:HA@573,registry:Host@280,registry:Host@486,whole:Route@126,whole:Route@373 8337ad81c8e8671acb44eacc642a1c43246a90d23ea69d35d1d7d7b58f2fcc89
@legacy 33d60a8c0abaf72ce2a3f73d927dadd3c15f54beb0cb37e2f0753545b18d7f06 internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. registry:Host@4776 717574378829734fb3461a7ec0a4e4e9089466745685d39008ad51b571ddf993
@legacy f4edd209fd6fe7d50fd79c2f6ecf96bf255d5301f094ca86a5882acf5fe8ba20 internal/host/agent.go haRecordFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (region HA P1a), the agent as carlos: activator.Config.Record, the closure the HA classification calls on a lifetime index miss: opens the deployment store once (openDeployStore, kept under a mutex) and reads the host's record through judgedRecord(store, judge, release.RouteAccount(rt), rt.App, rt.Host) (CI fix: provision.ReadRecordJudged under the box's lifetime judge, which also GETs the host's incarnation slot control/host-incarnations/<host>.json from the same deployment store; a record the slot no longer vouches for, or a tombstone, reads as os.ErrNotExist; a nil judge, host claims on, is provision.GetRecord exactly), turned into a lifetime entry by provision.LifetimeEntryOf; the reads are the row it is handed (registry:App, registry:Host, whole:Route); the record is the console-written deployment record the reconcile passes already read; an open or read error is returned and the wake fails closed; root never calls it;rev3=census-ruling-stateless-replicas-1;basis=Return RecordFacts with lifetime identity, Coordinator and ReplicaDeploy from the same judged record object; same store and record reads, no extra GET. registry:App@596,registry:Host@604,whole:Route@591 db6d777c93afde9836873ce72b6cbb62a55567eb3fb01f85f7e1e12274e0c66d
+@legacy e2d480482d14aee10d9a2451d91501d1960728889d9d6a9a4961fe97c56953b2 internal/registry/registry.go Registry.Fingerprint legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user); the remote arm, unchanged, in the process that holds a remote handle: census-ruling-seeded-instances's body with the row's lifetime pair (incarnation, serving_seq) folded into the edge's change poll, each only when non-zero, so a registry with no pair digests as before; self-serve moves 1 Task 7;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: hashes regional_domains (host, target, account, app, region; created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no regional rows digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; no file path read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R1 finding 1: the routes SELECT also reads host, kind, account, app, platform and fingerprintForwardInert (one CASE over the ForwardForbidden columns), and every row folds host, kind, account and app (tagged, quoted), platform when set, and forward_inert=0 for a forward row that is not inert, so a rowid reused by another hostname, an in-place account or app rewrite, or a stray forbidden column moves the edge's change poll. Same one SELECT per table on the same fresh connection to the box's own registry database, as carlos; no table, file or bucket read added; a digest, never a decision.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5): the SELECT also reads fleet_label and, only when it is set, hashes "fleet_label=<q>" into the digest, so labelling a row moves the edge's reload fingerprint. Read sites unchanged (33). Registry side, not root; an unlabelled registry's digest is byte-identical.;rev3=census-ruling-stateless-replicas-1;basis=Read the additive stateless projection in the existing registry SELECT and hash only when set; no new read source. file:Exec@284,file:Open@188,file:Query@368,file:Query@5758,file:Query@6237,file:Query@7223,file:Query@7919,file:Query@8831,file:Query@9888,registry:ClaimIncarnation@1448,registry:ClaimIncarnation@4666,registry:ClaimIncarnation@4743,registry:ClaimOwner@1492,registry:ClaimOwner@4867,registry:ClaimOwner@4932,registry:ClaimRowID@1511,registry:ClaimRowID@4959,registry:ClaimRowID@5025,registry:ClaimStamp@1473,registry:ClaimStamp@4776,registry:ClaimStamp@4840,registry:Incarnation@1556,registry:Incarnation@5246,registry:Incarnation@5310,registry:ServingSeq@1575,registry:ServingSeq@5337,registry:ServingSeq@5400,registry:Text@158,registry:path@207,registry:remote@55,registry:remote@87,whole:remoteClient@57,whole:remoteClient@89 20459fd46b63a9ec4eee58920a98ed4a2d01fdaad6a374d66654ba74650d847a
+@legacy 76170452f5e7f9f2ac77aad1b3f24f461c2d72da1db0d621ec26061ee3d533c0 internal/registry/registry.go upsertRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-alias-socket-follow-338;basis=#338: Upsert's unchanged statement moved into a helper so it can run on the database or inside a transaction;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 2 (runtimeFixed in the registry): takes a guard appended to the ON CONFLICT WHERE (UpsertUnlessRootfs passes routes.runtime = ''); a stored row with a runtime keeps its region and hibernate unless the tenant changed; replication is cleared only when the effective runtime is empty; no new read source, same SQLite table;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 3: on a refused conflict, the forward check reads the host (+registry:Host) to answer ErrForwardRow; the statement carries kind <> 'forward'. A refusal only.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 2): the conflict arm gains fleet_assigned (the excluded value on a re-tenanted host, else kept when the writer carries '') and fleet_moved (excluded on a re-tenanted host, else MAX of stored and excluded). Read sites unchanged (3). The same statement guard (claim ownership, kind <> 'forward') applies.;rev3=census-ruling-stateless-replicas-1;basis=Persist the stateless projection in the existing guarded upsert; no new read. file:Exec@116,registry:Host@4720,whole:Route@4596 ebc718cda38d18914e19680c1e6b9ba68b4f8fd43318be417569951b78c578f5
@legacy 1e4efb560a06cb532c8d4caf719ff375c27a03a5651b26c59d81f271c70da628 ship_check.go rootfsCheck.runArgs legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-1;basis=root-input (J4, as main's db.go units); the carlos CLI on a person's machine, as the person (no box unit): new (rootfs Plan 1), builds the docker or podman run argv for one check container; the scanner matches the word Command, here a field of release.Process (a process's argv), not os/exec; reads no file; decides nothing for root;rev3=census-ruling-rootfs-check-volumes;basis=R2 P1: the data and run volume mounts (-v) now carry :nocopy through rootfsCheck.volumeMount, so Docker and Podman never fill an empty check volume from the image directory at the mount point (which would reset the prepared owner and mode); same volumes, same paths, same probe mount, nothing else in the argv changed. Runs on the person's machine as the person; no box unit; no read added.;rev3=census-ruling-stateless-replicas-1;basis=Stateless local checks mount only the run volume and omit the database mount; same probe read, no new read. file:Command@887,file:Command@971 e684fd3273527a209460ed81e5bcd472a4282f46830fe580e5f07f0b0d876684
@legacy 6d1e960297f78cd109abb5310aef1af00618baf7f938c405e603d6e027ca7afa internal/activator/replicaobservation.go ObservedReplicaRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Read route Account, App and Host only to match the attempt-local observation carrier; refuse absent/stateful/incomplete/mismatched evidence, return copied deploy state and canonical target. No store or filesystem read, no authority granted. registry:Account@283,registry:App@307,registry:Host@328 17cf71ccf92a913a42bef47ea461888ab0045b2ed7acabc81648e55cca322bbb
@legacy bf907111a6526f31ed49ab718b90896b8f33a48ba63f26f47f3889a521e82bb9 internal/activator/rootfsrelease.go Service.runReleaseAdmitted legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Extract existing runner unchanged except optional pre-exec durable release transition after local admission and before any command; same staged process reads, stop/proof and exec gates, no new filesystem path. registry:Host@216,whole:Route@3085,whole:Route@3314,whole:Route@3802,whole:Route@3831,whole:Route@5879,whole:Route@621,whole:Route@6347,whole:Route@6624,whole:Route@7054,whole:Route@849,whole:Route@934 de8d9d6b31ac2b8cf2c34aaca32ecfbdd2c8966f75def906e3baef5bb409d109
@legacy 088046a3995bfabca5ef644c83320f529e9ea94ddf2c4dc9d890843e87e1c811 internal/activator/statelessrelease.go Service.PrepareStatelessRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Read durable deploy evidence and canonical target via existing-record observation seam; use coordinator authority only for this path, persist releasing before exec and require proof plus SafeUntil before success; commandless binary verifies staged artifact separately; R11 lets the current term retake pending via the typed begin gate; R12 follows renewed SafeUntil through the existing command supervisor instead of a fixed initial context deadline; no new store polling or direct typed record writer callsite. Fix round 1 replaces the frozen-carrier re-observation with an identical released writer replay; command execution, proof and authority gates remain. registry:Account@544,registry:App@574,registry:GoodDemand@2971,registry:GoodDigest@2956,registry:GoodVersion@2940,registry:Host@1170,registry:Host@224,registry:Host@3027,registry:Host@3085,registry:Host@3301,registry:Host@3369,registry:Host@601,whole:Route@3094,whole:Route@3101,whole:Route@3653,whole:Route@483 d4429770206e5905e3789157cbf222504cd34d0b7a4e22c765aee1b24a3e5e61
@legacy 1861ee20fec27c99526b8095d2b82598367595db4fcdbf2bc47ba40a269ec37f internal/replicas/coordinator.go ChangeCoordinator legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Generate a fresh 128-bit coordinator term using crypto/rand.Read; no file path or process input added. file:Read@472 e50ce5a352b3022a1ee6375fbfee315a5d2fcaeb4f4a25f4e33a5a10e3000a67
+@legacy 4139954f5fa906f863814feb7efad95d85503ef68272877043de62c66c5cb2df internal/registry/forward.go Registry.PutForward legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 2: the only writer of a forward row's declared columns: refuses an argument whose kind is not forward; copies only the declared fields from its argument (Status ready, Provisioned true; no forbidden column is ever written); inside one IMMEDIATE transaction refuses a host a non-forward row holds (ErrHostHeld); keeps FleetBox while Region is unchanged; preserves the observational columns (+file:Exec, +file:QueryRow, +registry:Account, App, Channel, RateLimit, Region, Slug, +registry:Host x3, +registry:Kind, +registry:remote x2, +whole:Route x3, +whole:remoteClient x2).;rev3=census-ruling-fleet-routes-followups;basis=refuses up front, with the new sentinel ErrNotForward and before any read or write, an rt that is not a forward row (as before, now a sentinel), has an empty Host, or whose Region is not a fleet placement (registry.FleetPlacement); +registry:Host x2 and +registry:Region x2 read only the argument in those checks; the transaction and statement are unchanged;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3), merged with main's ErrNotForward refusals (kept unchanged): the written row also carries FleetLabel = rt.FleetLabel and FleetBox = rt.FleetLabel; its conflict arm (forwardKept) writes fleet_label from the call and fleet_box as the call's label when set, else kept while the region is unchanged. The hub's forward phase in the agent, not root.;rev3=census-ruling-stateless-replicas-1;basis=Carry declarative Stateless into forward rows under existing transaction and shape guards; projection only. file:Exec@1255,file:QueryRow@1031,registry:Account@693,registry:App@670,registry:Channel@746,registry:FleetLabel@881,registry:FleetLabel@911,registry:Host@1085,registry:Host@197,registry:Host@234,registry:Host@419,registry:Host@594,registry:Kind@206,registry:RateLimit@773,registry:Region@428,registry:Region@720,registry:Region@84,registry:Slug@646,registry:Stateless@941,registry:remote@446,registry:remote@476,whole:Route@1288,whole:Route@531,whole:Route@539,whole:remoteClient@448,whole:remoteClient@478 dfabb444b451e5a15ebb7dfa39d5ac37b8156acaef52ea9dd766a9a7ea017ccd
+@legacy f144338de75cd87f6a594d5383e7693220a591252502d62d81d567c018eaab9e internal/registry/registry.go scanRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user): main's body with the two new columns scanned;rev3=census-ruling-design-edge-rate-limit-358;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user): main's body with the rate_limit column scanned into Route.RateLimit; the new kind is registry:RateLimit, one site; no other read;rev3=census-ruling-rootfs-apps-2;identity=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user);basis=main's body with the runtime column scanned into Route.Runtime, before rate_limit; the new kind is registry:Runtime, one site; no other read; re-digested at the merge of origin/main 3c33f2eb: main's assets_off and asset_gen (edge asset cache plan 1) scanned beside runtime and rate_limit; routeColCount 59; re-digested again at the merge of origin/main 953b9fda: main's incarnation and serving_seq (self-serve moves plan 1) scanned after asset_gen; routeColCount 61;rev3=census-ruling-instance-egress-sizes-328-329;identity=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user);basis=#328/#329 plan 1 Task 4: main's body with egress_allow, size and policy_expires_at scanned into Route.EgressAllow, Route.Size and Route.PolicyExpiresAt after serving_seq; the new kinds are registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each; routeColCount 64; no other read;rev3=census-ruling-region-ha-p1a;basis=scans one more column, ha, into Route.HA (+registry:HA); routeColCount 64 to 65; keeps legacy;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Tasks 2 and 5): scans three more columns, fleet_assigned, fleet_moved and fleet_label, into Route.Assigned, Moved and FleetLabel. Any root caller of Registry.Get sees three more fields, which no root decision reads (grep: only the activator start rule, edge, provision and registry read them).;rev3=census-ruling-stateless-replicas-1;basis=Decode the additive stateless registry column; no launch authority. registry:Account@426,registry:Addr@194,registry:Addrs@516,registry:App@269,registry:Args@575,registry:AssetGen@885,registry:AssetsOff@1097,registry:Assigned@981,registry:Backing@351,registry:BuildState@800,registry:Canary@1151,registry:Caps@456,registry:CertExpiresAt@408,registry:Channel@299,registry:ClaimIncarnation@637,registry:ClaimOwner@673,registry:ClaimRowID@688,registry:ClaimStamp@658,registry:CreatedAt@559,registry:DBPath@230,registry:DNSCheckedAt@391,registry:DNSStatus@377,registry:EgressAllow@931,registry:Environment@440,registry:FleetBox@501,registry:FleetLabel@1002,registry:Gate@550,registry:GoodDemand@747,registry:GoodDigest@732,registry:GoodVersion@716,registry:HA@1059,registry:Health@526,registry:Hibernate@1127,registry:HoldOp@703,registry:Host@156,registry:IdleSeconds@584,registry:ImportGate@832,registry:Incarnation@898,registry:Kind@174,registry:LastError@216,registry:MaxRunSeconds@600,registry:Moved@1075,registry:NextDue@339,registry:Platform@1197,registry:PolicyExpiresAt@956,registry:Pool@277,registry:PrevVersion@253,registry:Provisioned@1221,registry:RateLimit@859,registry:Region@288,registry:Replica@1248,registry:Replicas@618,registry:Replication@323,registry:Runtime@847,registry:Seed@483,registry:SeedSource@817,registry:ServingSeq@914,registry:ServingVersion@762,registry:Size@947,registry:Slug@165,registry:Socket@183,registry:Stateless@1029,registry:Status@203,registry:StatusNamed@1172,registry:Steering@537,registry:Tunnel@465,registry:Unit@492,registry:UpdateSettings@781,registry:Version@241,whole:Route@1277 9d963b1c26c40211fbca564fcfcb3da8c077c6b09902f6f8eae75b8c9e255bc2
@legacy e022f83d4f2fe0524efad7d2e7acc9cc44a0510f14016131edc162dc02242142 internal/activator/rootfsrelease.go Service.runRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1: new; the one place a release command runs. Refuses while any record of the host is open; skips the row's good build (releaseRan); reads the declared processes (declaredProcesses: the existing staged-manifest read) and refuses on a read error, never treating it as no release; runs only when releaseDue; needs a lease watch and a ReleaseBackend; its gate is the caller's plus the lease's Err and its safety deadline more than releaseStopLead (cmdStopBound, 2 min) away; creates the record under a.mu after releaseAdmitLocked; publishes the generations file and the build state (recordBuild) before anything runs; times out at the manifest's timeout_sec (default, capped at runs.MaxTimeout); ReleaseEnv; a supervisor stops the unit ahead of the lease's safety deadline; StartRelease under the exec gate; polls the unit (root's existing cmd status); stops and settles it (the existing cmd hold's stop, cmdStopBound); only a non-zero exit, a signal or the timeout with the unit proven gone is the build's failure (*ReleaseError); registry:Host sites are the record key and log lines;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9: newCmdHold takes the hold's role; a release command's hold is instancectl.RoleCmd, the unit it runs in; nothing else changed, no read added;rev3=census-ruling-stateless-replicas-1;basis=Delegate unchanged stateful admission and stop/proof behavior to runReleaseAdmitted with no durable admission hook; reads moved to that method. whole:Route@212 45130d20bc0a8f9dcc30908479ce0189e39ee9e68d44e95a9aa6b8e84e0bc20f
cli.go runShip legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-1;basis=rootfs Plan 1 Task 9: takes --rootfs, --processes, --hibernate, --jit and --check and hands a rootfs ship to runShipRootfs (ship_rootfs.go) before the binary path; the --notes-file ReadFile moved into shipNoteText (its own row, the same read of the file the person named) and the direct-mode version mint into mintDirectVersion; one read site fewer, none added; Task 12: the --hibernate flag help is RFS-1-C32's new text, the same reads;rev3=census-ruling-edge-asset-cache-1;basis=takes --assets (repeatable), checks the folders with checkShipAssets (release.ValidAssetPaths; refused on a static site) before the mode split, carries them into the API meta (sess.shipAssets) and the direct-mode manifest (shipAssetsBlock), and passes them to runShipRootfs (rootfsShipOpts.assets), which runs the same check and carries them the same two ways; after a direct-mode ship has stored a release declaring folders, directShipAssetGens runs the console ship door's backfill (provision.MintMissingAssetGens: lists the app's record keys and gives each record without an asset generation one, a CAS write in the deployment bucket as the person running the CLI) and fails naming any record it could not mint; read sites unchanged (2), none added;rev3=census-ruling-rootfs-apps-4;basis=adds the repeatable --env flag and refuses it before anything else unless --check is given (shipEnvRefusal, parseShipCheckEnv); the parsed values go into rootfsShipOpts.checkEnv. --env values reach the check's local container runtime as -e argv only, never root, never a box. No read added; read sites unchanged (2).;rev3=census-ruling-stateless-replicas-1;basis=Carry --stateless into binary/API and rootfs ship options; same two read sites, no new read. file:ReadFile@7899,file:ReadFile@8123 d6f244d2c3bcae95eb8ec0fa7e57c52e9b50c7e9e2e00dda85f930b643731a51
internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. d79460f7b2128cc601a9d9149fcc0ce0baed0f4555e7d073848f099b197ea39e
@@ -18,6 +22,8 @@ internal/host/agent.go fastConvergeLoop authority B3 rev3=census-ruling-self-ser
internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. registry:Host@4776 717574378829734fb3461a7ec0a4e4e9089466745685d39008ad51b571ddf993
internal/host/agent.go haRecordFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new (region HA P1a), the agent as carlos: activator.Config.Record, the closure the HA classification calls on a lifetime index miss: opens the deployment store once (openDeployStore, kept under a mutex) and reads the host's record through judgedRecord(store, judge, release.RouteAccount(rt), rt.App, rt.Host) (CI fix: provision.ReadRecordJudged under the box's lifetime judge, which also GETs the host's incarnation slot control/host-incarnations/<host>.json from the same deployment store; a record the slot no longer vouches for, or a tombstone, reads as os.ErrNotExist; a nil judge, host claims on, is provision.GetRecord exactly), turned into a lifetime entry by provision.LifetimeEntryOf; the reads are the row it is handed (registry:App, registry:Host, whole:Route); the record is the console-written deployment record the reconcile passes already read; an open or read error is returned and the wake fails closed; root never calls it;rev3=census-ruling-stateless-replicas-1;basis=Return RecordFacts with lifetime identity, Coordinator and ReplicaDeploy from the same judged record object; same store and record reads, no extra GET. registry:App@596,registry:Host@604,whole:Route@591 db6d777c93afde9836873ce72b6cbb62a55567eb3fb01f85f7e1e12274e0c66d
internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-stateless-replicas-1;basis=Construct coordination with existing fleet API credentials on fleet boxes, trusted deployment store otherwise; invalid fleet identity leaves it unarmed. Assign production observation callback, close after service shutdown with a five-second context. Existing read sites unchanged. file:Exec@17664,file:Open@1150,file:Statfs@45008,registry:App@11419,whole:Route@11411,whole:Route@28976 982510112e4bce377dddd0343847282cbc274e4e047fc01e67cd60ec139461e9
+internal/registry/registry.go Registry.Fingerprint legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user); the remote arm, unchanged, in the process that holds a remote handle: census-ruling-seeded-instances's body with the row's lifetime pair (incarnation, serving_seq) folded into the edge's change poll, each only when non-zero, so a registry with no pair digests as before; self-serve moves 1 Task 7;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: hashes regional_domains (host, target, account, app, region; created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no regional rows digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; no file path read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R1 finding 1: the routes SELECT also reads host, kind, account, app, platform and fingerprintForwardInert (one CASE over the ForwardForbidden columns), and every row folds host, kind, account and app (tagged, quoted), platform when set, and forward_inert=0 for a forward row that is not inert, so a rowid reused by another hostname, an in-place account or app rewrite, or a stray forbidden column moves the edge's change poll. Same one SELECT per table on the same fresh connection to the box's own registry database, as carlos; no table, file or bucket read added; a digest, never a decision.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5): the SELECT also reads fleet_label and, only when it is set, hashes "fleet_label=<q>" into the digest, so labelling a row moves the edge's reload fingerprint. Read sites unchanged (33). Registry side, not root; an unlabelled registry's digest is byte-identical.;rev3=census-ruling-stateless-replicas-1;basis=Read the additive stateless projection in the existing registry SELECT and hash only when set; no new read source. file:Exec@284,file:Open@188,file:Query@368,file:Query@5758,file:Query@6237,file:Query@7223,file:Query@7919,file:Query@8831,file:Query@9888,registry:ClaimIncarnation@1448,registry:ClaimIncarnation@4666,registry:ClaimIncarnation@4743,registry:ClaimOwner@1492,registry:ClaimOwner@4867,registry:ClaimOwner@4932,registry:ClaimRowID@1511,registry:ClaimRowID@4959,registry:ClaimRowID@5025,registry:ClaimStamp@1473,registry:ClaimStamp@4776,registry:ClaimStamp@4840,registry:Incarnation@1556,registry:Incarnation@5246,registry:Incarnation@5310,registry:ServingSeq@1575,registry:ServingSeq@5337,registry:ServingSeq@5400,registry:Text@158,registry:path@207,registry:remote@55,registry:remote@87,whole:remoteClient@57,whole:remoteClient@89 20459fd46b63a9ec4eee58920a98ed4a2d01fdaad6a374d66654ba74650d847a
+internal/registry/registry.go upsertRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-alias-socket-follow-338;basis=#338: Upsert's unchanged statement moved into a helper so it can run on the database or inside a transaction;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 2 (runtimeFixed in the registry): takes a guard appended to the ON CONFLICT WHERE (UpsertUnlessRootfs passes routes.runtime = ''); a stored row with a runtime keeps its region and hibernate unless the tenant changed; replication is cleared only when the effective runtime is empty; no new read source, same SQLite table;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 3: on a refused conflict, the forward check reads the host (+registry:Host) to answer ErrForwardRow; the statement carries kind <> 'forward'. A refusal only.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 2): the conflict arm gains fleet_assigned (the excluded value on a re-tenanted host, else kept when the writer carries '') and fleet_moved (excluded on a re-tenanted host, else MAX of stored and excluded). Read sites unchanged (3). The same statement guard (claim ownership, kind <> 'forward') applies.;rev3=census-ruling-stateless-replicas-1;basis=Persist the stateless projection in the existing guarded upsert; no new read. file:Exec@116,registry:Host@4720,whole:Route@4596 ebc718cda38d18914e19680c1e6b9ba68b4f8fd43318be417569951b78c578f5
internal/rollout/failures.go FailureBook.saveLocked authority E3 rev3=PROPOSED-p3;run=8;identity=root adoption uid 0 or legacy rollout uid carlos;basis=root instance uses checked store writer; legacy instances retain the original atomic file writer and epoch semantics;rev3=census-ruling-stateless-replicas-1;basis=Persist the additive replica_releases selection carrier in the existing failure-book atomic write; no new path, record writer or authority. IDs are returned only after a successful save. 443cdc68cd2c5cae070a81e4b0d98bbd8551adba8de795e18f5b505f4a03f1d7
internal/rollout/failures.go OpenFailureBook authority E1,E3,J1,J4 fix1-merge-review;basis=Loads schema-three durable generations and refuses unsafe identity recovery on entropy failure.;rev3=census-ruling-stateless-replicas-1;basis=Load the additive replica_releases carrier from the same existing failure-book ReadFile; unchanged schema acceptance, identity recovery, reconciliation and read site. No additional read. file:ReadFile@136 b92f6a033f129bffb158e8768b1b14ee88e855f67c2f0da360c65c93d27d8cf8
ship_check.go rootfsCheck.runArgs legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-1;basis=root-input (J4, as main's db.go units); the carlos CLI on a person's machine, as the person (no box unit): new (rootfs Plan 1), builds the docker or podman run argv for one check container; the scanner matches the word Command, here a field of release.Process (a process's argv), not os/exec; reads no file; decides nothing for root;rev3=census-ruling-rootfs-check-volumes;basis=R2 P1: the data and run volume mounts (-v) now carry :nocopy through rootfsCheck.volumeMount, so Docker and Podman never fill an empty check volume from the image directory at the mount point (which would reset the prepared owner and mode); same volumes, same paths, same probe mount, nothing else in the argv changed. Runs on the person's machine as the person; no box unit; no read added.;rev3=census-ruling-stateless-replicas-1;basis=Stateless local checks mount only the run volume and omit the database mount; same probe read, no new read. file:Command@887,file:Command@971 e684fd3273527a209460ed81e5bcd472a4282f46830fe580e5f07f0b0d876684
@@ -25,11 +31,16 @@ internal/activator/replicaobservation.go ObservedReplicaRelease legacy accepted-
internal/activator/rootfsrelease.go Service.runReleaseAdmitted legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Extract existing runner unchanged except optional pre-exec durable release transition after local admission and before any command; same staged process reads, stop/proof and exec gates, no new filesystem path. registry:Host@216,whole:Route@3085,whole:Route@3314,whole:Route@3802,whole:Route@3831,whole:Route@5879,whole:Route@621,whole:Route@6347,whole:Route@6624,whole:Route@7054,whole:Route@849,whole:Route@934 de8d9d6b31ac2b8cf2c34aaca32ecfbdd2c8966f75def906e3baef5bb409d109
internal/activator/statelessrelease.go Service.PrepareStatelessRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Read durable deploy evidence and canonical target via existing-record observation seam; use coordinator authority only for this path, persist releasing before exec and require proof plus SafeUntil before success; commandless binary verifies staged artifact separately; R11 lets the current term retake pending via the typed begin gate; R12 follows renewed SafeUntil through the existing command supervisor instead of a fixed initial context deadline; no new store polling or direct typed record writer callsite. Fix round 1 replaces the frozen-carrier re-observation with an identical released writer replay; command execution, proof and authority gates remain. registry:Account@544,registry:App@574,registry:GoodDemand@2971,registry:GoodDigest@2956,registry:GoodVersion@2940,registry:Host@1170,registry:Host@224,registry:Host@3027,registry:Host@3085,registry:Host@3301,registry:Host@3369,registry:Host@601,whole:Route@3094,whole:Route@3101,whole:Route@3653,whole:Route@483 d4429770206e5905e3789157cbf222504cd34d0b7a4e22c765aee1b24a3e5e61
internal/replicas/coordinator.go ChangeCoordinator legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Generate a fresh 128-bit coordinator term using crypto/rand.Read; no file path or process input added. file:Read@472 e50ce5a352b3022a1ee6375fbfee315a5d2fcaeb4f4a25f4e33a5a10e3000a67
+internal/registry/forward.go Registry.PutForward legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 2: the only writer of a forward row's declared columns: refuses an argument whose kind is not forward; copies only the declared fields from its argument (Status ready, Provisioned true; no forbidden column is ever written); inside one IMMEDIATE transaction refuses a host a non-forward row holds (ErrHostHeld); keeps FleetBox while Region is unchanged; preserves the observational columns (+file:Exec, +file:QueryRow, +registry:Account, App, Channel, RateLimit, Region, Slug, +registry:Host x3, +registry:Kind, +registry:remote x2, +whole:Route x3, +whole:remoteClient x2).;rev3=census-ruling-fleet-routes-followups;basis=refuses up front, with the new sentinel ErrNotForward and before any read or write, an rt that is not a forward row (as before, now a sentinel), has an empty Host, or whose Region is not a fleet placement (registry.FleetPlacement); +registry:Host x2 and +registry:Region x2 read only the argument in those checks; the transaction and statement are unchanged;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3), merged with main's ErrNotForward refusals (kept unchanged): the written row also carries FleetLabel = rt.FleetLabel and FleetBox = rt.FleetLabel; its conflict arm (forwardKept) writes fleet_label from the call and fleet_box as the call's label when set, else kept while the region is unchanged. The hub's forward phase in the agent, not root.;rev3=census-ruling-stateless-replicas-1;basis=Carry declarative Stateless into forward rows under existing transaction and shape guards; projection only. file:Exec@1255,file:QueryRow@1031,registry:Account@693,registry:App@670,registry:Channel@746,registry:FleetLabel@881,registry:FleetLabel@911,registry:Host@1085,registry:Host@197,registry:Host@234,registry:Host@419,registry:Host@594,registry:Kind@206,registry:RateLimit@773,registry:Region@428,registry:Region@720,registry:Region@84,registry:Slug@646,registry:Stateless@941,registry:remote@446,registry:remote@476,whole:Route@1288,whole:Route@531,whole:Route@539,whole:remoteClient@448,whole:remoteClient@478 dfabb444b451e5a15ebb7dfa39d5ac37b8156acaef52ea9dd766a9a7ea017ccd
+internal/registry/registry.go routeArgs authority E3 rev3=census-ruling-seeded-instances;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user), wherever a route is inserted: Upsert, the cold handover restore and the import journal's inserts: the bind list from Registry.Upsert's body (and RestoreClaimRows'), with seed_source and import_gate added; E3, the same family as Registry.Upsert, whose body it came from;rev3=census-ruling-design-edge-rate-limit-358;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user), wherever a route is inserted: the bind list gains t.RateLimit for the new rate_limit column (routeCols and Upsert's conflict clause gain it too); the new kind is registry:RateLimit, one site; it binds the value and decides nothing; E3, as before;rev3=census-ruling-rootfs-apps-2;identity=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user);basis=the bind list gains t.Runtime for the new runtime column (routeCols, routeColCount 57 with main's rate_limit, and Upsert's conflict clause gain it too); the new kind is registry:Runtime, one site; it binds the value and decides nothing; E3, as before; re-digested at the merge of origin/main 3c33f2eb: main's assets_off and asset_gen (edge asset cache plan 1) bound beside runtime and rate_limit; routeColCount 59; re-digested again at the merge of origin/main 953b9fda: main's incarnation and serving_seq (self-serve moves plan 1) bound after asset_gen; routeColCount 61;rev3=census-ruling-instance-egress-sizes-328-329;identity=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user);basis=#328/#329 plan 1 Task 4: the bind list gains t.EgressAllow, t.Size and t.PolicyExpiresAt for the three new columns (routeCols, routeColCount 64, and Upsert's conflict clause gain them too); the new kinds are registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each; it binds the values and decides nothing; E3, as before;rev3=census-ruling-region-ha-p1a;basis=binds one more column, ha, as an integer from Route.HA (+registry:HA); keeps authority E3;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Tasks 2 and 5): binds three more columns, t.Assigned, b2iDB(t.Moved) and t.FleetLabel (routeColCount 65 to 68).;rev3=census-ruling-stateless-replicas-1;basis=Encode the additive Stateless flag in the shared SQL insert argument list; no launch authority. registry:Account@355,registry:Addr@83,registry:Addrs@451,registry:App@152,registry:Args@505,registry:AssetGen@818,registry:AssetsOff@804,registry:Assigned@916,registry:Backing@253,registry:BuildState@730,registry:Canary@216,registry:Caps@381,registry:CertExpiresAt@338,registry:Channel@177,registry:ClaimIncarnation@577,registry:ClaimOwner@611,registry:ClaimRowID@625,registry:ClaimStamp@597,registry:CreatedAt@492,registry:DBPath@116,registry:DNSCheckedAt@320,registry:DNSStatus@307,registry:EgressAllow@861,registry:Environment@366,registry:FleetBox@439,registry:FleetLabel@944,registry:Gate@484,registry:GoodDemand@680,registry:GoodDigest@666,registry:GoodVersion@651,registry:HA@909,registry:Health@460,registry:Hibernate@196,registry:HoldOp@639,registry:Host@49,registry:IdleSeconds@513,registry:ImportGate@760,registry:Incarnation@830,registry:Kind@65,registry:LastError@101,registry:MaxRunSeconds@528,registry:Moved@934,registry:NextDue@242,registry:Platform@294,registry:PolicyExpiresAt@884,registry:Pool@159,registry:PrevVersion@137,registry:Provisioned@407,registry:RateLimit@785,registry:Region@167,registry:Replica@565,registry:Replicas@547,registry:Replication@227,registry:Runtime@774,registry:Seed@423,registry:SeedSource@746,registry:ServingSeq@845,registry:ServingVersion@694,registry:Size@876,registry:Slug@57,registry:Socket@73,registry:Stateless@964,registry:Status@91,registry:StatusNamed@272,registry:Steering@472,registry:Tunnel@389,registry:Unit@431,registry:UpdateSettings@712,registry:Version@126 7eee5ee9dbec674fc8fcaa7ff759c2825d2d0572358a62256e5355d7713acb79
+internal/registry/registry.go scanRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user): main's body with the two new columns scanned;rev3=census-ruling-design-edge-rate-limit-358;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user): main's body with the rate_limit column scanned into Route.RateLimit; the new kind is registry:RateLimit, one site; no other read;rev3=census-ruling-rootfs-apps-2;identity=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user);basis=main's body with the runtime column scanned into Route.Runtime, before rate_limit; the new kind is registry:Runtime, one site; no other read; re-digested at the merge of origin/main 3c33f2eb: main's assets_off and asset_gen (edge asset cache plan 1) scanned beside runtime and rate_limit; routeColCount 59; re-digested again at the merge of origin/main 953b9fda: main's incarnation and serving_seq (self-serve moves plan 1) scanned after asset_gen; routeColCount 61;rev3=census-ruling-instance-egress-sizes-328-329;identity=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user);basis=#328/#329 plan 1 Task 4: main's body with egress_allow, size and policy_expires_at scanned into Route.EgressAllow, Route.Size and Route.PolicyExpiresAt after serving_seq; the new kinds are registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each; routeColCount 64; no other read;rev3=census-ruling-region-ha-p1a;basis=scans one more column, ha, into Route.HA (+registry:HA); routeColCount 64 to 65; keeps legacy;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Tasks 2 and 5): scans three more columns, fleet_assigned, fleet_moved and fleet_label, into Route.Assigned, Moved and FleetLabel. Any root caller of Registry.Get sees three more fields, which no root decision reads (grep: only the activator start rule, edge, provision and registry read them).;rev3=census-ruling-stateless-replicas-1;basis=Decode the additive stateless registry column; no launch authority. registry:Account@426,registry:Addr@194,registry:Addrs@516,registry:App@269,registry:Args@575,registry:AssetGen@885,registry:AssetsOff@1097,registry:Assigned@981,registry:Backing@351,registry:BuildState@800,registry:Canary@1151,registry:Caps@456,registry:CertExpiresAt@408,registry:Channel@299,registry:ClaimIncarnation@637,registry:ClaimOwner@673,registry:ClaimRowID@688,registry:ClaimStamp@658,registry:CreatedAt@559,registry:DBPath@230,registry:DNSCheckedAt@391,registry:DNSStatus@377,registry:EgressAllow@931,registry:Environment@440,registry:FleetBox@501,registry:FleetLabel@1002,registry:Gate@550,registry:GoodDemand@747,registry:GoodDigest@732,registry:GoodVersion@716,registry:HA@1059,registry:Health@526,registry:Hibernate@1127,registry:HoldOp@703,registry:Host@156,registry:IdleSeconds@584,registry:ImportGate@832,registry:Incarnation@898,registry:Kind@174,registry:LastError@216,registry:MaxRunSeconds@600,registry:Moved@1075,registry:NextDue@339,registry:Platform@1197,registry:PolicyExpiresAt@956,registry:Pool@277,registry:PrevVersion@253,registry:Provisioned@1221,registry:RateLimit@859,registry:Region@288,registry:Replica@1248,registry:Replicas@618,registry:Replication@323,registry:Runtime@847,registry:Seed@483,registry:SeedSource@817,registry:ServingSeq@914,registry:ServingVersion@762,registry:Size@947,registry:Slug@165,registry:Socket@183,registry:Stateless@1029,registry:Status@203,registry:StatusNamed@1172,registry:Steering@537,registry:Tunnel@465,registry:Unit@492,registry:UpdateSettings@781,registry:Version@241,whole:Route@1277 9d963b1c26c40211fbca564fcfcb3da8c077c6b09902f6f8eae75b8c9e255bc2
internal/activator/rootfsrelease.go Service.runRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1: new; the one place a release command runs. Refuses while any record of the host is open; skips the row's good build (releaseRan); reads the declared processes (declaredProcesses: the existing staged-manifest read) and refuses on a read error, never treating it as no release; runs only when releaseDue; needs a lease watch and a ReleaseBackend; its gate is the caller's plus the lease's Err and its safety deadline more than releaseStopLead (cmdStopBound, 2 min) away; creates the record under a.mu after releaseAdmitLocked; publishes the generations file and the build state (recordBuild) before anything runs; times out at the manifest's timeout_sec (default, capped at runs.MaxTimeout); ReleaseEnv; a supervisor stops the unit ahead of the lease's safety deadline; StartRelease under the exec gate; polls the unit (root's existing cmd status); stops and settles it (the existing cmd hold's stop, cmdStopBound); only a non-zero exit, a signal or the timeout with the unit proven gone is the build's failure (*ReleaseError); registry:Host sites are the record key and log lines;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9: newCmdHold takes the hold's role; a release command's hold is instancectl.RoleCmd, the unit it runs in; nothing else changed, no read added;rev3=census-ruling-stateless-replicas-1;basis=Delegate unchanged stateful admission and stop/proof behavior to runReleaseAdmitted with no durable admission hook; reads moved to that method. whole:Route@212 45130d20bc0a8f9dcc30908479ce0189e39ee9e68d44e95a9aa6b8e84e0bc20f
@coverage . d8abf32baa39f05d1e9d4e9b8a24e7113c58f42f8735e7a62e217eb39e7a4bf7
-@coverage internal/activator 95f35b868e9003100889d3b4aad2ff849d246c9e1b385043aa943c7ed5e38bcf
+@coverage internal/activator 84de4ed8028b1677612190c2c795018905bbb0c9a683e0173ad6e5f09784e669
@coverage internal/host 50d79612f83e07e6ef70e5c3e46146494b71d9e459104a66a5e884148ac5084b
@coverage internal/provision 065bba3c905bb30f6f7b44408b2ab013ed063c3ce49c6fc26ee0b153a454e9ca
+@coverage internal/registry 25e5d232939ee0c4de4aa6d2a08113386de1812363384041803cdfbc937bcad5
@coverage internal/release c1012571516227abff9612aba085e749489e8b8119c0b55444f53a15ed881fb1
@coverage internal/replicas 53b94eb040154539a0a977498b4b8bc1d53d82f67c1c6233667a0b823dd30d8a
@coverage internal/rollout d95e28f37f3456b4b1fb38c848ffe310b2816ab4089347332b2f6b8cb9e02831
+@fields A,Account,Accounts,AddedAt,Addr,Addrs,Alias,Aliases,Alive,AllowAbsent,App,Archives,Args,AssetGen,AssetsOff,Assigned,At,Attempts,B,Backing,Bucket,BuildState,By,Callback,CallbackError,CallbackFailed,Canary,Caps,CertExpiresAt,Changed,Channel,CheckedAt,Claim,ClaimIncarnation,ClaimOwner,ClaimOwnership,ClaimRowID,ClaimStamp,Class,Column,Contents,CreatedAt,DBPath,DNSCheckedAt,DNSStatus,Deadline,Default,Demand,Digest,DoneBefore,DrainingSince,Due,DueAt,EgressAllow,Env,EnvBefore,Environment,Error,ErrorKind,ExcludeHosts,ExpectGood,ExpectOp,ExpectPair,Expected,F,Failed,FenceGen,Field,Fleet,FleetBox,FleetBoxes,FleetLabel,Fleets,From,FromDB,FromOp,FromSock,Gate,GoodDemand,GoodDigest,GoodVersion,HA,Hash,Health,Held,Hibernate,HoldOp,Host,Hosts,ID,Id,IdValue,Idle,IdleSeconds,ImportGate,Incarnation,Journal,Keep,KeyFP,Kind,Label,LabelledAt,LastAt,LastError,LastMs,LastStatus,Limit,MaxRun,MaxRunSeconds,Method,Moved,Ms,Name,Next,NextAt,NextDue,NextGood,NextValue,Now,Number,Number64,Observed,ObservedValue,Old,On,OnConflict,Op,Original,Owner,Ownership,P,Pair,Path,Paths,Platform,PolicyExpiresAt,Pool,Prefix,Prev,PrevVersion,Provisioned,Pub,RDs,RateLimit,RecordKey,Region,Regional,Registration,Replica,Replicas,Replication,Retirement,Route,Routes,Row,Rows,Runtime,SecretsKeyFP,SecretsKeySetAt,SecretsKeySetBy,SecretsPub,Seed,SeedID,SeedSource,ServingSeq,ServingVersion,Size,Slug,Socket,Spec,Sqid,State,Stateless,Status,StatusNamed,Steering,StringMap,T,TValue,Tags,Target,Targets,Text,Timer,Timers,Times,To,ToDB,ToOp,ToSock,TokenHash,Tunnel,Type,Unit,UpdateSettings,Ver,Version,W,WakeIncarnation,Wildcards,closed,conn,connect,ctx,d,dec,done,enc,full,input,mu,output,path,readOnly,remote,sql,wait
diff --git a/internal/registry/forward.go b/internal/registry/forward.go
index 8eb739733..a0d4d9184 100644
--- a/internal/registry/forward.go
+++ b/internal/registry/forward.go
@@ -102,7 +102,7 @@ var forwardShape = map[string]string{
"Host": "declared", "Kind": "declared", "Slug": "declared", "App": "declared",
"Account": "declared", "Region": "declared", "Channel": "declared",
"RateLimit": "declared", "Status": "declared", "Provisioned": "declared",
- "CreatedAt": "declared", "FleetLabel": "declared",
+ "CreatedAt": "declared", "FleetLabel": "declared", "Stateless": "declared",
"FleetBox": "binding",
@@ -297,6 +297,7 @@ var forwardKept = []forwardKeptColumn{
{"Provisioned", "provisioned", "excluded.provisioned"},
{"CreatedAt", "created_at", "routes.created_at"},
{"FleetLabel", "fleet_label", "excluded.fleet_label"},
+ {"Stateless", "stateless", "excluded.stateless"},
{"FleetBox", "fleet_box", "CASE WHEN excluded.fleet_label <> '' THEN excluded.fleet_label" +
" WHEN routes.region = excluded.region THEN routes.fleet_box ELSE '' END"},
{"DNSStatus", "dns_status", "routes.dns_status"},
@@ -375,6 +376,7 @@ func (r *Registry) PutForward(rt Route) error {
CreatedAt: time.Now().Unix(),
FleetLabel: rt.FleetLabel,
FleetBox: rt.FleetLabel,
+ Stateless: rt.Stateless,
}
return r.inImmediateTx(func(tx txer) error {
var kind string
diff --git a/internal/registry/registry.go b/internal/registry/registry.go
index d21f3a407..50a80c1ea 100644
--- a/internal/registry/registry.go
+++ b/internal/registry/registry.go
@@ -122,7 +122,9 @@ type Route struct {
// for AssetsOff's reason.
AssetGen string
- LastError string
+ LastError string
+ // Stateless projects the serving generation mode; it never authorizes a launch.
+ Stateless bool `json:"stateless,omitempty"`
DBPath string
Version string
PrevVersion string
@@ -688,6 +690,7 @@ var routeAddedColumns = []addedColumn{
{Name: "region", Type: "TEXT", Default: "''"},
{Name: "channel", Type: "TEXT", Default: "''"},
{Name: "hibernate", Type: "INTEGER", Default: "0"},
+ {Name: "stateless", Type: "INTEGER", Default: "0"},
{Name: "canary", Type: "INTEGER", Default: "0"},
{Name: "replication", Type: "TEXT", Default: "''"},
{Name: "next_due", Type: "INTEGER", Default: "0"},
@@ -1084,10 +1087,10 @@ provisioned, seed, unit, fleet_box, addrs, health, steering, gate, created_at,
args, idle_seconds, max_run_seconds, replicas, replica, claim_incarnation, claim_stamp, claim_owner, claim_row_id, hold_op,
good_version, good_digest, good_demand, serving_version, update_settings, build_state,
seed_source, import_gate, runtime, rate_limit, assets_off, asset_gen, incarnation, serving_seq,
-egress_allow, size, policy_expires_at, ha, fleet_assigned, fleet_moved, fleet_label`
+egress_allow, size, policy_expires_at, ha, fleet_assigned, fleet_moved, fleet_label, stateless`
// routeColCount is the number of names in routeCols.
-const routeColCount = 68
+const routeColCount = 69
// placeholders is n comma-joined bind parameters.
func placeholders(n int) string {
@@ -1096,7 +1099,7 @@ func placeholders(n int) string {
func scanRoute(scan func(...any) error) (Route, error) {
var t Route
- var hib, can, sn, plat, prov, rep, assetsOff, ha, moved int
+ var hib, can, sn, plat, prov, rep, assetsOff, ha, moved, stateless int
err := scan(&t.Host, &t.Slug, &t.Kind, &t.Socket, &t.Addr, &t.Status,
&t.LastError, &t.DBPath, &t.Version, &t.PrevVersion, &t.App, &t.Pool,
&t.Region, &t.Channel, &hib, &can, &t.Replication, &t.NextDue, &t.Backing,
@@ -1106,7 +1109,8 @@ func scanRoute(scan func(...any) error) (Route, error) {
&t.Args, &t.IdleSeconds, &t.MaxRunSeconds, &t.Replicas, &rep, &t.ClaimIncarnation, &t.ClaimStamp, &t.ClaimOwner, &t.ClaimRowID, &t.HoldOp,
&t.GoodVersion, &t.GoodDigest, &t.GoodDemand, &t.ServingVersion, &t.UpdateSettings, &t.BuildState,
&t.SeedSource, &t.ImportGate, &t.Runtime, &t.RateLimit, &assetsOff, &t.AssetGen, &t.Incarnation, &t.ServingSeq,
- &t.EgressAllow, &t.Size, &t.PolicyExpiresAt, &ha, &t.Assigned, &moved, &t.FleetLabel)
+ &t.EgressAllow, &t.Size, &t.PolicyExpiresAt, &ha, &t.Assigned, &moved, &t.FleetLabel, &stateless)
+ t.Stateless = stateless != 0
t.HA = ha != 0
t.Moved = moved != 0
t.AssetsOff = assetsOff != 0
@@ -1557,6 +1561,7 @@ ON CONFLICT(host) DO UPDATE SET
region=CASE WHEN routes.runtime != '' AND NOT (`+tenantChangedSQL+`) THEN routes.region ELSE excluded.region END,
channel=excluded.channel,
hibernate=CASE WHEN routes.runtime != '' AND NOT (`+tenantChangedSQL+`) THEN routes.hibernate ELSE excluded.hibernate END,
+ stateless=excluded.stateless,
canary=excluded.canary,
next_due=excluded.next_due,
backing=excluded.backing, status_named=excluded.status_named,
@@ -1674,7 +1679,7 @@ func routeArgs(t Route) []any {
t.Replicas, b2iDB(t.Replica), t.ClaimIncarnation, t.ClaimStamp, t.ClaimOwner, t.ClaimRowID, t.HoldOp,
t.GoodVersion, t.GoodDigest, t.GoodDemand, t.ServingVersion, t.UpdateSettings, t.BuildState,
t.SeedSource, t.ImportGate, t.Runtime, t.RateLimit, b2iDB(t.AssetsOff), t.AssetGen, t.Incarnation, t.ServingSeq,
- t.EgressAllow, t.Size, t.PolicyExpiresAt, b2iDB(t.HA), t.Assigned, b2iDB(t.Moved), t.FleetLabel,
+ t.EgressAllow, t.Size, t.PolicyExpiresAt, b2iDB(t.HA), t.Assigned, b2iDB(t.Moved), t.FleetLabel, b2iDB(t.Stateless),
}
}
@@ -3894,7 +3899,7 @@ SELECT rowid, status, socket, addr, version, hibernate, channel, backing, tunnel
db_path, region, fleet_box, addrs, health, gate, hold_op, import_gate, rate_limit,
claim_incarnation, claim_stamp, claim_owner, claim_row_id,
assets_off, asset_gen, incarnation, serving_seq,
- host, kind, account, app, platform, fleet_label,
+ host, kind, account, app, platform, fleet_label, stateless,
` + fingerprintForwardInert + `
FROM routes ORDER BY rowid`)
if err != nil {
@@ -3904,7 +3909,7 @@ FROM routes ORDER BY rowid`)
h := sha256.New()
n := 0
for rows.Next() {
- var rowid, hibernate, assetsOff, platform, forwardInert int64
+ var rowid, hibernate, assetsOff, platform, forwardInert, stateless int64
var pair Pair
var claim ClaimOwnership
var assetGen string
@@ -3914,7 +3919,7 @@ FROM routes ORDER BY rowid`)
&channel, &backing, &tunnel, &dbPath, &region, &fleetBox, &addrs, &health, &gate, &holdOp, &importGate, &rateLimit,
&claim.ClaimIncarnation, &claim.ClaimStamp, &claim.ClaimOwner, &claim.ClaimRowID,
&assetsOff, &assetGen, &pair.Incarnation, &pair.ServingSeq,
- &host, &kind, &account, &app, &platform, &fleetLabel, &forwardInert); err != nil {
+ &host, &kind, &account, &app, &platform, &fleetLabel, &stateless, &forwardInert); err != nil {
return "", err
}
fmt.Fprintf(h, "%d\x1f%s\x1f%s\x1f%s\x1f%s\x1f%d\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s",
@@ -3928,6 +3933,9 @@ FROM routes ORDER BY rowid`)
fmt.Fprintf(h, "\x1fhost=%q\x1fkind=%q\x1faccount=%q\x1fapp=%q", host, kind, account, app)
// The platform mark decides the platform-alias fold (PlatformAliasFold),
// and a refused source refuses its alias with it; folded only when set.
+ if stateless != 0 {
+ fmt.Fprint(h, "\x1fstateless=1")
+ }
if platform != 0 {
fmt.Fprint(h, "\x1fplatform=1")
}
@@ -4216,6 +4224,7 @@ var snapshotClaimCols = map[string]bool{
// digests exactly as it did before the columns existed, so upgrading does
// not force a snapshot on every box.
var snapshotWhenSetCols = map[string]bool{
+ "stateless": true,
"good_version": true,
"good_digest": true,
"good_demand": true,
diff --git a/internal/registry/registry_test.go b/internal/registry/registry_test.go
index 336f6ffd2..8c46117f1 100644
--- a/internal/registry/registry_test.go
+++ b/internal/registry/registry_test.go
@@ -76,7 +76,7 @@ func TestUpsertRoundTripsAllColumns(t *testing.T) {
DBPath: "/data/b.db", Version: "abc1234", PrevVersion: "def5678",
App: "kass", Pool: "shared", Region: "ie", Channel: "stable",
Environment: "demo", Caps: "host-role,port:25",
- Hibernate: true, Canary: true, Replication: "batched",
+ Stateless: true, Hibernate: true, Canary: true, Replication: "batched",
NextDue: 4200, Backing: BackingUnit, Unit: "console.service",
Steering: "latency",
Replicas: "ie,uk,us",
diff --git a/internal/registry/remote_test.go b/internal/registry/remote_test.go
index 8d6cf021a..1adc80165 100644
--- a/internal/registry/remote_test.go
+++ b/internal/registry/remote_test.go
@@ -37,7 +37,7 @@ func remoteTestRegistry(t *testing.T) (*Registry, string) {
func TestRemoteRegistryRoundTrip(t *testing.T) {
r, _ := remoteTestRegistry(t)
- route := Route{Host: "remote.example.com", Kind: "instance", Status: "ready"}
+ route := Route{Host: "remote.example.com", Kind: "instance", Status: "ready", Stateless: true}
if err := r.Upsert(route); err != nil {
t.Fatal(err)
}
@@ -45,7 +45,7 @@ func TestRemoteRegistryRoundTrip(t *testing.T) {
t.Fatal(err)
}
got, err := r.Get(route.Host)
- if err != nil || got == nil || got.Version != "v2" || got.PrevVersion != "v1" {
+ if err != nil || got == nil || got.Version != "v2" || got.PrevVersion != "v1" || !got.Stateless {
t.Fatalf("route = %+v, %v", got, err)
}
resident := Route{Host: "resident.example.com", Kind: "instance", Socket: "/run/carlos/instances/resident.example.com/app.sock",
diff --git a/internal/registry/stateless_test.go b/internal/registry/stateless_test.go
new file mode 100644
index 000000000..168e6a038
--- /dev/null
+++ b/internal/registry/stateless_test.go
@@ -0,0 +1,94 @@
+package registry
+
+import (
+ "path/filepath"
+ "testing"
+)
+
+func TestStatelessRouteProjection(t *testing.T) {
+ for _, remote := range []bool{false, true} {
+ name := "local"
+ if remote {
+ name = "remote"
+ }
+ t.Run(name, func(t *testing.T) {
+ r := openTestRegistry(t)
+ if remote {
+ r, _ = remoteTestRegistry(t)
+ }
+ rt := Route{Host: "shop.example.com", Kind: "instance", Status: "ready"}
+ if err := r.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ before, err := r.Fingerprint()
+ if err != nil {
+ t.Fatal(err)
+ }
+ rt.Stateless = true
+ if err := r.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ got, err := r.Get(rt.Host)
+ if err != nil || got == nil || !got.Stateless {
+ t.Fatalf("route = %+v, %v", got, err)
+ }
+ after, err := r.Fingerprint()
+ if err != nil || after == before {
+ t.Fatalf("mode did not change fingerprint: %v", err)
+ }
+ rt.Stateless = false
+ if err := r.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ got, err = r.Get(rt.Host)
+ if err != nil || got == nil || got.Stateless {
+ t.Fatalf("stateful route = %+v, %v", got, err)
+ }
+ rt.Kind, rt.Region, rt.Stateless = KindForward, "fleet/shop", true
+ rt.Host = "forward.example.com"
+ if err := r.PutForward(rt); err != nil {
+ t.Fatal(err)
+ }
+ got, err = r.Get(rt.Host)
+ if err != nil || got == nil || !got.Stateless || !got.InertForward() {
+ t.Fatalf("forward = %+v, %v", got, err)
+ }
+ })
+ }
+}
+
+func TestStatelessRegistryMigration(t *testing.T) {
+ path := filepath.Join(t.TempDir(), "registry.db")
+ r, err := Open(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ rt := Route{Host: "shop.example.com", Kind: "instance", Status: "ready"}
+ if err := r.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ // Recreate the pre-column shape with a populated legacy route.
+ if _, err := r.sql.Exec("ALTER TABLE routes DROP COLUMN stateless"); err != nil {
+ t.Fatal(err)
+ }
+ if err := r.Close(); err != nil {
+ t.Fatal(err)
+ }
+ r, err = Open(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer r.Close()
+ got, err := r.Get(rt.Host)
+ if err != nil || got == nil || got.Stateless {
+ t.Fatalf("legacy route = %+v, %v", got, err)
+ }
+ rt.Stateless = true
+ if err := r.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ got, err = r.Get(rt.Host)
+ if err != nil || got == nil || !got.Stateless {
+ t.Fatalf("migrated route = %+v, %v", got, err)
+ }
+}