Merge origin/main into agent-start-demo-3
Resolve the census chain by taking main's chain (restart-new-box-gap) and regenerating this branch's overlay last. Only agent.go fastTick and the host envelope re-freeze for main's body change.
docs/superpowers/notes/census-proposal-agent-start-demo-3.md+4 −4docs/superpowers/notes/census-proposal-restart-new-box-gap.md+29 −0internal/host/agent.go+24 −12internal/host/restart.go+163 −2internal/host/restartgain_test.go+338 −0internal/host/restartscope.go+6 −1internal/provision/testdata/plan14-root-reads-agent-start-demo-3.tsv+4 −4internal/provision/testdata/plan14-root-reads-chain.tsv+2 −1internal/provision/testdata/plan14-root-reads-restart-new-box-gap.tsv+14 −0
CI passed — run details
Intent
<task-notification> <task-id>bx21uql8s</task-id> <tool-use-id>toolu_01E4Vn7STbu1uX7Q5dRNDgY2</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/bx21uql8s.output</output-file> <status>completed</status> <summary>Background command "S=/home/paulca/.cache/tmp/claude-1001/agent-start-demo-3; until [ -f $S/merge.done ]; do sleep 30; done; tail -1 $S/merge.log" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a5c0e0f9d8d30910d</task-id> <tool-use-id>toolu_01V2vF8EsdM5mwZ5XvKsy8WP</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/a5c0e0f9d8d30910d.output</output-file> <status>completed</status> <summary>Agent "Check merge integration delta" 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>Verdict: READY. I found no P1 or P2 problems in the merge resolution (8a46f17d), and one P3. I read the remerge diff for `internal/console` and `internal/edge`, and main's alias code in `internal/edge/demo_api.go` and `internal/console/demo_api_origin.go`. I checked how the client IP is chosen, how `sameOrigin` works, and what the four claim handlers read. **(1) Direct requests to the console.** These can't fake their way past the IP limits or the origin rules. - **Untrusted callers:** if the caller is not a trusted proxy, `requireDemoAPIProof` passes the request through, but `clientIP` then ignores `X-Forwarded-For` and keys the send, guess and new-person limits on the caller's own address. - **Trusted callers:** if the caller is a trusted proxy and the site alias is configured, the request needs all of the following, or it gets a 503 before any credential read or budget spend: - the console's Host; - exactly one canonical `X-Forwarded-For` value; - exactly one valid proof (`demo_api_origin.go:34-62`). - **Order:** the proof check now runs first in all four handlers (start, verify, select, status), ahead of `demoClaimGate` and `demoClaimOrigin`. - **Faked site Origin:** this gains nothing. A non-browser client can already send no Origin at all and pass. A browser page on the site that calls the console host directly sends `Sec-Fetch-Site: cross-site` or `same-site`, which is refused (`demo_claim_auth.go:46-50`). The new test checks exactly this case. **(2) CSRF.** None of the agent handlers (`handleDemoClaimStart`, `Verify`, `Select`, `Status`, `demoClaimAccountChoice`, `newAppRegionReq`) reads a cookie or session. They are authorised only by the claim token, the flow token and the emailed code. The only cookie in the file is set by the browser email-link page, which is on `/auth/email/link`, not a claim API path. The site Origin is accepted only when it matches exactly. A third-party page carries its own Origin and is refused, and even if it got through, it would have no ambient credential to use. **(3) What the alias forwards.** Only the four exact routes, each with its one method (`edge/demo_api.go:44-52`). The path must be canonical: - `RequestURI` must equal the path; - no `RawPath`, no query, no `ForceQuery`; - `path.Clean` must not change it; - no upgrade requests. HEAD, PUT and OPTIONS, a trailing slash, `/claims/unknown`, `%63laims` and query strings all get a 404. `/demo/claim*` and `/api/box/demo-claims/*` are outside `/api/demo`, so on the site host they fall through to normal site serving and never reach the console proxy. Box callbacks are unchanged. **(4) Passing `Sec-Fetch-Site` through.** This makes the check stricter, not looser. Browsers set the header and page scripts can't change it. Before this change, the filtered proxy dropped it, so the console saw it as empty, which counts as allowed. A cross-site page on either host now arrives as `cross-site` and is refused. Only a request made by a page on the site itself shows up as `same-origin`. **(5) The Bearer flow token on status.** `Authorization` is on the forwarding allowlist and goes through unchanged. Nothing in the edge or console code logs it; the edge only uses it to decide caching, and responses are forced to `no-store, private`. The token travels in the header, and the edge refuses any status request that has a query string. **Finding** - **P3 (allowlist wider than the routes).** `internal/console/demo_claim_auth.go:30-31` accepts the site Origin for any path starting with `/api/demo/claims/`, not just the three routes under it. It's harmless today: only the four registered claim handlers reach this check through that prefix, and the edge forwards only those four routes. But a future handler under that prefix would accept the site Origin without anyone deciding it should. Matching the exact set of paths would close this. **Tests.** I ran `nice go test`, targeted with `-run`: - `internal/console` (`TestDemoClaimAPIOrigin|TestDemoClaimAliasDispatch|TestDemoAPIProofRequired`) passed. - `internal/edge` (`TestDemoAPI`) passed with the `TestDemoAPIAliasBoundary/local_transports` subtest skipped. The sandbox blocks creating the unix socket that subtest needs ("operation not permitted"), so it still needs a run outside the sandbox. I made no edits and changed no git state. READY</result> <usage><subagent_tokens>73288</subagent_tokens><tool_uses>14</tool_uses><duration_ms>186657</duration_ms></usage> </task-notification>
<task-notification> <task-id>bj7otgig8</task-id> <tool-use-id>toolu_01HFmvkA2inPiz5JrUT21zZZ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/bj7otgig8.output</output-file> <status>completed</status> <summary>Background command "sleep 30; until amadan ci status carlos/platform -branch agent-start-demo-3 2>&1 | head -1 | grep -q '8a46f17d.*CI \(passed\|failed\|succeeded\|green\|ok\)'; do sleep 60; amadan ci status carlos/platform -branch agent-start-demo-3 2>&1 | head -1 | grep -q '8a46f17d' || true; done; amadan ci status carlos/platform -branch agent-start-demo-3 2>&1 | head -3" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a89c61bb1e1ad3834</task-id> <tool-use-id>toolu_014GNTngYt1TxGQT8UFbHRq5</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/a89c61bb1e1ad3834.output</output-file> <status>completed</status> <summary>Agent "Census delta recheck" 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>The census delta on agent-start-demo-3 is **APPROVED**, tip reviewed **8a46f17d** (branch side 599ca449, main side 40e1990b). I read the AGENTS.md census section, the branch's in-scope diff `1b764ad6..599ca449`, the merge resolution (`git show --remerge-diff 8a46f17d`), the card, the claims file and the overlay. None of the changes lets root open, run, query or follow anything new from a path or input a tenant, app or box agent can name. No check root relies on is weaker, and every disposition fits its unit's reads. Every change below either keeps or tightens what was approved at 1b764ad6. **Test run.** `nice go test ./internal/provision -run 'TestPlan14RootReadCensus$|TestCensus' -count=1` on the default Go cache: - **Passed:** `TestPlan14RootReadCensus` (overlay leaves the census clean), `TestCensusScopeIsTheRootBinary`, `TestCensusRebaseCarriesDispositions` and the classifier, proposal and claims tests. - **Failed, sandbox only:** 13 fixture tests (`TestCensusRebaseProof*`, `TestCensusScopeGuard`, `TestCensusScopedScan`, `TestCensusRemoval*` and others). They fail with `open /home/paulca/.cache/go-build/...: read-only file system` because the sandbox mounts the cache read-only and these tests build fixture modules into it. They never reached the tree under review. CI or an unsandboxed run should confirm them. **Per unit and envelope:** - **`internal/host/units/carlos-instance-control.service` `external`: approve.** Against main only the `/run/systemd/system` comment changed. Both `StateDirectory=carlos-demo-snapshots` and `StateDirectoryMode=0700` are gone from the shared unit. `ReadWritePaths` and every other directive match main. - **`internal/host/claimunit.go` `claimUnitContent` (body, authority): approve.** The StateDirectory lines are added only when `cfg.demo.BoxMode()` is true, in both the enabled and disabled branches. `cfg.demo` comes from `demo.BoxConfig` over the root-read host unit settings, not from anything a tenant controls. The directory is root-created with mode 0700, and no read is added. On a box without demo config the directory now stays read-only under `ProtectSystem=strict`, which fails closed. - **`internal/host/agent.go` `statusLoop` (legacy): approve.** It adds `DemoClaimSeedReady: os.Getenv("CARLOS_DEMO_CLAIM") == "1"`, an operator environment flag, with no file or registry read. The claim line now matches the code. - **`internal/host/edgesfile.go` `edgesFileCapabilities` (no census unit; host envelope): approve.** - `seeds.DemoClaimCapability` is advertised only when `CARLOS_DEMO_CLAIM=1`. - `democlaim.MovedCapability` additionally needs `demo.ValidDomain(getenv("CARLOS_DEMO_DOMAIN"))`. - Both conditions narrow what is advertised. - **`internal/status/snapshot.go` `CollectBox` (legacy): approve.** The capability list starts empty and gets the claim-seed and moved entries only from their probe flags. That narrows what the heartbeat advertises, with no new read. - **`internal/provision/demo_claim_seed.go` `removeDemoClaimOrphan` (new, accepted-legacy): approve.** It adds `|| row.DBPath != NestedDBPath(cfg.DataDir, row.Host)` to the refusal before any fence, stop or remove. `NestedDBPath` is `filepath.Join(InstanceDir(dataDir, host), host+".db")`. This tightens the earlier prefix check: the later `LocalSeedID(row.DBPath)` and `RemoveLocal(row)` can only reach the path derived from the host. The extra `DBPath ×2` and `Host ×5` reads in the claim match this comparison. - **`internal/registry/demo_claim_seed.go` `CompareSeedGate` and `DeleteSeedRoute` (new): approve.** Both statements keep `kind='instance'` and add `AND kind <> 'forward'`. That is redundant, but it is the explicit fence the registry uses everywhere else. The match only narrows. - **`internal/host/demo_claim_executor.go` `claimRecord`: no net change.** The judged read added in 6ae89653 was reverted in 599ca449, so the code is byte-identical to 1b764ad6, which I approved. It stays on the unjudged `provision.GetRecord`. The permit and its reason are in `internal/console/lifetimes_audit_test.go`, outside census scope. The function only compares the record against signed claim work, and a mismatch refuses. - **`internal/edge/demo_api.go` (merge resolution; edge envelope): approve.** - `demoAPIPath` now also allows POST to `/api/demo/claims`, `/api/demo/claims/verify` and `/api/demo/claims/select`, and GET `/api/demo/claims/status`. These are exact strings, and the canonical-path, no-query and no-upgrade checks still run before them. - The destination is still the operator's `CARLOS_DEMO_API_CONSOLE_ORIGIN`, taken from the upstream snapshot or `ExactHome`. Nothing in the request selects it. - `Sec-Fetch-Site` joins the request-header allowlist. It is a header forwarded to the console, not a root read. - **The merge's other in-scope files are tests only:** `group_names_test.go`, `plan9_b8_census_test.go`, `agent_start_demo_3_census_test.go` and the chain TSV. The record-write inventory now builds on main's `demoAPISiteRouteWriteCensusInventory()`, which is the correct parent. - **Envelopes: approve.** `.`, `internal/activator`, `internal/demo`, `internal/demobuild`, `internal/democlaim`, `internal/edge`, `internal/host`, `internal/host/units`, `internal/instancectl`, `internal/provision`, `internal/registry`, `internal/release`, `internal/seeds`, `internal/status`. Each one is covered by the changes above or by main's own changes. The remaining in-scope edits since 1b764ad6 are `_test.go` files. All of your known items check out. The full card, claims and overlay are: - `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/agent-start-demo-3/docs/superpowers/notes/census-proposal-agent-start-demo-3.md` - `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/agent-start-demo-3/docs/superpowers/notes/census-agent-start-demo-3-claims.md` - `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/agent-start-demo-3/internal/provision/testdata/plan14-root-reads-agent-start-demo-3.tsv` **APPROVED**, tip 8a46f17d.</result> <usage><subagent_tokens>81804</subagent_tokens><tool_uses>20</tool_uses><duration_ms>135229</duration_ms></usage> </task-notification>
<task-notification> <task-id>bg1rgdd10</task-id> <tool-use-id>toolu_01BoJotyKqoRP1Kygkwm4VYZ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/bg1rgdd10.output</output-file> <status>completed</status> <summary>Background command "sleep 60; until ! amadan ci status carlos/platform -branch agent-start-demo-3 2>&1 | head -1 | grep -q 'running\|queued\|pending'; do sleep 60; done; amadan ci status carlos/platform -branch agent-start-demo-3 2>&1 | head -3" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 71.2 g CO₂e (9,102,432 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on agent-start-demo-3, 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-agent-start-demo-3.md b/docs/superpowers/notes/census-proposal-agent-start-demo-3.md| index 5c110750b..6d84cbe27 100644 |
| --- a/docs/superpowers/notes/census-proposal-agent-start-demo-3.md |
| +++ b/docs/superpowers/notes/census-proposal-agent-start-demo-3.md |
| @@ -9,7 +9,7 @@ Ruling `census-ruling-agent-start-demo-3`. The independent reviewer approves or |
| | `internal/edge/demo.go` `Edge.handleDemoRequest` | body | unchanged (5) | Check verified moved notices before route lookup so a purged source can still display its bounded notice. Census read-site delta: unchanged (5). | |
| | `internal/edge/demo.go` `Edge.redirectDemoRequest` | body | unchanged (3) | Serve signed moved notices at the demo redirect entry before redirecting; retain exact-host validation. Census read-site delta: unchanged (3). | |
| | `internal/edge/edge.go` `Edge.Reload` | body | unchanged (87) | Refresh the verified moved snapshot from registry on reload before route-independent serving. Census read-site delta: unchanged (87). | |
| -| `internal/host/agent.go` `fastConvergeLoop` | body | unchanged (2) | Attach the moved reader to the existing shared change watch and advertise that reader as armed. Census read-site delta: unchanged (2). | |
| +| `internal/host/agent.go` `fastConvergeLoop` | body | unchanged (1) | Attach the moved reader to the existing shared change watch and advertise that reader as armed. Census read-site delta: unchanged (2). | |
| | `internal/host/agent.go` `fastTick` | body | unchanged (1) | Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1). | |
| | `internal/host/agent.go` `runAgent` | body | unchanged (9) | Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9). | |
| | `internal/host/agent.go` `statusLoop` | body | unchanged (6) | Report moved capability only when the serving edge reports readiness; report claim-seed support only with CARLOS_DEMO_CLAIM=1. Reads the explicit capability flag from the process environment; no new filesystem or registry read. | |
| @@ -40,8 +40,8 @@ Recorded dispositions, which each change must still satisfy: |
| - `internal/edge/demo.go` `Edge.handleDemoRequest`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:87-109 classifies request authority using the loaded refusal/upstream maps and checks the existing Route binding before protected dispatch. Five whole Route uses; malformed, unknown and expired names receive fixed policy-bearing refusals, never ordinary fallback. No new storage read. |
| - `internal/edge/demo.go` `Edge.redirectDemoRequest`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:87-102 answers a plain-HTTP demo request with a 308 to the same host and path over HTTPS, with demo policy headers, only after the loaded Route, alias and serving checks pass; reads only the already-loaded Route (whole value), never dispatches, counts or opens anything. |
| - `internal/edge/edge.go` `Edge.Reload`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. Fix round 1 M2: comment and whitespace correction only; read sites and routing behavior unchanged.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1175-1177 passes an already-listed demo Route to demoProxy; :1358 passes existing Route and RouteAlias slices to demoRefusalNames; :1401 publishes refusal names before upstreams. Adds whole-value uses only, no new registry query; retained names refuse fallback after filtering.;rev3=census-ruling-demo-api-site-route;basis=Build a dedicated demo API proxy from the selected existing socket, TCP or probed console transport in the same atomic route snapshot, before ordinary wrappers. Reads existing route Host twice, Version and two whole Route values for exact operator-configured console eligibility. No additional registry query or external read. |
| -- `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. |
| -- `internal/host/agent.go` `fastTick`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites. |
| +- `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 |
| +- `internal/host/agent.go` `fastTick`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged |
| - `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority. |
| - `internal/host/agent.go` `statusLoop`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action. |
| - `internal/host/claimunit.go` `claimUnitContent`: authority, task E1,E3. Basis: rev3=PROPOSED-p3;identity=root claim/adoption controller uid 0;basis=adds write permission for exactly the public retry directory only when the root settings reader has verified a complete census and prepared that directory;rev3=census-ruling-agent-start-demo-1;basis=Demo-only ReadWritePaths for instance data/runtime, staged files and root release lock; ordinary rendering unchanged.;rev3=census-ruling-agent-start-demo-1-followups;basis=In demo box mode, declare StateDirectory=carlos-release/private with mode 0700 so systemd creates root-owned release state before namespace setup and keeps it writable. Existing ReadWritePaths and ordinary/claims rendering stay unchanged. No new read site or caller-controlled path. |
| @@ -113,6 +113,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the |
| - reads `internal/registry/registry.go:Registry.Fingerprint`: +file:QueryRow; keeps legacy, task accepted-legacy |
| - reads `internal/registry/registry.go:Registry.SnapshotFingerprint`: +file:QueryRow; keeps legacy, task accepted-legacy |
| -Seal: `c55b4a022b3d42f40a05b727f93e57dc9f76b6dc2251f7d3b777c34d7ffdee09` → `844534b0924c7382eb18539eded63780a5729979d7566f5e63f622af91da67ce`. |
| +Seal: `18e4df5f599a48a881526fc2f85a9b591e3ea8677bb297d5944c9d935771f5e6` → `ebeaa693941f5592cd7bc3458effc2a333a8d12ba4f192a93d0aa32589048939`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-agent-start-demo-3.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/notes/census-proposal-restart-new-box-gap.md b/docs/superpowers/notes/census-proposal-restart-new-box-gap.md| new file mode 100644 |
| index 000000000..9361a7ee9 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-restart-new-box-gap.md |
| @@ -0,0 +1,29 @@ |
| +# Census approval: restart-new-box-gap |
| + |
| +Ruling `census-ruling-restart-new-box-gap`. 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` `fastTick` | body | unchanged (1) | calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged | |
| +| `internal/host/agent.go` `fastConvergeLoop` | sites | -whole:Route | restart leg closure moved into armRestartLegs (same reg.List + restartRequestLeg); also wires restartGain; read moved, not added | |
| +| `internal/host/restart.go` `restartSeed` | sites | -whole:Route ×4 | body split: list routes then restartBaseline (the former body, unchanged); the route reads move with it | |
| + |
| +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` `fastTick`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites. |
| +- `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. |
| +- `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. |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `internal/host/restart.go:armRestartLegs`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen |
| +- new `internal/host/restart.go:restartBaseline`: reads +whole:Route ×5; written legacy, accepted-legacy, frozen |
| +- new `internal/host/restart.go:restartGainSeed`: reads +registry:App, +whole:Route ×7; written legacy, accepted-legacy, frozen |
| + |
| +Seal: `c55b4a022b3d42f40a05b727f93e57dc9f76b6dc2251f7d3b777c34d7ffdee09` → `18e4df5f599a48a881526fc2f85a9b591e3ea8677bb297d5944c9d935771f5e6`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-restart-new-box-gap.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/host/agent.go b/internal/host/agent.go| index cdc54b359..713a605c4 100644 |
| --- a/internal/host/agent.go |
| +++ b/internal/host/agent.go |
| @@ -2654,6 +2654,11 @@ type fastDeps struct { |
| // read returned (canaryHeads). nil: every pointer is read, as before. |
| canaryGate *release.ReadGate |
| canaryHeads map[[3]string]canaryRead // (account, app, channel) -> its group's last good read |
| + |
| + // restartGain baselines, on every tick, the apps this box gained since |
| + // the agent armed (restartGainSeed), so the first restart request after |
| + // a fresh box comes up is acted on. nil = not armed. |
| + restartGain func(ctx context.Context, now time.Time) |
| } |
| // canaryRead is one canary group's last good pointer read: the head it |
| @@ -3109,6 +3114,14 @@ func fastTick(ctx context.Context, d *fastDeps, now time.Time) { |
| log.Printf("agent: demo moved: %v", err) |
| } |
| armedBoxRoleReader.Load().pass(ctx, now) |
| + // Before the serial read, on every tick: an app this box gained since the |
| + // agent armed gets its restart baseline now, while nobody has asked for |
| + // anything, rather than on the serial move that carries the first request |
| + // (restartGainSeed). It reads the store only for an app it has no entry |
| + // for. |
| + if d.restartGain != nil { |
| + d.restartGain(ctx, now) |
| + } |
| fullRan := false |
| doc, _, err := release.ReadSerial(ctx, d.store) |
| switch { |
| @@ -3438,8 +3451,8 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu |
| // The restart check's memory (issue #113, narrowed requests added by |
| // discussion #16), seeded ONCE here — two reads per app at arming (the |
| // app-wide generation and the narrowed request log) and never again except |
| - // on a serial move, which is what keeps an idle box at exactly one serial |
| - // GET per tick. See restartSeed for why the baseline cannot wait for the |
| + // 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 |
| // first request to establish itself. |
| restartMem := newRestartMemory() |
| // `carlos instances retry` (zero-downtime spec §8.4) reaches the rollout |
| @@ -3461,8 +3474,13 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu |
| }) |
| } |
| restartSeed(ctx, reg, store, dd, restartMem) |
| - restartBounce := bounceFn(svc) |
| - restartWake := wakeFn(svc) |
| + // 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. |
| + restartGain, restartLeg := armRestartLegs(reg, store, dd, restartMem, bounceFn(svc), wakeFn(svc)) |
| // 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 |
| @@ -3527,14 +3545,8 @@ func fastConvergeLoop(reg *registry.Registry, svc *activator.Service, sd *schedu |
| // 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 = func(ctx context.Context) { |
| - routes, err := reg.List() |
| - if err != nil { |
| - log.Printf("agent: restart check: list routes: %v", err) |
| - return |
| - } |
| - restartRequestLeg(ctx, routes, store, dd, restartBounce, restartWake, restartMem) |
| - } |
| + 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 |
diff --git a/internal/host/restart.go b/internal/host/restart.go| index aa068d862..6d042b7d4 100644 |
| --- a/internal/host/restart.go |
| +++ b/internal/host/restart.go |
| @@ -50,6 +50,7 @@ import ( |
| "errors" |
| "fmt" |
| "log" |
| + "maps" |
| "os" |
| "path/filepath" |
| "time" |
| @@ -939,11 +940,29 @@ func restartSeed(ctx context.Context, reg *registry.Registry, store release.Stor |
| log.Printf("agent: restart baseline: list routes: %v (the first request may need a second try)", err) |
| return |
| } |
| + restartBaseline(ctx, routes, store, dd, mem) |
| +} |
| + |
| +// 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 |
| +// its baseline (or ask it to complete one). restartGainSeed runs it again, |
| +// later, over just the apps a box gained after arming. |
| +func restartBaseline(ctx context.Context, routes []registry.Route, store release.Store, dd string, mem *restartMemory) { |
| _, readErrs := restartGenPass(ctx, routes, store, mem.gen) |
| // A first sight cycles nothing, but it hands over the retry grants in |
| // both logs: they are not seed-skipped (Astra plan 9), so a grant |
| // written before this agent started, and not yet applied, is applied |
| // now. A grant spent or made stale since clears nothing. |
| + // |
| + // Which apps this pass is FIRST to see is taken before it runs: a |
| + // position the memory already held is not a first sight, even when the |
| + // pass reports its retries as history because that position fell out of |
| + // the log. That case is the restart leg's (Astra fix check, 2026-11-06). |
| + known := make(map[[2]string]bool, len(mem.scope)) |
| + for k := range mem.scope { |
| + known[k] = true |
| + } |
| scoped, scopeErrs := restartScopePass(ctx, routes, store, mem.scope) |
| readErrs = append(readErrs, scopeErrs...) |
| grants, grantErrs := hostRetryPass(ctx, routes, store, mem) |
| @@ -957,7 +976,20 @@ func restartSeed(ctx context.Context, reg *registry.Registry, store release.Stor |
| // A box with nothing that could clear a hold reads every legacy |
| // retry at its start as history, silently, as it always has: its |
| // line would only say, at every start, that nothing is held. |
| - applyRetries(routes, scoped, mem) |
| + // |
| + // First sights only: a baseline hands over what an app it has |
| + // never seen holds. At arming every app is a first sight; |
| + // restartGainSeed's scratch memory carries the positions the |
| + // agent already holds, and anything past one of those (movement, |
| + // or a position lost from the log) is the restart leg's to |
| + // handle, once, on its serial move. |
| + var history []scopedRestart |
| + for _, w := range scoped { |
| + if w.history && !known[w.app] { |
| + history = append(history, w) |
| + } |
| + } |
| + applyRetries(routes, history, mem) |
| } |
| if len(readErrs) > 0 { |
| log.Printf("agent: restart baseline: %d apps unreadable: %v", len(readErrs), readErrs[0]) |
| @@ -978,5 +1010,134 @@ func restartSeed(ctx context.Context, reg *registry.Registry, store release.Stor |
| return |
| } |
| log.Printf("agent: restart baseline: the root pass has no narrowed-restart mark for at least one app on this box " + |
| - "(a marks file written before narrowed restarts existed) — asked for one root pass to record it") |
| + "(a marks file written before narrowed restarts existed, or an app the root pass has not seen yet) — asked for one root pass to record it") |
| +} |
| + |
| +// restartGainRetry is how long restartGainSeed leaves an app alone after one |
| +// of its objects could not be read: long enough that a bucket refusing every |
| +// read costs a few GETs a minute per app rather than a few every tick, short |
| +// enough that a blip is over before anybody types `carlos restart`. |
| +const restartGainRetry = time.Minute |
| + |
| +// restartGainSeed baselines every app this box serves that the agent's memory |
| +// has no entry for yet: the apps whose first route landed AFTER restartSeed |
| +// ran. fastTick runs it on every tick, and on almost every tick it reads |
| +// nothing, because the memory already holds every app in the route set. |
| +// |
| +// The case it exists for is a fresh box. Its agent arms before reconcile has |
| +// minted a single route (the G2 replacement box on dev, 2026-11-05, logged |
| +// "reloaded (0 route(s))" at arming and minted its instance two seconds |
| +// later), so restartSeed sees no apps and records nothing. The restart leg |
| +// runs only on a serial MOVE, so on a quiet fleet the first time that box |
| +// ever reads the app's objects is the move a `carlos restart` makes, and a |
| +// first sight is a seed. The console answered "restart requested", every |
| +// other box cycled, and the new box took the request as its baseline and did |
| +// nothing. Any other serial bump in between closes the gap by luck; a quiet |
| +// fleet leaves it open for as long as it stays quiet. |
| +// |
| +// Seeding when the route appears applies the seed-don't-replay rule at the |
| +// right moment rather than changing it: whatever the objects say when a box |
| +// gains an app is history its freshly started process does not owe anybody, |
| +// and anything recorded after that is movement. A request that lands inside |
| +// the one tick between a route's mint and this sweep is still taken as the |
| +// baseline: the same window restartSeed leaves at boot, now a couple of |
| +// seconds wide instead of open-ended. |
| +// |
| +// The sweep is restartBaseline over the gained apps' routes, into a scratch |
| +// memory, merged back only where the memory has no entry. An entry the |
| +// memory already holds is never overwritten, because a later value there is |
| +// exactly the movement the leg exists to see. An app with an object that did |
| +// not read keeps what did read and is tried again after restartGainRetry. |
| +func restartGainSeed(ctx context.Context, routes []registry.Route, store release.Store, dd string, mem *restartMemory, now time.Time) (seeded int) { |
| + gained := map[[2]string]bool{} |
| + for _, k := range restartApps(routes) { |
| + _, haveGen := mem.gen[k] |
| + _, haveScope := mem.scope[k] |
| + if (haveGen && haveScope) || now.Before(mem.notBefore[k]) { |
| + continue |
| + } |
| + gained[k] = true |
| + } |
| + if len(gained) == 0 { |
| + return 0 |
| + } |
| + var sub []registry.Route |
| + for _, rt := range routes { |
| + if gained[[2]string{release.RouteAccount(rt), rt.App}] { |
| + sub = append(sub, rt) |
| + } |
| + } |
| + // The scratch memory starts from what the agent already holds for these |
| + // apps, so a retry with one half unreadable handles nothing twice: a |
| + // known narrowed position is not a first sight (its legacy retries are |
| + // not handed over again), and host-retry ids already handled stay |
| + // handled. Only an app's missing halves are first sights. |
| + scratch := newRestartMemory() |
| + scratch.retryHost, scratch.pub = mem.retryHost, mem.pub |
| + for k := range gained { |
| + if v, ok := mem.gen[k]; ok { |
| + scratch.gen[k] = v |
| + } |
| + if v, ok := mem.scope[k]; ok { |
| + scratch.scope[k] = v |
| + } |
| + if ids, ok := mem.retries[k]; ok { |
| + scratch.retries[k] = maps.Clone(ids) |
| + } |
| + } |
| + restartBaseline(ctx, sub, store, dd, scratch) |
| + for k := range gained { |
| + gen, genRead := scratch.gen[k] |
| + if _, have := mem.gen[k]; !have && genRead { |
| + mem.gen[k] = gen |
| + } |
| + id, scopeRead := scratch.scope[k] |
| + if _, have := mem.scope[k]; !have && scopeRead { |
| + mem.scope[k] = id |
| + } |
| + if ids, ok := scratch.retries[k]; ok { |
| + if mem.retries[k] == nil { |
| + mem.retries[k] = map[string]bool{} |
| + } |
| + for id := range ids { |
| + mem.retries[k][id] = true |
| + } |
| + } |
| + if !genRead || !scopeRead { |
| + mem.notBefore[k] = now.Add(restartGainRetry) |
| + continue |
| + } |
| + delete(mem.notBefore, k) |
| + seeded++ |
| + } |
| + return seeded |
| +} |
| + |
| +// armRestartLegs builds the agent's two restart hooks over ONE memory: gain, |
| +// which fastTick runs on every tick (restartGainSeed), and leg, which it runs |
| +// on a serial move (restartRequestLeg). The memory is passed in already |
| +// seeded (restartSeed), because fastConvergeLoop arms more than this file |
| +// knows about on it first. fastConvergeLoop takes both hooks from here, and |
| +// so do the tests, so the wiring a test exercises is the wiring production |
| +// runs. |
| +func armRestartLegs(reg *registry.Registry, store release.Store, dd string, mem *restartMemory, |
| + bounce func(host string) bool, wake func(rt registry.Route) error) (gain func(ctx context.Context, now time.Time), leg func(ctx context.Context)) { |
| + gain = func(ctx context.Context, now time.Time) { |
| + routes, err := reg.List() |
| + if err != nil { |
| + return // the leg reports a registry it cannot list; once is enough |
| + } |
| + if n := restartGainSeed(ctx, routes, store, dd, mem, now); n > 0 { |
| + log.Printf("agent: restart baseline: recorded %d app(s) this box gained since arming", n) |
| + } |
| + } |
| + leg = func(ctx context.Context) { |
| + routes, err := reg.List() |
| + if err != nil { |
| + log.Printf("agent: restart check: list routes: %v", err) |
| + return |
| + } |
| + restartRequestLeg(ctx, routes, store, dd, bounce, wake, mem) |
| + } |
| + return gain, leg |
| } |
diff --git a/internal/host/restartgain_test.go b/internal/host/restartgain_test.go| new file mode 100644 |
| index 000000000..be43321a1 |
| --- /dev/null |
| +++ b/internal/host/restartgain_test.go |
| @@ -0,0 +1,338 @@ |
| +package host |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "fmt" |
| + "os" |
| + "path/filepath" |
| + "slices" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/registry" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +// TestFastTickActsOnTheFirstRestartAfterAFreshBoxGainsItsRoute is the G2 |
| +// replacement box on dev (2026-11-05), through the production wiring: |
| +// restartSeed and armRestartLegs exactly as fastConvergeLoop calls them, |
| +// fastTick, a real registry and a real store. |
| +// |
| +// The agent arms with an empty registry, reconcile mints the instance a |
| +// moment later, and the fleet stays quiet: no serial bump until somebody |
| +// types `carlos restart --host`. That bump is the first serial move this box |
| +// has seen, so before the gain seed the restart leg met the app for the first |
| +// time on the very move that carried the request, took the request as its |
| +// baseline, and bounced nothing, while every other box cycled. |
| +func TestFastTickActsOnTheFirstRestartAfterAFreshBoxGainsItsRoute(t *testing.T) { |
| + ctx := context.Background() |
| + f := newFastFixture(t) |
| + dd := f.dataDir |
| + |
| + mem := newRestartMemory() |
| + restartSeed(ctx, f.reg, f.store, dd, mem) // arming: the registry is still empty |
| + var bounced []string |
| + bounce := func(h string) bool { bounced = append(bounced, h); return true } |
| + gain, leg := armRestartLegs(f.reg, f.store, dd, mem, bounce, nil) |
| + d := f.deps(func() {}) |
| + d.restartLeg, d.restartGain = leg, gain |
| + |
| + now := time.Unix(1762382167, 0) |
| + fastTick(ctx, d, now) // seeds the serial |
| + |
| + // Reconcile mints the instance off the serial path, two seconds after arming. |
| + host := "one.example.com" |
| + if err := f.reg.Upsert(execRoute(host, "bab", "shop")); err != nil { |
| + t.Fatalf("upsert: %v", err) |
| + } |
| + for i := 1; i <= 3; i++ { // quiet fleet: ticks, no serial move |
| + fastTick(ctx, d, now.Add(time.Duration(i)*2*time.Second)) |
| + } |
| + |
| + askScoped(t, ctx, f.store, "bab", "shop", release.RestartScopeHost, host) |
| + 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 !slices.Equal(bounced, []string{host}) { |
| + t.Fatalf("bounced %v after the first narrowed restart, want [%s]: the request was taken as the baseline", bounced, host) |
| + } |
| + if _, err := os.Stat(filepath.Join(dd, restartRequestMarker)); err != nil { |
| + t.Fatalf("no root-pass marker after the request: %v", err) |
| + } |
| +} |
| + |
| +// TestFastTickActsOnTheFirstAppWideRestartAfterAFreshBoxGainsItsRoute is the |
| +// same gap through the app-wide signal: `carlos restart --app` on a quiet |
| +// fleet, with a box that gained the app after arming. |
| +func TestFastTickActsOnTheFirstAppWideRestartAfterAFreshBoxGainsItsRoute(t *testing.T) { |
| + ctx := context.Background() |
| + f := newFastFixture(t) |
| + mem := newRestartMemory() |
| + restartSeed(ctx, f.reg, f.store, f.dataDir, mem) |
| + var bounced []string |
| + gain, leg := armRestartLegs(f.reg, f.store, f.dataDir, mem, func(h string) bool { bounced = append(bounced, h); return true }, nil) |
| + d := f.deps(func() {}) |
| + d.restartLeg, d.restartGain = leg, gain |
| + |
| + now := time.Unix(1762382167, 0) |
| + fastTick(ctx, d, now) |
| + if err := f.reg.Upsert(execRoute("one.example.com", "bab", "shop")); err != nil { |
| + t.Fatalf("upsert: %v", err) |
| + } |
| + fastTick(ctx, d, now.Add(2*time.Second)) |
| + |
| + if err := release.TouchRestartGen(ctx, f.store, "bab", "shop"); err != nil { |
| + t.Fatalf("touch restart gen: %v", err) |
| + } |
| + 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 !slices.Equal(bounced, []string{"one.example.com"}) { |
| + t.Fatalf("bounced %v, want the gained app's instance", bounced) |
| + } |
| +} |
| + |
| +// TestRestartGainSeedNeverOverwritesAnEntry: an app the memory already holds |
| +// keeps its entry even when its object has moved since, because that later |
| +// value is the movement the leg exists to see. Only the app with no entry is |
| +// read and recorded. |
| +func TestRestartGainSeedNeverOverwritesAnEntry(t *testing.T) { |
| + ctx, s := genKit(t) |
| + dd := t.TempDir() |
| + known := []registry.Route{execRoute("a.example.com", "bab", "shop")} |
| + mem := newRestartMemory() |
| + restartBaseline(ctx, known, s, dd, mem) |
| + before := mem.gen[[2]string{"bab", "shop"}] |
| + |
| + if err := release.TouchRestartGen(ctx, s, "bab", "shop"); err != nil { |
| + t.Fatalf("touch: %v", err) |
| + } |
| + both := append(known, execRoute("b.example.com", "bab", "cafe")) |
| + if n := restartGainSeed(ctx, both, s, dd, mem, time.Now()); n != 1 { |
| + t.Fatalf("seeded %d apps, want 1 (only the gained one)", n) |
| + } |
| + if got := mem.gen[[2]string{"bab", "shop"}]; got != before { |
| + t.Fatalf("the gain seed overwrote a known app's mark: %q -> %q", before, got) |
| + } |
| + if _, ok := mem.scope[[2]string{"bab", "cafe"}]; !ok { |
| + t.Fatal("the gained app has no narrowed mark") |
| + } |
| + var bounced []string |
| + if !restartRequestLeg(ctx, both, s, dd, func(h string) bool { bounced = append(bounced, h); return true }, nil, mem) { |
| + t.Fatal("the known app's restart was lost") |
| + } |
| + if !slices.Equal(bounced, []string{"a.example.com"}) { |
| + t.Fatalf("bounced %v, want only the app that was asked", bounced) |
| + } |
| +} |
| + |
| +// TestRestartGainSeedReadsNothingAtRest: with every app in memory a tick |
| +// costs no store read, which is what keeps an idle box at one serial GET per |
| +// tick. |
| +func TestRestartGainSeedReadsNothingAtRest(t *testing.T) { |
| + ctx, base := genKit(t) |
| + dd := t.TempDir() |
| + routes := []registry.Route{execRoute("a.example.com", "bab", "shop")} |
| + mem := newRestartMemory() |
| + restartBaseline(ctx, routes, base, dd, mem) |
| + cs := &countingStore{Store: base} |
| + if n := restartGainSeed(ctx, routes, cs, dd, mem, time.Now()); n != 0 { |
| + t.Fatalf("seeded %d apps at rest", n) |
| + } |
| + if len(cs.gets) != 0 { |
| + t.Fatalf("store reads at rest: %v", cs.gets) |
| + } |
| +} |
| + |
| +// TestRestartGainSeedBacksOffAnUnreadableApp: an object that will not read is |
| +// tried again after restartGainRetry, not on every tick, and the half that |
| +// did read is kept. |
| +func TestRestartGainSeedBacksOffAnUnreadableApp(t *testing.T) { |
| + ctx, base := genKit(t) |
| + dd := t.TempDir() |
| + routes := []registry.Route{execRoute("a.example.com", "bab", "shop")} |
| + fs := &failingKeyStore{Store: base, failKey: release.RestartScopeKey("bab", "shop"), err: errors.New("503 slow down")} |
| + cs := &countingStore{Store: fs} |
| + mem := newRestartMemory() |
| + now := time.Now() |
| + k := [2]string{"bab", "shop"} |
| + |
| + if n := restartGainSeed(ctx, routes, cs, dd, mem, now); n != 0 { |
| + t.Fatalf("seeded %d apps with the log unreadable", n) |
| + } |
| + if _, ok := mem.gen[k]; !ok { |
| + t.Fatal("the generation that did read was dropped") |
| + } |
| + if _, ok := mem.scope[k]; ok { |
| + t.Fatal("an unreadable log was recorded") |
| + } |
| + reads := cs.gets[release.RestartScopeKey("bab", "shop")] |
| + restartGainSeed(ctx, routes, cs, dd, mem, now.Add(2*time.Second)) |
| + if got := cs.gets[release.RestartScopeKey("bab", "shop")]; got != reads { |
| + t.Fatalf("retried inside the back-off: %d reads, want %d", got, reads) |
| + } |
| + |
| + fs.failKey = "" |
| + if n := restartGainSeed(ctx, routes, cs, dd, mem, now.Add(restartGainRetry)); n != 1 { |
| + t.Fatalf("seeded %d apps after the back-off, want 1", n) |
| + } |
| + if mem.scope[k] != release.RestartScopeNone { |
| + t.Fatalf("narrowed mark %q, want none", mem.scope[k]) |
| + } |
| +} |
| + |
| +// TestRestartGainSeedKeepsTheHalfItAlreadyHas: an app whose generation was |
| +// recorded and whose request log was not is read again for the log alone. A |
| +// generation that moved in between is a request, and must reach the leg as |
| +// one rather than being re-read into the baseline. |
| +func TestRestartGainSeedKeepsTheHalfItAlreadyHas(t *testing.T) { |
| + ctx, base := genKit(t) |
| + dd := t.TempDir() |
| + routes := []registry.Route{execRoute("a.example.com", "bab", "shop")} |
| + fs := &failingKeyStore{Store: base, failKey: release.RestartScopeKey("bab", "shop"), err: errors.New("503 slow down")} |
| + mem := newRestartMemory() |
| + now := time.Now() |
| + restartGainSeed(ctx, routes, fs, dd, mem, now) // generation recorded, log not |
| + k := [2]string{"bab", "shop"} |
| + before, ok := mem.gen[k] |
| + if !ok { |
| + t.Fatal("no generation mark after the first try") |
| + } |
| + |
| + if err := release.TouchRestartGen(ctx, base, "bab", "shop"); err != nil { |
| + t.Fatalf("touch: %v", err) |
| + } |
| + fs.failKey = "" |
| + if n := restartGainSeed(ctx, routes, fs, dd, mem, now.Add(restartGainRetry)); n != 1 { |
| + t.Fatalf("seeded %d apps, want 1", n) |
| + } |
| + if mem.gen[k] != before { |
| + t.Fatalf("the retry re-read the generation into the baseline: %q -> %q", before, mem.gen[k]) |
| + } |
| + var bounced []string |
| + if !restartRequestLeg(ctx, routes, fs, dd, func(h string) bool { bounced = append(bounced, h); return true }, nil, mem) { |
| + t.Fatal("the app-wide request made between the two tries was lost") |
| + } |
| + if !slices.Equal(bounced, []string{"a.example.com"}) { |
| + t.Fatalf("bounced %v", bounced) |
| + } |
| +} |
| + |
| +// TestRestartGainSeedHandlesEachRetryGrantOnce is Astra round 1's P2, both |
| +// rows: an app whose baseline keeps failing on ONE object is retried every |
| +// restartGainRetry, and each retry must not hand over again the grants an |
| +// earlier attempt already handled, from either log. A grant and a restart |
| +// that land between attempts are still new work: the grant is handled once, |
| +// and the restart reaches the leg. |
| +func TestRestartGainSeedHandlesEachRetryGrantOnce(t *testing.T) { |
| + for _, tc := range []struct { |
| + name string |
| + failKey string |
| + }{ |
| + {"host-retry log, narrowed log unreadable", release.RestartScopeKey("bab", "shop")}, |
| + {"legacy narrowed log, generation unreadable", release.RestartGenKey("bab", "shop")}, |
| + } { |
| + t.Run(tc.name, func(t *testing.T) { |
| + ctx, base := genKit(t) |
| + dd := t.TempDir() |
| + routes := []registry.Route{execRoute("a.example.com", "bab", "shop")} |
| + mem, priv := retryMemory(t) |
| + var retried []string |
| + mem.retryHost = func(h, b, bk string, e uint64) bool { |
| + retried = append(retried, fmt.Sprintf("%s %s %d", h, b, e)) |
| + return false |
| + } |
| + legacy := tc.failKey == release.RestartGenKey("bab", "shop") |
| + if legacy { |
| + legacySignedRetry(t, ctx, base, priv, "bab", "shop", "a.example.com", "v2", "bk", 5) |
| + } else { |
| + askRetry(t, ctx, base, priv, "bab", "shop", "a.example.com", "v2", "bk", 5) |
| + } |
| + fs := &failingKeyStore{Store: base, failKey: tc.failKey, err: errors.New("503 slow down")} |
| + now := time.Now() |
| + restartBaseline(ctx, routes, fs, dd, mem) // arming: one half unreadable |
| + restartGainSeed(ctx, routes, fs, dd, mem, now) |
| + restartGainSeed(ctx, routes, fs, dd, mem, now.Add(restartGainRetry)) |
| + if want := []string{"a.example.com v2 5"}; !slices.Equal(retried, want) { |
| + t.Fatalf("handled %v across three attempts, want %v once", retried, want) |
| + } |
| + |
| + // New work between attempts: a second grant (host-retry log) and |
| + // an app-wide restart. |
| + if !legacy { |
| + askRetry(t, ctx, base, priv, "bab", "shop", "a.example.com", "v3", "bk", 6) |
| + } |
| + if err := release.TouchRestartGen(ctx, base, "bab", "shop"); err != nil { |
| + t.Fatalf("touch: %v", err) |
| + } |
| + fs.failKey = "" |
| + if n := restartGainSeed(ctx, routes, fs, dd, mem, now.Add(2*restartGainRetry)); n != 1 { |
| + t.Fatalf("seeded %d apps once the object read, want 1", n) |
| + } |
| + var bounced []string |
| + restartRequestLeg(ctx, routes, fs, dd, func(h string) bool { bounced = append(bounced, h); return true }, nil, mem) |
| + want := []string{"a.example.com v2 5"} |
| + if !legacy { |
| + want = append(want, "a.example.com v3 6") |
| + } |
| + if !slices.Equal(retried, want) { |
| + t.Fatalf("handled %v, want %v (each grant once, the new one included)", retried, want) |
| + } |
| + if legacy { |
| + // The generation was unreadable at the baseline, so its first |
| + // readable value is the baseline: the touch above is history. |
| + return |
| + } |
| + if !slices.Equal(bounced, []string{"a.example.com"}) { |
| + t.Fatalf("bounced %v: the app-wide restart made between attempts was lost", bounced) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// TestRestartGainSeedLeavesALostPositionToTheLeg is the Astra fix check's |
| +// residual case: the agent holds a narrowed position, the generation will |
| +// not read, and the log grows past its bound so that position falls out of |
| +// it, with a signed legacy retry among the new entries. The scope pass |
| +// reports that log as history, but it is not a first sight for this memory: |
| +// the gain retries must hand nothing over, and the restart leg handles the |
| +// grant exactly once. |
| +func TestRestartGainSeedLeavesALostPositionToTheLeg(t *testing.T) { |
| + ctx, base := genKit(t) |
| + dd := t.TempDir() |
| + host := "a.example.com" |
| + routes := []registry.Route{execRoute(host, "bab", "shop")} |
| + mem, priv := retryMemory(t) |
| + calls := 0 |
| + mem.retryHost = func(string, string, string, uint64) bool { calls++; return false } |
| + |
| + askScoped(t, ctx, base, "bab", "shop", release.RestartScopeHost, host) |
| + fs := &failingKeyStore{Store: base, failKey: release.RestartGenKey("bab", "shop"), err: errors.New("503 slow down")} |
| + restartBaseline(ctx, routes, fs, dd, mem) // position recorded, generation not |
| + if _, ok := mem.scope[[2]string{"bab", "shop"}]; !ok { |
| + t.Fatal("no narrowed position after the baseline") |
| + } |
| + |
| + for i := 0; i < 31; i++ { |
| + askScoped(t, ctx, base, "bab", "shop", release.RestartScopeHost, "other.example.com") |
| + } |
| + legacySignedRetry(t, ctx, base, priv, "bab", "shop", host, "v2", "bk", 5) |
| + askScoped(t, ctx, base, "bab", "shop", release.RestartScopeHost, "other.example.com") |
| + |
| + now := time.Now() |
| + restartGainSeed(ctx, routes, fs, dd, mem, now) |
| + restartGainSeed(ctx, routes, fs, dd, mem, now.Add(restartGainRetry)) |
| + if calls != 0 { |
| + t.Fatalf("the gain seed handled %d grants past a position it already held, want 0 (the leg's)", calls) |
| + } |
| + bounce := func(string) bool { return true } |
| + restartRequestLeg(ctx, routes, fs, dd, bounce, nil, mem) |
| + restartRequestLeg(ctx, routes, fs, dd, bounce, nil, mem) |
| + if calls != 1 { |
| + t.Fatalf("handled the grant %d times in all, want once", calls) |
| + } |
| +} |
diff --git a/internal/host/restartscope.go b/internal/host/restartscope.go| index 0256d01bb..11bd319d2 100644 |
| --- a/internal/host/restartscope.go |
| +++ b/internal/host/restartscope.go |
| @@ -70,10 +70,15 @@ type restartMemory struct { |
| // every retry's grant is verified against (spec §11). Nil drops every |
| // retry: a box that cannot tell a grant from a forgery clears nothing. |
| pub ed25519.PublicKey |
| + // notBefore throttles restartGainSeed's retries after a read error, per |
| + // app, so an object that will not read is not asked for on every tick. |
| + // Nothing else reads it. |
| + notBefore map[[2]string]time.Time |
| } |
| func newRestartMemory() *restartMemory { |
| - return &restartMemory{gen: map[[2]string]string{}, scope: map[[2]string]string{}, retries: map[[2]string]map[string]bool{}} |
| + return &restartMemory{gen: map[[2]string]string{}, scope: map[[2]string]string{}, retries: map[[2]string]map[string]bool{}, |
| + notBefore: map[[2]string]time.Time{}} |
| } |
| // scopedRestart is one app's outstanding narrowed work: the requests this box |
diff --git a/internal/provision/testdata/plan14-root-reads-agent-start-demo-3.tsv b/internal/provision/testdata/plan14-root-reads-agent-start-demo-3.tsv| index d449a7d6e..b2e994983 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-agent-start-demo-3.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-agent-start-demo-3.tsv |
| @@ -6,7 +6,7 @@ |
| @legacy 9a074c6c52670efb7ec6aa7bbc12f21ddf9f17730270c98f4db68534f188ec9f internal/edge/demo.go Edge.handleDemoRequest legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:87-109 classifies request authority using the loaded refusal/upstream maps and checks the existing Route binding before protected dispatch. Five whole Route uses; malformed, unknown and expired names receive fixed policy-bearing refusals, never ordinary fallback. No new storage read.;rev3=census-ruling-agent-start-demo-3;basis=Check verified moved notices before route lookup so a purged source can still display its bounded notice. Census read-site delta: unchanged (5). whole:Route@405,whole:Route@472,whole:Route@513,whole:Route@729,whole:Route@771 4d7749918b907fff4aa332070318f1dbce2b031b615628ceaa4d0d5df7672f19 |
| @legacy 2844351e1dd8ec211341180f2f80e980dbacce8c2cc58cb3e9129db4a5936406 internal/edge/demo.go Edge.redirectDemoRequest legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:87-102 answers a plain-HTTP demo request with a 308 to the same host and path over HTTPS, with demo policy headers, only after the loaded Route, alias and serving checks pass; reads only the already-loaded Route (whole value), never dispatches, counts or opens anything.;rev3=census-ruling-agent-start-demo-3;basis=Serve signed moved notices at the demo redirect entry before redirecting; retain exact-host validation. Census read-site delta: unchanged (3). whole:Route@255,whole:Route@297,whole:Route@391 0c73d3995a12de11bbb57e2f3e53797be436c8a676fec06a9b7f1cb3564d4c06 |
| @legacy 623d568555a91ea356186dbbf78396e88898d427e17759502358dc30bdb8a384 internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. Fix round 1 M2: comment and whitespace correction only; read sites and routing behavior unchanged.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1175-1177 passes an already-listed demo Route to demoProxy; :1358 passes existing Route and RouteAlias slices to demoRefusalNames; :1401 publishes refusal names before upstreams. Adds whole-value uses only, no new registry query; retained names refuse fallback after filtering.;rev3=census-ruling-demo-api-site-route;basis=Build a dedicated demo API proxy from the selected existing socket, TCP or probed console transport in the same atomic route snapshot, before ordinary wrappers. Reads existing route Host twice, Version and two whole Route values for exact operator-configured console eligibility. No additional registry query or external read.;rev3=census-ruling-agent-start-demo-3;basis=Refresh the verified moved snapshot from registry on reload before route-independent serving. Census read-site delta: unchanged (87). registry:Account@9931,registry:Alias@25173,registry:Alias@25260,registry:Alias@25840,registry:App@9947,registry:Health@13672,registry:Health@13798,registry:Hibernate@29769,registry:Host@11258,registry:Host@11315,registry:Host@11351,registry:Host@12094,registry:Host@14281,registry:Host@14376,registry:Host@14664,registry:Host@14690,registry:Host@14742,registry:Host@17551,registry:Host@17584,registry:Host@19607,registry:Host@21514,registry:Host@21822,registry:Host@21849,registry:Host@22692,registry:Host@23264,registry:Host@25594,registry:Host@25643,registry:Host@28309,registry:Host@28334,registry:Host@28351,registry:Host@4416,registry:Host@4785,registry:Host@4839,registry:Host@4889,registry:Host@5909,registry:Host@6098,registry:Kind@17943,registry:Kind@17965,registry:Prefix@23239,registry:Socket@12158,registry:Socket@17822,registry:Socket@21830,registry:Status@4710,registry:Target@23251,registry:Tunnel@9791,registry:Tunnel@9962,registry:Version@17674,registry:Version@17924,registry:Version@18026,whole:RegionalDomain@26482,whole:Route@11406,whole:Route@11514,whole:Route@12214,whole:Route@14815,whole:Route@14879,whole:Route@14930,whole:Route@17601,whole:Route@17608,whole:Route@17732,whole:Route@21910,whole:Route@21917,whole:Route@22013,whole:Route@23127,whole:Route@24295,whole:Route@26474,whole:Route@26530,whole:Route@26570,whole:Route@28215,whole:Route@28249,whole:Route@28337,whole:Route@28416,whole:Route@29771,whole:Route@313,whole:Route@3436,whole:Route@3494,whole:Route@4424,whole:Route@5938,whole:Route@6201,whole:Route@6334,whole:Route@6357,whole:Route@6372,whole:Route@7218,whole:Route@7326,whole:Route@9853,whole:RouteAlias@25144,whole:RouteAlias@26538,whole:RoutePath@22670 015110e11afe65556624474d7a16ea18b746540261e031245b262915515cc12c |
| -@legacy 08ba7649d34caf979bd470f5f7352b49037bdd734a87dd1e3fe44a5459e75ac5 internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-agent-start-demo-3;basis=Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1). registry:Host@5023 53b33e077aff24cdb16cbee451a8df4ee3d7cd862da4f39cbed9c52ac4dec2a1 |
| +@legacy 6f60d5694ae07fdbc3172bd856a09e0dd6febddef37e13439015b157b14d08e8 internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged;rev3=census-ruling-agent-start-demo-3;basis=Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1). registry:Host@5388 e3ee89caba556f979c0a75771fe4170e16c93a343cd81c81c86e56f6d10c8ba1 |
| @legacy e531337b0be5da419c2ac1590fe608e6f6bafc026ca0a4242243e979c7879a38 internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action.;rev3=census-ruling-agent-start-demo-3;basis=Report moved capability only when the serving edge reports readiness; report claim-seed support only with CARLOS_DEMO_CLAIM=1. Reads the explicit capability flag from the process environment; no new filesystem or registry read. whole:Route@10141,whole:Route@11955,whole:Route@12236,whole:Route@6583,whole:Route@6610,whole:Route@7918 ffc2c848825a59de990f9ead1f291ce80ae10bd67772df940721b02722ada73c |
| @legacy a0b9e12b89199d21e951fe0e78422e114bbad331d7578c6674bdd28262a1d4e0 internal/host/demo_serving.go demoWorker.demoHeartbeat legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_serving.go:72-103 reads crypto/rand at :84 for a connection-local probe and keeps at most four monotonic send times. This Read is randomness, not an app-named file; heartbeat carries the current acknowledgement on the existing stream.;rev3=census-ruling-agent-start-demo-3;basis=Advertise claim export and moved capability beside existing serving probes. Census read-site delta: unchanged (1). file:Read@378 33d6ce8b67bc2dd496685c51a61ff3f7937af7ea2324c39172190772688ccd4c |
| @legacy 166b495fcd82919e66c5ecd035a9bdd5603fd675bd6053693e7fc41a20baceeb internal/host/demo_serving.go demoWorker.demoServingAllowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_serving.go:221-235 reads only the supplied local Route fields and locked in-memory control state. Requires an unexpired exact assignment, matching fleet/account/box, no hold and an enabled connected snapshot; no file, bucket or console read.;rev3=census-ruling-agent-start-demo-3;basis=Refuse traffic under the reversible operation-owned claim hold without resetting lifetime counters. Census read-site delta: unchanged (10). registry:Account@671,registry:DemoExpiresAt@541,registry:DemoID@316,registry:DemoLifetime@337,registry:FleetBox@589,registry:FleetBox@613,registry:HoldOp@702,registry:Host@360,registry:Region@634,registry:Status@738 25685b39f721eb381c233fa4c8580621e0c39da3c5e423cf1049d80884679445 |
| @@ -74,8 +74,8 @@ internal/demobuild/worker.go NewWorker legacy accepted-legacy accepted-legacy;re |
| internal/edge/demo.go Edge.handleDemoRequest legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:87-109 classifies request authority using the loaded refusal/upstream maps and checks the existing Route binding before protected dispatch. Five whole Route uses; malformed, unknown and expired names receive fixed policy-bearing refusals, never ordinary fallback. No new storage read.;rev3=census-ruling-agent-start-demo-3;basis=Check verified moved notices before route lookup so a purged source can still display its bounded notice. Census read-site delta: unchanged (5). whole:Route@405,whole:Route@472,whole:Route@513,whole:Route@729,whole:Route@771 4d7749918b907fff4aa332070318f1dbce2b031b615628ceaa4d0d5df7672f19 |
| internal/edge/demo.go Edge.redirectDemoRequest legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:87-102 answers a plain-HTTP demo request with a 308 to the same host and path over HTTPS, with demo policy headers, only after the loaded Route, alias and serving checks pass; reads only the already-loaded Route (whole value), never dispatches, counts or opens anything.;rev3=census-ruling-agent-start-demo-3;basis=Serve signed moved notices at the demo redirect entry before redirecting; retain exact-host validation. Census read-site delta: unchanged (3). whole:Route@255,whole:Route@297,whole:Route@391 0c73d3995a12de11bbb57e2f3e53797be436c8a676fec06a9b7f1cb3564d4c06 |
| internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. Fix round 1 M2: comment and whitespace correction only; read sites and routing behavior unchanged.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1175-1177 passes an already-listed demo Route to demoProxy; :1358 passes existing Route and RouteAlias slices to demoRefusalNames; :1401 publishes refusal names before upstreams. Adds whole-value uses only, no new registry query; retained names refuse fallback after filtering.;rev3=census-ruling-demo-api-site-route;basis=Build a dedicated demo API proxy from the selected existing socket, TCP or probed console transport in the same atomic route snapshot, before ordinary wrappers. Reads existing route Host twice, Version and two whole Route values for exact operator-configured console eligibility. No additional registry query or external read.;rev3=census-ruling-agent-start-demo-3;basis=Refresh the verified moved snapshot from registry on reload before route-independent serving. Census read-site delta: unchanged (87). registry:Account@9931,registry:Alias@25173,registry:Alias@25260,registry:Alias@25840,registry:App@9947,registry:Health@13672,registry:Health@13798,registry:Hibernate@29769,registry:Host@11258,registry:Host@11315,registry:Host@11351,registry:Host@12094,registry:Host@14281,registry:Host@14376,registry:Host@14664,registry:Host@14690,registry:Host@14742,registry:Host@17551,registry:Host@17584,registry:Host@19607,registry:Host@21514,registry:Host@21822,registry:Host@21849,registry:Host@22692,registry:Host@23264,registry:Host@25594,registry:Host@25643,registry:Host@28309,registry:Host@28334,registry:Host@28351,registry:Host@4416,registry:Host@4785,registry:Host@4839,registry:Host@4889,registry:Host@5909,registry:Host@6098,registry:Kind@17943,registry:Kind@17965,registry:Prefix@23239,registry:Socket@12158,registry:Socket@17822,registry:Socket@21830,registry:Status@4710,registry:Target@23251,registry:Tunnel@9791,registry:Tunnel@9962,registry:Version@17674,registry:Version@17924,registry:Version@18026,whole:RegionalDomain@26482,whole:Route@11406,whole:Route@11514,whole:Route@12214,whole:Route@14815,whole:Route@14879,whole:Route@14930,whole:Route@17601,whole:Route@17608,whole:Route@17732,whole:Route@21910,whole:Route@21917,whole:Route@22013,whole:Route@23127,whole:Route@24295,whole:Route@26474,whole:Route@26530,whole:Route@26570,whole:Route@28215,whole:Route@28249,whole:Route@28337,whole:Route@28416,whole:Route@29771,whole:Route@313,whole:Route@3436,whole:Route@3494,whole:Route@4424,whole:Route@5938,whole:Route@6201,whole:Route@6334,whole:Route@6357,whole:Route@6372,whole:Route@7218,whole:Route@7326,whole:Route@9853,whole:RouteAlias@25144,whole:RouteAlias@26538,whole:RoutePath@22670 015110e11afe65556624474d7a16ea18b746540261e031245b262915515cc12c |
| -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-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). whole:Route@7860,whole:Route@8423 d219071f9f0be4258e46b5b22f6826cf350d794e7f170f3f32322a89bc4739f3 |
| -internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-agent-start-demo-3;basis=Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1). registry:Host@5023 53b33e077aff24cdb16cbee451a8df4ee3d7cd862da4f39cbed9c52ac4dec2a1 |
| +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). whole:Route@8688 3da81d43bab63f119e4729b76baaab1055de870a18ebfc8bc580d3b3b56b6b18 |
| +internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged;rev3=census-ruling-agent-start-demo-3;basis=Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1). registry:Host@5388 e3ee89caba556f979c0a75771fe4170e16c93a343cd81c81c86e56f6d10c8ba1 |
| internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9). file:Exec@19132,file:Open@1707,file:Statfs@50034,registry:App@12731,registry:Host@46116,whole:Route@12723,whole:Route@45318,whole:Route@46239,whole:Route@46301 d31b7de059e79ea42ae15cfe0f57aabe3012d59476f6d406348a6a2015ccbdc8 |
| internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action.;rev3=census-ruling-agent-start-demo-3;basis=Report moved capability only when the serving edge reports readiness; report claim-seed support only with CARLOS_DEMO_CLAIM=1. Reads the explicit capability flag from the process environment; no new filesystem or registry read. whole:Route@10141,whole:Route@11955,whole:Route@12236,whole:Route@6583,whole:Route@6610,whole:Route@7918 ffc2c848825a59de990f9ead1f291ce80ae10bd67772df940721b02722ada73c |
| internal/host/claimunit.go claimUnitContent authority E1,E3 rev3=PROPOSED-p3;identity=root claim/adoption controller uid 0;basis=adds write permission for exactly the public retry directory only when the root settings reader has verified a complete census and prepared that directory;rev3=census-ruling-agent-start-demo-1;basis=Demo-only ReadWritePaths for instance data/runtime, staged files and root release lock; ordinary rendering unchanged.;rev3=census-ruling-agent-start-demo-1-followups;basis=In demo box mode, declare StateDirectory=carlos-release/private with mode 0700 so systemd creates root-owned release state before namespace setup and keeps it writable. Existing ReadWritePaths and ordinary/claims rendering stay unchanged. No new read site or caller-controlled path.;rev3=census-ruling-agent-start-demo-3;basis=Declare /var/lib/carlos-demo-snapshots as root-owned StateDirectory with mode 0700 only for configured demo boxes, including recovery with admission off. Ordinary claims units retain their original directories. The shared unit template is unchanged from main; no file read is added. data-literal@1127 b17feb76b76ea0d8687d3f049f0fef93f1e4a30a8a639d10c16752a0da58e59b |
| @@ -149,7 +149,7 @@ internal/registry/registry.go Registry.migrate legacy accepted-legacy accepted-l |
| @coverage internal/demobuild 7f72e797f270d9cd31f8d0e4752146144d610265a17b64bac5486821e524595c |
| @coverage internal/democlaim e5e0054ad3e6bf3b98e240770ceed9ac8642f22ca3155d686a7af77901885bd1 |
| @coverage internal/edge 605c1855fcdd55abe4ab0ba943d3bd8f074a40b6c52c8dbb9ea5ceae4705a732 |
| -@coverage internal/host 2ee1a88262e5f98a05ecae9180b3a1c3257527a27df4ad25a2ab29f70a66b99f |
| +@coverage internal/host 71e43d9d4aec2371bb3c5f96b7732dc6720c552c81d6f26c594d0760034d88a6 |
| @coverage internal/host/units ed8ae200bdd241150b210f61d11fecf3669e01763dbc3eb2ed6a18bbb4282e87 |
| @coverage internal/instancectl ccf73f5d4b9b6e947387a86dfb0050cde8ec55e33f352612deb52deaf72c1a43 |
| @coverage internal/provision c60d93a574e9b42a5800065c89edeee93a79c98ce49ec1d53ea358a5e659db43 |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 25067bc9d..686bb53a1 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -103,4 +103,5 @@ plan14-root-reads-agent-start-demo-analytics-fix.tsv 89841c50d08090185e24cb03c6b |
| plan14-root-reads-agent-start-demo-log-skip.tsv ed24b69243622fc702159e0b22c732f4f8297438b87f10c499887cd1a13f6fce |
| plan14-root-reads-demo-api-site-route.tsv 9bfd77d30d8e3deb5f3863cb6c272c2cb46ce32aa1370acbaa6e9181b71101b4 |
| plan14-root-reads-region-ha-p3b2-rolls.tsv c55b4a022b3d42f40a05b727f93e57dc9f76b6dc2251f7d3b777c34d7ffdee09 |
| -plan14-root-reads-agent-start-demo-3.tsv 844534b0924c7382eb18539eded63780a5729979d7566f5e63f622af91da67ce |
| +plan14-root-reads-restart-new-box-gap.tsv 18e4df5f599a48a881526fc2f85a9b591e3ea8677bb297d5944c9d935771f5e6 |
| +plan14-root-reads-agent-start-demo-3.tsv ebeaa693941f5592cd7bc3458effc2a333a8d12ba4f192a93d0aa32589048939 |
diff --git a/internal/provision/testdata/plan14-root-reads-restart-new-box-gap.tsv b/internal/provision/testdata/plan14-root-reads-restart-new-box-gap.tsv| new file mode 100644 |
| index 000000000..866426594 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-restart-new-box-gap.tsv |
| @@ -0,0 +1,14 @@ |
| +# Census overlay restart-new-box-gap, written by census-propose (#369). census-ruling-restart-new-box-gap, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-restart-new-box-gap.md. |
| +# 1 body, 2 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 f9901119aae0b7e5bc177c1075a6561e3fc15c272ce24c1156eda08bc471c8fd internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged registry:Host@5265 139e8bee2561c0c4f5c5ff41594c87337f06904c9dc061ed647ffe506ae7f744 |
| +@legacy 88f3281650a151b50649d98a03ff403d00e6b85168782683b8f5974b730988d8 internal/host/restart.go armRestartLegs legacy accepted-legacy accepted-legacy;rev3=census-ruling-restart-new-box-gap;basis=agent-side closures over reg.List for the gain seed and the existing restart leg; same reads the old fastConvergeLoop closure made whole:Route@448,whole:Route@766 1a6e4782f8769840153ed55f2851bde005cdcdaa17a4666b57e82269a29d12a9 |
| +@legacy ff9138a274d754572f76d22dccff3e11c0c10e6a9392e58353e168bc788de69d internal/host/restart.go restartBaseline legacy accepted-legacy accepted-legacy;rev3=census-ruling-restart-new-box-gap;basis=the former restartSeed body over a given route set (both logs, retry grants, seedRestartMarks/marker); legacy retries applied only for apps with no narrowed position before the pass (Astra r1 P2 + fix check), which at arming is every app whole:Route@1293,whole:Route@157,whole:Route@2055,whole:Route@889,whole:Route@999 642ef0cc4d27f87b59a3e52f9952dba1db6c7bd53533020331ff14777aae5584 |
| +@legacy 62b0eec4d5dd673a8ad1debb4e0c39270aeaa2707fe1d28d5898adfce1c94033 internal/host/restart.go restartGainSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-restart-new-box-gap;basis=baselines apps gained since arming via restartBaseline over those apps routes, into a scratch memory prefilled with the positions and handled retry ids already held (Astra r1 P2); merges only missing entries; throttles read errors; agent process, no root read registry:App@520,whole:Route@1246,whole:Route@212,whole:Route@463,whole:Route@515,whole:Route@534,whole:Route@547,whole:Route@552 be303c5bf5551ebcc9c45b5078d1b8e7b436c9008c07717bf0af3645575308cc |
| +internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged registry:Host@5265 139e8bee2561c0c4f5c5ff41594c87337f06904c9dc061ed647ffe506ae7f744 |
| +internal/host/restart.go armRestartLegs legacy accepted-legacy accepted-legacy;rev3=census-ruling-restart-new-box-gap;basis=agent-side closures over reg.List for the gain seed and the existing restart leg; same reads the old fastConvergeLoop closure made whole:Route@448,whole:Route@766 1a6e4782f8769840153ed55f2851bde005cdcdaa17a4666b57e82269a29d12a9 |
| +internal/host/restart.go restartBaseline legacy accepted-legacy accepted-legacy;rev3=census-ruling-restart-new-box-gap;basis=the former restartSeed body over a given route set (both logs, retry grants, seedRestartMarks/marker); legacy retries applied only for apps with no narrowed position before the pass (Astra r1 P2 + fix check), which at arming is every app whole:Route@1293,whole:Route@157,whole:Route@2055,whole:Route@889,whole:Route@999 642ef0cc4d27f87b59a3e52f9952dba1db6c7bd53533020331ff14777aae5584 |
| +internal/host/restart.go restartGainSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-restart-new-box-gap;basis=baselines apps gained since arming via restartBaseline over those apps routes, into a scratch memory prefilled with the positions and handled retry ids already held (Astra r1 P2); merges only missing entries; throttles read errors; agent process, no root read registry:App@520,whole:Route@1246,whole:Route@212,whole:Route@463,whole:Route@515,whole:Route@534,whole:Route@547,whole:Route@552 be303c5bf5551ebcc9c45b5078d1b8e7b436c9008c07717bf0af3645575308cc |
| +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 whole:Route@8609 d10becd47ccedd2d01c6fdb3933882872932e6592410d7c318dbc1390685eb4c |
| +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 whole:Route@298 b89f5767a539a57160f27d58f80ae2904c5993eeb1177563ed80aec63da632e1 |
| +@coverage internal/host 53016f44b4a5f467b1c5a1c362dabbca557c3c4036cde8140ea7aaf3552b0af3 |