carlos / platform Public

fix: satisfy console claim and copy-flow gates for stateless runtime

Register both replica API routes as app mutation doors, with authenticated
foreign/open claim fixtures and record-effect witnesses. Use the context's
lifetime-judged reader in the trusted release adapter and refresh its
record-write census entry after reviewing the unchanged writer gates.

Assign LiveIdentity's cached digest after checking its error so the copy-flow
audit can trace the field. Preserve stateful rootfs overlap refusal ordering
when the registry row disappears, with coverage for stateless transitions.
Compare binding timestamps by instant and exercise a different timezone.

Refresh the existing stateless-replicas-1 census proposal for these changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev a26b34e7225049ab54f3caf51272f28b89e9421d parent 124376a
12 files changed, +186 −16
  • docs/superpowers/notes/census-proposal-stateless-replicas-1.md +2 −2
  • internal/activator/backend_exec.go +2 −1
  • internal/activator/stateless_test.go +37 −0
  • internal/activator/swap.go +7 −2
  • internal/console/claim_invariant_fixtures_test.go +2 −0
  • internal/console/claim_invariant_replicas_test.go +120 −0
  • internal/console/testdata/claim-routes.txt +2 −0
  • internal/host/replicacoordinator.go +1 −1
  • internal/provision/stateless_binding_test.go +2 −2
  • internal/provision/stateless_replicas_census_test.go +4 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv +6 −6

Intent

Human

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

Human

