carlos / platform Public

fix: judge the stateless floor on platform channels, never block rollback

List and verify all router platform channel pointers once per mutation.
Memoize target manifests and admit unreadable targets under the R23
rollback contract; readable stateless targets still require the floor.

Make pre-wake mode projection symmetric, preserving serving and known-good
rows. Use serving evidence rather than the staged Version stamp, and
count actual request-triggered wakes in the residency witness.

Cover R22-R24 with regression and mutation tests, race checks, cross-builds
and refreshed census evidence. Independent census review remains pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 28cebb8164a9762ea52b57fe9a47512fd0246780 parent def6626
15 files changed, +222 −70
  • docs/superpowers/notes/census-proposal-stateless-replicas-1.md +4 −4
  • internal/activator/rootfs_wake_release_test.go +3 −0
  • internal/activator/stateless_resident_test.go +4 −1
  • internal/console/plancaps_doors_test.go +23 −27
  • internal/console/reqmemo.go +1 −1
  • internal/console/rootfs.go +29 −8
  • internal/console/stateless_floor_test.go +64 −7
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv +6 −6
  • internal/registry/forward_writers_test.go +1 −1
  • internal/registry/registry.go +6 −5
  • internal/registry/remote_dispatch.go +1 −1
  • internal/registry/stateless_test.go +32 −5
  • internal/release/adopt.go +3 −3
  • internal/release/stateless_adopt_test.go +44 −0

CI passed — run details

Intent

Human

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

Human

<task-notification> <task-id>a24d404135b941120</task-id> <tool-use-id>toolu_01FErXuXrU2SeZgQkJKTXGxu</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/a24d404135b941120.output</output-file> <status>completed</status> <summary>Agent "Review Task 4 (spec + quality)" 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>### Spec Compliance ❌ R21's floor is checked against the wrong platform pointer (Important 1). ⚠️ Stateful rollback is now refused when the target's manifest can't be read, which reverses a reviewed contract without a ruling (Important 2). ✅ Everything else in scope is met: - the four named tests, with the verbatim assertion contract; - R19 seeding from a freshly minted `RouteFor` row; - SR-1-C08 verbatim and in the built inventory; - hibernating rows are excluded from residency and never woken; - no root gate was removed. The dev-box step, the operator note and landing were not judged. The diff file is 387 KB; I read the production hunks and the tests named below in full and passed over the rest of the test and census churn. ### Strengths - The seed in `adoptHost` (`internal/release/adopt.go:1844`) reuses the verified staged manifest and runs inside `withReleaseWork`, before `PointLive`. `Registry.SeedStateless` compares the whole row in one transaction, flips only `stateless`, and is refused by the read-only remote gate (`remote.go:280`). - The wake mode still comes from the verified staged declaration (`storageMode`), not from the projection. A wrong projection therefore cannot skip the lease. - The binary resident restart reuses the existing exit, backoff and admission path in `rootfsTick`. The test covers the backoff, a sleeping hibernating sibling, zero acquires and zero requests. - The rollback and fast-track callbacks check the exact version inside the pointer conditional write. This closes the race between the preflight check and the write. All four console promote callers are gated. - The memo shares the platform-pointer read across the preflight and the guard. Stateful selections never read the platform pointer. ### Issues **Important** 1. **The floor reads the wrong pointer.** `internal/console/rootfs.go:39` calls `GetSystemPointer(..., "router", channel)` with the app's release channel (for example `canary/shop`). Boxes follow a separate platform channel: `CARLOS_SYSTEM_CHANNEL` per box, default `stable` (`internal/host/systemprobe.go`). Every other console floor reads platform channels from box metrics or from the router pointer list (`apiplacements.go:950`, `fleetfloor.go:180`). - Any app channel without a same-named platform pointer (`canary/shop`, `beta`, ...) is refused forever, because `ErrNotExist` refuses. - An app on `stable` is judged against the platform `stable` pointer even when its box follows `canary` and is older. - `stateless_floor_test.go:24-34` hides this by publishing a fake platform pointer named `canary/shop`. - This could also break the dev smoke unless the app happens to use a channel named like a platform channel. - R21's wording ("the platform channel pointer of the instance's channel") assumes a mapping the code doesn't have. The implementer followed the letter. - **Fix:** the controller re-rules. My suggestion is one complete view per mutation: list the router pointers as `fleetfloor.go` does and require every one to be at the floor (unreadable refuses), keeping the assigned-box check where the fleet view is already loaded. 2. **Stateful rollback is now gated.** `statelessVersionRefusal` (`rootfs.go:57`) reads the target manifest on every rollback, pending promote and pin change, even with plans off. An unreadable manifest gives 502 (`apicli.go:1303`, `server.go:5928`, `pendinghandlers.go:560`, `updatescore.go:167`). The renamed test `TestRollbackWithoutACatalogChecksStorageDeclaration` (`plancaps_doors_test.go:885`) reverses Astra plans-3b r3 f1 ("with plans off a rollback reads no manifest"). R21 asked for "stateful unaffected". Emergency rollback to a pruned manifest whose bytes are already on the box is now blocked. - **Fix:** when the manifest is unreadable, refuse only if the platform evidence is below the floor or unreadable, and admit otherwise. Or get an explicit controller ruling accepting the regression. **Minor** 3. `adopt.go:1844` seeds but never clears. If a stateful build is staged before the first wake, the row stays `Stateless=1`: one proactive stateful wake follows, and `storageMode` (`stateless.go:~95`) refuses that row instead of falling back to stateful while the declaration is unreadable. **Fix:** a symmetric unseed under the same never-served guard. 4. The API and browser rollback paths read the target manifest twice (preflight, then callback) and `checkDaemonVersion` may read it a third time. These are mutation-only reads, not per request, so they are acceptable but redundant. 5. `stateless_resident_test.go:91` hard-codes `requests := 0`. The contract is kept verbatim, but the count asserts nothing. A request counter on the rig would make it real. 6. The local operator path `cli.go:3004` (`PromoteOnLadder` with a key) bypasses the console floor. It is outside R21's console scope; noting it for the index. 7. The release-suite failure `TestPlan14GenerationPinsPrivateMount`: the diff touches only the rollback and fast-track signatures and the `adoptHost` seed, not the generation-pin or mount code. Nothing in this diff reaches it, and the implementer's base-overlay repro agrees, so it is pre-existing. ### Census - **`release.adoptHost` (seed): approve.** The input is the verified, signed staged manifest. The tenant controls `Stateless`, which is the intended declaration, and its only effect is residency under the existing admission gates. Hibernating rows are excluded, and no path is opened or followed. - **`Registry.SeedStateless` and `dispatchRemote`: approve.** Root's own registry row, a whole-row compare, and a single column write. The read-only remote server refuses the method. - **`Service.rootfsTick`, `statelessResident`, `residentShaped`: approve.** These check process exit and route fields only. `residentShaped` is equivalent to before. - **`claimRawRollbackAuthorized` / `claimRawFastTrack` (release envelope): approve.** The callbacks only refuse before the existing conditional write, and the signing and authorize hooks are unchanged. - **Question answered:** no new root read opens, runs, queries or follows a path or input that a tenant, app or box agent can create, write or name. ### Assessment **Task quality:** Needs fixes. **Reasoning:** The lifecycle and R19 work is sound and well witnessed. The R21 floor is judged against a platform pointer chosen by the app's channel name rather than the channel boxes actually follow, and it silently gates stateful rollback. Both need a controller ruling and a fix before the floor can be trusted.</result> <usage><subagent_tokens>108431</subagent_tokens><tool_uses>29</tool_uses><duration_ms>298661</duration_ms></usage> </task-notification>

