carlos / platform Public

host: run the boot full pass on arming, seeds beside it

fastConvergeLoop now builds the moves hold view and the offline keep
view, then runs its first tick at once (no tick sleep), so the boot full
pass that requestBootFullPass asked for starts as soon as what it reads
is built. The seeds (restart, sidecar wake, runs boot pass, schedule
converge, system pointer) run in their old order on their own goroutine
beside that tick, over the route list read before the first pass. The
loop waits for them before its second tick, runs one runs pass for the
notes the first tick kept, and only then wires restartGain, the restart
and wake legs and the system leg. fastBoot holds the order and says why
each seed's promise holds; witnesses in fastboot_test.go.

Census overlay fleet-first-reconcile-speed-4 (card in docs notes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 894b72d79db28b562665466527c3251e53c506d5 parent 8aae3f2
8 files changed, +659 −77
  • docs/superpowers/notes/census-proposal-fleet-first-reconcile-speed-4.md +29 −0
  • internal/host/agent.go +51 −75
  • internal/host/fastboot.go +165 −0
  • internal/host/fastboot_test.go +369 −0
  • internal/host/restart.go +12 −1
  • internal/host/sidecarwake.go +18 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-fleet-first-reconcile-speed-4.tsv +14 −0

Intent

Attributed to this commit: 11.1 g CO₂e (1,342,571 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on fleet-first-reconcile-fix, 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-fleet-first-reconcile-speed-4.md b/docs/superpowers/notes/census-proposal-fleet-first-reconcile-speed-4.md
new file mode 100644
index 000000000..51cb37208
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-fleet-first-reconcile-speed-4.md
@@ -0,0 +1,29 @@
+# Census approval: fleet-first-reconcile-speed-4
+
+Ruling `census-ruling-fleet-first-reconcile-speed-4`. The independent reviewer approves or rejects every change below, 3 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/host/agent.go` `fastConvergeLoop` | body | unchanged (1) | Arming order only (fleet first reconcile Task 4). The moves hold view, the offline view, the restart seed, the sidecar wake seed, the runs boot pass, the arming schedule converge and the arming systemLeg.observe are no longer called here: fastBoot.start runs them (views on this goroutine, then the first tick at once with the seeds beside it). The restart legs, the sidecar wake leg closure (same reg.List + sidecarWakeLeg) and newSystemLeg are built here as before and handed to fastBoot, which gives them to fastDeps once the seeds return, before the second tick. The first tick no longer waits for a tick's sleep. Same calls with the same arguments and keys; no read added; read sites unchanged (1). Agent, not root. |
+| `internal/host/restart.go` `restartSeed` | body | unchanged (1) | List-error log line moved into logRestartListError (same text); body otherwise unchanged (reg.List then restartBaseline). Doc comment notes fastBoot runs restartBaseline over the arming route list. No read added; agent, not root. |
+| `internal/host/sidecarwake.go` `sidecarWakeSeed` | body | unchanged (1) | Body split: reg.List, then sidecarWakeBaseline (the former rest of the body, unchanged); list-error log line moved into logSidecarWakeListError (same text). No read added; agent, not root. |
+
+Envelopes re-pinned: `internal/host`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/host/agent.go` `fastConvergeLoop`: authority, task B3. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): every pass context carries the box's lifetime judge (provision.WithLifetimes) and the reconcile config is boxProvisionConfig's; read sites unchanged, offsets moved; B3 authority retained;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 12: its pass config is now BoxProvisionConfig(reg, os.Getenv, judge, configure) (BoxProvisionConfig replaces boxProvisionConfig: the hub predicate hubArmed and, on the hub, ReconcileConfig.FleetOwners from hubFleetOwners); a call, no read site; read sites unchanged (2); B3 authority retained.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: wire the coordinator's nonblocking SignalTick to the existing fast tick. No new timer, polling read or authority.;rev3=census-ruling-region-ha-p3b;basis=Bind systemLeg to the existing cached reader fold and handle a nil leg on groups; names-2 rollback gate runs before artifact/request/marker work. Agent-memory evidence only, no new direct or cloud read and no autonomous group update.;rev3=census-ruling-restart-new-box-gap;basis=restart leg closure moved into armRestartLegs (same reg.List + restartRequestLeg); also wires restartGain; read moved, not added;rev3=census-ruling-agent-start-demo-3;basis=Attach the moved reader to the existing shared change watch and advertise that reader as armed. Census read-site delta: unchanged (2).;rev3=census-ruling-fleet-first-reconcile-speed;basis=Startup timing log lines only (fleet first reconcile Task 1). Logs its entry offset and one line per arming step, then times the first tick. restartSeed, sidecarWakeSeed, refreshMovesHolds, refreshOfflineView and the one arming systemLeg.observe now read through countStore(store), a pass-through wrapper that counts and times each call and forwards it unchanged with the same key; for that observe, systemLeg.store is swapped to the wrapper and restored. For the first tick only, d.store is a fresh countStore(store) wrapper and d.startup a step logger; both are reset to the plain store and nil after the tick. passLegs gets startup. Same calls in the same order, no read added; read sites unchanged (1). Agent, not root.
+- `internal/host/restart.go` `restartSeed`: authority, task E1,E3,J1,J4. Basis: fix1-merge-review;basis=Baselines both request logs without applying historical ordinary restarts; signed retry grants remain independently verified.;rev3=census-ruling-restart-new-box-gap;basis=body split: list routes then restartBaseline (the former body, unchanged); the route reads move with it
+- `internal/host/sidecarwake.go` `sidecarWakeSeed`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `internal/host/fastboot.go:fastBoot.seed`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen
+- new `internal/host/fastboot.go:fastBoot.start`: reads +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/host/sidecarwake.go:sidecarWakeBaseline`: reads +whole:Route; written legacy, accepted-legacy, frozen
+
+Seal: `9206205b2a3bf27b8b85310f4a44f94ef0c5886d85d6e55dbf2f22e073a8af11` → `e82eba6df923f7baa2d14517be12b71a67e641d136f1b7acc1bb50df9107814e`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-fleet-first-reconcile-speed-4.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/agent.go b/internal/host/agent.go
index c1e2d5ae6..70934a071 100644
--- a/internal/host/agent.go
+++ b/internal/host/agent.go
@@ -3701,12 +3701,14 @@ func (d *fastDeps) indexTick(ctx context.Context, now time.Time, obs map[string]
// its new binary, not wait for hibernation. Nil is fine.
//
// Thin and untested by convention, like adoptLoop/statusLoop — the tick's
-// whole decision lives in fastTick/fastMembers, which are tested.
+// whole decision lives in fastTick/fastMembers, and the order it arms in
+// lives in fastBoot, which are tested.
func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *scheduleDeps, writes hostwrite.Config, serialNotify chan<- struct{}, bs *buildStates, judge *provision.LifetimeJudge, configure ...func(*provision.ReconcileConfig)) {
// Startup timing (startuptiming.go): every step before the loop arms,
- // the first tick and the first full pass each get a line. The seeds
- // read through a counting wrapper (seedStore); what is kept for the
- // loop's life holds the plain store.
+ // the first tick, the seeds beside it and the first full pass each get
+ // a line. The arming views read through a counting wrapper (viewStore),
+ // the seeds through one of their own; what is kept for the loop's life
+ // holds the plain store.
startup := newStartupLog()
startup.at("fast converge loop entered")
arming := startup.steps("arming: ", nil)
@@ -3717,9 +3719,9 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu
declinedHoldsStay("no deploy store")
return // adoptLoop already logged this
}
- seedStore, seedOps := countStore(store)
+ viewStore, viewOps := countStore(store)
arming.done("deploy store")
- arming.count(seedOps)
+ arming.count(viewOps)
pub, err := release.ParsePublicKey(os.Getenv("CARLOS_RELEASE_PUBKEY"), "CARLOS_RELEASE_PUBKEY")
if err != nil {
declinedHoldsStay("no release key")
@@ -3757,7 +3759,7 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu
d.mintLeg = (&mintAsker{reg: reg, store: store, sys: systemdUnits{}, optDir: optDir,
policyPath: release.ProofPolicyPath, request: mintRequester(dd), now: time.Now}).tick
// The restart check's memory (issue #113, narrowed requests added by
- // discussion #16), seeded ONCE here — two reads per app at arming (the
+ // discussion #16), seeded ONCE at arming (fastBoot) — two reads per app (the
// app-wide generation and the narrowed request log) and never again except
// on a serial move or for an app the box gains later (restartGainSeed),
// which is what keeps an idle box at exactly one serial GET per tick. See restartSeed for why the baseline cannot wait for the
@@ -3783,49 +3785,20 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu
})
}
arming.done("held holds")
- restartSeed(ctx, reg, seedStore, dd, restartMem)
- arming.done("restart seed")
// The seed alone is not enough on a fresh box: its agent arms before
// reconcile has minted a route, so the seed sees no apps, and the leg
// runs only on a serial move. The gain hook baselines each app as its
// first route appears (restartGainSeed), so the first `carlos restart`
// after a replacement box comes up is acted on, not taken as the
- // baseline.
+ // baseline. Built here, handed to the loop by fastBoot once the seed
+ // has run.
restartGain, restartLeg := armRestartLegs(reg, store, dd, restartMem, bounceFn(svc), wakeFn(svc))
- arming.done("restart legs")
// The sidecar wake leg's own memory, seeded the same way and for the
// same reason: one silent read per served sidecar at arming so the
// FIRST wake request after a boot is acted on rather than swallowed as
// the baseline (sidecarWakeSeed's own doc comment).
sidecarWakeMem := newSidecarWakeMemory(writes.Enabled)
- sidecarWakeSeed(ctx, reg, seedStore, sidecarWakeMem)
sidecarWake := wakeFn(svc)
- arming.done("sidecar wake seed")
- // The moves hold view, built before the converge below: that converge
- // runs before the first moves pass, and an unbuilt view freezes every
- // host (moves spec §9.4). Nothing with the Phase 1 switch off.
- refreshMovesHolds(ctx, seedStore)
- arming.done("moves holds")
- // The offline keep view, likewise before any reconcile pass: once it is
- // read, keep answers false for every host with no offline move, so the
- // first pass removes what it always has (movesoffline.go).
- refreshOfflineView(ctx, seedStore, armedOfflineView())
- arming.done("offline view")
- // carlos run's boot pass (run spec §5.2, index item 2): reconcile's
- // first pass is a minute away and the CLI expires a run at 60 s.
- runRunsBootPass(ctx)
- arming.done("runs boot pass")
- // The schedule converge's own seed, on restartSeed's precedent and for the
- // same shape of reason: the leg below runs only on a serial MOVE, so
- // without one pass here a box that booted after the bump would carry no
- // timer rows (and report no status) until the hourly floor in adoptLoop —
- // up to an hour of a schedule silently not running. It also seeds the
- // converger's etag memory, which is what makes a run signal older than this
- // process read as history rather than as a fresh request to run.
- if err := sd.converge(ctx); err != nil {
- log.Printf("agent: schedule converge (start): %v", err)
- }
- arming.done("schedule converge")
d.restart = restart
d.passOpts = opts
// The scheduler's pass with CARLOS_SWAP=overlap armed, nothing while
@@ -3859,17 +3832,13 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu
// (spec §5). Built here, after RunAgent armed the index.
d.canaryGate = newChangeGate()
}
- // The restart leg: this process's own children bounced here, everything
- // unit-shaped relayed to a root pass. Deliberately NOT inside fullPass
- // above — see fastTick's comment for both reasons.
- d.restartLeg = restartLeg
- d.restartGain = restartGain
// The sidecar wake leg: apps/<acct>/<app>/sidecar-wake/<name>.json
- // (release.SidecarWakeKey) compared and dispatched here, riding the
- // same serial move as the restart leg immediately above it — see
- // fastTick's comment for why both must run after fullPass and on a
- // box with no CARLOS_SECRETS_KEY.
- d.wakeLeg = func(ctx context.Context) {
+ // (release.SidecarWakeKey) compared and dispatched on a serial move,
+ // riding the same move as the restart leg — see fastTick's comment for
+ // why both must run after fullPass and on a box with no
+ // CARLOS_SECRETS_KEY. The restart leg is deliberately NOT inside
+ // fullPass either (fastTick's comment). fastBoot hands both to the loop.
+ wakeLeg := func(ctx context.Context) {
routes, err := reg.List()
if err != nil {
log.Printf("agent: sidecar wake check: list routes: %v", err)
@@ -3879,7 +3848,8 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu
}
// The schedule leg: converge this box's timer rows from the apps'
// declarations. Nil when the box has no scheduled work armed, which
- // fastTick tolerates.
+ // fastTick tolerates. It rides a serial move only, so the first tick
+ // never runs it; the converger's own seed is fastBoot's.
d.scheduleLeg = scheduleLegFor(sd)
// The layout leg: this box's label is the one its status publishes
// under, which is the label an operator scopes a layout request to.
@@ -3890,39 +3860,45 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu
// ever fetches into /data and writes a request. It lives here rather than
// in a loop of its own because the spread deadline needs a seconds
// cadence to run down on, and this is the loop that already has one.
+ // One observe at arming (fastBoot's seeds), on restartSeed's precedent:
+ // the leg only re-observes on a serial move or at its hourly floor, so a
+ // box that (re)starts under an already-promoted pointer would otherwise
+ // sit on the old build for up to an hour with nobody to bump the serial.
+ // observe handles "no pointer" itself, which is every deployment before
+ // its first `carlos system update`.
+ system := newSystemLeg(store, pub, os.Getenv, dd, optDir)
+ if system != nil {
+ system.readers = cachedGroupReaders
+ }
arming.done("loop wiring")
- d.systemLeg = newSystemLeg(store, pub, os.Getenv, dd, optDir)
- if d.systemLeg != nil {
- d.systemLeg.readers = cachedGroupReaders
- // One observe at arming, on restartSeed's precedent: the leg below only
- // re-observes on a serial move or at its hourly floor, so a box that
- // (re)starts under an already-promoted pointer would otherwise sit on the
- // old build for up to an hour with nobody to bump the serial. observe
- // handles "no pointer" itself, which is every deployment before its first
- // `carlos system update`. Read through the counting wrapper for
- // this one observe only.
- d.systemLeg.store = seedStore
- d.systemLeg.observe(ctx)
- d.systemLeg.store = store
- }
- arming.done("system pointer")
- arming.total("total")
- log.Printf("agent: fast converge loop armed (2s + jitter: serial poll + canary/* + unstaged routes + system pointer)")
- first := true
- for {
- time.Sleep(fastTickEvery + rand.N(time.Second))
- if !first {
- fastTick(ctx, d, time.Now())
- continue
- }
+ // The views, then the first tick at once with the seeds beside it
+ // (fastBoot, which says why each seed's promise holds in that order).
+ // The first tick runs the boot full pass requestBootFullPass asked for,
+ // so on a fleet box the routes a stopped box missed are minted without
+ // waiting for every seed and a tick's sleep. The seeds read through
+ // their own counting store, so their lines and the views' stay apart.
+ seedsStore, seedsOps := countStore(store)
+ boot := &fastBoot{reg: reg, viewStore: viewStore, seedStore: seedsStore, dd: dd, sd: sd,
+ restartMem: restartMem, wakeMem: sidecarWakeMem, system: system,
+ restartGain: restartGain, restartLeg: restartLeg, wakeLeg: wakeLeg,
+ arming: arming, log: startup, seedOps: seedsOps}
+ ready := boot.start(ctx, d, func() {
+ arming.total("total")
+ log.Printf("agent: fast converge loop armed (2s + jitter: serial poll + canary/* + unstaged routes + system pointer)")
// The first tick, timed part by part, its own reads counted.
- first = false
- arming.done("first tick wait")
tickStore, tickOps := countStore(store)
d.store, d.startup = tickStore, startup.steps("first tick: ", tickOps)
fastTick(ctx, d, time.Now())
d.startup.total("total")
d.store, d.startup = store, nil
+ })
+ for {
+ time.Sleep(fastTickEvery + rand.N(time.Second))
+ if ready != nil {
+ ready() // the seeds' legs, before any tick that could act on a serial move
+ ready = nil
+ }
+ fastTick(ctx, d, time.Now())
}
}
diff --git a/internal/host/fastboot.go b/internal/host/fastboot.go
new file mode 100644
index 000000000..f3ccc61ef
--- /dev/null
+++ b/internal/host/fastboot.go
@@ -0,0 +1,165 @@
+package host
+
+import (
+ "context"
+ "log"
+ "sync"
+ "time"
+
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// fastBoot is the start of fastConvergeLoop, in the order the first full
+// pass needs (fleet first reconcile, Task 4). The loop's first tick runs the
+// boot full pass (requestBootFullPass), and on a fleet box that pass mints
+// the routes a stopped box missed, so it runs as soon as what it reads is
+// built:
+//
+// 1. The views, on the loop's goroutine: the moves hold view, then the
+// offline keep view. An unbuilt hold view freezes every host (moves spec
+// §9.4), and keep answers false only once the offline view has read a
+// listing (movesoffline.go), so no pass starts before both have returned.
+// 2. The first tick, at once rather than after a tick's sleep, on the loop's
+// goroutine like every tick. Beside it, on a goroutine of their own, the
+// seeds, in their old order: restart, sidecar wake, the runs boot pass,
+// the schedule converge, the system pointer. The first tick reads none
+// of what they write.
+// 3. ready, which the loop calls before its second tick, on the loop's
+// goroutine: it waits for the seeds, runs one runs pass for what the
+// first tick noted, and only then hands the loop the legs that read the
+// seeds' memories.
+//
+// Why each seed's promise still holds:
+//
+// - The restart, sidecar wake and schedule legs act only on a serial MOVE.
+// The first tick cannot act on one: its first good serial read only seeds
+// lastSerial (fastTick). ready runs before the second tick, so every
+// baseline exists before the first move is acted on. The two legs that
+// run on every tick and read seeded memory, restartGain and the system
+// leg's tick, are left off the first tick for the same reason.
+// - Both baselines are taken over the route list read here, before the
+// first pass, never over what that pass leaves. A sidecar the pass mints
+// with a wake already standing at it is the create-then-wake flow, and is
+// woken on the next move (sidecarWakeChanges), not recorded as history.
+// An app the pass mints is gained on the second tick (restartGainSeed),
+// as an app minted after arming always was: its baseline, not a request.
+// - The schedule converger and the runs worker already take calls from
+// more than one goroutine and order them themselves: Converger.Pass holds
+// its mutex for the whole pass, and a runs pass that starts before the
+// runs boot pass has finished acts on nothing and keeps reconcile's notes
+// (runsWorker.booted), which ready then takes. Both still start after the
+// views, as before: the converger reads the hold view (Converger.Frozen).
+type fastBoot struct {
+ reg *registry.Registry
+ viewStore release.Store // the views' reads
+ seedStore release.Store // the seeds' reads
+ dd string
+ sd *scheduleDeps
+ restartMem *restartMemory
+ wakeMem *sidecarWakeMemory
+ system *systemLeg // nil: not armed
+
+ // The legs ready hands the loop once the seeds have returned.
+ restartGain func(ctx context.Context, now time.Time)
+ restartLeg func(ctx context.Context)
+ wakeLeg func(ctx context.Context)
+
+ arming *startupSteps // the loop goroutine's arming lines; nil in tests
+ log *startupLog // nil in tests
+ seedOps *storeCounter // seedStore's counter, or nil
+}
+
+// The boot steps, production by default. Tests replace them to hold one
+// step on a barrier or to record the order the steps ran in.
+var (
+ bootMovesHolds = refreshMovesHolds
+ bootOfflineView = func(ctx context.Context, s release.Store) { refreshOfflineView(ctx, s, armedOfflineView()) }
+ bootRestartSeed = restartBaseline
+ bootWakeSeed = sidecarWakeBaseline
+ bootRunsPass = runRunsBootPass
+ bootRunsNotes = runRunsPass
+ bootSchedule = func(ctx context.Context, sd *scheduleDeps) error { return sd.converge(ctx) }
+ bootSystem = func(ctx context.Context, l *systemLeg) { l.observe(ctx) }
+)
+
+// start builds the views, then runs first (the loop's first tick) with the
+// seeds beside it, and returns ready. The loop calls ready before its second
+// tick, and before any other tick: it is what hands the loop the seeded legs.
+func (b *fastBoot) start(ctx context.Context, d *fastDeps, first func()) (ready func()) {
+ bootMovesHolds(ctx, b.viewStore)
+ b.arming.done("moves holds")
+ bootOfflineView(ctx, b.viewStore)
+ b.arming.done("offline view")
+ // The routes the box serves now, before the first pass mints anything:
+ // the baselines are taken over this list (fastBoot's comment).
+ routes, listErr := b.reg.List()
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ b.seed(ctx, routes, listErr)
+ }()
+ first()
+ var once sync.Once
+ return func() {
+ once.Do(func() {
+ wait := b.log.steps("seeds: ", nil)
+ <-done
+ wait.done("second tick wait")
+ // The first tick's runs pass may have run before the runs boot
+ // pass had finished, and then acted on nothing: a run queued after
+ // the boot pass read the records waits in the notes. This pass
+ // acts on them now, rather than at the next full pass.
+ bootRunsNotes(ctx)
+ wait.done("runs notes")
+ d.restartGain, d.restartLeg, d.wakeLeg, d.systemLeg = b.restartGain, b.restartLeg, b.wakeLeg, b.system
+ })
+ }
+}
+
+// seed runs the seeds, in order, over routes (the list read at arming; nil
+// with listErr when it could not be read). Its own goroutine: it touches
+// nothing the loop reads until ready has waited for it.
+func (b *fastBoot) seed(ctx context.Context, routes []registry.Route, listErr error) {
+ steps := b.log.steps("seeds: ", b.seedOps)
+ if listErr != nil {
+ logRestartListError(listErr)
+ } else {
+ bootRestartSeed(ctx, routes, b.seedStore, b.dd, b.restartMem)
+ }
+ steps.done("restart seed")
+ // An unread list leaves the wake memory unseeded on purpose
+ // (sidecarWakeSeed): the first leg pass is then the baseline.
+ if listErr != nil {
+ logSidecarWakeListError(listErr)
+ } else {
+ bootWakeSeed(ctx, routes, b.seedStore, b.wakeMem)
+ }
+ steps.done("sidecar wake seed")
+ // carlos run's boot pass (run spec §5.2, index item 2): it must not wait
+ // for a reconcile pass on a box whose first one is a minute away, since
+ // the CLI expires a run at 60 s. A runs pass that starts before it has
+ // finished does nothing and keeps reconcile's notes (runsWorker.booted);
+ // ready runs one more pass for the notes the first tick left.
+ bootRunsPass(ctx)
+ steps.done("runs boot pass")
+ // The schedule converge's own seed, on restartSeed's precedent: the leg
+ // runs only on a serial MOVE, so without one pass here a box that booted
+ // after the bump would carry no timer rows (and report no status) until
+ // the hourly floor in adoptLoop. It also seeds the converger's etag
+ // memory, which is what makes a run signal older than this process read
+ // as history rather than as a fresh request to run.
+ if err := bootSchedule(ctx, b.sd); err != nil {
+ log.Printf("agent: schedule converge (start): %v", err)
+ }
+ steps.done("schedule converge")
+ if b.system != nil {
+ // Read through the seeds' counting store for this one observe only.
+ plain := b.system.store
+ b.system.store = b.seedStore
+ bootSystem(ctx, b.system)
+ b.system.store = plain
+ }
+ steps.done("system pointer")
+ steps.total("total")
+}
diff --git a/internal/host/fastboot_test.go b/internal/host/fastboot_test.go
new file mode 100644
index 000000000..263ef3e0d
--- /dev/null
+++ b/internal/host/fastboot_test.go
@@ -0,0 +1,369 @@
+package host
+
+import (
+ "context"
+ "go/ast"
+ "go/parser"
+ "go/token"
+ "slices"
+ "sync"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// bootFailAfter bounds a wait that only a regression would make long. It
+// never paces a passing run.
+const bootFailAfter = 10 * time.Second
+
+// swapBootSteps replaces every boot step with a no-op for the test's life,
+// so a test arms only the steps it names.
+func swapBootSteps(t *testing.T) {
+ t.Helper()
+ holds, offline, restart, wake, runs, notes, sched, system := bootMovesHolds, bootOfflineView, bootRestartSeed, bootWakeSeed, bootRunsPass, bootRunsNotes, bootSchedule, bootSystem
+ t.Cleanup(func() {
+ bootMovesHolds, bootOfflineView, bootRestartSeed, bootWakeSeed, bootRunsPass, bootRunsNotes, bootSchedule, bootSystem = holds, offline, restart, wake, runs, notes, sched, system
+ })
+ bootMovesHolds = func(context.Context, release.Store) {}
+ bootOfflineView = func(context.Context, release.Store) {}
+ bootRestartSeed = func(context.Context, []registry.Route, release.Store, string, *restartMemory) {}
+ bootWakeSeed = func(context.Context, []registry.Route, release.Store, *sidecarWakeMemory) {}
+ bootRunsPass = func(context.Context) {}
+ bootRunsNotes = func(context.Context) {}
+ bootSchedule = func(context.Context, *scheduleDeps) error { return nil }
+ bootSystem = func(context.Context, *systemLeg) {}
+}
+
+// bootFixture is a fastBoot over the fast fixture, with the boot full pass
+// requested as requestBootFullPass requests it on a fleet box.
+func bootFixture(t *testing.T, f *fastFixture, fullPass func()) (*fastDeps, *fastBoot) {
+ t.Helper()
+ d := f.deps(fullPass)
+ due := &atomic.Bool{}
+ requestBootFullPass(nil, due)
+ d.fullDue = due
+ mem := newRestartMemory()
+ gain, leg := armRestartLegs(f.reg, f.store, f.dataDir, mem, nil, nil)
+ b := &fastBoot{
+ reg: f.reg, viewStore: f.store, seedStore: f.store, dd: f.dataDir,
+ restartMem: mem, wakeMem: newSidecarWakeMemory(false),
+ restartGain: gain, restartLeg: leg, wakeLeg: func(context.Context) {},
+ }
+ return d, b
+}
+
+// TestFastBootFirstPassDoesNotWaitForTheSeeds is witness (a): with any one
+// seed held on a barrier, the first tick still runs the boot full pass, and
+// the legs that read the seeds' memories reach the loop only once the seeds
+// have returned.
+func TestFastBootFirstPassDoesNotWaitForTheSeeds(t *testing.T) {
+ for _, seed := range []string{"restart seed", "sidecar wake seed", "runs boot pass", "schedule converge", "system pointer"} {
+ t.Run(seed, func(t *testing.T) {
+ swapBootSteps(t)
+ barrier := make(chan struct{})
+ var once sync.Once
+ unblock := func() { once.Do(func() { close(barrier) }) }
+ hold := func() { <-barrier }
+ switch seed {
+ case "restart seed":
+ bootRestartSeed = func(context.Context, []registry.Route, release.Store, string, *restartMemory) { hold() }
+ case "sidecar wake seed":
+ bootWakeSeed = func(context.Context, []registry.Route, release.Store, *sidecarWakeMemory) { hold() }
+ case "runs boot pass":
+ bootRunsPass = func(context.Context) { hold() }
+ case "schedule converge":
+ bootSchedule = func(context.Context, *scheduleDeps) error { hold(); return nil }
+ case "system pointer":
+ bootSystem = func(context.Context, *systemLeg) { hold() }
+ }
+
+ ctx := context.Background()
+ f := newFastFixture(t)
+ reconciled := make(chan struct{}, 4)
+ d, b := bootFixture(t, f, func() { reconciled <- struct{}{} })
+ b.system = &systemLeg{} // armed; its observe is the swapped step
+ readyc := make(chan func(), 1)
+ go func() { readyc <- b.start(ctx, d, func() { fastTick(ctx, d, time.Unix(1762382167, 0)) }) }()
+ var ready func()
+ // Before the fixture's own cleanups: a failing run leaves start
+ // or the seeds blocked; free them and wait them out first.
+ t.Cleanup(func() {
+ unblock()
+ if ready == nil {
+ ready = <-readyc
+ }
+ ready()
+ })
+
+ select {
+ case <-reconciled:
+ case <-time.After(bootFailAfter):
+ t.Fatalf("the first full pass waited for the %s", seed)
+ }
+ ready = <-readyc
+ if d.restartGain != nil || d.restartLeg != nil || d.wakeLeg != nil || d.systemLeg != nil {
+ t.Fatalf("a leg reading a seed's memory reached the loop while the %s was still running", seed)
+ }
+
+ unblock()
+ ready()
+ if d.restartGain == nil || d.restartLeg == nil || d.wakeLeg == nil || d.systemLeg == nil {
+ t.Fatal("ready returned without handing the loop the seeded legs")
+ }
+ })
+ }
+}
+
+// TestFastBootFirstPassWaitsForTheViews is witness (b): the first full pass
+// starts only after the moves hold view and then the offline keep view have
+// returned, and the schedule converge, which reads the hold view, also
+// starts after them.
+func TestFastBootFirstPassWaitsForTheViews(t *testing.T) {
+ swapBootSteps(t)
+ var mu sync.Mutex
+ var order []string
+ note := func(s string) {
+ mu.Lock()
+ order = append(order, s)
+ mu.Unlock()
+ }
+ bootMovesHolds = func(context.Context, release.Store) { note("holds") }
+ bootOfflineView = func(context.Context, release.Store) { note("offline") }
+ bootSchedule = func(context.Context, *scheduleDeps) error { note("schedule"); return nil }
+
+ ctx := context.Background()
+ f := newFastFixture(t)
+ passes := 0
+ d, b := bootFixture(t, f, func() { passes++; note("reconcile") })
+ ready := b.start(ctx, d, func() { fastTick(ctx, d, time.Unix(1762382167, 0)) })
+ ready()
+
+ at := func(s string) int { return slices.Index(order, s) }
+ if at("holds") < 0 || at("offline") < 0 || at("reconcile") < 0 || at("schedule") < 0 {
+ t.Fatalf("order %v: a step did not run", order)
+ }
+ if !(at("holds") < at("offline") && at("offline") < at("reconcile")) {
+ t.Fatalf("order %v: the first pass started before the views had returned", order)
+ }
+ if at("offline") > at("schedule") {
+ t.Fatalf("order %v: the schedule converge started before the views", order)
+ }
+ if passes != 1 {
+ t.Fatalf("the boot full pass ran %d times at arming, want once", passes)
+ }
+}
+
+// TestFastBootRestartBaselineNeitherReplaysNorSwallows is witness (c),
+// through the production restart seed and legs: a restart request already
+// in the store at boot is not replayed, an app the first pass mints is a
+// baseline rather than a request, and a request written after the seed is
+// acted on at the next serial move. The boot pass runs once, at arming.
+func TestFastBootRestartBaselineNeitherReplaysNorSwallows(t *testing.T) {
+ swapBootSteps(t)
+ bootRestartSeed = restartBaseline
+
+ ctx := context.Background()
+ f := newFastFixture(t)
+ served := execRoute("one.example.com", "bab", "shop")
+ minted := execRoute("two.example.com", "bab", "cafe")
+ if err := f.reg.Upsert(served); err != nil {
+ t.Fatalf("upsert: %v", err)
+ }
+ now := time.Unix(1762382167, 0)
+ // History: a request for the app the box serves, one for the app its
+ // first pass will mint, and the serial bumps behind them.
+ for _, app := range []string{"shop", "cafe"} {
+ if err := release.TouchRestartGen(ctx, f.store, "bab", app); err != nil {
+ t.Fatalf("touch restart gen: %v", err)
+ }
+ }
+ if err := release.BumpSerial(ctx, f.store, now.Add(-time.Minute)); err != nil {
+ t.Fatalf("bump serial: %v", err)
+ }
+
+ passes := 0
+ d, b := bootFixture(t, f, func() {
+ passes++
+ if err := f.reg.Upsert(minted); err != nil {
+ t.Errorf("mint: %v", err)
+ }
+ })
+ var bounced []string
+ b.restartGain, b.restartLeg = armRestartLegs(f.reg, f.store, f.dataDir, b.restartMem,
+ func(h string) bool { bounced = append(bounced, h); return true }, nil)
+
+ ready := b.start(ctx, d, func() { fastTick(ctx, d, now) })
+ ready()
+ fastTick(ctx, d, now.Add(2*time.Second)) // inside the clamp; gains the minted app
+ if passes != 1 {
+ t.Fatalf("the boot full pass ran %d times by the second tick, want once", passes)
+ }
+
+ move := func(at time.Time) {
+ t.Helper()
+ if err := release.BumpSerial(ctx, f.store, at); err != nil {
+ t.Fatalf("bump serial: %v", err)
+ }
+ fastTick(ctx, d, at)
+ }
+ move(now.Add(time.Hour)) // an unrelated move
+ if len(bounced) != 0 {
+ t.Fatalf("bounced %v on the first move: history replayed, or a minted route taken as a request", bounced)
+ }
+
+ if err := release.TouchRestartGen(ctx, f.store, "bab", "shop"); err != nil {
+ t.Fatalf("touch restart gen: %v", err)
+ }
+ move(now.Add(2 * time.Hour))
+ if !slices.Equal(bounced, []string{served.Host}) {
+ t.Fatalf("bounced %v after a request written after the seed, want [%s]", bounced, served.Host)
+ }
+
+ if err := release.TouchRestartGen(ctx, f.store, "bab", "cafe"); err != nil {
+ t.Fatalf("touch restart gen: %v", err)
+ }
+ move(now.Add(3 * time.Hour))
+ if !slices.Equal(bounced, []string{served.Host, minted.Host}) {
+ t.Fatalf("bounced %v after a request for the minted app, want it added", bounced)
+ }
+}
+
+// TestFastBootWakesASidecarTheFirstPassMints: the sidecar wake baseline is
+// taken over the routes the box served when it armed. A sidecar the first
+// pass mints with a wake already standing at it is the create-then-wake flow
+// and is woken on the next move; a sidecar served at arming keeps its wake
+// as history.
+func TestFastBootWakesASidecarTheFirstPassMints(t *testing.T) {
+ swapBootSteps(t)
+ bootWakeSeed = sidecarWakeBaseline
+
+ ctx := context.Background()
+ f := newFastFixture(t)
+ old := wakeSidecarRoute("old.shop.sidecar.internal", "bdm", "shop", "old")
+ bot := wakeSidecarRoute("bot.shop.sidecar.internal", "bdm", "shop", "bot")
+ if err := f.reg.Upsert(old); err != nil {
+ t.Fatalf("upsert: %v", err)
+ }
+ touchSidecarWake(t, ctx, f.store, "bdm", "shop", "old") // history
+ touchSidecarWake(t, ctx, f.store, "bdm", "shop", "bot") // create-then-wake, before the mint
+ now := time.Unix(1762382167, 0)
+ if err := release.BumpSerial(ctx, f.store, now.Add(-time.Minute)); err != nil {
+ t.Fatalf("bump serial: %v", err)
+ }
+
+ d, b := bootFixture(t, f, func() {
+ if err := f.reg.Upsert(bot); err != nil {
+ t.Errorf("mint: %v", err)
+ }
+ })
+ var moved []registry.Route
+ b.wakeLeg = func(ctx context.Context) {
+ routes, err := f.reg.List()
+ if err != nil {
+ t.Errorf("list: %v", err)
+ return
+ }
+ m, _ := sidecarWakeLeg(ctx, routes, f.store, b.wakeMem, nil)
+ moved = append(moved, m...)
+ }
+
+ ready := b.start(ctx, d, func() { fastTick(ctx, d, now) })
+ ready()
+ if err := release.BumpSerial(ctx, f.store, now.Add(time.Hour)); err != nil {
+ t.Fatalf("bump serial: %v", err)
+ }
+ fastTick(ctx, d, now.Add(time.Hour))
+
+ if len(moved) != 1 || moved[0].Host != bot.Host {
+ t.Fatalf("woke %v on the first move, want only the sidecar the first pass minted", moved)
+ }
+}
+
+// TestFastBootActsOnTheRunsTheFirstTickNoted: the first tick's runs pass
+// can start before the runs boot pass has finished, and then acts on
+// nothing (runsWorker.booted) and keeps reconcile's notes. ready runs one
+// more runs pass once the boot pass is done, so those notes are taken now,
+// not at the next full pass.
+func TestFastBootActsOnTheRunsTheFirstTickNoted(t *testing.T) {
+ swapBootSteps(t)
+ ctx := context.Background()
+ f := newFastFixture(t)
+ w := newRunsWorker(f.store, func(string) (*registry.Route, error) { return nil, nil }, nil, t.TempDir(), "box-1", "boot-1")
+ prev := armedRuns.Load()
+ armedRuns.Store(w)
+ t.Cleanup(func() { armedRuns.Store(prev) })
+ barrier := make(chan struct{})
+ bootRunsPass = func(ctx context.Context) { <-barrier; runRunsBootPass(ctx) }
+ bootRunsNotes = runRunsPass
+
+ d, b := bootFixture(t, f, func() {
+ w.note(provision.Record{Host: "one.example.com"}) // reconcile's note
+ runRunsPass(ctx) // the full pass's runs leg
+ })
+ ready := b.start(ctx, d, func() { fastTick(ctx, d, time.Unix(1762382167, 0)) })
+ noted := func() int {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ return len(w.noted)
+ }
+ if n := noted(); n != 1 {
+ t.Fatalf("%d notes after the first tick, want 1 kept: the runs pass acted before the boot pass finished", n)
+ }
+ close(barrier)
+ ready()
+ if n := noted(); n != 0 {
+ t.Fatalf("%d notes left after ready, want 0: the first tick's notes wait for the next full pass", n)
+ }
+}
+
+// TestFastConvergeLoopArmsThroughFastBoot pins the wiring the witnesses
+// above rely on: fastConvergeLoop reaches the views and the seeds only
+// through fastBoot, so their order is the one fastBoot.start keeps.
+func TestFastConvergeLoopArmsThroughFastBoot(t *testing.T) {
+ file, err := parser.ParseFile(token.NewFileSet(), "agent.go", nil, 0)
+ if err != nil {
+ t.Fatal(err)
+ }
+ banned := map[string]bool{
+ "refreshMovesHolds": true, "refreshOfflineView": true, "restartSeed": true, "restartBaseline": true,
+ "sidecarWakeSeed": true, "sidecarWakeBaseline": true, "runRunsBootPass": true,
+ }
+ found, starts := false, 0
+ for _, decl := range file.Decls {
+ fn, ok := decl.(*ast.FuncDecl)
+ if !ok || fn.Name.Name != "fastConvergeLoop" {
+ continue
+ }
+ found = true
+ ast.Inspect(fn.Body, func(n ast.Node) bool {
+ call, ok := n.(*ast.CallExpr)
+ if !ok {
+ return true
+ }
+ switch fun := call.Fun.(type) {
+ case *ast.Ident:
+ if banned[fun.Name] {
+ t.Errorf("fastConvergeLoop calls %s itself; it belongs to fastBoot", fun.Name)
+ }
+ case *ast.SelectorExpr:
+ switch fun.Sel.Name {
+ case "start":
+ starts++
+ case "converge", "observe":
+ t.Errorf("fastConvergeLoop calls .%s itself; the arming one belongs to fastBoot", fun.Sel.Name)
+ }
+ }
+ return true
+ })
+ }
+ if !found {
+ t.Fatal("no fastConvergeLoop in agent.go")
+ }
+ if starts != 1 {
+ t.Fatalf("fastConvergeLoop calls .start %d times, want once (fastBoot.start)", starts)
+ }
+}
diff --git a/internal/host/restart.go b/internal/host/restart.go
index 6d042b7d4..7cb44aa8b 100644
--- a/internal/host/restart.go
+++ b/internal/host/restart.go
@@ -934,15 +934,26 @@ func restartRequestLeg(ctx context.Context, routes []registry.Route, store relea
// narrowed log, is verified and applied here (applyRetries), so one written
// before this agent started is not lost to the baseline. One spent or made
// stale since clears nothing.
+//
+// fastConvergeLoop runs the same sweep (restartBaseline) over the route list
+// it takes at arming, on the seeds' goroutine beside its first tick
+// (fastBoot), and hands the loop the restart legs only once it has
+// returned: the baseline still exists before the first serial move is acted
+// on.
func restartSeed(ctx context.Context, reg *registry.Registry, store release.Store, dd string, mem *restartMemory) {
routes, err := reg.List()
if err != nil {
- log.Printf("agent: restart baseline: list routes: %v (the first request may need a second try)", err)
+ logRestartListError(err)
return
}
restartBaseline(ctx, routes, store, dd, mem)
}
+// logRestartListError is the seed's line for a route list it could not read.
+func logRestartListError(err error) {
+ log.Printf("agent: restart baseline: list routes: %v (the first request may need a second try)", err)
+}
+
// restartBaseline is restartSeed's sweep over a given route set, and every
// rule in restartSeed's comment is this function's: record what every app's
// two objects say, cycle nothing, apply retry grants, and give the root pass
diff --git a/internal/host/sidecarwake.go b/internal/host/sidecarwake.go
index 5893a6953..b024d4dc6 100644
--- a/internal/host/sidecarwake.go
+++ b/internal/host/sidecarwake.go
@@ -265,12 +265,29 @@ func sidecarWakeLeg(ctx context.Context, routes []registry.Route, store release.
// "every sidecar on this box is brand new" and waking the lot. A per-sidecar
// read error is narrower — that one sidecar is left out of the cache and may
// be woken once on its next sighting.
+//
+// fastConvergeLoop takes the route list itself, before its first full pass,
+// and runs sidecarWakeBaseline over it beside that pass (fastBoot): a list
+// taken after the pass would record a sidecar the pass just minted as
+// history, and drop the wake standing at it.
func sidecarWakeSeed(ctx context.Context, reg *registry.Registry, store release.Store, mem *sidecarWakeMemory) {
routes, err := reg.List()
if err != nil {
- log.Printf("agent: sidecar wake baseline: list routes: %v (the first request may need a second try)", err)
+ logSidecarWakeListError(err)
return
}
+ sidecarWakeBaseline(ctx, routes, store, mem)
+}
+
+// logSidecarWakeListError is the seed's line for a route list it could not
+// read, which leaves the memory unseeded.
+func logSidecarWakeListError(err error) {
+ log.Printf("agent: sidecar wake baseline: list routes: %v (the first request may need a second try)", err)
+}
+
+// sidecarWakeBaseline is sidecarWakeSeed's silent pass over a given route
+// list, the one the agent served when it armed.
+func sidecarWakeBaseline(ctx context.Context, routes []registry.Route, store release.Store, mem *sidecarWakeMemory) {
_, readErrs := sidecarWakeChanges(ctx, routes, store, mem)
if len(readErrs) > 0 {
log.Printf("agent: sidecar wake baseline: %d sidecars unreadable: %v", len(readErrs), readErrs[0])
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 241ab02c2..00f61cab3 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -230,3 +230,4 @@ plan14-root-reads-fleet-unrouted-503.tsv 0f148cc5106065040691da81c9705da76b3663f
plan14-root-reads-fleet-unrouted-503-fix1.tsv e8043922abe9911a69ed6f5a9f8ec1d8f1db1aaf0c250f369cadff8ed394b079
plan14-root-reads-omr-run.tsv f82b5e513d7434e1440c13aa4aa8bc06348745749a21593cf453f761ded0781b
plan14-root-reads-fleet-first-reconcile-speed.tsv 9206205b2a3bf27b8b85310f4a44f94ef0c5886d85d6e55dbf2f22e073a8af11
+plan14-root-reads-fleet-first-reconcile-speed-4.tsv e82eba6df923f7baa2d14517be12b71a67e641d136f1b7acc1bb50df9107814e
diff --git a/internal/provision/testdata/plan14-root-reads-fleet-first-reconcile-speed-4.tsv b/internal/provision/testdata/plan14-root-reads-fleet-first-reconcile-speed-4.tsv
new file mode 100644
index 000000000..9d254424c
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-fleet-first-reconcile-speed-4.tsv
@@ -0,0 +1,14 @@
+# Census overlay fleet-first-reconcile-speed-4, written by census-propose (#369). census-ruling-fleet-first-reconcile-speed-4, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-fleet-first-reconcile-speed-4.md.
+# 3 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 3 new dispositions: 0 reads re-frozen at their disposition with the claim, 3 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy b0d342fd85526d360ba5d6b2b31d603800c7b1b6192985679b3e1e64f3cdfd5e internal/host/sidecarwake.go sidecarWakeSeed legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=Body split: reg.List, then sidecarWakeBaseline (the former rest of the body, unchanged); list-error log line moved into logSidecarWakeListError (same text). No read added; agent, not root. whole:Route@226 2ab3e681cf37e2020c89971b0a9ce4da882053b37931308710dfcf2bee81cebc
+@legacy 16afd173acebffd6bf8c97e66f0cd397d13a744f144cff15aabb8ad1019fce91 internal/host/fastboot.go fastBoot.seed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=New: the seeds moved out of fastConvergeLoop, same order: restartBaseline and sidecarWakeBaseline over the arming route snapshot (or the two existing list-error lines), runRunsBootPass, sd.converge, and systemLeg.observe with systemLeg.store swapped to the counting wrapper and restored, all through package func vars defaulting to those functions. Same calls and keys as before; no read added. Agent, not root. whole:Route@216,whole:Route@500 22b0ee458e68a571ed694180c9e980aa2298b743473a2bac8b07e9f37d3a9346
+@legacy 16b9e5cb942d9d670a9bbad7817b24c9f68ab1b3a4f54fb0b0f5db792cbcebd9 internal/host/fastboot.go fastBoot.start legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=New: the arming order moved out of fastConvergeLoop. Calls refreshMovesHolds and refreshOfflineView (through package func vars defaulting to them), one reg.List of this box's registry (the route snapshot the seeds use), starts the seeds goroutine, runs the first tick, returns ready which waits for the seeds, runs runRunsPass once (through bootRunsNotes; the same runs pass every full pass runs, here for notes the first tick kept while the runs boot pass was unfinished) and assigns the seeded legs to fastDeps. No read beyond those the moved calls and that existing runs pass already make. Agent, not root. whole:Route@467 762ff6187a65d46f44cfcc312b376f58818d78cffb911bf08426ff730f295fe1
+@legacy e7e1964bcc5167146f6b0438f36132659cacd1cdd6b23923e6061e172135b9f6 internal/host/sidecarwake.go sidecarWakeBaseline legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=New: the former second half of sidecarWakeSeed over a given route list (sidecarWakeChanges on the box's own routes, read errors logged). The route values come from the caller's reg.List of this box's registry; no new read site. Agent, not root. whole:Route@158 44f8d730300282571787e2d2e7d59c8f8bb0f768045c44864a7860233370636e
+internal/host/agent.go fastConvergeLoop authority B3 rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): every pass context carries the box's lifetime judge (provision.WithLifetimes) and the reconcile config is boxProvisionConfig's; read sites unchanged, offsets moved; B3 authority retained;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 12: its pass config is now BoxProvisionConfig(reg, os.Getenv, judge, configure) (BoxProvisionConfig replaces boxProvisionConfig: the hub predicate hubArmed and, on the hub, ReconcileConfig.FleetOwners from hubFleetOwners); a call, no read site; read sites unchanged (2); B3 authority retained.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: wire the coordinator's nonblocking SignalTick to the existing fast tick. No new timer, polling read or authority.;rev3=census-ruling-region-ha-p3b;basis=Bind systemLeg to the existing cached reader fold and handle a nil leg on groups; names-2 rollback gate runs before artifact/request/marker work. Agent-memory evidence only, no new direct or cloud read and no autonomous group update.;rev3=census-ruling-restart-new-box-gap;basis=restart leg closure moved into armRestartLegs (same reg.List + restartRequestLeg); also wires restartGain; read moved, not added;rev3=census-ruling-agent-start-demo-3;basis=Attach the moved reader to the existing shared change watch and advertise that reader as armed. Census read-site delta: unchanged (2).;rev3=census-ruling-fleet-first-reconcile-speed;basis=Startup timing log lines only (fleet first reconcile Task 1). Logs its entry offset and one line per arming step, then times the first tick. restartSeed, sidecarWakeSeed, refreshMovesHolds, refreshOfflineView and the one arming systemLeg.observe now read through countStore(store), a pass-through wrapper that counts and times each call and forwards it unchanged with the same key; for that observe, systemLeg.store is swapped to the wrapper and restored. For the first tick only, d.store is a fresh countStore(store) wrapper and d.startup a step logger; both are reset to the plain store and nil after the tick. passLegs gets startup. Same calls in the same order, no read added; read sites unchanged (1). Agent, not root.;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=Arming order only (fleet first reconcile Task 4). The moves hold view, the offline view, the restart seed, the sidecar wake seed, the runs boot pass, the arming schedule converge and the arming systemLeg.observe are no longer called here: fastBoot.start runs them (views on this goroutine, then the first tick at once with the seeds beside it). The restart legs, the sidecar wake leg closure (same reg.List + sidecarWakeLeg) and newSystemLeg are built here as before and handed to fastBoot, which gives them to fastDeps once the seeds return, before the second tick. The first tick no longer waits for a tick's sleep. Same calls with the same arguments and keys; no read added; read sites unchanged (1). Agent, not root. whole:Route@7828 305f82326c431fb0fcb7dc4d66a94dee5bb46107ec935dafbc456407fcd53627
+internal/host/restart.go restartSeed authority E1,E3,J1,J4 fix1-merge-review;basis=Baselines both request logs without applying historical ordinary restarts; signed retry grants remain independently verified.;rev3=census-ruling-restart-new-box-gap;basis=body split: list routes then restartBaseline (the former body, unchanged); the route reads move with it;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=List-error log line moved into logRestartListError (same text); body otherwise unchanged (reg.List then restartBaseline). Doc comment notes fastBoot runs restartBaseline over the arming route list. No read added; agent, not root. whole:Route@221 5ee75ad73f3e2ed1d0ef3f3cd4c87c5b055cd9488e0e5a891f865079ebc97a40
+internal/host/sidecarwake.go sidecarWakeSeed legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=Body split: reg.List, then sidecarWakeBaseline (the former rest of the body, unchanged); list-error log line moved into logSidecarWakeListError (same text). No read added; agent, not root. whole:Route@226 2ab3e681cf37e2020c89971b0a9ce4da882053b37931308710dfcf2bee81cebc
+internal/host/fastboot.go fastBoot.seed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=New: the seeds moved out of fastConvergeLoop, same order: restartBaseline and sidecarWakeBaseline over the arming route snapshot (or the two existing list-error lines), runRunsBootPass, sd.converge, and systemLeg.observe with systemLeg.store swapped to the counting wrapper and restored, all through package func vars defaulting to those functions. Same calls and keys as before; no read added. Agent, not root. whole:Route@216,whole:Route@500 22b0ee458e68a571ed694180c9e980aa2298b743473a2bac8b07e9f37d3a9346
+internal/host/fastboot.go fastBoot.start legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=New: the arming order moved out of fastConvergeLoop. Calls refreshMovesHolds and refreshOfflineView (through package func vars defaulting to them), one reg.List of this box's registry (the route snapshot the seeds use), starts the seeds goroutine, runs the first tick, returns ready which waits for the seeds, runs runRunsPass once (through bootRunsNotes; the same runs pass every full pass runs, here for notes the first tick kept while the runs boot pass was unfinished) and assigns the seeded legs to fastDeps. No read beyond those the moved calls and that existing runs pass already make. Agent, not root. whole:Route@467 762ff6187a65d46f44cfcc312b376f58818d78cffb911bf08426ff730f295fe1
+internal/host/sidecarwake.go sidecarWakeBaseline legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-first-reconcile-speed-4;basis=New: the former second half of sidecarWakeSeed over a given route list (sidecarWakeChanges on the box's own routes, read errors logged). The route values come from the caller's reg.List of this box's registry; no new read site. Agent, not root. whole:Route@158 44f8d730300282571787e2d2e7d59c8f8bb0f768045c44864a7860233370636e
+@coverage internal/host 4df5538380d525506ce4a81aea909a5d2434e2342102726f55c0875e73f0944d