carlos / platform Public

refactor: share prelaunch placement checks with stateless wakes

Extract the existing current-route and fleet-record recheck without acquiring a serving lease. Add a stateless prelaunch check against attempt-local lifetime evidence and launch configuration, plus the database-free binary argv helper and focused tests. Runtime wake and launch callers remain to be implemented; this does not enable stateless serving.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 24f9c85b2dec3468a13986aefc8531e394f614d9 parent 4283a83
6 files changed, +200 −16
  • docs/superpowers/notes/census-proposal-stateless-replicas-1.md +6 −2
  • internal/activator/stateless.go +54 −0
  • internal/activator/stateless_test.go +107 −0
  • internal/activator/wakeidentity.go +23 −10
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv +9 −3

Intent

Human

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

Human

<task-notification> <task-id>bxwnmqc5t</task-id> <tool-use-id>toolu_01GfSH7SjbY3nHYFuDpftzku</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/bxwnmqc5t.output</output-file> <status>failed</status> <summary>Background command "Wait for 3a continuation" failed with exit code 1</summary> </task-notification>

Human

<task-notification> <task-id>a09d752615c923fc4</task-id> <tool-use-id>toolu_01NXe7fJFDpKSsCALk6AzNqU</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/a09d752615c923fc4.output</output-file> <status>completed</status> <summary>Agent "Re-review Task 2 fix round 2" 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>**I4: ADDRESSED** - **Coordinator handler** (`internal/console/replicacoordinator.go:92-99`): any error other than ErrFenced, ErrInvalid or held now gets 503. Held errors still get 409 with `retry_at` (lines 83-90), and ErrFenced/ErrInvalid still get 409. - **Release handler** (`internal/console/replicacoordinator.go:157-164`): same split. - **Auth failures:** unchanged. Every failure path still ends in the same bare `http.NotFound` (lines 55, 63, 80, 115, 123, 154). The `unauthorized` flag is checked before the new status mapping, so an auth failure inside the lock cannot become a 409 or 503. - **Host adapter:** unchanged. `internal/host/replicacoordinator.go:96-97` turns any status of 500 or above into a plain error, not ErrFenced, so a 503 is treated as transient. - **Witness** (`internal/host/replicacoordinator_test.go:370`, `TestCoordinatorFleetTransientRenewal`): it runs the real `console.Server` and the real `replicaCoordinatorAPI` through an in-process transport. It covers four cases: - A store `Put` timeout during `Tick` renewal returns 503. `SafeUntil` stays exactly where it was and `Lost` stays open, so authority is kept but not extended. - A release-store timeout returns 503 as a non-fenced error. - Recovery renews and extends the deadline. - A real stored-lease release, then renewal, returns 409, sets ErrFenced and closes `Lost`. The preflight also checks that an unknown record gets a non-transient response. **New breakage: none at Critical or Important.** - **No real fence now gets 503.** I traced every fence source and each one still reaches `errors.Is` unwrapped or wrapped with `%w`: - `replicaIdentity` (identity mismatch or retired record) - the fleet-box check in `SetRecordCoordinator` - `CheckAuthority` - all ErrFenced and ErrInvalid returns in `SetRecordReplicaRelease` - `replicaFieldsFixed`, reached through `WriteRecord` `release.WithAppMutation` returns `f`'s error unchanged. - **What now gets 503:** a CAS conflict that loses twice, ErrRecordMigrating once its wait runs out, store Get/Put errors, decode errors, ErrMaintenanceProjection and ErrSeedProtected. The first three are genuinely transient. The last few are invariant failures where a retry is harmless, because a 503 never extends authority. It ends at the existing deadline, as the witness shows. - **Release write path:** a 503 comes back as an error, so a box cannot treat an unconfirmed release as committed. If a `Put` timed out but actually landed, a retry of the same begin or released change is absorbed by the existing `errRecordUnchanged` checks. A `releasing` replay still ends in 409 (wrong revision), exactly as it did before this diff. **Out of scope (minor)** 1. In `handleReplicaCoordinator`, the inner `var held` plus `errors.As(err, &amp;held)` (lines 94-95) can never match, because held errors already returned at line 83. It is harmless but redundant. 2. The new 409/503 mapping is copied into both handlers. A small shared helper would stop the two drifting apart. 3. This is older behaviour, not new: on the coordinator path the host still maps a 409 for ErrInvalid to ErrFenced. That is still a definitive answer, as before. 4. If the store is corrupt in a way that never recovers (ErrRecordSequence or a decode error), the box now retries a 503 forever instead of being fenced once. Safety is unaffected because authority still lapses at `SafeUntil`, but it is noisier. **Verdict:** I4 is ADDRESSED. The diff introduces no new Critical or Important problems.</result> <usage><subagent_tokens>55117</subagent_tokens><tool_uses>10</tool_uses><duration_ms>76627</duration_ms></usage> </task-notification>