Attributed to this commit: 33.9 g CO₂e (4,136,997 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 3cf3bff49..a3e126947 100644
--- a/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
+++ b/docs/superpowers/notes/census-proposal-stateless-replicas-1.md
@@ -46,7 +46,7 @@ Ruling `census-ruling-stateless-replicas-1`. The independent reviewer approves o
| `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/swap.go` `Service.spawnSuccessor` | sites | +whole:Route ×5 | Task 3a: Carry verified target mode on the actual generation and add the stateless current-record gate at the real launch boundary; preserve the existing lifecycle, publication and placement gates. Fix 3a round 1 I2: attach single final record check on stateless overlap spawn; repeated surrounding gates remain registry/observation-only, preserving local ownership checks. |
| `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. |
-| `internal/registry/remote_dispatch.go` `Registry.dispatchRemote` | sites | +registry:Host, +registry:Observed, +registry:On, +registry:Ver, +whole:Route | Task 3a: Add SetServingMode dispatch using the existing remote request Host, Ver and On fields; the same local narrow writer handles it. No new transport or root path. Task 4 R19: dispatch SeedStateless with the existing Observed Route carrier to its guarded local method. No new transport; the existing read-only service gate still refuses writes. |
+| `internal/registry/remote_dispatch.go` `Registry.dispatchRemote` | sites | +registry:Host, +registry:Observed, +registry:On ×2, +registry:Ver, +whole:Route | Task 3a: Add SetServingMode dispatch using the existing remote request Host, Ver and On fields; the same local narrow writer handles it. No new transport or root path. Task 4 R24: dispatch SeedStateless with the existing Observed Route and On carriers to its symmetric guarded local method. No new transport; the existing read-only service gate still refuses writes. |
| `internal/rollout/manager.go` `Manager.resolve` | sites | +whole:Route | Task 3a: Carry demand, artifact identity, stateless verdict and canonical digest from one verified RuntimeSelection into the attempt; unreadable selection refuses. |
| `internal/rollout/wakeplan.go` `Manager.planRow` | sites | +whole:Route | Task 3a: Carry each selection read by the existing planner on its WakePlan so wake uses that same canonical verdict/digest, including selected fallbacks. |
@@ -132,7 +132,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/host/agent.go:replicaRecordFacts`: reads +registry:App, +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/host/agent.go:storageDeclaration`: reads +registry:App, +registry:Stateless ×2, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/host/fleetbind.go:statelessBindingPublisher.publish`: reads +registry:Account, +registry:App, +registry:Assigned, +registry:Host, +registry:Provisioned, +registry:ServingVersion, +registry:Stateless, +registry:Status; written legacy, accepted-legacy, frozen
-- new `internal/registry/registry.go:Registry.SeedStateless`: reads +file:Exec, +file:QueryRow, +registry:Backing, +registry:Host ×2, +registry:Kind, +registry:ServingVersion, +registry:Socket, +registry:Tunnel, +registry:Version, +registry:remote ×2, +registry:sql, +whole:Route ×4, +whole:remoteClient ×2; written legacy, accepted-legacy, frozen
+- new `internal/registry/registry.go:Registry.SeedStateless`: reads +file:Exec, +file:QueryRow, +registry:Backing, +registry:GoodVersion, +registry:Host ×2, +registry:Kind, +registry:ServingVersion, +registry:Socket, +registry:Tunnel, +registry:remote ×2, +registry:sql, +whole:Route ×4, +whole:remoteClient ×2; written legacy, accepted-legacy, frozen
- new `internal/registry/registry.go:Registry.SetServingMode`: reads +file:Exec, +registry:remote ×2, +registry:sql, +whole:remoteClient ×2; 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)
@@ -164,8 +164,8 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/registry/registry.go:scanRoute`: +registry:Stateless; keeps legacy, task accepted-legacy
- 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
-- reads `internal/release/adopt.go:adoptHost`: +registry:Backing, +registry:Kind, +registry:ServingVersion, +registry:Socket, +registry:Stateless ×2, +registry:Tunnel, +registry:Version, +whole:Route; keeps authority, task B3,E1,E2,E3,E4,J1
+- reads `internal/release/adopt.go:adoptHost`: +registry:Backing, +registry:GoodVersion, +registry:Kind, +registry:ServingVersion, +registry:Socket, +registry:Stateless ×2, +registry:Tunnel, +whole:Route; keeps authority, task B3,E1,E2,E3,E4,J1
-Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `2dc64e66fd1323bd90c04eecdf0be69eb9ef442cdb22f425f5513312d13d0bbc`.
+Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `8b80aab5d0d3288d4567ecdb6a7fb3a9cd950c7ff26596b24bb5261f5ff1419b`.
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/rootfs_wake_release_test.go b/internal/activator/rootfs_wake_release_test.go
index 0fdd760ee..f177ffac8 100644
--- a/internal/activator/rootfs_wake_release_test.go
+++ b/internal/activator/rootfs_wake_release_test.go
@@ -20,6 +20,7 @@ import (
"slices"
"strings"
"sync"
+ "sync/atomic"
"testing"
"time"
@@ -229,6 +230,7 @@ func (r *routeRows) get(host string) registry.Route {
// with v1 as its fallback. The registry's row is routes'; the generations
// file is on disk; the clock is fake (the reaper's pace).
type wakeRelRig struct {
+ requests atomic.Int64
b *wakeRelBackend
a *Service
clk *fakeClock
@@ -307,6 +309,7 @@ func (r *wakeRelRig) setPlan(p WakePlan) {
// wake begins a request for the host in the background; its error arrives
// on the channel (nil once the wake served it).
func (r *wakeRelRig) wake(a *Service) <-chan error {
+ r.requests.Add(1)
ch := make(chan error, 1)
go func() {
done, err := a.beginRequest(context.Background(), r.rt)
diff --git a/internal/activator/stateless_resident_test.go b/internal/activator/stateless_resident_test.go
index 9007672a3..8bcc173b5 100644
--- a/internal/activator/stateless_resident_test.go
+++ b/internal/activator/stateless_resident_test.go
@@ -89,7 +89,7 @@ func TestStatelessBinaryResidentRestarts(t *testing.T) {
}
r.clk.advance(delay)
startResident(t, r.a, r.rt.Host)
- starts, acquireCalls, requests := len(r.b.started()), r.b.acquireCount(), 0
+ starts, acquireCalls, requests := len(r.b.started()), r.b.acquireCount(), r.requests.Load()
// TestStatelessBinaryResidentRestarts
if starts != 2 || acquireCalls != 0 || requests != 0 {
t.Fatal("binary residency required traffic or a lease")
@@ -126,6 +126,9 @@ func TestStatelessRunAndInteractive(t *testing.T) {
if err := waitErr(t, r.wake(r.a)); err != nil {
t.Fatal(err)
}
+ if r.requests.Load() != 1 {
+ t.Fatal("request counter did not observe the wake request")
+ }
denied := errors.New("authorization refused")
if _, err := r.a.RunCmd(context.Background(), r.rt, CmdSpec{RunID: "denied", Prepare: func(context.Context) error { return denied }}); !errors.Is(err, denied) {
t.Fatalf("authorization: %v", err)
diff --git a/internal/console/plancaps_doors_test.go b/internal/console/plancaps_doors_test.go
index b7cf23071..f44ea2815 100644
--- a/internal/console/plancaps_doors_test.go
+++ b/internal/console/plancaps_doors_test.go
@@ -882,41 +882,37 @@ func TestPendingRollbackToADaemonReleaseRefusedUnderAPlan(t *testing.T) {
}
}
-// R21 requires the storage declaration even with plans off: an unreadable
-// manifest cannot establish that this target is stateful. Once readable,
-// a stateful rollback still needs no platform pointer or plan catalog.
-func TestRollbackWithoutACatalogChecksStorageDeclaration(t *testing.T) {
+// R23: with plans off, an unreadable target manifest is treated as stateful.
+// The read is memoised across preflight and the conditional-write callback.
+func TestRollbackWithoutACatalogAdmitsUnreadableManifest(t *testing.T) {
fx := newConsoleFixture(t)
- shipVersion(t, fx, "kass", "old1")
- shipVersion(t, fx, "kass", "new2")
- seedChannel(t, fx, "kass", "canary/x", "old1")
- seedChannel(t, fx, "kass", "canary/x", "new2")
- key := release.ManifestKey(release.OpsAccount, "kass", "old1")
- raw, _, err := fx.rel.Get(context.Background(), key)
- if err != nil {
- t.Fatal(err)
- }
- if err := fx.rel.Delete(context.Background(), key); err != nil {
- t.Fatal(err)
+ for _, v := range []string{"old1", "new2"} {
+ shipVersion(t, fx, "kass", v)
+ seedChannel(t, fx, "kass", "canary/x", v)
+ if err := fx.rel.Delete(t.Context(), release.ManifestKey(release.OpsAccount, "kass", v)); err != nil {
+ t.Fatal(err)
+ }
}
+ store := &statelessManifestReads{Store: fx.rel}
+ fx.srv.cfg.Releases = store
token := cliToken(t, fx, "paul@keymail.dev", "code-rollback-nomanifest")
- if status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/bab/kass/rollback", map[string]string{"channel": "canary/x"}, token); status != http.StatusBadGateway || out["error"] != rootfsReleasesUnreadableMsg {
- t.Fatalf("rollback with unknown storage declaration = %d %v", status, out)
+ if status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/bab/kass/rollback", map[string]string{"channel": "canary/x"}, token); status != http.StatusOK {
+ t.Fatalf("rollback with unreadable manifest = %d %v", status, out)
}
- c := signInPaul(t, fx)
- postForm(t, c, fx.u("/apps/kass/rollback"), url.Values{"csrf": {sessionToken(t, fx, c)}, "channel": {"canary/x"}, "confirmed": {"1"}})
- if p := fx.channelVersion(t, "kass", "canary/x"); p.Version != "new2" {
- t.Fatalf("unreadable target selected: %+v", p)
+ if p := fx.channelVersion(t, "kass", "canary/x"); p.Version != "old1" {
+ t.Fatalf("API rollback = %+v", p)
}
- if _, err := fx.rel.Put(context.Background(), key, raw, ""); err != nil {
- t.Fatal(err)
- }
- if status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/bab/kass/rollback", map[string]string{"channel": "canary/x"}, token); status != http.StatusOK {
- t.Fatalf("stateful rollback without a platform pointer = %d %v", status, out)
+ if store.reads != 1 {
+ t.Fatalf("API target manifest reads = %d, want 1", store.reads)
}
+ c := signInPaul(t, fx)
+ store.reads = 0
postForm(t, c, fx.u("/apps/kass/rollback"), url.Values{"csrf": {sessionToken(t, fx, c)}, "channel": {"canary/x"}, "confirmed": {"1"}})
if p := fx.channelVersion(t, "kass", "canary/x"); p.Version != "new2" {
- t.Fatalf("stateful browser rollback = %+v", p)
+ t.Fatalf("browser rollback = %+v", p)
+ }
+ if store.reads != 1 {
+ t.Fatalf("browser target manifest reads = %d, want 1", store.reads)
}
}
diff --git a/internal/console/reqmemo.go b/internal/console/reqmemo.go
index 457972be1..cdb2f9091 100644
--- a/internal/console/reqmemo.go
+++ b/internal/console/reqmemo.go
@@ -75,7 +75,7 @@ func withWriteMemo(ctx context.Context) context.Context {
// writeMemoKey includes the stateless platform-floor snapshot so a preflight
// and the guarded selection share one read, including a failed read.
func writeMemoKey(key string) bool {
- return key == "edges" || strings.HasPrefix(key, "boxes:") || strings.HasPrefix(key, "stateless-system-pointer:")
+ return key == "edges" || strings.HasPrefix(key, "boxes:") || strings.HasPrefix(key, "stateless-system-pointer:") || strings.HasPrefix(key, "stateless-manifest:")
}
// memoOf is ctx's memo when it holds key, nil otherwise.
diff --git a/internal/console/rootfs.go b/internal/console/rootfs.go
index 16a31e8c2..c1b4307fb 100644
--- a/internal/console/rootfs.go
+++ b/internal/console/rootfs.go
@@ -9,6 +9,7 @@ import (
"maps"
"net/http"
"slices"
+ "strings"
"time"
"github.com/carlosframework/platform/internal/provision"
@@ -25,9 +26,9 @@ func atStatelessRuntimeFloor(version string) bool {
return ok && valid && v.Compare(floor) >= 0
}
-// R21 uses the signed platform channel pointer, with any already-loaded
-// assigned-box evidence as an additional gate. Stateful selections read nothing.
-func (s *Server) statelessRuntimeRefusal(ctx context.Context, channel string, m *release.Manifest, fleet *fleetView, box string) *doorRefusal {
+// R22 judges every platform channel, plus any already-loaded assigned box.
+// Stateful selections read no platform evidence.
+func (s *Server) statelessRuntimeRefusal(ctx context.Context, _ string, m *release.Manifest, fleet *fleetView, box string) *doorRefusal {
if m == nil || !m.Stateless {
return nil
}
@@ -35,9 +36,25 @@ func (s *Server) statelessRuntimeRefusal(ctx context.Context, channel string, m
if s.cfg.Releases == nil || s.cfg.Key == nil {
return ref
}
- allowed, err := memoize(ctx, "stateless-system-pointer:"+channel, func() (bool, error) {
- cur, _, err := release.GetSystemPointer(ctx, s.cfg.Releases, release.RootSigner(s.cfg.Key).RootPublicKey(), "router", channel)
- return err == nil && cur != nil && atStatelessRuntimeFloor(cur.Current.Version), err
+ allowed, err := memoize(ctx, "stateless-system-pointer:all", func() (bool, error) {
+ prefix, _ := strings.CutSuffix(release.SystemPointerKey(release.SystemComponentRouter, ""), ".json")
+ keys, err := s.cfg.Releases.List(ctx, prefix)
+ if err != nil {
+ return false, err
+ }
+ found := false
+ for _, key := range keys {
+ channel, ok := systemChannelOf(prefix, key)
+ if !ok {
+ continue
+ }
+ found = true
+ cur, _, err := release.GetSystemPointer(ctx, s.cfg.Releases, release.RootSigner(s.cfg.Key).RootPublicKey(), release.SystemComponentRouter, channel)
+ if err != nil || cur == nil || !atStatelessRuntimeFloor(cur.Current.Version) {
+ return false, err
+ }
+ }
+ return found, nil
})
if err != nil || !allowed {
return ref
@@ -54,9 +71,13 @@ func (s *Server) statelessRuntimeRefusal(ctx context.Context, channel string, m
}
func (s *Server) statelessVersionRefusal(ctx context.Context, acct, app, channel, version string) *doorRefusal {
- m, err := release.GetManifest(ctx, s.cfg.Releases, acct, app, version)
+ // R23: a pruned or unreadable manifest must not block emergency rollback.
+ // Only a readable stateless declaration triggers this floor.
+ m, err := memoize(ctx, "stateless-manifest:"+release.ManifestKey(acct, app, version), func() (*release.Manifest, error) {
+ return release.GetManifest(ctx, s.cfg.Releases, acct, app, version)
+ })
if err != nil {
- return &doorRefusal{http.StatusBadGateway, rootfsReleasesUnreadableMsg}
+ return nil
}
return s.statelessRuntimeRefusal(ctx, channel, m, nil, "")
}
diff --git a/internal/console/stateless_floor_test.go b/internal/console/stateless_floor_test.go
index 44d20413c..7a6deb7cf 100644
--- a/internal/console/stateless_floor_test.go
+++ b/internal/console/stateless_floor_test.go
@@ -55,9 +55,11 @@ func TestStatelessRuntimeFloorAPIMutations(t *testing.T) {
t.Fatal(err)
}
const channel = "canary/shop"
- statelessFloorPointer(t, fx, channel, tc.platform)
- // A different channel at the floor cannot admit this channel.
+ statelessFloorPointer(t, fx, "canary", tc.platform)
+ // The app channel is independent of both platform channels.
statelessFloorPointer(t, fx, "stable", "v0.34.0")
+ store := &statelessPointerReads{Store: fx.rel, failList: tc.name == "unreadable"}
+ fx.srv.cfg.Releases = store
if action == "rollback" {
if err := release.Promote(t.Context(), fx.rel, fx.priv, "bab", "shop", channel, "v1"); err != nil {
t.Fatal(err)
@@ -83,6 +85,13 @@ func TestStatelessRuntimeFloorAPIMutations(t *testing.T) {
} else if code != http.StatusOK {
t.Fatalf("%d %v", code, out)
}
+ wantLists := 0
+ if tc.stateless {
+ wantLists = 1
+ }
+ if store.lists != wantLists {
+ t.Fatalf("platform listings = %d, want %d", store.lists, wantLists)
+ }
})
}
}
@@ -90,8 +99,20 @@ func TestStatelessRuntimeFloorAPIMutations(t *testing.T) {
type statelessPointerReads struct {
release.Store
- reads int
- fail bool
+ reads int
+ lists int
+ fail bool
+ failList bool
+}
+
+func (s *statelessPointerReads) List(ctx context.Context, prefix string) ([]string, error) {
+ if strings.HasPrefix(prefix, "control/system/") {
+ s.lists++
+ if s.failList {
+ return nil, context.DeadlineExceeded
+ }
+ }
+ return s.Store.List(ctx, prefix)
}
func (s *statelessPointerReads) Get(ctx context.Context, key string) ([]byte, string, error) {
@@ -107,6 +128,7 @@ func (s *statelessPointerReads) Get(ctx context.Context, key string) ([]byte, st
func TestStatelessRuntimeFloorSnapshotAndFleet(t *testing.T) {
fx := newConsoleFixture(t)
statelessFloorPointer(t, fx, "stable", "v0.34.0")
+ statelessFloorPointer(t, fx, "canary", "v0.34.0")
store := &statelessPointerReads{Store: fx.rel}
fx.srv.cfg.Releases = store
m := &release.Manifest{Stateless: true}
@@ -124,8 +146,11 @@ func TestStatelessRuntimeFloorSnapshotAndFleet(t *testing.T) {
t.Fatal(ref)
}
}
- if store.reads != 1 {
- t.Fatalf("pointer reads = %d, want one per mutation", store.reads)
+ if store.reads != 2 || store.lists != 1 {
+ t.Fatalf("snapshot reads=%d lists=%d, want 2 and 1", store.reads, store.lists)
+ }
+ if ref := fx.srv.statelessRuntimeRefusal(ctx, "canary/shop", m, nil, ""); ref != nil || store.reads != 2 || store.lists != 1 {
+ t.Fatalf("second selection reloaded snapshot: %v reads=%d lists=%d", ref, store.reads, store.lists)
}
store.fail = true
if ref := fx.srv.statelessRuntimeRefusal(withWriteMemo(t.Context()), "stable", m, nil, ""); ref == nil || ref.Msg != statelessFloorWant {
@@ -134,7 +159,7 @@ func TestStatelessRuntimeFloorSnapshotAndFleet(t *testing.T) {
if ref := fx.srv.statelessRuntimeRefusal(withWriteMemo(t.Context()), "stable", &release.Manifest{}, nil, ""); ref != nil {
t.Fatal(ref)
}
- if store.reads != 2 {
+ if store.reads != 3 || store.lists != 2 {
t.Fatalf("stateful read platform pointer: %d", store.reads)
}
}
@@ -302,3 +327,35 @@ func TestStatelessRuntimeFloorChangedRollbackTarget(t *testing.T) {
t.Fatalf("unchecked target published: %+v %v", p, err)
}
}
+
+// Count manifest attempts, including failed reads of pruned releases.
+type statelessManifestReads struct {
+ release.Store
+ reads int
+ fail bool
+}
+
+func (s *statelessManifestReads) Get(ctx context.Context, key string) ([]byte, string, error) {
+ if strings.HasSuffix(key, "/manifest.json") {
+ s.reads++
+ if s.fail {
+ return nil, "", context.DeadlineExceeded
+ }
+ }
+ return s.Store.Get(ctx, key)
+}
+
+func TestStatelessRuntimeFloorManifestReadFailureAdmits(t *testing.T) {
+ fx := newConsoleFixture(t)
+ store := &statelessManifestReads{Store: fx.rel, fail: true}
+ fx.srv.cfg.Releases = store
+ ctx := withWriteMemo(t.Context())
+ for range 2 {
+ if ref := fx.srv.statelessVersionRefusal(ctx, "bab", "shop", "canary/shop", "v1"); ref != nil {
+ t.Fatal(ref)
+ }
+ }
+ if store.reads != 1 {
+ t.Fatalf("failed target read attempts = %d, want 1", store.reads)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 5c73d38fa..7500cf887 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 2dc64e66fd1323bd90c04eecdf0be69eb9ef442cdb22f425f5513312d13d0bbc
+plan14-root-reads-stateless-replicas-1.tsv 8b80aab5d0d3288d4567ecdb6a7fb3a9cd950c7ff26596b24bb5261f5ff1419b
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 4d07fccc7..b4ac39cb7 100644
--- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
+++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv
@@ -51,7 +51,7 @@
@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
@legacy edbf463069228bbafd3264dbb31e5a112c891f411b56438df1cbd809ccc9e824 internal/host/fleetbind.go statelessBindingPublisher.publish legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3b: consume the applied record and serving route already read by reconcile, check instance/account/app/assignment/status/fleet/box and exact held coordinator lifetime, then publish the existing binding key. A per-host state cache excludes expiry-only renewals and avoids unchanged binding I/O. No instance-record scan or root exec; no typed record writer added. registry:Account@273,registry:App@302,registry:Assigned@323,registry:Host@250,registry:Provisioned@208,registry:ServingVersion@1012,registry:Stateless@155,registry:Status@226 80eedea2f893c34d9e9ce3711299871fd291f339f35f17c6736df0b5abe3a3be
-@legacy 282d6973418bcdb8a339dfb6f96a1c08d21808cc6f6f31c32a283a54902f85a9 internal/registry/registry.go Registry.SeedStateless legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: transaction reads the existing local registry row and compares the entire observed row before setting only stateless=1. Accept only a fresh socket-backed instance with no installed or serving version, backing or tunnel; refuse forward rows and stale observations. No serving version claim, bucket read or filesystem path introduced. file:Exec@791,file:QueryRow@552,registry:Backing@170,registry:Host@613,registry:Host@867,registry:Kind@114,registry:ServingVersion@247,registry:Socket@145,registry:Tunnel@196,registry:Version@221,registry:remote@315,registry:remote@345,registry:sql@457,whole:Route@403,whole:Route@413,whole:Route@723,whole:Route@734,whole:remoteClient@317,whole:remoteClient@347 bed3ada221993cb1330a92dba080ab0e38da989bd23c932b379849a33eef20b9
+@legacy b1bc36171f1d1f8ddd66fa1d68a718ec705ad50047895a890a328cc98e579c66 internal/registry/registry.go Registry.SeedStateless legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: transaction reads the existing local registry row and compares the entire observed row before setting only the stateless bit from the verified staged selection (R24, seed and unseed). Accept only a socket-backed instance with no ServingVersion or GoodVersion, backing or tunnel; Version is a staging stamp and may already be set before the first wake; refuse forward rows and stale observations. No serving version claim, bucket read or filesystem path introduced. file:Exec@826,file:QueryRow@587,registry:Backing@186,registry:GoodVersion@237,registry:Host@648,registry:Host@920,registry:Kind@130,registry:ServingVersion@267,registry:Socket@161,registry:Tunnel@212,registry:remote@335,registry:remote@365,registry:sql@492,whole:Route@423,whole:Route@433,whole:Route@758,whole:Route@769,whole:remoteClient@337,whole:remoteClient@367 43723641171b869299b5d744ca8a5d1ea05ac0dc6b815ca116d6aebbca004102
@legacy 946d4be489d2c872cf10c7746423e31d8ece0caa7b632a5c13512ca780869536 internal/registry/registry.go Registry.SetServingMode legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: A narrow service-user SQL UPDATE projects serving_version and stateless together and excludes forward rows. Remote form dispatches to the same method; it grants no launch authority. file:Exec@247,registry:remote@114,registry:remote@84,registry:sql@247,whole:remoteClient@116,whole:remoteClient@86 15b731f3d6e5fb0d7cad3194b035624fc99d7b24d923b27bbe71d32f6fa072f3
@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 7cf61a9c73df53cead9ed723d069fb9d501537cdd0faa59b7829c038fbc20193 internal/activator/activator.go Service.startSidecar legacy accepted-legacy accepted-legacy;rev3=fix1-merge-review;basis=Uses the sidecar's own fallback after a flag decline; agent lifecycle remains legacy.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Propagate the actual parent generation storage mode to its legacy sidecar environment; preserve existing ownership, build and termination gates. registry:Host@1830,registry:Host@282,registry:Stateless@121,whole:Route@1315,whole:Route@1378,whole:Route@1777,whole:Route@1968,whole:Route@487,whole:Route@550,whole:Route@609,whole:Route@651,whole:Route@781 0cea2de8439b8a5adabfd95524f76641946c6def8a80609291514c657a8ef487
@@ -152,7 +152,7 @@ internal/activator/wakeidentity.go Service.currentWakeRoute legacy accepted-lega
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
internal/host/fleetbind.go statelessBindingPublisher.publish legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3b: consume the applied record and serving route already read by reconcile, check instance/account/app/assignment/status/fleet/box and exact held coordinator lifetime, then publish the existing binding key. A per-host state cache excludes expiry-only renewals and avoids unchanged binding I/O. No instance-record scan or root exec; no typed record writer added. registry:Account@273,registry:App@302,registry:Assigned@323,registry:Host@250,registry:Provisioned@208,registry:ServingVersion@1012,registry:Stateless@155,registry:Status@226 80eedea2f893c34d9e9ce3711299871fd291f339f35f17c6736df0b5abe3a3be
-internal/registry/registry.go Registry.SeedStateless legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: transaction reads the existing local registry row and compares the entire observed row before setting only stateless=1. Accept only a fresh socket-backed instance with no installed or serving version, backing or tunnel; refuse forward rows and stale observations. No serving version claim, bucket read or filesystem path introduced. file:Exec@791,file:QueryRow@552,registry:Backing@170,registry:Host@613,registry:Host@867,registry:Kind@114,registry:ServingVersion@247,registry:Socket@145,registry:Tunnel@196,registry:Version@221,registry:remote@315,registry:remote@345,registry:sql@457,whole:Route@403,whole:Route@413,whole:Route@723,whole:Route@734,whole:remoteClient@317,whole:remoteClient@347 bed3ada221993cb1330a92dba080ab0e38da989bd23c932b379849a33eef20b9
+internal/registry/registry.go Registry.SeedStateless legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: transaction reads the existing local registry row and compares the entire observed row before setting only the stateless bit from the verified staged selection (R24, seed and unseed). Accept only a socket-backed instance with no ServingVersion or GoodVersion, backing or tunnel; Version is a staging stamp and may already be set before the first wake; refuse forward rows and stale observations. No serving version claim, bucket read or filesystem path introduced. file:Exec@826,file:QueryRow@587,registry:Backing@186,registry:GoodVersion@237,registry:Host@648,registry:Host@920,registry:Kind@130,registry:ServingVersion@267,registry:Socket@161,registry:Tunnel@212,registry:remote@335,registry:remote@365,registry:sql@492,whole:Route@423,whole:Route@433,whole:Route@758,whole:Route@769,whole:remoteClient@337,whole:remoteClient@367 43723641171b869299b5d744ca8a5d1ea05ac0dc6b815ca116d6aebbca004102
internal/registry/registry.go Registry.SetServingMode legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: A narrow service-user SQL UPDATE projects serving_version and stateless together and excludes forward rows. Remote form dispatches to the same method; it grants no launch authority. file:Exec@247,registry:remote@114,registry:remote@84,registry:sql@247,whole:remoteClient@116,whole:remoteClient@86 15b731f3d6e5fb0d7cad3194b035624fc99d7b24d923b27bbe71d32f6fa072f3
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/activator/activator.go Service.startSidecar legacy accepted-legacy accepted-legacy;rev3=fix1-merge-review;basis=Uses the sidecar's own fallback after a flag decline; agent lifecycle remains legacy.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Propagate the actual parent generation storage mode to its legacy sidecar environment; preserve existing ownership, build and termination gates. registry:Host@1830,registry:Host@282,registry:Stateless@121,whole:Route@1315,whole:Route@1378,whole:Route@1777,whole:Route@1968,whole:Route@487,whole:Route@550,whole:Route@609,whole:Route@651,whole:Route@781 0cea2de8439b8a5adabfd95524f76641946c6def8a80609291514c657a8ef487
@@ -183,7 +183,7 @@ internal/registry/registry.go routeArgs authority E3 rev3=census-ruling-seeded-i
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/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/release/adopt.go adoptHost authority B3,E1,E2,E3,E4,J1 E16: root first-registration creation evidence under release exclusion; exact installation identity is required for first-program adoption and is consumed before an attempt. Installed-program history comes from the verified claim launch. Fixtures: TestPlan14FreshInstallRegistration, TestPlan14FreshInstallProgramGate, TestPlan14FreshInstallCanonicalIdentity, TestPlan14FreshInstallLaunchObservation, TestPlan14InstalledLaunchProgramEvidence, TestPlan14FreshInstallProcessCrash, TestPlan14FreshInstallVisibleSync, TestClaimControlUnitInstallers. E22: root generation pins guard existing-tree artifact and manifest writes in adoption and moves-held staging/publication. Held snapshot is read under release exclusion before the leaf held-stage lock; failures remain restrictive for writes. Claims-off source returns no root pins. Fresh wholly absent version trees retain signed staging. Fixtures: TestPlan14GenerationSiblingWrites, TestPlan14GenerationVerifiedSiblingWrites, TestPlan14GenerationHeldStage (production source assembly, both flag values without census, lock order, pin/error/fresh cases). Production completeness remains unavailable; no new completeness grant.;rev3=PROPOSED-p3;run=8;identity=carlos adopt uid 0; legacy agent pass uid carlos;basis=applies root settings to canonically resolved routes including named units while legacy settings eligibility remains unchanged;rev3=PROPOSED-p3;run=16;basis=P3-R11 approved punctuation edit only; authority and reads unchanged;rev3=census-ruling-315;identity=legacy agent pass uid carlos (RootRestartsUnits; never set on carlos adopt);basis=a non-root agent pass hands a route its named unit serves (unitServed) to root through the stage relay before staging or repointing; root adopt reads unchanged;rev3=census-ruling-rootfs-apps-2;identity=the root adopt pass (carlos adopt, carlos-adopt.service, root);basis=the row's runtime (Runtime) rides on a copy of the stage check, so stageFrom stages only the kind the row runs (runtimeMatches) before any download, and the manifest the pass ends up holding is checked again; the artifact sha comes from Manifest.BoxArtifact (the rootfs key for an image); the new kind is registry:Runtime, two sites, and one more Host site in the refusal's line. A runtime the agent forges can make the pass refuse a release, and can also admit a rootfs release to staging for a row it marks rootfs. The evidence paths that can then hand back a staged identity, exhaustively: (1) the signed channel pointer with a manifest digest (ensureStagedDigest, then stageFrom: a fresh download or the staged copy reused); (2) a signed pointer with no digest (the digest marker off), through ensureStagedChecked: with the manifest fetched, stageFrom as in (1); with the fetch failing, a binary's sibling on disk is handed back as before, and a rootfs sibling is refused (controller ruling R-a, task 11 fix E5); (3) a signed promotion record's manifest digest (stageAuthorized, then ensureStagedDigest and stageFrom); (4) retained-copy recovery when (3) fails (stageAuthorized, RetainedStaged: the copy's bytes must hash to its sibling's digest). For a rootfs version every path that hands back an identity yields a sibling byte-equal to the manifest just authorised: stageFrom reads the sibling back after a fresh stage or a reuse and refuses otherwise; (2)'s fallback never yields one; recovery refuses a sibling whose bytes do not hash to the digest a readable record names (retainedRootfsAuthorised, task 11 fix E1), and with no record readable takes the copy root itself verified, as for a binary. Every path is for the row's own account and app. The held stage (materializeheld.go) and signedhead.go stage through ensureStagedDigest with a zero stage check (a binary row's), so they never stage a rootfs release, and their no-digest fallback refuses a rootfs sibling too;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate check is left as is for a resident;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: reuse the manifest verified by existing staging and signed selection; within withReleaseWork after history, proof and staging gates, seed only a fresh stateless exec instance before PointLive. All existing root admission, credentials, quotas, proof, restart and rollback checks retained; no additional manifest or bucket read. registry:App@11547,registry:App@11701,registry:App@13055,registry:App@13981,registry:App@15579,registry:App@21034,registry:App@26510,registry:App@3144,registry:App@34290,registry:App@6758,registry:App@8059,registry:App@8253,registry:Backing@20791,registry:Hibernate@35265,registry:Host@10484,registry:Host@11427,registry:Host@11460,registry:Host@11560,registry:Host@11714,registry:Host@11810,registry:Host@11842,registry:Host@11907,registry:Host@12357,registry:Host@12697,registry:Host@12821,registry:Host@13268,registry:Host@13377,registry:Host@13579,registry:Host@14071,registry:Host@14857,registry:Host@15332,registry:Host@15565,registry:Host@15907,registry:Host@16542,registry:Host@20250,registry:Host@20358,registry:Host@21002,registry:Host@2105,registry:Host@21822,registry:Host@21980,registry:Host@22442,registry:Host@22494,registry:Host@22641,registry:Host@22728,registry:Host@2294,registry:Host@2375,registry:Host@23834,registry:Host@24078,registry:Host@24738,registry:Host@25123,registry:Host@25264,registry:Host@26478,registry:Host@26605,registry:Host@27947,registry:Host@28597,registry:Host@3157,registry:Host@31830,registry:Host@32448,registry:Host@32773,registry:Host@32847,registry:Host@33094,registry:Host@33245,registry:Host@34462,registry:Host@34629,registry:Host@34736,registry:Host@34964,registry:Host@35107,registry:Host@35966,registry:Host@36092,registry:Host@36180,registry:Host@4469,registry:Host@4583,registry:Host@5546,registry:Host@5651,registry:Host@6870,registry:Host@6918,registry:Host@7035,registry:Host@7067,registry:Host@7945,registry:Host@8113,registry:Host@8239,registry:Host@8358,registry:Host@8836,registry:Host@9223,registry:Host@9449,registry:Host@9545,registry:Host@9636,registry:Kind@20747,registry:Kind@554,registry:Runtime@11211,registry:Runtime@12615,registry:ServingVersion@20850,registry:Socket@20772,registry:Stateless@20731,registry:Stateless@20948,registry:Tunnel@20811,registry:Unit@32993,registry:Unit@579,registry:Version@20830,whole:Route@10073,whole:Route@10427,whole:Route@11542,whole:Route@11696,whole:Route@13045,whole:Route@13971,whole:Route@15547,whole:Route@16112,whole:Route@16518,whole:Route@17718,whole:Route@18021,whole:Route@18177,whole:Route@20507,whole:Route@20651,whole:Route@20907,whole:Route@21024,whole:Route@2206,whole:Route@23563,whole:Route@23962,whole:Route@26500,whole:Route@3139,whole:Route@31401,whole:Route@34438,whole:Route@3595,whole:Route@4347,whole:Route@6753 add804300a72fb39eb2a074b8ec4bacaf8e6650af54ac99a6259045061ad6630
+internal/release/adopt.go adoptHost authority B3,E1,E2,E3,E4,J1 E16: root first-registration creation evidence under release exclusion; exact installation identity is required for first-program adoption and is consumed before an attempt. Installed-program history comes from the verified claim launch. Fixtures: TestPlan14FreshInstallRegistration, TestPlan14FreshInstallProgramGate, TestPlan14FreshInstallCanonicalIdentity, TestPlan14FreshInstallLaunchObservation, TestPlan14InstalledLaunchProgramEvidence, TestPlan14FreshInstallProcessCrash, TestPlan14FreshInstallVisibleSync, TestClaimControlUnitInstallers. E22: root generation pins guard existing-tree artifact and manifest writes in adoption and moves-held staging/publication. Held snapshot is read under release exclusion before the leaf held-stage lock; failures remain restrictive for writes. Claims-off source returns no root pins. Fresh wholly absent version trees retain signed staging. Fixtures: TestPlan14GenerationSiblingWrites, TestPlan14GenerationVerifiedSiblingWrites, TestPlan14GenerationHeldStage (production source assembly, both flag values without census, lock order, pin/error/fresh cases). Production completeness remains unavailable; no new completeness grant.;rev3=PROPOSED-p3;run=8;identity=carlos adopt uid 0; legacy agent pass uid carlos;basis=applies root settings to canonically resolved routes including named units while legacy settings eligibility remains unchanged;rev3=PROPOSED-p3;run=16;basis=P3-R11 approved punctuation edit only; authority and reads unchanged;rev3=census-ruling-315;identity=legacy agent pass uid carlos (RootRestartsUnits; never set on carlos adopt);basis=a non-root agent pass hands a route its named unit serves (unitServed) to root through the stage relay before staging or repointing; root adopt reads unchanged;rev3=census-ruling-rootfs-apps-2;identity=the root adopt pass (carlos adopt, carlos-adopt.service, root);basis=the row's runtime (Runtime) rides on a copy of the stage check, so stageFrom stages only the kind the row runs (runtimeMatches) before any download, and the manifest the pass ends up holding is checked again; the artifact sha comes from Manifest.BoxArtifact (the rootfs key for an image); the new kind is registry:Runtime, two sites, and one more Host site in the refusal's line. A runtime the agent forges can make the pass refuse a release, and can also admit a rootfs release to staging for a row it marks rootfs. The evidence paths that can then hand back a staged identity, exhaustively: (1) the signed channel pointer with a manifest digest (ensureStagedDigest, then stageFrom: a fresh download or the staged copy reused); (2) a signed pointer with no digest (the digest marker off), through ensureStagedChecked: with the manifest fetched, stageFrom as in (1); with the fetch failing, a binary's sibling on disk is handed back as before, and a rootfs sibling is refused (controller ruling R-a, task 11 fix E5); (3) a signed promotion record's manifest digest (stageAuthorized, then ensureStagedDigest and stageFrom); (4) retained-copy recovery when (3) fails (stageAuthorized, RetainedStaged: the copy's bytes must hash to its sibling's digest). For a rootfs version every path that hands back an identity yields a sibling byte-equal to the manifest just authorised: stageFrom reads the sibling back after a fresh stage or a reuse and refuses otherwise; (2)'s fallback never yields one; recovery refuses a sibling whose bytes do not hash to the digest a readable record names (retainedRootfsAuthorised, task 11 fix E1), and with no record readable takes the copy root itself verified, as for a binary. Every path is for the row's own account and app. The held stage (materializeheld.go) and signedhead.go stage through ensureStagedDigest with a zero stage check (a binary row's), so they never stage a rootfs release, and their no-digest fallback refuses a rootfs sibling too;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate check is left as is for a resident;rev3=census-ruling-stateless-replicas-1;basis=Task 4 R19: reuse the manifest verified by existing staging and signed selection; within withReleaseWork after history, proof and staging gates, seed or unseed the exec mode before PointLive (R24), under the same full-row compare and no ServingVersion/GoodVersion/running build guard. Version stamps staging and is not serving evidence. All existing root admission, credentials, quotas, proof, restart and rollback checks retained; no additional manifest or bucket read. registry:App@11547,registry:App@11701,registry:App@13055,registry:App@13981,registry:App@15579,registry:App@21074,registry:App@26550,registry:App@3144,registry:App@34330,registry:App@6758,registry:App@8059,registry:App@8253,registry:Backing@20790,registry:GoodVersion@20829,registry:Hibernate@35305,registry:Host@10484,registry:Host@11427,registry:Host@11460,registry:Host@11560,registry:Host@11714,registry:Host@11810,registry:Host@11842,registry:Host@11907,registry:Host@12357,registry:Host@12697,registry:Host@12821,registry:Host@13268,registry:Host@13377,registry:Host@13579,registry:Host@14071,registry:Host@14857,registry:Host@15332,registry:Host@15565,registry:Host@15907,registry:Host@16542,registry:Host@20250,registry:Host@20358,registry:Host@21042,registry:Host@2105,registry:Host@21862,registry:Host@22020,registry:Host@22482,registry:Host@22534,registry:Host@22681,registry:Host@22768,registry:Host@2294,registry:Host@2375,registry:Host@23874,registry:Host@24118,registry:Host@24778,registry:Host@25163,registry:Host@25304,registry:Host@26518,registry:Host@26645,registry:Host@27987,registry:Host@28637,registry:Host@3157,registry:Host@31870,registry:Host@32488,registry:Host@32813,registry:Host@32887,registry:Host@33134,registry:Host@33285,registry:Host@34502,registry:Host@34669,registry:Host@34776,registry:Host@35004,registry:Host@35147,registry:Host@36006,registry:Host@36132,registry:Host@36220,registry:Host@4469,registry:Host@4583,registry:Host@5546,registry:Host@5651,registry:Host@6870,registry:Host@6918,registry:Host@7035,registry:Host@7067,registry:Host@7945,registry:Host@8113,registry:Host@8239,registry:Host@8358,registry:Host@8836,registry:Host@9223,registry:Host@9449,registry:Host@9545,registry:Host@9636,registry:Kind@20746,registry:Kind@554,registry:Runtime@11211,registry:Runtime@12615,registry:ServingVersion@20853,registry:Socket@20771,registry:Stateless@20730,registry:Stateless@20981,registry:Tunnel@20810,registry:Unit@33033,registry:Unit@579,whole:Route@10073,whole:Route@10427,whole:Route@11542,whole:Route@11696,whole:Route@13045,whole:Route@13971,whole:Route@15547,whole:Route@16112,whole:Route@16518,whole:Route@17718,whole:Route@18021,whole:Route@18177,whole:Route@20507,whole:Route@20651,whole:Route@20927,whole:Route@21064,whole:Route@2206,whole:Route@23603,whole:Route@24002,whole:Route@26540,whole:Route@3139,whole:Route@31441,whole:Route@34478,whole:Route@3595,whole:Route@4347,whole:Route@6753 1e1ed801980977952aa0d77766c6e1b1c604e223d8eaac7346636836c461a062
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. 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
@@ -199,7 +199,7 @@ internal/activator/rootfsenv.go ExecBackend.rootfsTTYVars legacy accepted-legacy
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/swap.go Service.spawnSuccessor legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry verified target mode on the actual generation and add the stateless current-record gate at the real launch boundary; preserve the existing lifecycle, publication and placement gates. Fix 3a round 1 I2: attach single final record check on stateless overlap spawn; repeated surrounding gates remain registry/observation-only, preserving local ownership checks. registry:Host@949,whole:Route@1056,whole:Route@1122,whole:Route@328,whole:Route@451,whole:Route@546,whole:Route@563,whole:Route@610 b49a0c053322869503e7ffeb5506859a114186566eaa6c2d5f62dcb34e359a17
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
-internal/registry/remote_dispatch.go Registry.dispatchRemote hint E2 rev3=census-ruling-self-serve-moves-1;basis=the registry child (carlos __registry-child, the service user a root pass forks): plan14-root-reads-e's mixed declaration (E2 adds only the ArtifactHosts read; every other arm is the local method of the same name), with three more write arms, SetHoldIfSeq, ReleaseHoldSeq and InstallLifetimeIf, each calling the local setter; no read operation added; self-serve moves 1 Task 7;rev3=census-ruling-instance-egress-sizes-328-329;identity=the registry child (carlos __registry-child, the service user a root pass forks);basis=#328/#329 plan 1 Task 4: one more write arm, SetPolicy, calling the local Registry.SetPolicy with the request's Host, EgressAllow, Size and PolicyExpiresAt (remoteRequest fields sent by the remote handle's holder); the new kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, plus one more registry:Host site, all of the request; no read operation added; the read-only worker never reaches it (serveRemote's method gate); no production root pass sends SetPolicy;rev3=census-ruling-region-ha-p1a;basis=the registry child (carlos __registry-child, the service user a root pass forks): one more write arm, SetHA, calling the local Registry.SetHA with the request's Host (+registry:Host); no read operation added; only the provision pass sends it;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 8: two new remote methods, UpsertUnlessRootfs (carlos add's guarded write) and ResidentInstances (the residency sweep's list), each calling the same-named Registry method;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: two more methods on the existing remote registry transport, ListRegional and ReplaceRegionalSet (request field RDs, response field Regional), each calling the local method of the same name, which validates its own input; no new kind of read;rev3=census-ruling-fleet-secrets-key;basis=one new case, SetFleetSecretsKey, reading the request's Name, Pub, KeyFP, By and At fields and calling SetFleetSecretsKey;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 1-2: three new cases (SetFleetBoxIf reads the request's Fleet and answers Changed; PutForward reads TValue, a whole Route; DeleteForward reads Host and answers Changed); SetFleetBox gone (+registry:Changed x2, +registry:Fleet, +registry:Host, +registry:TValue, +whole:Route). Each case calls the local writer with its own guards.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Tasks 2 and 6b): three more remote methods dispatched to their local forms, SetFleetBoxDraining (q.Fleet, q.Label, q.At, answering Number64), MarkFleetBoxLabelled (q.Fleet, q.Label, q.At) and SetFleetAssignment (q.Host, q.Assigned, q.Moved); remoteRequest gains Assigned and Moved. The registry child, not root.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Add SetServingMode dispatch using the existing remote request Host, Ver and On fields; the same local narrow writer handles it. No new transport or root path. Task 4 R19: dispatch SeedStateless with the existing Observed Route carrier to its guarded local method. No new transport; the existing read-only service gate still refuses writes. registry:A@7648,registry:Account@4416,registry:Accounts@3078,registry:Addr@4993,registry:Addrs@5001,registry:Alias@7696,registry:Alias@7760,registry:Alias@7848,registry:Aliases@7570,registry:Alive@9523,registry:Args@7272,registry:AssetGen@5143,registry:AssetsOff@5130,registry:Assigned@5621,registry:At@2232,registry:At@2621,registry:At@2706,registry:At@6515,registry:At@7779,registry:At@7857,registry:At@9271,registry:Attempts@9293,registry:B@2281,registry:Backing@4812,registry:BuildState@5380,registry:By@2226,registry:Changed@1996,registry:Changed@3501,registry:Changed@3588,registry:Changed@3677,registry:Changed@3748,registry:Changed@3852,registry:Changed@3939,registry:Changed@4032,registry:Changed@4114,registry:Changed@5968,registry:Changed@6105,registry:Changed@9203,registry:Channel@4476,registry:Channel@5811,registry:Channel@6360,registry:CheckedAt@6441,registry:Class@4931,registry:DoneBefore@9532,registry:Due@6973,registry:Due@7037,registry:Due@9315,registry:EgressAllow@5283,registry:Env@5879,registry:Env@6271,registry:Env@6371,registry:ExcludeHosts@8998,registry:ExcludeHosts@9093,registry:ExpectGood@6640,registry:ExpectOp@3556,registry:ExpectOp@3806,registry:ExpectPair@3986,registry:Expected@1250,registry:Expected@289,registry:Expected@762,registry:Expected@939,registry:F@1968,registry:F@2029,registry:Fleet@2054,registry:Fleet@2339,registry:Fleet@2421,registry:Fleet@2502,registry:Fleet@2603,registry:Fleet@2688,registry:Fleet@2777,registry:Fleet@6011,registry:FleetBoxes@2738,registry:Fleets@2112,registry:From@4587,registry:From@4648,registry:FromDB@4723,registry:FromOp@3644,registry:FromSock@4733,registry:Hash@5685,registry:Health@5010,registry:Host@1024,registry:Host@1135,registry:Host@272,registry:Host@3262,registry:Host@3303,registry:Host@3456,registry:Host@3532,registry:Host@3618,registry:Host@3710,registry:Host@3782,registry:Host@3888,registry:Host@3978,registry:Host@4066,registry:Host@4158,registry:Host@4408,registry:Host@4468,registry:Host@4526,registry:Host@4579,registry:Host@4640,registry:Host@4715,registry:Host@4804,registry:Host@4858,registry:Host@4923,registry:Host@4985,registry:Host@5063,registry:Host@5122,registry:Host@5210,registry:Host@5275,registry:Host@5372,registry:Host@5437,registry:Host@5498,registry:Host@5548,registry:Host@5613,registry:Host@5677,registry:Host@5738,registry:Host@5871,registry:Host@5925,registry:Host@6003,registry:Host@6140,registry:Host@6193,registry:Host@6423,registry:Host@6507,registry:Host@6564,registry:Host@6632,registry:Host@6774,registry:Host@6850,registry:Host@6910,registry:Host@6965,registry:Host@7029,registry:Host@7213,registry:Host@7264,registry:Host@7331,registry:Host@7406,registry:Host@7469,registry:Host@8066,registry:Host@8192,registry:Host@8346,registry:Host@8634,registry:Host@8698,registry:Host@8757,registry:Host@8840,registry:Host@8923,registry:Host@9154,registry:Host@9239,registry:Host@9371,registry:Host@9452,registry:Host@9615,registry:Hosts@187,registry:Hosts@3141,registry:Hosts@5802,registry:Hosts@6262,registry:Hosts@6351,registry:Id@1244,registry:Id@1555,registry:Id@1654,registry:Id@1734,registry:Id@1885,registry:IdValue@2897,registry:Idle@7339,registry:Journal@1262,registry:Journal@1561,registry:Journal@1740,registry:Journal@442,registry:Keep@9631,registry:KeyFP@2217,registry:Kind@9460,registry:Kind@9623,registry:Label@2348,registry:Label@2430,registry:Label@2511,registry:Label@2612,registry:Label@2697,registry:Label@6020,registry:Limit@8989,registry:Limit@9084,registry:MaxRun@7347,registry:Method@151,registry:Moved@5633,registry:Ms@9287,registry:Name@1032,registry:Name@1143,registry:Name@2082,registry:Name@2202,registry:Name@2916,registry:Name@8706,registry:Name@8765,registry:Name@8848,registry:Name@9162,registry:Name@9247,registry:Name@9379,registry:Next@301,registry:NextAt@9305,registry:NextGood@6654,registry:NextValue@1814,registry:NextValue@1912,registry:Now@1167,registry:Now@7540,registry:Now@8982,registry:Now@9077,registry:Now@9170,registry:Number64@2561,registry:Number64@3004,registry:Number@9420,registry:Number@9491,registry:Number@9576,registry:Observed@365,registry:Observed@6713,registry:ObservedValue@643,registry:Old@1807,registry:Old@1905,registry:On@6789,registry:On@6918,registry:On@7414,registry:On@7477,registry:Op@3474,registry:Op@3550,registry:Op@3718,registry:Op@3800,registry:Op@3896,registry:Op@4074,registry:Op@4166,registry:Owner@280,registry:Owner@377,registry:Owner@660,registry:P@8300,registry:Pair@3818,registry:Pair@3902,registry:Pair@4000,registry:Path@8531,registry:Paths@8228,registry:PolicyExpiresAt@5306,registry:Prefix@8354,registry:Prev@6579,registry:Pub@2210,registry:RDs@8200,registry:RateLimit@5746,registry:Regional@8098,registry:Registration@1040,registry:Registration@1151,registry:Registration@8856,registry:Registration@9255,registry:Replica@5506,registry:Replicas@5445,registry:Retirement@1891,registry:Route@3239,registry:Routes@3197,registry:Routes@4192,registry:Routes@7071,registry:Routes@7138,registry:Routes@7507,registry:Rows@8642,registry:Seed@7221,registry:Size@5298,registry:Sqid@2908,registry:Sqid@2971,registry:Sqid@3050,registry:Status@1056,registry:Status@2520,registry:Status@3464,registry:Status@3540,registry:Status@3626,registry:Status@3790,registry:Status@4534,registry:Status@6431,registry:Status@7769,registry:Status@9277,registry:Status@9387,registry:Steering@5071,registry:StringMap@2814,registry:T@757,registry:T@851,registry:T@8582,registry:T@934,registry:TValue@3344,registry:TValue@3411,registry:TValue@6070,registry:Tags@2439,registry:Target@6201,registry:Targets@453,registry:Text@1460,registry:Text@1607,registry:Text@3018,registry:Text@8387,registry:Text@8450,registry:Timer@709,registry:Timer@8670,registry:Timer@891,registry:Timers@8893,registry:Timers@8952,registry:Timers@9041,registry:Times@9665,registry:To@4595,registry:To@4656,registry:ToDB@4745,registry:ToOp@3636,registry:ToSock@4753,registry:TokenHash@2357,registry:Tunnel@5933,registry:Unit@4866,registry:UpdateSettings@5218,registry:Ver@6572,registry:Ver@6782,registry:Ver@6858,registry:W@8000,registry:Wildcards@7894,whole:Account@3082,whole:ClaimOwnership@282,whole:ClaimOwnership@379,whole:ClaimOwnership@662,whole:ClaimRow@455,whole:ClaimRowArchive@561,whole:ClaimRowArchive@571,whole:ColdRows@1809,whole:ColdRows@1816,whole:ColdRows@1907,whole:ColdRows@1914,whole:Fleet@1970,whole:Fleet@2031,whole:Fleet@2058,whole:Fleet@2116,whole:FleetBox@2283,whole:FleetBox@2742,whole:GoodBuild@6642,whole:GoodBuild@6656,whole:Pair@3820,whole:Pair@3904,whole:Pair@3988,whole:Pair@4002,whole:RegionalDomain@8102,whole:RegionalDomain@8202,whole:Route@3201,whole:Route@3243,whole:Route@3346,whole:Route@3413,whole:Route@367,whole:Route@4196,whole:Route@4351,whole:Route@4357,whole:Route@6072,whole:Route@6715,whole:Route@7075,whole:Route@7142,whole:Route@7511,whole:RouteAlias@7574,whole:RouteAlias@7650,whole:RoutePath@8232,whole:RoutePath@8302,whole:Timer@645,whole:Timer@713,whole:Timer@759,whole:Timer@853,whole:Timer@8584,whole:Timer@8644,whole:Timer@8674,whole:Timer@8897,whole:Timer@895,whole:Timer@8956,whole:Timer@9045,whole:Timer@936,whole:WildcardDomain@7898,whole:WildcardDomain@8002 6117c9c98cbfffb1d960f43ccda2c47f04c902335cb5431ad2f17afcac5245ed
+internal/registry/remote_dispatch.go Registry.dispatchRemote hint E2 rev3=census-ruling-self-serve-moves-1;basis=the registry child (carlos __registry-child, the service user a root pass forks): plan14-root-reads-e's mixed declaration (E2 adds only the ArtifactHosts read; every other arm is the local method of the same name), with three more write arms, SetHoldIfSeq, ReleaseHoldSeq and InstallLifetimeIf, each calling the local setter; no read operation added; self-serve moves 1 Task 7;rev3=census-ruling-instance-egress-sizes-328-329;identity=the registry child (carlos __registry-child, the service user a root pass forks);basis=#328/#329 plan 1 Task 4: one more write arm, SetPolicy, calling the local Registry.SetPolicy with the request's Host, EgressAllow, Size and PolicyExpiresAt (remoteRequest fields sent by the remote handle's holder); the new kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, plus one more registry:Host site, all of the request; no read operation added; the read-only worker never reaches it (serveRemote's method gate); no production root pass sends SetPolicy;rev3=census-ruling-region-ha-p1a;basis=the registry child (carlos __registry-child, the service user a root pass forks): one more write arm, SetHA, calling the local Registry.SetHA with the request's Host (+registry:Host); no read operation added; only the provision pass sends it;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 8: two new remote methods, UpsertUnlessRootfs (carlos add's guarded write) and ResidentInstances (the residency sweep's list), each calling the same-named Registry method;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: two more methods on the existing remote registry transport, ListRegional and ReplaceRegionalSet (request field RDs, response field Regional), each calling the local method of the same name, which validates its own input; no new kind of read;rev3=census-ruling-fleet-secrets-key;basis=one new case, SetFleetSecretsKey, reading the request's Name, Pub, KeyFP, By and At fields and calling SetFleetSecretsKey;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 1-2: three new cases (SetFleetBoxIf reads the request's Fleet and answers Changed; PutForward reads TValue, a whole Route; DeleteForward reads Host and answers Changed); SetFleetBox gone (+registry:Changed x2, +registry:Fleet, +registry:Host, +registry:TValue, +whole:Route). Each case calls the local writer with its own guards.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Tasks 2 and 6b): three more remote methods dispatched to their local forms, SetFleetBoxDraining (q.Fleet, q.Label, q.At, answering Number64), MarkFleetBoxLabelled (q.Fleet, q.Label, q.At) and SetFleetAssignment (q.Host, q.Assigned, q.Moved); remoteRequest gains Assigned and Moved. The registry child, not root.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Add SetServingMode dispatch using the existing remote request Host, Ver and On fields; the same local narrow writer handles it. No new transport or root path. Task 4 R24: dispatch SeedStateless with the existing Observed Route and On carriers to its symmetric guarded local method. No new transport; the existing read-only service gate still refuses writes. registry:A@7654,registry:Account@4416,registry:Accounts@3078,registry:Addr@4993,registry:Addrs@5001,registry:Alias@7702,registry:Alias@7766,registry:Alias@7854,registry:Aliases@7576,registry:Alive@9529,registry:Args@7278,registry:AssetGen@5143,registry:AssetsOff@5130,registry:Assigned@5621,registry:At@2232,registry:At@2621,registry:At@2706,registry:At@6515,registry:At@7785,registry:At@7863,registry:At@9277,registry:Attempts@9299,registry:B@2281,registry:Backing@4812,registry:BuildState@5380,registry:By@2226,registry:Changed@1996,registry:Changed@3501,registry:Changed@3588,registry:Changed@3677,registry:Changed@3748,registry:Changed@3852,registry:Changed@3939,registry:Changed@4032,registry:Changed@4114,registry:Changed@5968,registry:Changed@6105,registry:Changed@9209,registry:Channel@4476,registry:Channel@5811,registry:Channel@6360,registry:CheckedAt@6441,registry:Class@4931,registry:DoneBefore@9538,registry:Due@6979,registry:Due@7043,registry:Due@9321,registry:EgressAllow@5283,registry:Env@5879,registry:Env@6271,registry:Env@6371,registry:ExcludeHosts@9004,registry:ExcludeHosts@9099,registry:ExpectGood@6640,registry:ExpectOp@3556,registry:ExpectOp@3806,registry:ExpectPair@3986,registry:Expected@1250,registry:Expected@289,registry:Expected@762,registry:Expected@939,registry:F@1968,registry:F@2029,registry:Fleet@2054,registry:Fleet@2339,registry:Fleet@2421,registry:Fleet@2502,registry:Fleet@2603,registry:Fleet@2688,registry:Fleet@2777,registry:Fleet@6011,registry:FleetBoxes@2738,registry:Fleets@2112,registry:From@4587,registry:From@4648,registry:FromDB@4723,registry:FromOp@3644,registry:FromSock@4733,registry:Hash@5685,registry:Health@5010,registry:Host@1024,registry:Host@1135,registry:Host@272,registry:Host@3262,registry:Host@3303,registry:Host@3456,registry:Host@3532,registry:Host@3618,registry:Host@3710,registry:Host@3782,registry:Host@3888,registry:Host@3978,registry:Host@4066,registry:Host@4158,registry:Host@4408,registry:Host@4468,registry:Host@4526,registry:Host@4579,registry:Host@4640,registry:Host@4715,registry:Host@4804,registry:Host@4858,registry:Host@4923,registry:Host@4985,registry:Host@5063,registry:Host@5122,registry:Host@5210,registry:Host@5275,registry:Host@5372,registry:Host@5437,registry:Host@5498,registry:Host@5548,registry:Host@5613,registry:Host@5677,registry:Host@5738,registry:Host@5871,registry:Host@5925,registry:Host@6003,registry:Host@6140,registry:Host@6193,registry:Host@6423,registry:Host@6507,registry:Host@6564,registry:Host@6632,registry:Host@6780,registry:Host@6856,registry:Host@6916,registry:Host@6971,registry:Host@7035,registry:Host@7219,registry:Host@7270,registry:Host@7337,registry:Host@7412,registry:Host@7475,registry:Host@8072,registry:Host@8198,registry:Host@8352,registry:Host@8640,registry:Host@8704,registry:Host@8763,registry:Host@8846,registry:Host@8929,registry:Host@9160,registry:Host@9245,registry:Host@9377,registry:Host@9458,registry:Host@9621,registry:Hosts@187,registry:Hosts@3141,registry:Hosts@5802,registry:Hosts@6262,registry:Hosts@6351,registry:Id@1244,registry:Id@1555,registry:Id@1654,registry:Id@1734,registry:Id@1885,registry:IdValue@2897,registry:Idle@7345,registry:Journal@1262,registry:Journal@1561,registry:Journal@1740,registry:Journal@442,registry:Keep@9637,registry:KeyFP@2217,registry:Kind@9466,registry:Kind@9629,registry:Label@2348,registry:Label@2430,registry:Label@2511,registry:Label@2612,registry:Label@2697,registry:Label@6020,registry:Limit@8995,registry:Limit@9090,registry:MaxRun@7353,registry:Method@151,registry:Moved@5633,registry:Ms@9293,registry:Name@1032,registry:Name@1143,registry:Name@2082,registry:Name@2202,registry:Name@2916,registry:Name@8712,registry:Name@8771,registry:Name@8854,registry:Name@9168,registry:Name@9253,registry:Name@9385,registry:Next@301,registry:NextAt@9311,registry:NextGood@6654,registry:NextValue@1814,registry:NextValue@1912,registry:Now@1167,registry:Now@7546,registry:Now@8988,registry:Now@9083,registry:Now@9176,registry:Number64@2561,registry:Number64@3004,registry:Number@9426,registry:Number@9497,registry:Number@9582,registry:Observed@365,registry:Observed@6713,registry:ObservedValue@643,registry:Old@1807,registry:Old@1905,registry:On@6725,registry:On@6795,registry:On@6924,registry:On@7420,registry:On@7483,registry:Op@3474,registry:Op@3550,registry:Op@3718,registry:Op@3800,registry:Op@3896,registry:Op@4074,registry:Op@4166,registry:Owner@280,registry:Owner@377,registry:Owner@660,registry:P@8306,registry:Pair@3818,registry:Pair@3902,registry:Pair@4000,registry:Path@8537,registry:Paths@8234,registry:PolicyExpiresAt@5306,registry:Prefix@8360,registry:Prev@6579,registry:Pub@2210,registry:RDs@8206,registry:RateLimit@5746,registry:Regional@8104,registry:Registration@1040,registry:Registration@1151,registry:Registration@8862,registry:Registration@9261,registry:Replica@5506,registry:Replicas@5445,registry:Retirement@1891,registry:Route@3239,registry:Routes@3197,registry:Routes@4192,registry:Routes@7077,registry:Routes@7144,registry:Routes@7513,registry:Rows@8648,registry:Seed@7227,registry:Size@5298,registry:Sqid@2908,registry:Sqid@2971,registry:Sqid@3050,registry:Status@1056,registry:Status@2520,registry:Status@3464,registry:Status@3540,registry:Status@3626,registry:Status@3790,registry:Status@4534,registry:Status@6431,registry:Status@7775,registry:Status@9283,registry:Status@9393,registry:Steering@5071,registry:StringMap@2814,registry:T@757,registry:T@851,registry:T@8588,registry:T@934,registry:TValue@3344,registry:TValue@3411,registry:TValue@6070,registry:Tags@2439,registry:Target@6201,registry:Targets@453,registry:Text@1460,registry:Text@1607,registry:Text@3018,registry:Text@8393,registry:Text@8456,registry:Timer@709,registry:Timer@8676,registry:Timer@891,registry:Timers@8899,registry:Timers@8958,registry:Timers@9047,registry:Times@9671,registry:To@4595,registry:To@4656,registry:ToDB@4745,registry:ToOp@3636,registry:ToSock@4753,registry:TokenHash@2357,registry:Tunnel@5933,registry:Unit@4866,registry:UpdateSettings@5218,registry:Ver@6572,registry:Ver@6788,registry:Ver@6864,registry:W@8006,registry:Wildcards@7900,whole:Account@3082,whole:ClaimOwnership@282,whole:ClaimOwnership@379,whole:ClaimOwnership@662,whole:ClaimRow@455,whole:ClaimRowArchive@561,whole:ClaimRowArchive@571,whole:ColdRows@1809,whole:ColdRows@1816,whole:ColdRows@1907,whole:ColdRows@1914,whole:Fleet@1970,whole:Fleet@2031,whole:Fleet@2058,whole:Fleet@2116,whole:FleetBox@2283,whole:FleetBox@2742,whole:GoodBuild@6642,whole:GoodBuild@6656,whole:Pair@3820,whole:Pair@3904,whole:Pair@3988,whole:Pair@4002,whole:RegionalDomain@8108,whole:RegionalDomain@8208,whole:Route@3201,whole:Route@3243,whole:Route@3346,whole:Route@3413,whole:Route@367,whole:Route@4196,whole:Route@4351,whole:Route@4357,whole:Route@6072,whole:Route@6715,whole:Route@7081,whole:Route@7148,whole:Route@7517,whole:RouteAlias@7580,whole:RouteAlias@7656,whole:RoutePath@8238,whole:RoutePath@8308,whole:Timer@645,whole:Timer@713,whole:Timer@759,whole:Timer@853,whole:Timer@8590,whole:Timer@8650,whole:Timer@8680,whole:Timer@8903,whole:Timer@895,whole:Timer@8962,whole:Timer@9051,whole:Timer@936,whole:WildcardDomain@7904,whole:WildcardDomain@8008 43d7cfd4c91aa1833b21a5e5706b6cebe48ad850b421c0398dbf42950f2d05a2
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
@@ -207,8 +207,8 @@ internal/rollout/wakeplan.go Manager.planRow legacy accepted-legacy accepted-leg
@coverage internal/host 785f628a5994901a1813c347b5265b86cd9bb99c0e113253b13805966cceae02
@coverage internal/ops 67289ea5b95d14e295bc19e855fab6b00ed240b822e75d4be42b9ded59662e4d
@coverage internal/provision 98d437ab5b9838a252b4e8b517926cac9a568571eae6dc817f94f7ed489e19db
-@coverage internal/registry 09ca13b89e733863570c1147f227f14aa8e1435c55f6ef3e4949a3f6b05effbf
-@coverage internal/release c5648fedbd46820dd788081edd77866cec9eb99a93736cedb22d47555a80dce4
+@coverage internal/registry 48a8cef168a7e7070f72e309a0921dc1a583791d92e9dd83def41a92e6297a54
+@coverage internal/release fb44a6e53692b8f56c0bc1c869963f981d6ca2ce613a475dc98c8d2215bfa7dd
@coverage internal/replicas 53b94eb040154539a0a977498b4b8bc1d53d82f67c1c6233667a0b823dd30d8a
@coverage internal/rollout 3eb995849e51ceae6255fed33eb411b61e5d5ce5d6d7d71a37fb53da059e02df
@fields A,Account,Accounts,AddedAt,Addr,Addrs,Alias,Aliases,Alive,AllowAbsent,App,Archives,Args,AssetGen,AssetsOff,Assigned,At,Attempts,B,Backing,Bucket,BuildState,By,Callback,CallbackError,CallbackFailed,Canary,Caps,CertExpiresAt,Changed,Channel,CheckedAt,Claim,ClaimIncarnation,ClaimOwner,ClaimOwnership,ClaimRowID,ClaimStamp,Class,Column,Contents,CreatedAt,DBPath,DNSCheckedAt,DNSStatus,Deadline,Default,Demand,Digest,DoneBefore,DrainingSince,Due,DueAt,EgressAllow,Env,EnvBefore,Environment,Error,ErrorKind,ExcludeHosts,ExpectGood,ExpectOp,ExpectPair,Expected,F,Failed,FenceGen,Field,Fleet,FleetBox,FleetBoxes,FleetLabel,Fleets,From,FromDB,FromOp,FromSock,Gate,GoodDemand,GoodDigest,GoodVersion,HA,Hash,Health,Held,Hibernate,HoldOp,Host,Hosts,ID,Id,IdValue,Idle,IdleSeconds,ImportGate,Incarnation,Journal,Keep,KeyFP,Kind,Label,LabelledAt,LastAt,LastError,LastMs,LastStatus,Limit,MaxRun,MaxRunSeconds,Method,Moved,Ms,Name,Next,NextAt,NextDue,NextGood,NextValue,Now,Number,Number64,Observed,ObservedValue,Old,On,OnConflict,Op,Original,Owner,Ownership,P,Pair,Path,Paths,Platform,PolicyExpiresAt,Pool,Prefix,Prev,PrevVersion,Provisioned,Pub,RDs,RateLimit,RecordKey,Region,Regional,Registration,Replica,Replicas,Replication,Retirement,Route,Routes,Row,Rows,Runtime,SecretsKeyFP,SecretsKeySetAt,SecretsKeySetBy,SecretsPub,Seed,SeedID,SeedSource,ServingSeq,ServingVersion,Size,Slug,Socket,Spec,Sqid,State,Stateless,Status,StatusNamed,Steering,StringMap,T,TValue,Tags,Target,Targets,Text,Timer,Timers,Times,To,ToDB,ToOp,ToSock,TokenHash,Tunnel,Type,Unit,UpdateSettings,Ver,Version,W,WakeIncarnation,Wildcards,closed,conn,connect,ctx,d,dec,done,enc,full,input,mu,output,path,readOnly,remote,sql,wait
diff --git a/internal/registry/forward_writers_test.go b/internal/registry/forward_writers_test.go
index 64b7e0e1e..dbb5c060e 100644
--- a/internal/registry/forward_writers_test.go
+++ b/internal/registry/forward_writers_test.go
@@ -389,7 +389,7 @@ func routeWriterCases() []writerCase {
rt.Socket = "/run/shop.sock"
})
observed := mustRoute(t, r, host)
- return host, func(bool) (bool, error) { return false, r.SeedStateless(observed) }
+ return host, func(bool) (bool, error) { return false, r.SeedStateless(observed, true) }
}},
errCase("SetServingMode", false, nil, func(r *Registry, h string) error { return r.SetServingMode(h, "v1", true) }),
errCase("SetServingVersion", false, nil, func(r *Registry, h string) error { return r.SetServingVersion(h, "v1") }),
diff --git a/internal/registry/registry.go b/internal/registry/registry.go
index 038d3dfa1..3228385d3 100644
--- a/internal/registry/registry.go
+++ b/internal/registry/registry.go
@@ -3111,16 +3111,17 @@ WHERE host = ? AND kind <> 'forward' AND good_version = ? AND good_digest = ? AN
}
// SeedStateless gives a fresh exec row its verified staged mode before its
-// first wake. It never changes a serving row or claims a serving version.
-func (r *Registry) SeedStateless(observed Route) error {
+// first wake. Version is only a staged-build stamp; ServingVersion and
+// GoodVersion are the serving evidence. It never changes either serving stamp.
+func (r *Registry) SeedStateless(observed Route, stateless bool) error {
if observed.IsForward() {
return ErrForwardRow
}
- if observed.Kind != "instance" || observed.Socket == "" || observed.Backing != "" || observed.Tunnel != "" || observed.Version != "" || observed.ServingVersion != "" {
+ if observed.Kind != "instance" || observed.Socket == "" || observed.Backing != "" || observed.Tunnel != "" || observed.GoodVersion != "" || observed.ServingVersion != "" {
return ErrGoodBuildChanged
}
if r.remote != nil {
- _, err := r.remote.call(nil, remoteRequest{Method: "SeedStateless", Observed: observed}, nil)
+ _, err := r.remote.call(nil, remoteRequest{Method: "SeedStateless", Observed: observed, On: stateless}, nil)
return err
}
tx, err := r.sql.Begin()
@@ -3138,7 +3139,7 @@ func (r *Registry) SeedStateless(observed Route) error {
if current != observed {
return ErrGoodBuildChanged
}
- if _, err := tx.Exec(`UPDATE routes SET stateless=1 WHERE host=? AND kind <> 'forward'`, observed.Host); err != nil {
+ if _, err := tx.Exec(`UPDATE routes SET stateless=? WHERE host=? AND kind <> 'forward'`, b2iDB(stateless), observed.Host); err != nil {
return err
}
return tx.Commit()
diff --git a/internal/registry/remote_dispatch.go b/internal/registry/remote_dispatch.go
index 8989ec281..101613252 100644
--- a/internal/registry/remote_dispatch.go
+++ b/internal/registry/remote_dispatch.go
@@ -321,7 +321,7 @@ func (r *Registry) dispatchRemote(ctx context.Context, q remoteRequest, callback
case "SetGoodBuild":
err = r.SetGoodBuild(q.Host, q.ExpectGood, q.NextGood)
case "SeedStateless":
- err = r.SeedStateless(q.Observed)
+ err = r.SeedStateless(q.Observed, q.On)
case "SetServingMode":
err = r.SetServingMode(q.Host, q.Ver, q.On)
case "SetServingVersion":
diff --git a/internal/registry/stateless_test.go b/internal/registry/stateless_test.go
index f3a203220..747f86469 100644
--- a/internal/registry/stateless_test.go
+++ b/internal/registry/stateless_test.go
@@ -118,7 +118,7 @@ func TestStatelessInitialProjection(t *testing.T) {
}
defer r.Close()
}
- rt := Route{Host: "shop.example.com", Kind: "instance", Socket: "/run/shop.sock", Account: "bab", App: "shop"}
+ rt := Route{Host: "shop.example.com", Kind: "instance", Socket: "/run/shop.sock", Account: "bab", App: "shop", Version: "staged"}
if err := r.Upsert(rt); err != nil {
t.Fatal(err)
}
@@ -128,22 +128,49 @@ func TestStatelessInitialProjection(t *testing.T) {
}
stale := *observed
stale.Incarnation++
- if err := r.SeedStateless(stale); err == nil {
+ if err := r.SeedStateless(stale, true); err == nil {
t.Fatal("stale lifetime seeded residency")
}
- if err := r.SeedStateless(*observed); err != nil {
+ if err := r.SeedStateless(*observed, true); err != nil {
t.Fatal(err)
}
got, err := r.Get(rt.Host)
- if err != nil || !got.Stateless || got.ServingVersion != "" || got.Version != "" {
+ if err != nil || !got.Stateless || got.ServingVersion != "" || got.Version != "staged" {
t.Fatalf("seed=%+v %v", got, err)
}
+ if err := r.SeedStateless(*observed, false); err == nil {
+ t.Fatal("stale projection cleared residency")
+ }
+ if err := r.SeedStateless(*got, false); err != nil {
+ t.Fatal(err)
+ }
+ got, err = r.Get(rt.Host)
+ if err != nil || got.Stateless || got.ServingVersion != "" || got.Version != "staged" {
+ t.Fatalf("unseed=%+v %v", got, err)
+ }
+ if err := r.SetGoodBuild(rt.Host, GoodBuild{}, GoodBuild{Version: "v1", Digest: "digest"}); err != nil {
+ t.Fatal(err)
+ }
+ got, _ = r.Get(rt.Host)
+ if err := r.SeedStateless(*got, true); err == nil {
+ t.Fatal("known-good row was seeded")
+ }
+ if err := r.SetGoodBuild(rt.Host, got.Good(), GoodBuild{}); err != nil {
+ t.Fatal(err)
+ }
if err := r.SetServingMode(rt.Host, "v1", false); err != nil {
t.Fatal(err)
}
got, _ = r.Get(rt.Host)
- if err := r.SeedStateless(*got); err == nil {
+ if err := r.SeedStateless(*got, true); err == nil {
t.Fatal("serving stateful row was seeded")
}
+ if err := r.SetServingMode(rt.Host, "v2", true); err != nil {
+ t.Fatal(err)
+ }
+ got, _ = r.Get(rt.Host)
+ if err := r.SeedStateless(*got, false); err == nil {
+ t.Fatal("serving stateless row was unseeded")
+ }
}
}
diff --git a/internal/release/adopt.go b/internal/release/adopt.go
index 3ded1b48c..b776ae376 100644
--- a/internal/release/adopt.go
+++ b/internal/release/adopt.go
@@ -1841,11 +1841,11 @@ func adoptHost(ctx context.Context, work hostwrite.Work, reg *registry.Registry,
return err
}
}
- if m != nil && m.Stateless && !rt.Stateless && rt.Kind == "instance" && rt.Socket != "" && rt.Backing == "" && rt.Tunnel == "" && rt.Version == "" && rt.ServingVersion == "" {
- if err := reg.SeedStateless(rt); err != nil {
+ if m != nil && m.Stateless != rt.Stateless && rt.Kind == "instance" && rt.Socket != "" && rt.Backing == "" && rt.Tunnel == "" && rt.GoodVersion == "" && rt.ServingVersion == "" && running == "" {
+ if err := reg.SeedStateless(rt, m.Stateless); err != nil {
return err
}
- rt.Stateless = true
+ rt.Stateless = m.Stateless
}
if err := PointLive(optDir, rt.Host, RouteAccount(rt), ver, rt.App, running); err != nil {
return err
diff --git a/internal/release/stateless_adopt_test.go b/internal/release/stateless_adopt_test.go
new file mode 100644
index 000000000..325c3d839
--- /dev/null
+++ b/internal/release/stateless_adopt_test.go
@@ -0,0 +1,44 @@
+package release
+
+import (
+ "testing"
+
+ "github.com/carlosframework/platform/internal/registry"
+)
+
+func TestStatelessStagingClearsBeforeFirstWake(t *testing.T) {
+ store := NewDirStore(t.TempDir())
+ priv, pub := testKeys(t)
+ reg := testRegistry(t)
+ defer reg.Close()
+ opt := t.TempDir()
+ rt := registry.Route{Host: "shop.example.com", Kind: "instance", Account: "bab", App: "shop", Channel: "canary/shop", Socket: "/run/shop.sock"}
+ if err := reg.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ for _, step := range []struct {
+ version string
+ stateless bool
+ }{{"v1", true}, {"v2", false}, {"v3", true}} {
+ m := Manifest{App: "shop", Version: step.version, Kind: "binary", Stateless: step.stateless, Artifacts: map[string]Artifact{adoptPlatform: {File: "shop"}}}
+ if err := Ship(t.Context(), store, "bab", m, map[string][]byte{adoptPlatform: []byte(step.version)}); err != nil {
+ t.Fatal(err)
+ }
+ if err := Promote(t.Context(), store, priv, "bab", "shop", rt.Channel, step.version); err != nil {
+ t.Fatal(err)
+ }
+ if err := Pass(t.Context(), reg, store, pub, opt, nil); err != nil {
+ t.Fatal(err)
+ }
+ got, err := reg.Get(rt.Host)
+ if err != nil || got == nil {
+ t.Fatalf("route: %v %v", got, err)
+ }
+ if got.Stateless != step.stateless || got.Version != step.version || got.ServingVersion != "" || got.Resident() != step.stateless {
+ t.Fatalf("%s staged mode: %+v", step.version, got)
+ }
+ if live, err := LiveVersion(opt, rt.Host); err != nil || live != step.version {
+ t.Fatalf("live = %q, %v", live, err)
+ }
+ }
+}