<task-notification> <task-id>abb7dfae41e1bbc34</task-id> <tool-use-id>toolu_01Rv8xAJFp5FTnvb9iyh6m85</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/abb7dfae41e1bbc34.output</output-file> <status>completed</status> <summary>Agent "Re-review Task 3a 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>**N1: ADDRESSED.** The three "the good build %s failed too" arms are back to the 65420a4d text, `%w` included, at wakeplan.go:481, :522 and :622. `fallbackWakeError` (wakeplan.go:961-967) is now used only by the three "not started" arms (:479, :520, :620). It keeps the primary failure wrapped, prints the fallback with `%v`, and wraps only a `*wakeModeChange`. An unproven good-build start with no process still reaches `genStartUnproven` and keeps the lease. The amended helper test (stateless_fix1_test.go:191) now includes `errGenUnproven`, the legacy-start error and `ReleaseError` among its not-started cases. The new witness (stateless_fix2_test.go:36-64) covers both the web and release fallback paths: lease kept, unproven obligation set, next wake refused. The census rows for the three functions no longer say "text-only". **N2: ADDRESSED.** `declarationRoute` is now built from the route and pin projection before anything clears `rt.Stateless` (activator.go:2652-2655). It is used for the replan check before the lease (:2696) and for the storage check after the lease (:2926). So a route or pin projected stateless whose manifest is missing or unreadable now refuses with SR-1-C07 under the lease. The unplanned path takes the alternative N2 allowed: the capture taken before the lease is the one that gets settled (:2898-2902), and `heldIdentityOK` still checks it. A route projected stateless reaches the stateful arm only through a readable stateful declaration with a digest, which is what R18 allows. **N3: ADDRESSED.** There is now one `LiveIdentity` capture (activator.go:2667-2676), reused at settle. `LiveIdentity` hashes with `FileSHA256Cached` (backend_exec.go:1977-1985), so the later `VerifyStaged` and storage checks reuse that digest. On stateful routes, a changed copy or a capture error before the lease no longer refuses as `errStorageDeclaration` (:2681-2686, :2894-2897). It now fails as `start &lt;host&gt;: %w` after Acquire and Restore, with the lease given back (:2920-2925). That matches the pre-Plan-1 outcome: nothing runs and nothing falls back. **New breakage:** none Critical or Important in this diff. - Stateful order still matches 65420a4d for the steps you named: Acquire, the route recheck under the lease, Restore, then settle, publication and the record write. - One identity hash per wake. The `%w` "failed too" arms are back, and `genUnproven` keeps the lease. - A verified stateless build returns into `doStatelessWake` before Acquire (:2717-2718). After the lease, a stateless result can only give the lease back with `wakeModeChange`. It never starts. - The 3b escrow files are untouched by this diff: escrow.go, escrow_authority.go, statelessrelease.go, fleetbind.go, ops/litestream.go and provision/reconcile.go. `doStatelessWake` and `prepareStateless` are unchanged too. - One focused run passed (activator, 4.3s): the five new or amended witnesses plus TestSwapWitnessUnprovenWakeKeepsTheLease. I used `$TMPDIR`, because `/tmp/g` is read-only in my sandbox. **Out of scope (minor):** 1. An unplanned, unheld stateful wake now reads the live link before the lease. 65420a4d read it after Restore. If the link is repointed during Acquire or Restore, the wake now runs and records the superseded build. That build stays pinned to its path. The drift sweep (`spawnVersion`) then cycles it, which costs one extra restart. The comment at step 2b ("select... under the lease, after Restore") and the claim wording "Acquire/Restore precede selection" are now only partly true. Publication still happens under the lease. 2. The cached digest in `LiveIdentity` also feeds `declinedLivePin`, the sidecar live start and `startRootfsFromLive`. In the rootfs case, the `VerifyStaged` that follows now compares cached against cached. Root's uncached exec validation remains. 3. If the live link exists but its target is missing, `ensureLiveLink` and Materialize can now run before the lease. 4. Pre-existing, not from this diff: on a rootfs route with no pre-lease identity, a build discovered stateless only under the lease has already run Restore, and possibly the first-boot placeholder and marker, before the `wakeModeChange` refusal. **Census:** approve all four. - `doWakeOnce`: approve. The stateful arm keeps the 65420a4d order for Acquire, the route recheck under the lease, Restore, the replan, settle and publication. Its claim discloses the reused capture before the lease. The only read added is the cached hash of the same path, and there is no new path or database authority. Minor point 1 above is a wording matter, not a reason to escalate. - `spawnPlanned`, `spawnPlannedRelease` and `spawnPlannedWorker`: approve. The "failed too" arms are identical to 65420a4d, and the "not started" arms differ only by the typed mode-change wrap. The corrected claims are accurate. - `ExecBackend.LiveIdentity`: approve. Same link chain, existing digest cache, and root's uncached check unchanged. **Verdict: all addressed.**</result> <usage><subagent_tokens>96053</subagent_tokens><tool_uses>26</tool_uses><duration_ms>283797</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 b1e606eae..9a63098b5 100644
--- a/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
+++ b/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
@@ -32,7 +32,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/activator.go` `Service.doWake` | sites | -registry:DBPath ×5, -registry:GoodVersion, -registry:Host ×8, -registry:Replication ×6, -registry:Seed, -registry:Socket ×4, -whole:Route ×59 | Task 3a: Keep the original entrypoint at its existing census path. Run doWakeOnce, and retry a selected fallback only after the failed generation is proven stopped, no release or stray obligation remains, and a stateful lease was returned. Carry the fallback canonical selection and original outcome metadata. |
-| `internal/activator/backend_exec.go` `ExecBackend.LiveIdentity` | sites | +registry:Host | Fix 3a round 2 N3: resolve the same live-link chain and hash the captured path with the existing agent digest cache; later VerifyStaged calls reuse that digest for an unchanged settled file. Existing settle window, file-identity invalidation and root uncached verification stay intact. Host is read again only to retain the hash error context. No new path or exec authority. |
+| `internal/activator/backend_exec.go` `ExecBackend.LiveIdentity` | sites | +registry:Host | Fix 3a round 2 N3: resolve the same live-link chain and hash the captured path with the existing agent digest cache; later VerifyStaged calls reuse that digest for an unchanged settled file. Existing settle window, file-identity invalidation and root uncached verification stay intact. Host is read again only to retain the hash error context. No new path or exec authority. CI fix 1: assign the cached hash to a local, check its error, then set Digest. Same hash, error and returned identity; no new read. |
| `internal/activator/backend_exec.go` `ExecBackend.StartWorkerStaged` | sites | +whole:Route | Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. |
| `internal/activator/backend_exec.go` `ExecBackend.startSidecarChildFrom` | sites | +whole:Route | Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. |
| `internal/activator/backend_exec.go` `ExecBackend.startSidecarUnitFrom` | sites | +whole:Route | Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. |
@@ -161,6 +161,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/registry/runtime.go:Route.ActivatorOwned`: +registry:Stateless; keeps legacy, task accepted-legacy
- reads `internal/registry/runtime.go:Route.Resident`: +registry:Runtime, +registry:Stateless; keeps legacy, task accepted-legacy
-Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `140a17425883c01fc36856760246a528eaa3cdb7a9d58119c61c0ed7ea5befc7`.
+Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `49d8b26abf726f8ed349ff191452ab1e55490ab3b906797597145c6734c34db2`.
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/backend_exec.go b/internal/activator/backend_exec.go
index ddddf5433..19c8dfe4e 100644
--- a/internal/activator/backend_exec.go
+++ b/internal/activator/backend_exec.go
@@ -1978,10 +1978,11 @@ func (b *ExecBackend) LiveIdentity(ctx context.Context, rt registry.Route) (rele
if err != nil {
return release.StagedIdentity{}, fmt.Errorf("%s: %w", rt.Host, err)
}
- id.Digest, err = release.FileSHA256Cached(id.StagedPath)
+ digest, err := release.FileSHA256Cached(id.StagedPath)
if err != nil {
return release.StagedIdentity{}, fmt.Errorf("%s: hash %s: %w", rt.Host, id.StagedPath, err)
}
+ id.Digest = digest
return id, nil
}
diff --git a/internal/activator/stateless_test.go b/internal/activator/stateless_test.go
index df9bc28b2..a921f3bc1 100644
--- a/internal/activator/stateless_test.go
+++ b/internal/activator/stateless_test.go
@@ -636,3 +636,40 @@ func TestStatelessWakeUsesSelectionCarrier(t *testing.T) {
t.Fatal(err)
}
}
+
+func TestStatelessSwapMissingRowKeepsRefusalOrder(t *testing.T) {
+ for _, tc := range []struct {
+ name string
+ oldMode, targetMode, disabled bool
+ want error
+ }{
+ {"stateful", false, false, false, errReleaseRowChanged},
+ {"stateful disabled", false, false, true, errReleaseTurnedOff},
+ {"stateless", true, true, false, ErrFenced},
+ {"to stateless", false, true, false, ErrFenced},
+ {"from stateless", true, false, false, ErrFenced},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ f := newRelSwapFixture(t, true)
+ f.committedRow(t)
+ if err := f.reg.Delete(f.host); err != nil {
+ t.Fatal(err)
+ }
+ f.a.mu.Lock()
+ f.a.entries[f.host].gen.Stateless = tc.oldMode
+ f.a.mu.Unlock()
+ f.a.StorageDeclaration = func(context.Context, registry.Route, release.StagedIdentity) (bool, string, error) {
+ return tc.targetMode, "canonical", nil
+ }
+ f.a.SetDisabledFor(func(registry.Route) bool { return tc.disabled })
+ res := f.swapNoRelease(t, f.attempt(ModeOverlap))
+ if res.Outcome != SwapAbandoned || res.Executed || !strings.Contains(res.Reason, tc.want.Error()) {
+ t.Fatalf("Swap = %+v; want refusal %v before any execution", res, tc.want)
+ }
+ if n := f.rb.readCount(); n != 0 {
+ t.Fatalf("read processes %d times after the row disappeared", n)
+ }
+ f.nothingAdmitted(t, tc.name)
+ })
+ }
+}
diff --git a/internal/activator/swap.go b/internal/activator/swap.go
index 5b1c3e614..a331b27a6 100644
--- a/internal/activator/swap.go
+++ b/internal/activator/swap.go
@@ -336,15 +336,17 @@ func (a *Service) Swap(ctx context.Context, at Attempt, newest func(host string)
oldStateless = current.gen.Stateless
}
a.mu.Unlock()
+ rowMissing := false
if a.Routes != nil && current != nil {
fresh, err := a.Routes.Get(at.Host)
if err != nil {
return abandon(err)
}
if fresh == nil {
- return abandon(ErrFenced)
+ rowMissing = true
+ } else {
+ route = *fresh
}
- route = *fresh
}
id := release.StagedIdentity{Version: at.Build, StagedPath: at.StagedPath, Digest: at.Digest, Demand: at.Demand}
if at.Declaration != nil {
@@ -354,6 +356,9 @@ func (a *Service) Swap(ctx context.Context, at Attempt, newest func(host string)
if modeErr != nil {
return abandon(modeErr)
}
+ if rowMissing && (mode || oldStateless || !route.Rootfs() || at.Mode != ModeOverlap || a.foreignRow(at.Host)) {
+ return abandon(ErrFenced)
+ }
ctx = withStorageMode(ctx, route, id, mode, digest)
if mode {
prepared, err := a.prepareStateless(ctx, route, id, digest)
diff --git a/internal/console/claim_invariant_fixtures_test.go b/internal/console/claim_invariant_fixtures_test.go
index eecb2fdd9..be2daa3d9 100644
--- a/internal/console/claim_invariant_fixtures_test.go
+++ b/internal/console/claim_invariant_fixtures_test.go
@@ -730,6 +730,8 @@ func (cx *claimCase) crashedRestore(t *testing.T) {
// ---- the table ----------------------------------------------------------------
var claimFixtures = map[string]claimFixture{
+ "route POST /api/fleet/replicas/{account}/{app}/{host}/coordinator": {door: claimReplicaDoor("coordinator")},
+ "route POST /api/fleet/replicas/{account}/{app}/{host}/release": {door: claimReplicaDoor("release")},
"route GET /accounts": claimRead("renders only the signed-in person’s account memberships"),
// ---- methodless routes (the handler checks r.Method itself) ----
"route /api/economics/backhaul": claimRead("operator backhaul report (GET only) computed from the economics view; writes nothing"),
diff --git a/internal/console/claim_invariant_replicas_test.go b/internal/console/claim_invariant_replicas_test.go
new file mode 100644
index 000000000..686037490
--- /dev/null
+++ b/internal/console/claim_invariant_replicas_test.go
@@ -0,0 +1,120 @@
+package console
+
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/hostclaim"
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/replicas"
+)
+
+func claimReplicaDoor(operation string) *claimDoor {
+ const host = "shop.example.com"
+ return &claimDoor{
+ apps: claimRefs("bab/titogo"),
+ setup: func(t *testing.T, cx *claimCase) {
+ cx.fleet(t)
+ token, hash, err := mintFleetToken()
+ if err != nil {
+ t.Fatal(err)
+ }
+ reg, err := openRegistry(cx.srv.cfg.Registry)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := reg.AddFleetBox(registry.FleetBox{Fleet: "pi", Label: "pi-1", TokenHash: hash}); err != nil {
+ t.Fatal(err)
+ }
+ rec := provision.Record{Schema: 1, Account: "bab", App: "titogo", Host: host, Slug: "shop", Region: "fleet/pi", FleetBox: "pi-1", Channel: "stable", CreatedAt: time.Now().UTC()}
+ if err := provision.CreateRecord(context.Background(), cx.rel, rec); err != nil {
+ t.Fatal(err)
+ }
+ inc, err := provision.Incarnation(rec.Account, rec.App, rec.Host, rec.CreatedAt)
+ if err != nil {
+ t.Fatal(err)
+ }
+ claim := hostclaim.Claim{V: 2, Host: host, Gen: 1, Holder: &hostclaim.Holder{
+ Family: "instance", Key: provision.RecordKey(rec.Account, rec.App, host),
+ Account: rec.Account, App: rec.App, CreatedAt: rec.CreatedAt,
+ Incarnation: inc, Location: "instances/" + host,
+ }, Op: hostclaim.Op{Kind: hostclaim.KindServing}}
+ body, err := json.Marshal(claim)
+ if err != nil {
+ t.Fatal(err)
+ }
+ key, err := hostclaim.Key(host)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err := cx.rel.Put(context.Background(), key, body, ""); err != nil {
+ t.Fatal(err)
+ }
+ cx.vars["replica-token"], cx.vars["replica-incarnation"] = token, inc
+ if operation == "release" {
+ code, _, body := claimReplicaRequest(t, cx, "coordinator")
+ if code != http.StatusOK {
+ t.Fatalf("stage coordinator: %d %s", code, body)
+ }
+ var reply replicas.CoordinatorReply
+ if err := json.Unmarshal([]byte(body), &reply); err != nil {
+ t.Fatal(err)
+ }
+ cx.vars["replica-term"] = reply.Lease.Term
+ }
+ },
+ do: func(t *testing.T, cx *claimCase) int {
+ code, _, _ := claimReplicaRequest(t, cx, operation)
+ return code
+ },
+ check: func(t *testing.T, cx *claimCase, open bool) string {
+ rec, err := provision.GetRecord(context.Background(), cx.rel, "bab", "titogo", host)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if operation == "coordinator" {
+ if (rec.Coordinator != nil) != open {
+ return "coordinator mutation did not match the app's admission"
+ }
+ if open && (rec.Coordinator.Box != "pi-1" || rec.Coordinator.BootID != "fixture-boot") {
+ return "coordinator did not retain the authenticated box and boot"
+ }
+ } else {
+ if (rec.ReplicaDeploy != nil) != open {
+ return "release mutation did not match the app's admission"
+ }
+ if open && (rec.ReplicaDeploy.ID != "deploy-1" || rec.ReplicaDeploy.Phase != "pending" || rec.ReplicaDeploy.Term != cx.vars["replica-term"]) {
+ return "release did not retain the deploy and coordinator term"
+ }
+ }
+ return ""
+ },
+ }
+}
+
+func claimReplicaRequest(t *testing.T, cx *claimCase, operation string) (int, http.Header, string) {
+ payload := map[string]any{"incarnation": cx.vars["replica-incarnation"], "op": "acquire", "boot_id": "fixture-boot"}
+ if operation == "release" {
+ payload = map[string]any{"incarnation": cx.vars["replica-incarnation"], "op": "begin", "id": "deploy-1", "term": cx.vars["replica-term"], "target": replicas.Build{Version: "v1", Digest: "digest"}}
+ }
+ body, err := json.Marshal(payload)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return rawReqHeader(t, http.MethodPost, cx.ts.URL+"/api/fleet/replicas/bab/titogo/shop.example.com/"+operation, cx.vars["replica-token"], string(body), map[string]string{"Carlos-Tunnel-Name": "pi/pi-1"})
+}
+
+func TestReplicaCoordinatorClaimMutations(t *testing.T) {
+ for _, operation := range []string{"coordinator", "release"} {
+ t.Run(operation, func(t *testing.T) {
+ problems, _ := runClaimDoor(t, claimReplicaDoor(operation))
+ for _, problem := range problems {
+ t.Error(problem)
+ }
+ })
+ }
+}
diff --git a/internal/console/testdata/claim-routes.txt b/internal/console/testdata/claim-routes.txt
index 8803e8889..3c2d54c66 100644
--- a/internal/console/testdata/claim-routes.txt
+++ b/internal/console/testdata/claim-routes.txt
@@ -324,6 +324,8 @@ route POST /api/cli/system/pointer-digests
route POST /api/cli/system/rollback
route POST /api/cli/system/seeds-floor
route POST /api/cli/system/update
+route POST /api/fleet/replicas/{account}/{app}/{host}/coordinator
+route POST /api/fleet/replicas/{account}/{app}/{host}/release
route POST /api/ses/events
route POST /auth/cli/accounts
route POST /auth/cli/approve
diff --git a/internal/host/replicacoordinator.go b/internal/host/replicacoordinator.go
index db4cfa136..5038aea5f 100644
--- a/internal/host/replicacoordinator.go
+++ b/internal/host/replicacoordinator.go
@@ -44,7 +44,7 @@ func (s *replicaCoordinatorStore) coordinator(ctx context.Context, id replicas.I
func (s *replicaCoordinatorStore) releaseState(ctx context.Context, id replicas.Identity, change replicas.ReleaseChange) (replicas.Deploy, error) {
var result replicas.Deploy
err := release.WithAppMutation(ctx, s.store, id.Account, id.App, "host.replicaRelease", func(ctx context.Context) error {
- current, err := provision.GetRecord(ctx, s.store, id.Account, id.App, id.Host)
+ current, _, err := provision.ReadRecordJudged(ctx, s.store, provision.JudgeFrom(ctx), id.Account, id.App, id.Host)
if err != nil {
return err
}
diff --git a/internal/provision/stateless_binding_test.go b/internal/provision/stateless_binding_test.go
index c51d6d428..0864d9800 100644
--- a/internal/provision/stateless_binding_test.go
+++ b/internal/provision/stateless_binding_test.go
@@ -15,7 +15,7 @@ func TestStatelessBindingUsesExistingReconcile(t *testing.T) {
if err := PutManifest(ctx, s, acct, "shop", Manifest{Schema: 1, App: "shop", Domain: "example.com", Pool: "shop"}); err != nil {
t.Fatal(err)
}
- rec := Record{Schema: 1, Host: "shop.example.com", Slug: "shop", App: "shop", Account: acct, Pool: "shop", Region: "ie", Channel: "stable", CreatedAt: time.Unix(1, 0)}
+ rec := Record{Schema: 1, Host: "shop.example.com", Slug: "shop", App: "shop", Account: acct, Pool: "shop", Region: "ie", Channel: "stable", CreatedAt: time.Unix(1, 0).In(time.FixedZone("fixture", 3600))}
if err := CreateRecord(ctx, s, rec); err != nil {
t.Fatal(err)
}
@@ -25,7 +25,7 @@ func TestStatelessBindingUsesExistingReconcile(t *testing.T) {
seen := 0
cfg.StatelessBinding = func(_ context.Context, r Record, rt registry.Route) error {
seen++
- if r.Host != rec.Host || r.CreatedAt != rec.CreatedAt || !rt.Stateless || rt.ServingVersion != "v1" {
+ if r.Host != rec.Host || !r.CreatedAt.Equal(rec.CreatedAt) || !rt.Stateless || rt.ServingVersion != "v1" {
t.Fatalf("wrong binding observation: %+v %+v", r, rt)
}
return nil
diff --git a/internal/provision/stateless_replicas_census_test.go b/internal/provision/stateless_replicas_census_test.go
index 4f65b7d16..f13fdc7b6 100644
--- a/internal/provision/stateless_replicas_census_test.go
+++ b/internal/provision/stateless_replicas_census_test.go
@@ -48,7 +48,10 @@ func statelessReplicasWriteCensusInventory() []censusEntry {
// Trusted client only: both calls retain lifetime-judged typed CAS.
// Fleet selection constructs only the HTTP adapter and cannot reach these.
{"internal/host/replicacoordinator.go", "replicaCoordinatorStore.coordinator", "record-writer", "key:SetRecordCoordinator", "1856926de34983178e3d2b79dd34b4e7fe9f5b0a77d9a766aa899d09532c9946"},
- {"internal/host/replicacoordinator.go", "replicaCoordinatorStore.releaseState", "record-writer", "key:SetRecordReplicaRelease", "6841e676c0e8ab24d026cc15e04394b9e3e0e4dc0fdfd578c83275a752779d18"},
+ // CI fix 1 self-review: use the context lifetime judge for the prior
+ // release observation. Nil judge keeps the old read; stale lifetimes
+ // refuse before the unchanged typed CAS, app admission and serial bump.
+ {"internal/host/replicacoordinator.go", "replicaCoordinatorStore.releaseState", "record-writer", "key:SetRecordReplicaRelease", "2d0e6c66799f42a108537b4cf0927b225ef5f9479fa5d27ed17874627fa3db02"},
// Registration adds only the two fleet routes; the existing literal-only
// instances/sidecars classification and all existing route handlers stay fixed.
{"internal/console/authcli.go", "Server.registerCLIRoutes", "key-site", "lit:instances,lit:sidecars", "89c700b1b939a8c8bbd478a548efeabfa4fc888f1509b7e3c76ad91472219a29"},
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 8e72be2dd..1c106a667 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 140a17425883c01fc36856760246a528eaa3cdb7a9d58119c61c0ed7ea5befc7
+plan14-root-reads-stateless-replicas-1.tsv 49d8b26abf726f8ed349ff191452ab1e55490ab3b906797597145c6734c34db2
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 c22b73d73..ce8aa902f 100644
--- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
+++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
@@ -45,7 +45,7 @@
@legacy e121c698e2eb8423a9f9bcb1d22bf2f83a6fd32a3c90da68905d0be861393002 internal/activator/stateless.go withDeclarations legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry verified storage or successful preparation facts only within one identity/account/app attempt. Pure context values, no store read, polling, authority acquisition or global cache. registry:Account@231,registry:App@243 63c2b119bdd8eb5b873366c3b969efac92f6e8bf4f0a8811592285b1911b61fd
@legacy 262c1e752d8ed1886dddb5457b835ea64a2a3d6ade6836be4593366dace8788b internal/activator/stateless.go withStorageMode legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry verified storage or successful preparation facts only within one identity/account/app attempt. Pure context values, no store read, polling, authority acquisition or global cache. registry:Account@208,registry:App@220 3a42c298bccefd5d1bf5e553db32e72e2fe117cc11554ace02c0d58920b50f58
@legacy d0144a62af1d234245f362382a1d66da7fb5f0c64b488cc512ae1d539225b7e0 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. Fix 3b round 1 I2 / R20: only the matching released branch calls the backend escrow initializer. Held authority is reused; absent trio can acquire through the existing coordinator adapter. No release rerun, deploy mutation, new record read or loop; existing final-exec checks from 3a remain unchanged. registry:Account@544,registry:App@574,registry:GoodDemand@3101,registry:GoodDigest@3086,registry:GoodVersion@3070,registry:Host@1300,registry:Host@224,registry:Host@3157,registry:Host@3215,registry:Host@3431,registry:Host@3499,registry:Host@601,whole:Route@1110,whole:Route@3224,whole:Route@3231,whole:Route@3783,whole:Route@483 cd038701b7b55e7c1ce5a52c8e5b16170db5a38b960dba35e46e1080474e50f8
-@legacy 71cd83557f6267ac468b6b4d6e8a98b65d68927101a5e3ee45e9d2c83b6f4d0a internal/activator/swap.go Service.Swap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Verify the target canonical mode and prepare its durable stateless release before stopping the incumbent. A mode change forces the existing proven hold path; same-mode stateless overlap uses local lifecycle gates and the final current-record check, without a serving lease. whole:Route@1042,whole:Route@1051,whole:Route@1232,whole:Route@1332,whole:Route@1421,whole:Route@1500,whole:Route@1745,whole:Route@785,whole:Route@801,whole:Route@992 04b35d9e1b21a082f01a3327c07ae483efc8a9ee04ef2512ff92c2730a63323c
+@legacy bfaaa8bb930f911e68b649e68d2ecea97b050781e3e5c4b4c0b655b85b231cfa internal/activator/swap.go Service.Swap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Verify the target canonical mode and prepare its durable stateless release before stopping the incumbent. A mode change forces the existing proven hold path; same-mode stateless overlap uses local lifecycle gates and the final current-record check, without a serving lease. CI fix 1: defer a missing registry row to the existing release checks only for stateful rootfs overlap, preserving disabled/newest checks and committedGood refusal. Stateless modes, transitions, binary/foreign/hold paths still fence before preparation. No new reads. whole:Route@1013,whole:Route@1063,whole:Route@1072,whole:Route@1257,whole:Route@1357,whole:Route@1590,whole:Route@1669,whole:Route@1914,whole:Route@785,whole:Route@801 0a160ddaf53d03e2673a5cb42fefc56754ec06f480c90806e8106cf2c347a426
@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 c97a6c678604ecf30de5c58dfb6f017999395a331afc6f85dd7a706aa8f71f1b internal/host/agent.go replicaRecordFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 1 I2: read existing in-memory reconcile snapshot for release preparation, require account/app/host match, derive RecordFacts. Missing snapshot refuses until reconciliation; fresh final record check still required. registry:App@283,registry:Host@208,whole:Route@265 d7e2210647a05add1e7cf815a0cb27100f4b879c5c8143eb60a196c8411204c6
@legacy 5ac6a0cde576df2085e0f23ebc876d9adc8fe592582d334ee58e38c59da704ad internal/host/agent.go storageDeclaration legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 1 I3b/R18: open deploy store lazily under mutex, retain only successful opens, retry transient open failure. Stateful missing evidence falls back; stateless projection refuses. Canonical selection verifies staged digest. registry:App@629,registry:Stateless@431,registry:Stateless@664,whole:Route@624 d63e67011a951f6f10cba11c2cfed0695bfddd1f94ca9cc43691337d8b0bf200
@@ -80,7 +80,7 @@
@legacy 3189111bdce9af1ad57a8f5dea9a4ff20f5bb42252044a939fd7e1a46b3d0833 internal/registry/runtime.go Route.ActivatorOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator manages this instance: it hibernates or has any runtime; reads Kind, Hibernate, Runtime;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Include projected stateless binary instances in local lifecycle/residency selection. Launch still requires the selected build canonical declaration; this flag never bypasses database preparation by itself. registry:Hibernate@72,registry:Kind@47,registry:Runtime@87,registry:Stateless@106 3dbd1801c0a3c370a249b9108c2f56c6ef716ad482207245cbf1130ad5351d2b
@legacy b3d06fb2ce57397f32f2166621eb167cb89294fa7a8ebc462727592bd4d43deb internal/registry/runtime.go Route.Resident legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: an always-on rootfs instance (an instance with runtime rootfs-v1 that does not hibernate); reads Kind, Runtime, Hibernate;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Include projected stateless binary instances in local lifecycle/residency selection. Launch still requires the selected build canonical declaration; this flag never bypasses database preparation by itself. registry:Hibernate@118,registry:Kind@41,registry:Runtime@81,registry:Stateless@100 4d9d7df1e8cb21f72ee403391e29bbd1839f29cc8d259557f2ff02dbe20faa8d
@legacy 8c4a6dafdd650b56d9c1430b0a004c865930e8c33e2f8ca96efc0cd2abca1d30 internal/activator/activator.go Service.doWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body (census ruling 292's legacy start mark and lease give-back; census ruling owed's pending record) with the seeded change ruled under census-ruling-seeded-instances (the refreshed row checked against the row the wake began from, twice; the seed's first upload recorded after the wake), and now one more line on a failed start: a start its pre-exec gate refused (launchNotStarted: the exec gate, the pending record or its recheck answered no before root was asked) is recorded as known not started (stopObservation.notStarted) instead of uncertain, only when the wake has started nothing else (wakeStartedNothing); otherwise it goes through cleanupFailedWake and its proofs. A refusal before its lease (step 1), which has started nothing, is recorded the same way. Read sites unchanged; no new read and no root decision;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=marks the end of each wake step on the woken instance's journal timer (wakeSteps: a.now() and a slice append, journal only); no read added, no step reordered;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: (1) after the restore it asks the backend for the replication class an HA restore imported from the host's published wake state (restoredReplication(rt)) and, if it differs, logs it and sets rt.Replication and the entry's route to it; (2) an HA lease of the stream class replicates with a 1 s monitor interval (SetMonitorInterval); (3) after Replicate, an HA replica opens the entry's files publisher (openEntryFiles(ctx, e, rt)) and starts it, and a publisher that will not open fails the wake through cleanupFailedWake; (4) every cleanupFailedWake call passes e; (5) final fix F1: the two start-error arms that gave the lease straight back (a start its pre-exec gate refused with nothing started, and the default arm) now call giveBackAfterStart(ctx, rt, w, lease), which gives a legacy lease back exactly as before and an HA one only over an empty host slice. New sites: registry:Replication x5 (the class compare, the log line, the assignment and the HA sync-interval check) and whole:Route x6 (rt handed to restoredReplication, openEntryFiles, the cleanup calls and giveBackAfterStart); no file read in this body; only adds a condition before an HA release, no check removed;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: the rootfs admission runs before the claim path and before Acquire on the refreshed row (rootfsWakeRefusal), again in full if a re-read under the lock changed any gate field, and a resident wake re-checks residentRunnable; for a rootfs row a held lease or refused config is an ownership refusal; a rootfs first boot (no good version, fresh) places the empty database under the lease (placeRootfsDB) and uploads it once (syncRootfsPlaceholder), while fresh with a good version is refused as a lost database; declared processes are logged after the wake (rootfsProcessesHook); binary rows unchanged; fix wave 1 and 2 (6189a9db, then the r2 ruling "refuse interrupted init"): a fresh rootfs first boot goes through rootfsFirstBoot (rootfsmarker.go) instead of placeRootfsDB alone: under the lease it reads the lifetime's first-boot marker from the hibernate bucket (present or unreadable refuses, present as errRootfsReplicaMissing), writes it create-only, reads it back (only a read back that finds it confirms it; a write conflict proves nothing), and only then places the database; a warm wake does nothing with the marker (fix wave 1's settleRootfsFirstBoot call and its whole:Route site are gone, no local pending record); adds refusals only, binary rows unchanged;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R3: (1) refuses (errWakeUnproven) while another entry's release record of the host is open; (2) a rootfs row with a plan or a pin reads its declared processes before the lease (declaredProcesses(rt, g): the existing staged-manifest read of ExecBackend.Processes, the manifest root's staging wrote, checked against the identity's path and digest) and refuses before Acquire on an error; (3) the staged-identity start runs releaseInWake(ctx, e, rt, id, lease) before startGenExe, under this wake's lease, and a release that did not pass fails the wake; (4) a rootfs row with no plan, no pin and no staged identity is refused, the lease given back, nothing started; (5) a start error whose release is not proven stopped hands the lease to the release record (oweWakeLeaseToRelease) instead of giving it back. New sites +whole:Route x2 (rt to declaredProcesses and releaseInWake); no new file read beyond the existing staged-manifest read; binary rows unchanged;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: step 7 no longer calls rootfsProcessesHook (log only); it calls declareRootfsWorkers(e, rt, w), which registers the workers the wake's generation declares as pending and starts nothing (the resident tick starts them once the entry is awake under its lease watch); a worker is never a failure of the wake; the read of the declaration is the existing staged-manifest read (see registerRootfsWorkers); the same read sites in this body, no new read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: a successful acquire drops the host's holder-cache entry; same reads;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1 and the controller ruling after it): after the lease, doWake asks routeCurrentUnderLease(ctx, rt, e.worker) (the +whole:Route site), which re-reads the host's row from the box's own registry and, for a labelled row on a fleet box, reads the instance record once; a row that is not this box's and current gives the lease back and refuses the wake, nothing restored or started. Its checks up to the spawn ask wakeGoesOn(e), which adds the entry's in-memory retired mark (set by RetireExcept) to the fence test. Task 6a's awake record call is removed. Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Keep the original entrypoint at its existing census path. Run doWakeOnce, and retry a selected fallback only after the failed generation is proven stopped, no release or stray obligation remains, and a stateful lease was returned. Carry the fallback canonical selection and original outcome metadata. whole:Route@423 942fe545a6b3bcd1f3dfc5469e8e6ef2850766046ab151f748075bfbc44feff2
-@legacy 33d11e53dbe99a54adf62993ac0bb436ea92a0d91ab0f924e25d97f2b81fb73b internal/activator/backend_exec.go ExecBackend.LiveIdentity legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 2 N3: resolve the same live-link chain and hash the captured path with the existing agent digest cache; later VerifyStaged calls reuse that digest for an unchanged settled file. Existing settle window, file-identity invalidation and root uncached verification stay intact. Host is read again only to retain the hash error context. No new path or exec authority. registry:Host@142,registry:Host@253,registry:Host@335,registry:Host@492 6fa387e677239e26bd87d9dadcc02f88688c634ba2f519b2873586e30d2220d7
+@legacy 24c6ae7466bfdf4b35732007e63f1e4ef2e81955c6fa73fce058db5c4ede8cc2 internal/activator/backend_exec.go ExecBackend.LiveIdentity legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 2 N3: resolve the same live-link chain and hash the captured path with the existing agent digest cache; later VerifyStaged calls reuse that digest for an unchanged settled file. Existing settle window, file-identity invalidation and root uncached verification stay intact. Host is read again only to retain the hash error context. No new path or exec authority. CI fix 1: assign the cached hash to a local, check its error, then set Digest. Same hash, error and returned identity; no new read. registry:Host@142,registry:Host@253,registry:Host@335,registry:Host@490 e52059b30d12e06b5985f051e5312fb256c023a7d92a1b16fe5f13ff4bb48d2f
@legacy fd9f21d35c7f8fa76f648360b176743426447653d151a412ab80f85545c8fa35 internal/activator/backend_exec.go ExecBackend.StartWorkerStaged legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. file:Command@3507,registry:Args@227,registry:Args@378,registry:Host@1388,registry:Host@2610,registry:Host@3646,registry:Host@369,registry:Host@4532,registry:Host@473,registry:Host@589,registry:Host@685,whole:Route@1148,whole:Route@1692,whole:Route@2238,whole:Route@3459,whole:Route@3577,whole:Route@3607,whole:Route@4373,whole:Route@4463 064ad933d522ffbbf1cb335abafc545af7f81ee7b30a905425de32ca9a882aa2
@legacy 551465e5e10d030700cca3722ba5b84b83a063e071cdbfe5645f983b73881d80 internal/activator/backend_exec.go ExecBackend.startSidecarChildFrom legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. file:Command@886,registry:Host@1348,registry:Host@1407,whole:Route@1166,whole:Route@150,whole:Route@480,whole:Route@840,whole:Route@955 e1841fe5edbc5e9e6f8f4a440a1ffe8d799cf97c4502f152ac23b97841fc95c2
@legacy 5bd5f1321c588fb971e1eab323c55c66cf644cb171a9331a562e8b9a933e3038 internal/activator/escrow.go ExecBackend.EscrowSweep legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, the agent as carlos (carlos-edge.service), no root caller, from escrowLoop: classifies each row against the rows handed in (Classify), keeps eligible rows known not HA from memory (haKnown, no read), and in host order from a round-robin cursor stats each escrowed file (stampAt) and publishes the changed ones, 8 at a time, at most 256 a sweep (sweepPublish); a box without a files store or key does nothing; opens nothing outside the rows' own data directories; writes only the hibernate bucket's files/0 prefix and the ledger Fix round 1: a host whose instance lease this box does not hold (holdsLease) is skipped, and one with a conflict marker counts as failing and is not published; the report is tallied through one lock (P1-4). Durability 3a Task 5: for each lease-held candidate, the host's held publisher (st.pub under the escrow lock) is handed to noteRawBaseline. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host sites are rt.Host as the state key and the detector's argument.;rev3=census-ruling-stateless-replicas-1;basis=Task 3b: use coordinator authority for stateless projections and the unchanged serving lease for stateful rows; followers are skipped without I/O; no new poll loop or file path. registry:Host@1009,registry:Host@1046,registry:Host@1136,registry:Host@1292,registry:Host@1311,registry:Host@1462,registry:Host@1995,registry:Host@2341,registry:Host@2598,registry:Host@2672,registry:Host@536,registry:Host@800,registry:Host@938,whole:Route@1193,whole:Route@1197,whole:Route@1214,whole:Route@1301,whole:Route@1320,whole:Route@1471,whole:Route@1789,whole:Route@1997,whole:Route@2227,whole:Route@2343,whole:Route@2600,whole:Route@2674,whole:Route@356,whole:Route@519,whole:Route@587,whole:Route@653,whole:Route@706,whole:Route@771 0e7b85ae702f5cf4ff2e961787d7d3a8170ca1b0fa06b0991d6dc1b54f17bfa1
@@ -143,7 +143,7 @@ internal/activator/stateless.go storageVars legacy accepted-legacy accepted-lega
internal/activator/stateless.go withDeclarations legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry verified storage or successful preparation facts only within one identity/account/app attempt. Pure context values, no store read, polling, authority acquisition or global cache. registry:Account@231,registry:App@243 63c2b119bdd8eb5b873366c3b969efac92f6e8bf4f0a8811592285b1911b61fd
internal/activator/stateless.go withStorageMode legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry verified storage or successful preparation facts only within one identity/account/app attempt. Pure context values, no store read, polling, authority acquisition or global cache. registry:Account@208,registry:App@220 3a42c298bccefd5d1bf5e553db32e72e2fe117cc11554ace02c0d58920b50f58
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. Fix 3b round 1 I2 / R20: only the matching released branch calls the backend escrow initializer. Held authority is reused; absent trio can acquire through the existing coordinator adapter. No release rerun, deploy mutation, new record read or loop; existing final-exec checks from 3a remain unchanged. registry:Account@544,registry:App@574,registry:GoodDemand@3101,registry:GoodDigest@3086,registry:GoodVersion@3070,registry:Host@1300,registry:Host@224,registry:Host@3157,registry:Host@3215,registry:Host@3431,registry:Host@3499,registry:Host@601,whole:Route@1110,whole:Route@3224,whole:Route@3231,whole:Route@3783,whole:Route@483 cd038701b7b55e7c1ce5a52c8e5b16170db5a38b960dba35e46e1080474e50f8
-internal/activator/swap.go Service.Swap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Verify the target canonical mode and prepare its durable stateless release before stopping the incumbent. A mode change forces the existing proven hold path; same-mode stateless overlap uses local lifecycle gates and the final current-record check, without a serving lease. whole:Route@1042,whole:Route@1051,whole:Route@1232,whole:Route@1332,whole:Route@1421,whole:Route@1500,whole:Route@1745,whole:Route@785,whole:Route@801,whole:Route@992 04b35d9e1b21a082f01a3327c07ae483efc8a9ee04ef2512ff92c2730a63323c
+internal/activator/swap.go Service.Swap legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Verify the target canonical mode and prepare its durable stateless release before stopping the incumbent. A mode change forces the existing proven hold path; same-mode stateless overlap uses local lifecycle gates and the final current-record check, without a serving lease. CI fix 1: defer a missing registry row to the existing release checks only for stateful rootfs overlap, preserving disabled/newest checks and committedGood refusal. Stateless modes, transitions, binary/foreign/hold paths still fence before preparation. No new reads. whole:Route@1013,whole:Route@1063,whole:Route@1072,whole:Route@1257,whole:Route@1357,whole:Route@1590,whole:Route@1669,whole:Route@1914,whole:Route@785,whole:Route@801 0a160ddaf53d03e2673a5cb42fefc56754ec06f480c90806e8106cf2c347a426
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/host/agent.go replicaRecordFacts legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 1 I2: read existing in-memory reconcile snapshot for release preparation, require account/app/host match, derive RecordFacts. Missing snapshot refuses until reconciliation; fresh final record check still required. registry:App@283,registry:Host@208,whole:Route@265 d7e2210647a05add1e7cf815a0cb27100f4b879c5c8143eb60a196c8411204c6
internal/host/agent.go storageDeclaration legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 1 I3b/R18: open deploy store lazily under mutex, retain only successful opens, retry transient open failure. Stateful missing evidence falls back; stateless projection refuses. Canonical selection verifies staged digest. registry:App@629,registry:Stateless@431,registry:Stateless@664,whole:Route@624 d63e67011a951f6f10cba11c2cfed0695bfddd1f94ca9cc43691337d8b0bf200
@@ -179,7 +179,7 @@ internal/registry/registry.go scanRoute legacy accepted-legacy accepted-legacy;r
internal/registry/runtime.go Route.ActivatorOwned legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator manages this instance: it hibernates or has any runtime; reads Kind, Hibernate, Runtime;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Include projected stateless binary instances in local lifecycle/residency selection. Launch still requires the selected build canonical declaration; this flag never bypasses database preparation by itself. registry:Hibernate@72,registry:Kind@47,registry:Runtime@87,registry:Stateless@106 3dbd1801c0a3c370a249b9108c2f56c6ef716ad482207245cbf1130ad5351d2b
internal/registry/runtime.go Route.Resident legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: an always-on rootfs instance (an instance with runtime rootfs-v1 that does not hibernate); reads Kind, Runtime, Hibernate;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Include projected stateless binary instances in local lifecycle/residency selection. Launch still requires the selected build canonical declaration; this flag never bypasses database preparation by itself. registry:Hibernate@118,registry:Kind@41,registry:Runtime@81,registry:Stateless@100 4d9d7df1e8cb21f72ee403391e29bbd1839f29cc8d259557f2ff02dbe20faa8d
internal/activator/activator.go Service.doWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-292fix;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body (census ruling 292's legacy start mark and lease give-back; census ruling owed's pending record) with the seeded change ruled under census-ruling-seeded-instances (the refreshed row checked against the row the wake began from, twice; the seed's first upload recorded after the wake), and now one more line on a failed start: a start its pre-exec gate refused (launchNotStarted: the exec gate, the pending record or its recheck answered no before root was asked) is recorded as known not started (stopObservation.notStarted) instead of uncertain, only when the wake has started nothing else (wakeStartedNothing); otherwise it goes through cleanupFailedWake and its proofs. A refusal before its lease (step 1), which has started nothing, is recorded the same way. Read sites unchanged; no new read and no root decision;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=marks the end of each wake step on the woken instance's journal timer (wakeSteps: a.now() and a slice append, journal only); no read added, no step reordered;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: (1) after the restore it asks the backend for the replication class an HA restore imported from the host's published wake state (restoredReplication(rt)) and, if it differs, logs it and sets rt.Replication and the entry's route to it; (2) an HA lease of the stream class replicates with a 1 s monitor interval (SetMonitorInterval); (3) after Replicate, an HA replica opens the entry's files publisher (openEntryFiles(ctx, e, rt)) and starts it, and a publisher that will not open fails the wake through cleanupFailedWake; (4) every cleanupFailedWake call passes e; (5) final fix F1: the two start-error arms that gave the lease straight back (a start its pre-exec gate refused with nothing started, and the default arm) now call giveBackAfterStart(ctx, rt, w, lease), which gives a legacy lease back exactly as before and an HA one only over an empty host slice. New sites: registry:Replication x5 (the class compare, the log line, the assignment and the HA sync-interval check) and whole:Route x6 (rt handed to restoredReplication, openEntryFiles, the cleanup calls and giveBackAfterStart); no file read in this body; only adds a condition before an HA release, no check removed;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: the rootfs admission runs before the claim path and before Acquire on the refreshed row (rootfsWakeRefusal), again in full if a re-read under the lock changed any gate field, and a resident wake re-checks residentRunnable; for a rootfs row a held lease or refused config is an ownership refusal; a rootfs first boot (no good version, fresh) places the empty database under the lease (placeRootfsDB) and uploads it once (syncRootfsPlaceholder), while fresh with a good version is refused as a lost database; declared processes are logged after the wake (rootfsProcessesHook); binary rows unchanged; fix wave 1 and 2 (6189a9db, then the r2 ruling "refuse interrupted init"): a fresh rootfs first boot goes through rootfsFirstBoot (rootfsmarker.go) instead of placeRootfsDB alone: under the lease it reads the lifetime's first-boot marker from the hibernate bucket (present or unreadable refuses, present as errRootfsReplicaMissing), writes it create-only, reads it back (only a read back that finds it confirms it; a write conflict proves nothing), and only then places the database; a warm wake does nothing with the marker (fix wave 1's settleRootfsFirstBoot call and its whole:Route site are gone, no local pending record); adds refusals only, binary rows unchanged;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R3: (1) refuses (errWakeUnproven) while another entry's release record of the host is open; (2) a rootfs row with a plan or a pin reads its declared processes before the lease (declaredProcesses(rt, g): the existing staged-manifest read of ExecBackend.Processes, the manifest root's staging wrote, checked against the identity's path and digest) and refuses before Acquire on an error; (3) the staged-identity start runs releaseInWake(ctx, e, rt, id, lease) before startGenExe, under this wake's lease, and a release that did not pass fails the wake; (4) a rootfs row with no plan, no pin and no staged identity is refused, the lease given back, nothing started; (5) a start error whose release is not proven stopped hands the lease to the release record (oweWakeLeaseToRelease) instead of giving it back. New sites +whole:Route x2 (rt to declaredProcesses and releaseInWake); no new file read beyond the existing staged-manifest read; binary rows unchanged;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: step 7 no longer calls rootfsProcessesHook (log only); it calls declareRootfsWorkers(e, rt, w), which registers the workers the wake's generation declares as pending and starts nothing (the resident tick starts them once the entry is awake under its lease watch); a worker is never a failure of the wake; the read of the declaration is the existing staged-manifest read (see registerRootfsWorkers); the same read sites in this body, no new read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: a successful acquire drops the host's holder-cache entry; same reads;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1 and the controller ruling after it): after the lease, doWake asks routeCurrentUnderLease(ctx, rt, e.worker) (the +whole:Route site), which re-reads the host's row from the box's own registry and, for a labelled row on a fleet box, reads the instance record once; a row that is not this box's and current gives the lease back and refuses the wake, nothing restored or started. Its checks up to the spawn ask wakeGoesOn(e), which adds the entry's in-memory retired mark (set by RetireExcept) to the fence test. Task 6a's awake record call is removed. Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Keep the original entrypoint at its existing census path. Run doWakeOnce, and retry a selected fallback only after the failed generation is proven stopped, no release or stray obligation remains, and a stateful lease was returned. Carry the fallback canonical selection and original outcome metadata. whole:Route@423 942fe545a6b3bcd1f3dfc5469e8e6ef2850766046ab151f748075bfbc44feff2
-internal/activator/backend_exec.go ExecBackend.LiveIdentity legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 2 N3: resolve the same live-link chain and hash the captured path with the existing agent digest cache; later VerifyStaged calls reuse that digest for an unchanged settled file. Existing settle window, file-identity invalidation and root uncached verification stay intact. Host is read again only to retain the hash error context. No new path or exec authority. registry:Host@142,registry:Host@253,registry:Host@335,registry:Host@492 6fa387e677239e26bd87d9dadcc02f88688c634ba2f519b2873586e30d2220d7
+internal/activator/backend_exec.go ExecBackend.LiveIdentity legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Fix 3a round 2 N3: resolve the same live-link chain and hash the captured path with the existing agent digest cache; later VerifyStaged calls reuse that digest for an unchanged settled file. Existing settle window, file-identity invalidation and root uncached verification stay intact. Host is read again only to retain the hash error context. No new path or exec authority. CI fix 1: assign the cached hash to a local, check its error, then set Digest. Same hash, error and returned identity; no new read. registry:Host@142,registry:Host@253,registry:Host@335,registry:Host@490 e52059b30d12e06b5985f051e5312fb256c023a7d92a1b16fe5f13ff4bb48d2f
internal/activator/backend_exec.go ExecBackend.StartWorkerStaged legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. file:Command@3507,registry:Args@227,registry:Args@378,registry:Host@1388,registry:Host@2610,registry:Host@3646,registry:Host@369,registry:Host@4532,registry:Host@473,registry:Host@589,registry:Host@685,whole:Route@1148,whole:Route@1692,whole:Route@2238,whole:Route@3459,whole:Route@3577,whole:Route@3607,whole:Route@4373,whole:Route@4463 064ad933d522ffbbf1cb335abafc545af7f81ee7b30a905425de32ca9a882aa2
internal/activator/backend_exec.go ExecBackend.startSidecarChildFrom legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. file:Command@886,registry:Host@1348,registry:Host@1407,whole:Route@1166,whole:Route@150,whole:Route@480,whole:Route@840,whole:Route@955 e1841fe5edbc5e9e6f8f4a440a1ffe8d799cf97c4502f152ac23b97841fc95c2
internal/activator/backend_exec.go ExecBackend.startSidecarUnitFrom authority E2 E40: claim-enabled raw backend refuses unsupported direct, placed and legacy-control launches before spawn. Claims-off body unchanged. TestPlan14GenerationBackendDirectBoundary, TestPlan14GenerationBackendControlBoundary, TestPlan14GenerationBackendAuxiliaryBoundary; each guard has an independent behavioral mutation. Agent-side refusal is not root reservation or containment evidence.;rev3=census-ruling-rootfs-apps-2;basis=newUnitProc now returns an error, which closes the log listener and fails the start; the sidecar launch and its E40 guards are unchanged; no read added;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only. registry:Host@1073,registry:Host@1557,registry:Host@1632,registry:Host@1778,registry:Host@1891,registry:Host@1946,registry:Host@992,whole:Route@1109,whole:Route@1512,whole:Route@1673,whole:Route@1985,whole:Route@247,whole:Route@752,whole:Route@838,whole:Route@896 aa47e7c46fddcc3932930c59958286da83cb8910781c9f2c3e1d28539be6c0df
@@ -196,8 +196,8 @@ internal/registry/remote_dispatch.go Registry.dispatchRemote hint E2 rev3=census
internal/rollout/manager.go Manager.resolve legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry demand, artifact identity, stateless verdict and canonical digest from one verified RuntimeSelection into the attempt; unreadable selection refuses. registry:App@147,registry:GoodDemand@751,registry:GoodDemand@797,registry:GoodDigest@671,registry:GoodDigest@736,registry:GoodVersion@653,registry:Host@400,whole:Route@1212,whole:Route@142,whole:Route@897 a57af8f772817ec1f664c5bc53fc853132936a67d1848bc27d9b9f75fad608ba
internal/rollout/wakeplan.go Manager.planRow legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry each selection read by the existing planner on its WakePlan so wake uses that same canonical verdict/digest, including selected fallbacks. registry:App@164,registry:Host@1062,registry:Version@1221,whole:Route@115,whole:Route@1217,whole:Route@1459,whole:Route@1545,whole:Route@159,whole:Route@234,whole:Route@241,whole:Route@584,whole:Route@804 66e00b7558526beba1dcc97859c002f9c0cf34f1231dd4f9b752f53adcbaa517
@coverage . d8abf32baa39f05d1e9d4e9b8a24e7113c58f42f8735e7a62e217eb39e7a4bf7
-@coverage internal/activator 7cfe4e5b813df08175581ec35097289895706e5e0c7d8c6d04b816c189dc74c5
-@coverage internal/host 54ad894277d9e072cb1188c4ec61069f3dce22ea95a5f436d848c8a6680722bf
+@coverage internal/activator bff59113dca053aab77aa67f0a8a3dcea840c39540d301e8bb2be9a43ad51755
+@coverage internal/host 785f628a5994901a1813c347b5265b86cd9bb99c0e113253b13805966cceae02
@coverage internal/ops 67289ea5b95d14e295bc19e855fab6b00ed240b822e75d4be42b9ded59662e4d
@coverage internal/provision 98d437ab5b9838a252b4e8b517926cac9a568571eae6dc817f94f7ed489e19db
@coverage internal/registry 19a5a1350bc29eb4445afdbfacfa727218b8f0af44762d29bb56a67b2fa14882