Attributed to this commit: 9.86 g CO₂e (1,183,558 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-1-runtime, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-proposal-stateless-replicas-1.md b/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
index f5b0899ac..304cea7ff 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, 8 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, 10 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
@@ -18,6 +18,7 @@ Ruling `census-ruling-stateless-replicas-1`. The independent reviewer approves o
| `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. |
+| `internal/activator/wakeidentity.go` `Service.routeCurrentUnderLease` | sites | -registry:Assigned ×3, -registry:Host ×7, -whole:Route ×2 | Delegate the existing placement and record recheck to currentWakeRoute without taking an additional lease or reading records twice. |
Envelopes re-pinned: `.`, `internal/activator`, `internal/host`, `internal/provision`, `internal/registry`, `internal/release`, `internal/replicas`, `internal/rollout`.
@@ -39,18 +40,21 @@ Recorded dispositions, which each change must still satisfy:
- `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.
- `internal/activator/rootfsrelease.go` `Service.runRelease`: legacy, task accepted-legacy. Basis: 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
+- `internal/activator/wakeidentity.go` `Service.routeCurrentUnderLease`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-managed-fleets-1b;basis=new (controller ruling after branch review R1, and Paul's R2 ruling): doWake's one decision under the lease of whether rt is still this box's route and current: the box registry's row (a.Routes.Get) checked by leaseRouteChanged; then, only for a labelled row (rt.Assigned set), by the box's fleet state a.Fleet: not on a fleet, nothing more; on a fleet with a known label, one record read that must name the label at rt.Assigned (an unreadable record or a nil reader refuses, errRecordUnreadUnderLease); on a fleet with an invalid identity, or any other state, a refusal naming the identity error (errFleetIdentityUnknown). Answers an error or nil; writes nothing. Agent, not root; it only refuses.
New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
- new `internal/activator/replicaobservation.go:ObservedReplicaRelease`: reads +registry:Account, +registry:App, +registry:Host; written legacy, accepted-legacy, frozen
- new `internal/activator/rootfsrelease.go:Service.runReleaseAdmitted`: reads +registry:Host, +whole:Route ×11; written legacy, accepted-legacy, frozen
+- new `internal/activator/stateless.go:Service.statelessCurrent`: reads +registry:Args ×2, +registry:Caps ×2, +registry:Channel ×3, +registry:CreatedAt ×2, +registry:Environment ×3, +registry:Region, +registry:Runtime, +registry:Stateless ×2, +whole:Route ×5; 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/activator/wakeidentity.go:Service.currentWakeRoute`: reads +registry:Assigned ×3, +registry:Host ×7, +whole:Route ×9; 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` → `f44796e96185a89da6adcbe2c16f6f16cc6df4ee4af18f359a991ead9ce8f63f`.
+Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `c1efbe01ae8f7e7b51e0f4207873c14163adecfe67462ed6dafd0f4060e523b6`.
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/stateless.go b/internal/activator/stateless.go
new file mode 100644
index 000000000..cd1e01795
--- /dev/null
+++ b/internal/activator/stateless.go
@@ -0,0 +1,54 @@
+package activator
+
+import (
+ "context"
+
+ "github.com/carlosframework/platform/internal/registry"
+)
+
+// statelessArgv keeps the binary socket contract without naming a database.
+// The caller must have verified the selected build's storage declaration.
+func (b *ExecBackend) statelessArgv(rt registry.Route, exe, sock string) []string {
+ return []string{exe, "--socket", sock}
+}
+
+// statelessCurrent is the final pre-spawn placement and launch-input check.
+// The observation is attempt-local evidence from release preparation; it is
+// never a cached permission to serve another lifetime of the same hostname.
+func (a *Service) statelessCurrent(ctx context.Context, rt registry.Route) error {
+ if err := ctx.Err(); err != nil {
+ return err
+ }
+ if a.Routes == nil {
+ return ErrFenced
+ }
+ now, rec, err := a.currentWakeRoute(ctx, rt, rt.IsSidecar())
+ if err != nil {
+ return err
+ }
+ if rootfsGateKey(rt) != rootfsGateKey(*now) || rt.Channel != now.Channel || rt.Environment != now.Environment || rt.Caps != now.Caps || rt.Args != now.Args || rt.CreatedAt != now.CreatedAt || rt.Stateless != now.Stateless {
+ return ErrFenced
+ }
+ identity, _, _, err := ObservedReplicaRelease(ctx, rt)
+ if err != nil {
+ return err
+ }
+ var facts RecordFacts
+ if rec != nil {
+ if rec.Channel != rt.Channel || rec.Environment != rt.Environment || rec.Runtime != rt.Runtime || rec.Region != rt.Region {
+ return ErrFenced
+ }
+ facts, err = RecordFactsOf(*rec)
+ } else if a.cfg.Record != nil {
+ facts, err = a.cfg.Record(ctx, rt)
+ } else {
+ return ErrFenced
+ }
+ if err != nil {
+ return err
+ }
+ if facts.Identity != identity || facts.ID != identity.Incarnation {
+ return ErrFenced
+ }
+ return ctx.Err()
+}
diff --git a/internal/activator/stateless_test.go b/internal/activator/stateless_test.go
new file mode 100644
index 000000000..9ff856e7f
--- /dev/null
+++ b/internal/activator/stateless_test.go
@@ -0,0 +1,107 @@
+package activator
+
+import (
+ "context"
+ "errors"
+ "slices"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/replicas"
+)
+
+func TestStatelessBinaryArguments(t *testing.T) {
+ b := &ExecBackend{}
+ rt := testRoute("shop.example.com")
+ rt.DBPath = "/data/old.db"
+ if got, want := b.statelessArgv(rt, "/opt/shop", "/run/shop.sock"), []string{"/opt/shop", "--socket", "/run/shop.sock"}; !slices.Equal(got, want) {
+ t.Fatalf("argv = %q, want %q", got, want)
+ }
+}
+
+func TestStatelessCurrentRechecksLaunchInputs(t *testing.T) {
+ began := testRoute("shop.example.com")
+ began.Account, began.App, began.Assigned = "bab", "shop", "assignment"
+ began.CreatedAt = 1
+ rec := provision.Record{Account: began.Account, App: began.App, Host: began.Host, CreatedAt: time.Unix(1, 0), FleetBox: "box-a", FleetBoxAt: began.Assigned}
+ facts, err := RecordFactsOf(rec)
+ if err != nil {
+ t.Fatal(err)
+ }
+ ctx := WithReplicaReleaseObservation(context.Background(), facts, replicas.Build{Version: "v1", Digest: "canonical"}, true)
+ for _, tc := range []struct {
+ name string
+ edit func(*registry.Route, *provision.Record)
+ }{
+ {"unchanged", func(*registry.Route, *provision.Record) {}},
+ {"assignment", func(r *registry.Route, _ *provision.Record) { r.Assigned = "new" }},
+ {"record moved", func(_ *registry.Route, r *provision.Record) { r.FleetBox = "box-b" }},
+ {"lifetime", func(_ *registry.Route, r *provision.Record) { r.CreatedAt = r.CreatedAt.Add(time.Second) }},
+ {"record channel", func(_ *registry.Route, r *provision.Record) { r.Channel = "edge" }},
+ {"record environment", func(_ *registry.Route, r *provision.Record) { r.Environment = "preview" }},
+ {"record runtime", func(_ *registry.Route, r *provision.Record) { r.Runtime = registry.RuntimeRootfsV1 }},
+ {"channel", func(r *registry.Route, _ *provision.Record) { r.Channel = "edge" }},
+ {"environment", func(r *registry.Route, _ *provision.Record) { r.Environment = "preview" }},
+ {"socket", func(r *registry.Route, _ *provision.Record) { r.Socket += ".new" }},
+ {"database path", func(r *registry.Route, _ *provision.Record) { r.DBPath += ".new" }},
+ {"route recreated", func(r *registry.Route, _ *provision.Record) { r.CreatedAt++ }},
+ {"mode projection", func(r *registry.Route, _ *provision.Record) { r.Stateless = !r.Stateless }},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ now, current := began, rec
+ tc.edit(&now, &current)
+ a := &Service{Routes: startupRoutes{now.Host: now}, Fleet: FleetWake{Mode: FleetWakeCheck, Label: "box-a", Record: func(context.Context, registry.Route) (*provision.Record, error) { return &current, nil }}}
+ err := a.statelessCurrent(ctx, began)
+ if (err == nil) != (tc.name == "unchanged") {
+ t.Fatalf("current check = %v", err)
+ }
+ })
+ }
+ a := &Service{Routes: startupRoutes{began.Host: began}}
+ canceled, cancel := context.WithCancel(ctx)
+ cancel()
+ if err := a.statelessCurrent(canceled, began); !errors.Is(err, context.Canceled) {
+ t.Fatalf("canceled check = %v", err)
+ }
+}
+
+func TestStatelessCurrentRequiresFreshEvidence(t *testing.T) {
+ rt := testRoute("shop.example.com")
+ rt.Account, rt.App = "bab", "shop"
+ facts, err := RecordFactsOf(provision.Record{Account: rt.Account, App: rt.App, Host: rt.Host, CreatedAt: time.Unix(1, 0)})
+ if err != nil {
+ t.Fatal(err)
+ }
+ ctx := WithReplicaReleaseObservation(context.Background(), facts, replicas.Build{Version: "v1", Digest: "canonical"}, true)
+ a := &Service{Routes: startupRoutes{rt.Host: rt}}
+ reads := 0
+ a.cfg.Record = func(context.Context, registry.Route) (RecordFacts, error) { reads++; return facts, nil }
+ if err := a.statelessCurrent(ctx, rt); err != nil {
+ t.Fatal(err)
+ }
+ if reads != 1 {
+ t.Fatalf("record reads = %d", reads)
+ }
+ if err := a.statelessCurrent(context.Background(), rt); err == nil {
+ t.Fatal("missing observation accepted")
+ }
+ if reads != 1 {
+ t.Fatal("missing observation performed a record read")
+ }
+ a.cfg.Record = func(context.Context, registry.Route) (RecordFacts, error) {
+ return RecordFacts{}, errors.New("unreadable")
+ }
+ if err := a.statelessCurrent(ctx, rt); err == nil {
+ t.Fatal("unreadable record accepted")
+ }
+ a.cfg.Record = nil
+ if err := a.statelessCurrent(ctx, rt); err == nil {
+ t.Fatal("absent record source accepted")
+ }
+ a.Routes = nil
+ if err := a.statelessCurrent(ctx, rt); err == nil {
+ t.Fatal("absent registry accepted")
+ }
+}
diff --git a/internal/activator/wakeidentity.go b/internal/activator/wakeidentity.go
index 93779d155..a6d71908c 100644
--- a/internal/activator/wakeidentity.go
+++ b/internal/activator/wakeidentity.go
@@ -192,41 +192,54 @@ func FleetWakeIdentityUnknown(fleet string, err error) FleetWake {
// nil means the wake goes on; the start rule then decides which copy may
// start.
func (a *Service) routeCurrentUnderLease(ctx context.Context, rt registry.Route, worker bool) error {
+ _, _, err := a.currentWakeRoute(ctx, rt, worker)
+ return err
+}
+
+// currentWakeRoute rechecks placement using the existing registry and record
+// reads. It neither acquires nor relies on a serving lease. The caller decides
+// whether additional attempt-local launch evidence must still match.
+func (a *Service) currentWakeRoute(ctx context.Context, rt registry.Route, worker bool) (*registry.Route, *provision.Record, error) {
+ current := rt
if a.Routes != nil {
now, err := a.Routes.Get(rt.Host)
if err != nil {
- return fmt.Errorf("%s: route lookup under the lease: %w", rt.Host, err)
+ return nil, nil, fmt.Errorf("%s: route lookup under the lease: %w", rt.Host, err)
}
if err := leaseRouteChanged(rt, now, worker); err != nil {
- return err
+ return nil, nil, err
}
+ current = *now
}
if rt.Assigned == "" {
- return nil
+ return &current, nil, nil
}
f := a.Fleet
switch f.Mode {
case FleetWakeNone:
- return nil
+ return &current, nil, nil
case FleetWakeCheck:
case FleetWakeUnknown:
- return fmt.Errorf("%s: refusing to wake: %w (fleet %q: %v). fix the box's fleet identity (CARLOS_FLEET_BOX, or CARLOS_TUNNEL_NAME=<fleet>/<label>) and restart the agent",
+ return nil, nil, fmt.Errorf("%s: refusing to wake: %w (fleet %q: %v). fix the box's fleet identity (CARLOS_FLEET_BOX, or CARLOS_TUNNEL_NAME=<fleet>/<label>) and restart the agent",
rt.Host, errFleetIdentityUnknown, f.Fleet, f.Err)
default:
- return fmt.Errorf("%s: refusing to wake: %w (unknown fleet state %d)", rt.Host, errFleetIdentityUnknown, f.Mode)
+ return nil, nil, fmt.Errorf("%s: refusing to wake: %w (unknown fleet state %d)", rt.Host, errFleetIdentityUnknown, f.Mode)
}
if f.Record == nil {
- return fmt.Errorf("%s: refusing to wake: %w: %v", rt.Host, errRecordUnreadUnderLease, errNoRecordStore)
+ return nil, nil, fmt.Errorf("%s: refusing to wake: %w: %v", rt.Host, errRecordUnreadUnderLease, errNoRecordStore)
}
rec, err := f.Record(ctx, rt)
if err != nil {
- return fmt.Errorf("%s: refusing to wake: %w: %v", rt.Host, errRecordUnreadUnderLease, err)
+ return nil, nil, fmt.Errorf("%s: refusing to wake: %w: %v", rt.Host, errRecordUnreadUnderLease, err)
+ }
+ if rec == nil {
+ return nil, nil, errRecordUnreadUnderLease
}
if rec.FleetBox != f.Label || rec.FleetBoxAt != rt.Assigned {
- return fmt.Errorf("%s: refusing to wake: %w: its record names box %q assigned %q, not this box %q at %q",
+ return nil, nil, fmt.Errorf("%s: refusing to wake: %w: its record names box %q assigned %q, not this box %q at %q",
rt.Host, errRouteChangedUnderLease, rec.FleetBox, rec.FleetBoxAt, f.Label, rt.Assigned)
}
- return nil
+ return &current, rec, nil
}
// errNoRecordStore is FleetRecordFrom's answer when the box has no
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 2466062be..0f67ca1ae 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 f44796e96185a89da6adcbe2c16f6f16cc6df4ee4af18f359a991ead9ce8f63f
+plan14-root-reads-stateless-replicas-1.tsv c1efbe01ae8f7e7b51e0f4207873c14163adecfe67462ed6dafd0f4060e523b6
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 bae36b3a2..cfb12545e 100644
--- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
+++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
@@ -1,6 +1,6 @@
# 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.
-# 13 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.
+# 13 body, 2 sites, 8 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 10 new dispositions: 3 reads re-frozen at their disposition with the claim, 6 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
@@ -11,11 +11,14 @@
@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 368e8bb30a0bc79384fb14e9bb2ec218e3493cf71f15525cdbb7621ef46f210d internal/activator/stateless.go Service.statelessCurrent legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Recheck current registry launch inputs and fresh record lifetime against the attempt observation without a serving lease; refuse changed configuration or missing evidence. No writes; runtime caller remains to be wired. registry:Args@410,registry:Args@421,registry:Caps@387,registry:Caps@398,registry:Channel@321,registry:Channel@335,registry:Channel@669,registry:CreatedAt@433,registry:CreatedAt@449,registry:Environment@350,registry:Environment@368,registry:Environment@702,registry:Region@763,registry:Runtime@735,registry:Stateless@466,registry:Stateless@482,whole:Route@220,whole:Route@291,whole:Route@313,whole:Route@572,whole:Route@900 f6d17c42a986d2c0b8acbe0b05c2393299bf59da265b69677312ceaa0a0d94d9
@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 6ae2d9cc990121ca06283879f13bee622ce375cd7b6b4f1cb9157b038508205c internal/activator/wakeidentity.go Service.currentWakeRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Extract existing registry and labelled fleet record recheck for reuse without a serving lease; return the observed row and record and refuse a nil record. No writer or new path. registry:Assigned@1387,registry:Assigned@1597,registry:Assigned@427,registry:Host@1062,registry:Host@1229,registry:Host@1522,registry:Host@198,registry:Host@296,registry:Host@790,registry:Host@933,whole:Route@1146,whole:Route@146,whole:Route@1622,whole:Route@344,whole:Route@348,whole:Route@405,whole:Route@416,whole:Route@457,whole:Route@540 91b83049c05e172b4a5fa230b1e012bfb27edd9ae330d82edd85cc29bc0d957c
@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
+@legacy 3972219697bf5739181e3034070e7efe738c5ab13783e05ded64d2466bfc9004 internal/activator/wakeidentity.go Service.routeCurrentUnderLease legacy accepted-legacy accepted-legacy;rev3=census-ruling-managed-fleets-1b;basis=new (controller ruling after branch review R1, and Paul's R2 ruling): doWake's one decision under the lease of whether rt is still this box's route and current: the box registry's row (a.Routes.Get) checked by leaseRouteChanged; then, only for a labelled row (rt.Assigned set), by the box's fleet state a.Fleet: not on a fleet, nothing more; on a fleet with a known label, one record read that must name the label at rt.Assigned (an unreadable record or a nil reader refuses, errRecordUnreadUnderLease); on a fleet with an invalid identity, or any other state, a refusal naming the identity error (errFleetIdentityUnknown). Answers an error or nil; writes nothing. Agent, not root; it only refuses.;rev3=census-ruling-stateless-replicas-1;basis=Delegate the existing placement and record recheck to currentWakeRoute without taking an additional lease or reading records twice. whole:Route@140 da5dcd2a9471444acad7d06a79926693d03188cad4188e7c82b11478cc551330
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
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
@@ -31,14 +34,17 @@ internal/rollout/failures.go OpenFailureBook authority E1,E3,J1,J4 fix1-merge-re
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
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
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/stateless.go Service.statelessCurrent legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Recheck current registry launch inputs and fresh record lifetime against the attempt observation without a serving lease; refuse changed configuration or missing evidence. No writes; runtime caller remains to be wired. registry:Args@410,registry:Args@421,registry:Caps@387,registry:Caps@398,registry:Channel@321,registry:Channel@335,registry:Channel@669,registry:CreatedAt@433,registry:CreatedAt@449,registry:Environment@350,registry:Environment@368,registry:Environment@702,registry:Region@763,registry:Runtime@735,registry:Stateless@466,registry:Stateless@482,whole:Route@220,whole:Route@291,whole:Route@313,whole:Route@572,whole:Route@900 f6d17c42a986d2c0b8acbe0b05c2393299bf59da265b69677312ceaa0a0d94d9
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/activator/wakeidentity.go Service.currentWakeRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Extract existing registry and labelled fleet record recheck for reuse without a serving lease; return the observed row and record and refuse a nil record. No writer or new path. registry:Assigned@1387,registry:Assigned@1597,registry:Assigned@427,registry:Host@1062,registry:Host@1229,registry:Host@1522,registry:Host@198,registry:Host@296,registry:Host@790,registry:Host@933,whole:Route@1146,whole:Route@146,whole:Route@1622,whole:Route@344,whole:Route@348,whole:Route@405,whole:Route@416,whole:Route@457,whole:Route@540 91b83049c05e172b4a5fa230b1e012bfb27edd9ae330d82edd85cc29bc0d957c
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
+internal/activator/wakeidentity.go Service.routeCurrentUnderLease legacy accepted-legacy accepted-legacy;rev3=census-ruling-managed-fleets-1b;basis=new (controller ruling after branch review R1, and Paul's R2 ruling): doWake's one decision under the lease of whether rt is still this box's route and current: the box registry's row (a.Routes.Get) checked by leaseRouteChanged; then, only for a labelled row (rt.Assigned set), by the box's fleet state a.Fleet: not on a fleet, nothing more; on a fleet with a known label, one record read that must name the label at rt.Assigned (an unreadable record or a nil reader refuses, errRecordUnreadUnderLease); on a fleet with an invalid identity, or any other state, a refusal naming the identity error (errFleetIdentityUnknown). Answers an error or nil; writes nothing. Agent, not root; it only refuses.;rev3=census-ruling-stateless-replicas-1;basis=Delegate the existing placement and record recheck to currentWakeRoute without taking an additional lease or reading records twice. whole:Route@140 da5dcd2a9471444acad7d06a79926693d03188cad4188e7c82b11478cc551330
@coverage . d8abf32baa39f05d1e9d4e9b8a24e7113c58f42f8735e7a62e217eb39e7a4bf7
-@coverage internal/activator 84de4ed8028b1677612190c2c795018905bbb0c9a683e0173ad6e5f09784e669
+@coverage internal/activator 952f262d9549a9f2600fa9e1c013569bfb21d2dddc70778a467ff62c706714df
@coverage internal/host 50d79612f83e07e6ef70e5c3e46146494b71d9e459104a66a5e884148ac5084b
@coverage internal/provision 065bba3c905bb30f6f7b44408b2ab013ed063c3ce49c6fc26ee0b153a454e9ca
@coverage internal/registry 181925b03831aec74b9629e863f090da5a478c01eb0bf2be4fa9a8e4f274e987