carlos / platform Public

test: verify demo edge protections and operator controls

Prove source updates, durable counters, two ingress paths, serving controls, reports and offline retirement with a local production-worker harness. Run the Chromium warning witness through production edge wiring and add the inert moved-page hook.

Prepare operator docs, preserve controller rulings and deferred findings, correct the deployment-wide serving SQL scope, and generate the branch census proposal. Independent review, copy approval, CI and dev activation remain controller work.
codex agent, operated by paul@keymail.dev pushed by claude agent, operated by paul@keymail.dev ed6a19ee2c586dfd99d1cf4aa445330df2adb980 parent b031a93
19 files changed, +1,361 −21
  • README.md +37 −3
  • docs/site/cli.md +12 −2
  • docs/superpowers/notes/agent-start-demo-2-rulings.md +184 −0
  • docs/superpowers/notes/census-agent-start-demo-2-claims.md +53 −0
  • docs/superpowers/notes/census-proposal-agent-start-demo-2.md +49 −0
  • internal/console/claim_invariant_test.go +0 −1
  • internal/console/demo_gate_test.go +68 −4
  • internal/console/demo_protections_e2e_test.go +567 −0
  • internal/console/store_gate.go +1 −1
  • internal/edge/demo.go +6 −0
  • internal/edge/demo_banner_browser_test.go +33 −8
  • internal/edge/demo_protections_test.go +46 −0
  • internal/edge/demo_traffic.go +3 −0
  • internal/edge/testdata/demo-protections/app.js +1 −1
  • internal/edge/testdata/demo-protections/main.go +21 −1
  • internal/edge/testdata/demo-protections/style.css +2 −0
  • internal/host/demo_protections_test.go +222 −0
  • internal/provision/testdata/plan14-root-reads-agent-start-demo-2.tsv +55 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0

CI failed — run details

Intent

Human

<task-notification> <task-id>b23kd7fjk</task-id> <tool-use-id>toolu_01NNzdvo6wBmyj5ReXXuExWZ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6e566fe9-9aca-47cb-9753-64e881b0d285/tasks/b23kd7fjk.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 5 fix run" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a3e8862683214f9ee</task-id> <tool-use-id>toolu_01YGEe6nMakXZ5DrU1S6mUh5</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6e566fe9-9aca-47cb-9753-64e881b0d285/tasks/a3e8862683214f9ee.output</output-file> <status>completed</status> <summary>Agent "Re-review Task 5 fix, round 2 (Opus)" 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**. The fix (b031a93a over beb841f7) adds no new P1 or P2. - **P1-1: ADDRESSED.** The report page now sends `Referrer-Policy: same-origin` (`internal/console/apidemoreports.go:95`), and the exact-Origin check is unchanged. The form test asserts the policy. The implementer reports that the opt-in Chromium test passed, with the browser sending the real Origin itself; I did not run that test. Firefox and Safari are still untested, as ruling R6 allows. - **P1-2: ADDRESSED, implemented as ruled.** At `apidemoreports.go:232-239` the report door only calls the existing `edgeProofKeys` loader and its 30 s cache. There is no new loader, poller or storage call. Tests count exactly 2 key reads per cache fill and no writes, polls or lists. Requests without a proof header never trigger a key read. - **P3-1: ADDRESSED.** The form limit is now `maxlength="300"` (`templates/demo_report.html:25`). That is at most 900 bytes, under the server's 1,000-byte limit. - **P3-3: ADDRESSED.** The GET test now also checks that `demo_report_attempts` is empty (`demo_reports_test.go:77-80`). Your four specific checks: - **Forged XFF or proof header:** no bypass. The edge strips any client proof header and signs its own (`internal/edge/forwardproof.go:39,51`). The signature covers the Host, the whole XFF chain and a timestamp, and with no keys nothing verifies. Tests for forged, wrong-host, stale, extra-XFF and unsigned requests all count against 127.0.0.1. - **Cold-cache load failure:** fails safe by reading of the code. The loader returns no keys on a cold failure, so the request counts against the peer and is never attributed to the forged IP. - **Per-IP test:** a real witness. With a cold cache, 11 signed distinct clients all succeed and the same client's 11th attempt gets 429. The old code would have failed the distinct case. That half was never seen failing, because the implementer's pre-fix run stopped at the earlier Referrer-Policy assertion; the reasoning shows it would. - **Referrer-Policy leak:** none. The page loads only same-origin stylesheets, has no outbound links, and its CSP allows only same-origin form posts, so the form URL goes only to the console origin. There are two new P3s: - **P3-7 (missing test for the safe fallback):** no test makes the key load fail on the report path. The round-1 failing-store case was dropped. - **P3-8 (shared key cache can be held cold):** this already existed on login, and the report door adds a second anonymous trigger. A client that disconnects during the first key load after a restart cancels it and leaves the cache empty for 30 s. Repeating that each window keeps everyone in the single shared bucket. The direction is still safe and only availability is affected. The fix belongs in the shared loader, for example `context.WithoutCancel`, outside this task. I ran `nice -n 10 go test -p 1 ./internal/console -run 'TestDemoReport' -count=1` at b031a93a and it passed in 4.4 s. The browser test is opt-in and was skipped. The review is at `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/agent-start-demo-2/.superpowers/sdd/2026-11-04-agent-start-demo-2-edge-protections/task-5-review-r2.md`.</result> <usage><subagent_tokens>79890</subagent_tokens><tool_uses>13</tool_uses><duration_ms>141416</duration_ms></usage> </task-notification>

Human

<paseo-system version="1" kind="agent-message" source-agent-id="aa3c74b3-0b6f-4d00-8740-af2485f3529e" message-id="033ea3e3-80f0-4cf0-a3ec-3a88eba5fa53" source-agent-title="Region HA P3b-1 dev group (executing approved card)"> From aa3c74b: P3b-1 third window OPEN 2026-11-05T00:15:24Z (posted on #421). Dev channel frozen: no release/promote, no host.env edit or carlos-edge restart on sophie/leo/dennis, no console restart, until &apos;P3b-1 window closed&apos;. </paseo-system>

Attributed to this commit: 38.9 g CO₂e (4,627,247 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-2, 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/README.md b/README.md
index 2323ea92d..457a93e0f 100644
--- a/README.md
+++ b/README.md
@@ -605,7 +605,7 @@ This release adds the app policy (#328, #329). A system operator can let an app'
Anonymous demos accept a locked Go source archive and keep a local SQLite database for 24 hours. Updates keep the same expiry and database. There are no backups, and data is not recoverable after box loss. Demos cannot send mail, use object storage or schedules, run sidecars, or use custom domains. Claiming is not available in this release.
-Keep admission off until the designated dev witness and branch review have passed. Local protocol tests do not prove systemd isolation, public DNS or TLS. Infrastructure work needs approval for its exact scope before you create or change anything.
+Keep admission and serving off until the designated dev witness and branch review have passed. Local protocol tests do not prove systemd isolation, public DNS or TLS. Infrastructure work needs approval for its exact scope before you create or change anything.
Use a dedicated non-ops holding account with no human members or service credentials. It must own only the demo fleet. The fleet must be empty when you first enable admission, with no ordinary apps or orphaned app objects. Demos stay on their assigned box. Run nested linux-arm64 boxes with host claims off. Root applies the small tier and denies outbound networking to every instance on a demo box. Do not share that fleet with ordinary apps.
@@ -620,6 +620,9 @@ Set these variables on the console:
| `CARLOS_DEMO_CREATE_PER_IP_DAY` | Positive integer. Default `30`. IPv6 callers share their /64 budget. |
| `CARLOS_DEMO_CREATE_GLOBAL_DAY` | Positive integer. Default `100`. |
| `CARLOS_DEMO_MAX_LIVE` | Positive integer. Default `20`. Failed and retiring demos keep their place until cleanup completes. |
+| `CARLOS_DEMO_EDGE_PROTECTIONS` | `1` enables protections. Unset keeps demos closed. Set it on the console and every demo ingress and serving box. |
+| `CARLOS_DEMO_REQUEST_CAP` | Lifetime requests, from `1` to `1000000`. Default `2000`. |
+| `CARLOS_DEMO_BANDWIDTH_CAP_BYTES` | Lifetime body bytes, from `1` to `10000000000`. Default `200000000` (200 MB, with 1 MB = 1,000,000 bytes). |
Create the holding account and its demo fleet. Revoke all of the account's CLI and service tokens through its service pages, including expired tokens. Only an owner can revoke them, so do this before removing the last owner. Then run `console member -remove <address> "$CARLOS_DEMO_ACCOUNT"` on the console box for each member, leaving the owner until last. Use the console's environment with valid demo settings. You can leave `CARLOS_DEMO_APPS` unset while preparing the account. Only the configured holding account can lose its last owner. It must own `CARLOS_DEMO_FLEET`. The command refuses to remove the last owner while any tokens remain unrevoked and lists them. It reports when no members remain.
@@ -633,13 +636,44 @@ Make the directory and its ancestors root-owned and safe from agent writes. Bund
On every ingress box for the demo domain and every box that can become the housekeeper, set the same `CARLOS_DEMO_ACCOUNT`, `CARLOS_DEMO_FLEET` and `CARLOS_DEMO_DOMAIN` in root-owned `/etc/carlos/host.env`, without `CARLOS_DEMO_BOX`. Preserve these per-box values through host.env rewrites. The housekeeper is the deployment's certificate issuer and orders the demo wildcard. Give every box that can hold that role the DNS-01 grant on the demo zone, even if it does not serve ingress traffic. The edge reads these settings at startup, so restart `carlos-edge` on each affected box as part of the rollout after changing them.
-For an approved rollout, point wildcard DNS for your demo domain at the existing ingress and install wildcard TLS through the deployment's existing certificate workflow. The edge includes `CARLOS_DEMO_DOMAIN` among its explicit wildcard parents. Roll out the built boxes and ingress first, then the console. Confirm the box reports `anonymous-demo-v1` with the expected verified bundle digest, the policy writer can acquire its lease, and change delivery is working before enabling admission. Verify an ordinary app through its own hostname as well.
+For this protection rollout, keep admission off in the console drop-in and roll the console first. Old consoles reject the new worker heartbeat. Run `carlos system demos serving off`, then roll every public ingress, housekeeper and demo serving box. Remove or drain any old ingress before opening serving. Confirm the existing housekeeper wildcard certificate covers the demo names. Use the deployment's existing certificate workflow; this rollout needs no new DNS or certificate resources.
+
+Set `CARLOS_DEMO_CONSOLE_URL` on every demo edge to the exact HTTPS origin in the console's `CONSOLE_ORIGIN`. A mismatched origin can break reporting. Preserve the per-box settings through host.env rewrites and restart affected edges. Verify the worker's `anonymous-demo-v1` readiness and bundle digest, policy lease and change delivery.
+
+Take down every existing Plan 1 demo through `carlos system demos takedown --host <host>`. Check `takedown-status` until cleanup is complete. Their earlier traffic was never counted, so they cannot be grandfathered or backfilled with zero counters. Once every serving path runs the protected version, run `carlos system demos serving on` and restore admission. The intended first activation is the approved dev rollout when this slice lands; wider activation waits for the later /start plans.
For the smoke check, gzip a tar archive of the locked starter's files without a wrapper directory. Submit it without logging in to `POST /api/demo/apps` as `application/gzip`; the compressed limit is 5,000,000 bytes. Keep the returned claim token private. Both create and update return `202` with `jobId`, `name`, `statusUrl` and `expiresAt` (Unix seconds). Create also returns `claimToken`, `claimUrl` and `claimAvailable:false`. Send your harness name in `X-Carlos-Client`; the stored value is trimmed to 100 bytes. Poll `statusUrl` (`GET /api/demo/jobs/<jobId>`) until its `state` is `live`. The other states are `building`, `starting`, `failed` and `superseded`. An earlier job becomes `superseded` when a newer update is accepted, even if the earlier job was live. Use the new update's `statusUrl` to follow its progress. Then GET its exact HTTPS URL and check `X-Carlos-Version`. Write a SQLite value, submit changed source to the same POST endpoint with `Authorization: Bearer <claimToken>`, and verify that a new version serves the saved value. An update must not extend the 24-hour lifetime. An unavailable worker or failed policy check must refuse admission. If a worker has not reconnected after a console restart, create and update return `503` with `Retry-After: 15`. Retry after that many seconds; this refusal does not spend a create or update attempt.
Run `CARLOS_DEMO_DEV_WITNESS=1 go test ./internal/host -run '^TestDemoDevKernelAndPurge$' -count=1 -v` only on an explicitly designated disposable, idle linux-arm64 systemd sandbox. Install the built binary and this checkout's unit templates first. The application witness needs no pre-existing demo drop-ins; the builder witness needs root control active with its worker switch off, concurrency one, and `CARLOS_DEMO_TOOLCHAIN_DIR` pointing at the verified bundle. The root release/adoption gate must be available for the purge witness. The test exercises application and builder isolation, root stop-before-delete, and the local protocol and durability checks. A skipped test is outstanding evidence, not a rollout pass. Real DNS, TLS and fleet activation still need a separately recorded deployment check.
-After the smoke check, unset `CARLOS_DEMO_APPS` unless persistent dev admission was approved. Retain the account, fleet and domain settings and keep cleanup workers running. The next healthy five-minute expiry pass retires demos at 24 hours. Allow up to ten minutes for serving to stop. Local DB, WAL, SHM, runtime and build scratch must be removed before the assigned box acknowledges cleanup. Bucket content and the initialization marker must be gone before the place is released. A disconnected box keeps its cleanup obligation until reconnect. It must not restart the expired demo. Confirm that the job is expired, the host no longer serves, and cleanup has completed before dismantling witness resources. Never reuse public demo hostnames. Keep minimal host tombstones after detailed history ages out.
+After the smoke check, unset `CARLOS_DEMO_APPS` unless persistent dev admission was approved. Retain the account, fleet and domain settings and keep cleanup workers running. The next healthy five-minute expiry pass retires demos at 24 hours. Protected edges refuse new requests at the original expiry and cancel active responses. Cleanup may take longer. Local DB, WAL, SHM, runtime and build scratch must be removed before the assigned box acknowledges cleanup. Bucket content and the initialization marker must be gone before the place is released. A disconnected box keeps its cleanup obligation until reconnect. It must not restart the expired demo. Confirm that the job is expired, the host no longer serves, and cleanup has completed before dismantling witness resources. Never reuse public demo hostnames. Keep minimal host tombstones after detailed history ages out.
+
+#### Demo traffic and operator controls
+
+Use your configured console as an ops account owner or listed system operator:
+
+```sh
+carlos system demos status
+carlos system demos serving off
+carlos system demos takedown --host shop.example.com
+carlos system demos takedown-status --host shop.example.com
+carlos system demos reports --limit 50
+carlos system demos reports resolve --id <id>
+```
+
+Admission controls new creates and updates. Serving off also stops existing demos and refuses creates and updates, while cleanup and reporting remain available. Check serving confirmation separately from cleanup. A stop is pending until the box acknowledges it or its control expires. Protected workers renew through the existing authenticated stream every 10 seconds, with at most 30 seconds of validity from their probe. Output writes have a five-second bound, so confirmation can take 35 seconds. Bytes already handed to the network cannot be recalled. Old workers have no such bound. Keep them drained; do not downgrade an offline box after it has acknowledged initialization.
+
+Caps are saved when a lifetime is created. Changes affect new demos only. Updates, restarts and serving off/on preserve counters and the original 24-hour expiry. The assigned box commits each request before dispatch and body bytes before output. Bytes include inserted markup and final compression, but exclude HTTP/TLS framing and uploads. App assets, errors, all app methods and readiness requests count. HEAD and bodyless responses spend no body bytes. The fixed warning stylesheet, platform refusals and console reports are excluded overhead.
+
+Failed delivery and short writes can spend allowance that the visitor never receives. There are no refunds. This keeps crash overservice at zero requests and zero bytes. A stream that reaches the byte cap is cut without an appended page; later requests receive 429. Status reports saved caps and lifecycle, not estimated usage. Exhaustion keeps data and the private token until the original expiry. Claiming is not available yet.
+
+A missing or corrupt local traffic database refuses serving. Never delete or recreate counters to restore allowance. A corrupt traffic database also blocks local retirement, so cleanup can stay pending until storage is repaired. Confirm purge before treating the demo as removed. Data has no backup, and a replacement box cannot grant a fresh allowance.
+
+The warning is removable by the app's own scripts or CSS. The Content Security Policy limits forms, connections, images and scripts to the same origin. Inline scripts, eval, workers, upgrades and active document types other than supported HTML are refused. Server cookie Domain attributes are removed; a cookie with an unparseable Expires attribute is dropped. Script-written parent-domain cookies remain a known limit. Keep the private claim link out of pages and reports.
+
+Reports do not trigger automatic takedown or notifications. Review the queue and resolve each report separately. POST attempts have durable IP, host and global limits. GET and HEAD form requests spend no report-attempt budget and still need ordinary ingress abuse protection. Forwarded reports use the login path's shared edge-proof key cache: a refresh reads two existing key objects, at most once per 30 seconds after a successful load. Traffic, counters, status and the serving switch add no bucket calls. Retirement keeps its existing receipt, tombstone and cleanup work. Identifying report data is removed seven days after confirmed purge.
+
+During the approved dev check, submit a fresh source fixture, check its version, banner and policy through every ingress, and verify a saved SQLite value after an update. Use small caps on that fresh lifetime to check stream truncation and 429. Submit, list and resolve a report, switch serving off, then take the demo down and confirm purge. Check Chromium, Firefox and Safari separately; an unrun browser is outstanding evidence. Verify an ordinary app too. If any check fails, leave serving off and admission off while keeping cleanup running. Never roll back to unprotected serving.
<!-- End DEMO-OPERATOR-DOCS. -->
diff --git a/docs/site/cli.md b/docs/site/cli.md
index 548d46441..15ca15a65 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -2746,8 +2746,9 @@ owns.
Manage anonymous demos through your configured console. Ops account owners and
listed system operators can stop serving or remove an exact public demo host.
-Check serving confirmation and cleanup separately. An offline box can take up to
-35 seconds to stop; cleanup stays pending until the box acknowledges its purge.
+Check serving confirmation and cleanup separately. A protected worker can take up to
+35 seconds to confirm a stop; cleanup stays pending until the box acknowledges
+its purge. Old workers must be drained and upgraded before activation.
```sh
carlos system demos status
@@ -2765,6 +2766,15 @@ Changing the configured caps affects new demos. Turning serving on preserves
existing counters and never restores a retired demo. Remove old Plan 1 demos
before activation; they cannot be backfilled with a fresh allowance.
+Reports are listed oldest first, including resolved reports. Use `--after` with
+an ID from the preceding page and `--limit` from 1 to 100. Resolving a report does
+not take its demo down. Recheck the first page when reviewing new arrivals;
+pagination is not a fixed snapshot.
+
+`status`, `serving`, `takedown` and `takedown-status` accept `--console` to choose
+a console. `--host` requires the exact public demo hostname. Successful commands
+and pending operations exit 0, remote failures exit 1, and invalid arguments exit 2.
+
#### carlos system managed-fleets show
Read the deployment's managed fleet settings through the console:
diff --git a/docs/superpowers/notes/agent-start-demo-2-rulings.md b/docs/superpowers/notes/agent-start-demo-2-rulings.md
new file mode 100644
index 000000000..599bbb5bf
--- /dev/null
+++ b/docs/superpowers/notes/agent-start-demo-2-rulings.md
@@ -0,0 +1,184 @@
+# Agent /start demo, plan 2 rulings and evidence
+
+Task 6 prepares local evidence only. The controller owns the copy pass,
+whole-branch and cross-family census review, CI, landing and dev activation.
+No live activation or census approval is recorded here.
+
+## Controller rulings
+
+The following ledger lines are verbatim, including their cost-if-wrong.
+R8's complete ledger wording supersedes the shorter plan-context copy.
+The task brief overrides R5's timing: Task 6 prepares the copy deck and commits;
+the controller runs the remaining copy pass afterward.
+
+Ruling R1: Task 3 wires SetDemoTraffic on the host with a serving func that returns false (closed) until Task 4 replaces it with demoServingAllowed — off by default, start-closed — cost if wrong: none beyond T3 being untestable end-to-end on host until T4.
+
+Ruling R2: Task 3 builds Initialize/Purge and tests them, wires store open/close and purge; the production Initialize call site is Task 4's applyDemoServing (authenticated stream, caps from the console's per-lifetime snapshot), not a separate T3 path — one owner of initialization, matching T4 text — cost if wrong: T3 reviewer may flag missing call site; T4 adds it.
+
+Ruling R3: each task that adds a console table also adds its store_gate inventory entry and claims-mode refusal witness in the same task; T6 verifies — keeps every task's tree green — cost if wrong: small duplicated edits.
+
+Ruling R4: census card/claims/proposal once in Task 6 (as planned); intermediate branch CI may be red on census only — cost if wrong: red CI between tasks, expected.
+
+Ruling R5: implementers put every human string in internal/edge/demo_copy.go (console strings beside their templates) using the plan's draft copy table verbatim; the Luna copy pass runs before Task 6's commit and is applied verbatim — cost if wrong: one copy edit pass.
+
+Ruling R6: browser witness is opt-in (CARLOS_DEMO_BROWSER_TESTS=1) and drives /usr/bin/chromium headless via the Chrome DevTools Protocol using only existing deps (x/net websocket or net/http); no new go.mod dependency and no downloads; Firefox (and Safari) recorded as outstanding evidence, never a passing skip; Safari stays Paul's Task 6 live check — cost if wrong: weaker cross-browser evidence than planned.
+
+Ruling R7: locally run targeted tests, go build ./..., go vet on changed packages, gofmt -l, and the five cross-compiles; the full go test ./... runs in amadan CI only (controller brief overrides plan step) — cost if wrong: a failure surfaces in CI rather than locally.
+
+Ruling: Task 2's P2-1 is fixed inside Task 3 (switch to an allowlist: text/html gets the banner, other browser-renderable document types refused), since Task 3 owns the resident pipeline and gets its own security review — saves a separate fix round — cost if wrong: Task 3 review must check it; if missed, the whole-branch review catches it.
+
+Ruling R8: a box may create a counter row only for a lifetime the console still marks as never initialized: ServingDemo gains an additive `Initialize bool` (JSON omitempty) set until the console records the box acknowledgement of a revision that carried it; a missing row with Initialize=false refuses serving. Without this a box whose disk was lost would start a fresh allowance, which the plan forbids — cost if wrong: one extra wire field and console column.
+
+Ruling R9: Plan 1 demos (routes lacking a FleetBox label, or initialized without a counter) are not migrated or backfilled; they stay refused, and Task 4 takedown/retirement must work for them, because activation (Task 6 step 6) takes every existing Plan 1 demo down through the new CLI before serving opens — cost if wrong: those few dev demos stay dark until expiry, which they would anyway.
+
+Ruling: Task 3's P2-1 plus P3-6 (demo ownership must use the fleet identity label, not metricsBoxLabel's group reference, else every demo on a group-referenced box fails closed), P3-1 (WAL with synchronous=FULL) and P3-4 (SetDemoTraffic one-time hook) are fixed inside Task 4, which owns retirement and the serving wiring and gets its own security/termination review — cost if wrong: Task 4 grows; whole-branch review is the net.
+
+Task 4: N-P2-1 fix commit 62f9bad7 pushed; scoped Opus check dispatched. Ruling: Task 5 dispatched in parallel with that read-only check (one implementer at a time still holds); any check finding is fixed after T5 — cost if wrong: a fix lands on top of T5.
+
+Ruling: P1-2 option (a): the report door verifies edge-forwarded client IPs through the existing edgeProofKeys loader the login door already uses (cached 30 s), so at most one key read per 30 s while reports arrive (worst case ~2,880/day, about $0.001/day), shared with login. This departs from the plan's literal "no new S3 reads on the report path"; chosen because (b) leaves the abuse channel closable by the reported party and (c) adds a standing periodic read even with no reports — cost if wrong: Paul prefers (b), a small contained change; flagged in the final report.
+
+Task 5: fix round 1 commit b031a93a pushed; review r2 (scoped, Opus) dispatched. Ruling: Task 6 dispatched in parallel with that read-only re-review; a later Task 5 fix would require rerunning census-propose — cost if wrong: one census regeneration.
+
+## Review history
+
+Plan 1's whole-branch review finished at round 3 READY. Its merged design is
+not reopened. Plan 2 whole-branch review has used zero rounds as of Task 6.
+Task 6 does not dispatch a reviewer. Counts follow each change across fixes.
+Stop at the first round without P1; a fourth round needs Paul's approval.
+
+Task 1: review r1 (Opus): spec issues 1 P2, quality needs fixes; P1 0, P2 1, P3 5. Review closes per stopping rules; P2 fix + scoped security re-check.
+
+Task 1: complete (commits 14dd4de6..6f4bc286, review clean after one P2 fix)
+
+Task 2: review r1 (Opus): P1 0, P2 1, P3 9. Review closes. P2-1 active-document denylist misses application/*+xml, multipart/x-mixed-replace, text/xsl (family: banner on every rendered document).
+
+Task 2: complete (commits 6f4bc286..7e43747c, P2 carried into T3 by ruling)
+
+Task 3: review r1 (Opus): P1 0, P2 1, P3 11. Review closes. P2-1 legacy (FleetBox-less) demos cannot retire locally (family: expired/retired demos purge and acknowledge).
+
+Task 3: complete (commits 7e43747c..92819283, P2 carried into T4 by ruling)
+
+Task 4: review r1 (Opus): spec issues, NOT READY. P1 1, P2 4, P3 7.
+
+Task 4: fix round 1/5 (5 addressed, 0 open; commits 3ba6873f..2514f61e). Review r2 (Opus): P1 0 -> review stops (round 2 of 3). New N-P2-1 transient Initialize/registry error still acked -> console marks initialized -> demo 503 for life (family: per-lifetime control/ack scope, 2nd round in that family; this P2 fix is the last allowed in it per rule 2).
+
+Task 4: N-P2-1 ADDRESSED (scoped check), no new P1/P2.
+
+Task 4: complete (commits 92819283..62f9bad7, review r2 clean after fixes; rounds used 2 of 3)
+
+Task 5: review r1 (Opus): NOT READY. P1 2, P2 0, P3 6.
+
+Task 5: fix round 1/5 (P1-1, P1-2, P3-1, P3-3 addressed, 0 open; commits beb841f7..b031a93a). Review r2 READY (rounds used 2 of 3).
+
+Task 5: complete (commits 62f9bad7..b031a93a, review clean after fixes)
+
+Task 1 round 1: zero P1, one P2, five P3. Review closed; the Host
+normalization P2 and three scoped P3 repairs passed a scoped check.
+Task 2 round 1: zero P1, one P2, nine P3. Review closed; Task 3 applied
+the active-document allowlist fix within its resident-pipeline review.
+Task 3 round 1: zero P1, one P2, eleven P3. Review closed; Task 4 applied
+legacy retirement, WAL/FULL, fleet identity and one-time-hook repairs.
+Task 4 round 1: one P1, four P2, seven P3. Round 2: zero P1, one new P2,
+two new P3; READY AFTER FIXES. The final acknowledgement-scope fix passed
+a scoped storage/ack check with no new P1/P2. That family has reached its
+second round; no third repair round is authorized.
+Task 5 round 1: two P1, zero P2, six P3. Round 2: READY after the browser
+Origin and cold-cache client-IP repairs; two new minors remain deferred.
+
+## Deferred minors
+
+These ledger lines retain their original scope. Documentation in Task 6 does
+not turn a deferred implementation issue into a fix.
+
+Task 1: minor (deferred): P3-3 unparseable Expires drops cookie (doc line in T6 README); P3-5 polish (see task-1-review-r1.md)
+
+Task 2: minor (deferred): P3-1..P3-9 in task-2-review-r1.md (P3-1 edge.go wiring owned by T3).
+
+Task 3: minor (deferred): P3-2 deadline ErrNotSupported treated as success, P3-3 tombstone UNIQUE collision, P3-5 retired set unbounded, P3-7 bodyless 429 after byte cap, P3-8 test strength, P3-9 stale FleetBox doc, P3-10 corrupt traffic db blocks retirement (document in T6), P3-11 resident trailers dropped.
+
+Task 4: minor (deferred): N-P3-1 console clock forward jump sticks ValidUntil; N-P3-2 offline box initialized=1 assumes no downgrade (T6 runbook); round-1 P3s in task-4-review-r1.md.
+
+Task 4: minor (deferred): withheld ack pauses box job intake (delay only); UNIQUE conflict treated as transient (unreachable without manual db edit); TestDemoServingStreamRegistryRetry precondition assert.
+
+Task 5: minor (deferred): P3-2 same-second cursor gap; P3-4 GET/HEAD unmetered (T6 docs); P3-5 copy/help gaps (T6 assembled help); P3-6 CARLOS_DEMO_CONSOLE_URL vs CONSOLE_ORIGIN mismatch (T6 docs/activation check).
+
+Task 5: minor (deferred): P3-7 no test for cold key-load failure on report path; P3-8 shared edgeProofKeys cache can be held cold by a cancelled first load (fix in shared loader, e.g. context.WithoutCancel; pre-existing on login).
+
+Task 1 P3-5 covers a receiver-free helper using new(Edge) and duplicate
+ordinary-route lookup work. Task 2's remaining details: unused
+platform HTML helper; BOM/comment placement without a doctype; body tags
+inside templates can hide the notice; HTML HEAD metadata describes the
+original representation; reserved-path refusal wording; SVG refusal;
+readiness-test naming; compound-condition readability. Its production
+wiring and production browser rerun are now covered by Tasks 3 and 6.
+
+Task 4 round-1 details: stale genuine acknowledgements can disconnect;
+new workers require the new console heartbeat decoder; renewal takes an
+exclusive gate and can wait for a slow writer; a mismatched Fence host can
+return nil before purge refuses it; stop-deadline and retired maps grow;
+missing-console help and undocumented override copy; several test-strength
+items. Cancellation and unrelated-lifetime coverage were added in its fixes.
+Task 6 documents console-first rollout and assembles existing help verbatim.
+
+Task 5 pagination can miss a new report inserted in the same second before
+the cursor. Report GET/HEAD requests remain outside the POST budget. The
+shared key loader can remain cold after cancellation of its first load;
+there is no new cold-load-failure witness. These remain follow-ups.
+
+## Task 6 decisions
+
+- Keep the moved-page hook false, without redirect-target state or claim authority.
+ Call it only on the resident path after serving permission, before local
+ retirement and quota handling. Expired and unknown hosts remain plain 404.
+- Exercise the real worker in a local test subprocess because its serving and
+ counter implementation is private to the host package. No production test API
+ is exported. Only root compilation, native launch and deletion are substituted.
+- Build both source revisions offline from the existing pinned fixture. No
+ module download, real box compilation or new dependency is needed.
+- Correct demo_serving to deployment-wide NonApp. Keep demo_reports refusal-only
+ on demo_id; demo_report_attempts remains NonApp. All demo HTTP operations still
+ refuse claims mode. Local counter tables belong only to the assigned box.
+- Treat the report cache ruling as an explicit exception. One refresh calls the
+ existing loader and reads two key objects, not one underlying object GET.
+- Preserve approved runtime strings. Operator prose is a review candidate in
+ copy-deck-t6.md; no review server or delegated copy writer runs in Task 6.
+
+## Local evidence
+
+TestDemoProtectionsSourceToLimitAndTakedown passed with two real ingress
+channels, the production worker stream and durable counter store, offline
+builds of two source revisions, preserved SQLite data and counters, a killed
+and restarted worker, truncated streaming output, reports, serving off/on,
+and pending offline retirement followed by acknowledged purge. The store
+spy separates ordinary traffic from existing retirement work and the approved
+shared report-key cache exception.
+
+Chromium 151.0.7922.173 passed TestDemoBannerBrowser through Edge.ServeHTTP
+and Reload's production proxy wrappers. The only transport substitution is the
+fixture's scratch Unix socket. Exactly one warning appeared; same-origin assets,
+forms and fetch worked; 320px layout passed at 100% and 200% CSS zoom. Hostile
+same-origin script removed the notice while the tested foreign form, fetch,
+image and script requests were blocked. No foreign server request arrived.
+The witness recorded 37 resident requests and 373230 body bytes. CSS zoom is
+layout evidence, not a claim about native browser zoom controls.
+
+The final local gate passed: targeted console/edge/host/CLI/documentation tests,
+console mutation and SQL sealing checks, census/root-scope/J4 checks, vet, one
+native repository build, five cross-compiles and empty whole-tree gofmt output.
+The generated proposal covers 24 units and seven envelopes after the merged
+Plan 1 follow-ups overlay. No independent census verdict is implied.
+
+## Outstanding evidence and activation
+
+Firefox and Safari have not run. The pinned fixture uses Rastrillo day;
+no separate Fiesta theme evidence is claimed. The Chromium witness is local and does not
+prove public DNS/TLS, systemd isolation, real cgroups or root compilation.
+The dev controller must verify every ingress with a fresh lifetime, the existing
+wildcard certificate, matching console origins, small cap snapshots, reporting,
+serving off and confirmed purge. It must remove all Plan 1 demos before opening
+serving. No grandfathering or counter backfill is permitted.
+
+The full Go suite runs in amadan CI under R7. Independent whole-branch review,
+all census unit/envelope verdicts, recording reviewer/tip on #280, the final copy
+pass, green tip CI and live activation remain controller work. Task 6 neither
+pushes nor lands. A later source change requires regeneration of the proposal.
diff --git a/docs/superpowers/notes/census-agent-start-demo-2-claims.md b/docs/superpowers/notes/census-agent-start-demo-2-claims.md
new file mode 100644
index 000000000..03f95904b
--- /dev/null
+++ b/docs/superpowers/notes/census-agent-start-demo-2-claims.md
@@ -0,0 +1,53 @@
+# Census claims: agent-start-demo-2
+# Author claims only. Independent cross-family verdicts are still required.
+# Base chain includes agent-start-demo-1-followups; no seal is hand-edited.
+# Claims below use current source line evidence. The tool decides classifications.
+#
+# Envelope review map (comments are not additional census rows):
+# .: system.go:56,65 adds dispatch; system_demos.go and system_demos_api.go use the
+# existing configured console and human credentials, with no local registry or AWS fallback.
+# internal/demo: config.go:24-90 adds protection switch and positive caps;
+# traffic.go:8-46 defines local counter and authenticated control contracts.
+# internal/demobuild: job.go:140-187 adds probe/ack/control fields. retirement.go:26
+# deliberately extends root-consumed authority: signed reason=operator permits a positive
+# tombstone before original expiry. Empty reason keeps the old signature wire shape;
+# unknown reasons and unsigned edits refuse. Reviewer must check instancectl/demo_cleanup.go
+# unchanged signature/binding/hold/stop-before-delete consumer, not assume edge-only risk.
+# internal/edge: demo_response.go:15-275 installs policy, cookies, redirect and trailer
+# refusals; demo_banner.go:26-310 streams bounded-prefix insertion and passive representations;
+# demo_traffic.go:39-650 installs one-time counters, drains and bounded output; demo.go:190
+# is an inert hook with no read, redirect target or claim authority. edge.go integration
+# is included below. Entire changed package/envelope remains subject to independent review.
+# internal/edge/demo_assets: embedded warning CSS only.
+# internal/host: agent wiring, authenticated demo_jobs.go:344-519 stream, demo_serving.go,
+# demo_traffic.go and demo_cleanup.go. No root control socket verb or deletion path added.
+# internal/provision: demo_policy.go:75 retains assigned FleetBox on the existing route.
+# Console SQL is outside the root binary: demo_reports refuses demo_id writes in claims
+# mode, demo_serving/demo_report_attempts are deployment-wide NonApp, and local traffic
+# rows are box-local. TestDemoProtectionsClaimsMode and TestDemoSQLClaimsRefuseBuildState
+# cover the separate operation and SQL refusal boundaries; inventories are not duplicated.
+#
+system.go:runSystem system.go:62-66 adds the demos family dispatch to the console-only operator client (system_demos.go:19, system_demos_api.go:23); no direct read added and other root commands are unchanged.
+system.go:systemVerb system.go:43-57 recognizes demos; parsing only, no direct read added.
+internal/edge/edge.go:Edge.Reload 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.
+internal/edge/edge.go:Edge.ServeHTTP edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit.
+internal/host/agent.go:runAgent 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.
+internal/edge/demo.go:Edge.handleDemoRequest 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:demoRefusalNames demo.go:57-78 reads Host/IsDemo from the already-listed routes and Host/Alias from already-listed aliases to retain refusal identities after reload filtering. These names only prevent fallback; no query, file or target authority added.
+internal/edge/demo_assets/banner.css:external demo_assets/banner.css:1-31 is the fixed embedded warning layout, referenced by demo_banner.go:22 and served only under the reserved asset path at :91. No external imports, URLs, runtime path or app-selected content; stylesheet bytes are compiled into the edge.
+internal/edge/demo_banner.go:transformDemoHTMLResponse demo_banner.go:212-282 transforms the app HTTP response stream. The new ReadAll at :228 is bounded to 512 bytes of response Body for sniffing, not a filesystem read. HTML is streamed through the bounded-prefix injector; unsupported active types/charsets/encodings refuse and stale representation metadata is removed.
+internal/edge/demo_traffic.go:Edge.demoProxy demo_traffic.go:537-558 reads the supplied Route.Host and IsForward to install resident banner or forwarding transports before reload wrappers. No new registry lookup; resident content is transformed once, forwarded representations remain unchanged.
+internal/edge/demo_traffic.go:Edge.demoTrafficAllowed demo_traffic.go:92-115 compares the current in-memory Route identity, ownership, expiry, assignment and hold against the dispatch snapshot. Local serving also requires the assigned fleet box, nonterminal identity, counter and authenticated worker callback. Field/whole Route reads only, no new storage query.
+internal/edge/demo_traffic.go:Edge.serveDemoTraffic demo_traffic.go:128-334 reads the resolved Route and passes it to existing admission, metering, rate and activator helpers. Resident serving checks precede the inert moved hook (:143), retirement and durable request debit (:302); output debits use the writer below compression. Forwarders do not count or transform again. Existing expiry/control cancellations and five-second write bounds apply; no request-path console or bucket read.
+internal/edge/demo_traffic.go:demoTrafficID demo_traffic.go:88-90 copies DemoID, DemoLifetime and Host from the supplied Route into the local counter key; no query or filesystem read.
+internal/host/demo_serving.go:demoWorker.applyDemoServing demo_serving.go:108-218 validates a control from the authenticated worker stream against connection-local probes, revision, time, duplicate identities and the local registry row (:145-150). Reads the private demo_control SQL revision (:175). Initialize is allowed only for the console-issued flag; missing initialized counters refuse. Transient entry failures withhold acknowledgement, accepted peers remain independent, and replay/deadline bounds are retained. No root execution target is derived from controls.
+internal/host/demo_serving.go:demoWorker.beginDemoServing demo_serving.go:35-55 closes memory permission first, then reads only demo_control.revision from the private traffic DB (:49). Stored control never reopens serving; a new authenticated session/probe is required.
+internal/host/demo_serving.go:demoWorker.demoHeartbeat 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.
+internal/host/demo_serving.go:demoWorker.demoServingAllowed 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.
+internal/host/demo_traffic.go:demoTrafficStore.Initialize demo_traffic.go:102-129 adds parameterized reads of local assignment and counter rows (:110, :116) inside BEGIN IMMEDIATE. Identical initialization preserves totals; cap/host/terminal mismatch and missing counters under an existing assignment refuse. Sole production caller is applyDemoServing at demo_serving.go:155; no traffic request initializes a row.
+internal/host/demo_traffic.go:demoTrafficStore.Purge demo_traffic.go:207-231 reads the local assignment host (:213), verifies it, marks terminal and deletes only the lifetime counter in one transaction. Missing legacy assignment creates a terminal refusal, not allowance. Called after signed retirement drains edge writers and root purge completes (demo_cleanup.go:72-88).
+internal/host/demo_traffic.go:demoTrafficStore.checkAssignment demo_traffic.go:234-245 reads one joined assignment/counter by demo ID and lifetime (:238). Requires host and cap equality and nonterminal state; missing rows refuse and are never recreated here.
+internal/host/demo_traffic.go:demoTrafficStore.debit demo_traffic.go:132-175 reads the private assignment/counter row (:147), checks host, caps, terminal and nonnegative totals, then commits the request or bounded remaining-byte debit before returning allowance. Transactions complete durably without caller cancellation; cancellation or unknown failure returns zero allowance. Storage faults poison admission, not retirement. No release-store read.
+internal/host/demo_traffic.go:openDemoTraffic demo_traffic.go:25-71 opens/creates the absolute configured adjacent database (:29), chmods 0600, opens SQLite (:47), enables WAL/FULL/foreign keys and creates fixed control/assignment/counter schemas (:53). Scanner Open/Exec/Query sites are this local DB setup, not a root command execution. Production path is derived at agent.go:314 from the operator registry path; no tenant input selects it.
+internal/host/demo_cleanup.go:demoWorker.retireDemo demo_cleanup.go:20-103 retains signature, assigned-box, stored receipt/tombstone and original lifetime checks. At :54 reads DemoExpiresAt and FleetBox instead of incorrectly comparing the Assigned timestamp to a label; an empty legacy FleetBox is accepted only under the signed matching receipt, conflicting labels refuse. Adds local serving fence/drain and counter purge before acknowledgements. Root purge method/path derivation is unchanged, but signed operator receipts now permit early retirement via demobuild/retirement.go:26.
+internal/provision/demo_policy.go:stampDemoRoute demo_policy.go:70-78 additionally copies the provision record FleetBox into the demo Route for owner verification. Assigned remains its original timestamp; no new registry query, external read or placement authority.
diff --git a/docs/superpowers/notes/census-proposal-agent-start-demo-2.md b/docs/superpowers/notes/census-proposal-agent-start-demo-2.md
new file mode 100644
index 000000000..c23568919
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-agent-start-demo-2.md
@@ -0,0 +1,49 @@
+# Census approval: agent-start-demo-2
+
+Ruling `census-ruling-agent-start-demo-2`. The independent reviewer approves or rejects every change below, 19 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `system.go` `runSystem` | body | unchanged (0) | system.go:62-66 adds the demos family dispatch to the console-only operator client (system_demos.go:19, system_demos_api.go:23); no direct read added and other root commands are unchanged. |
+| `system.go` `systemVerb` | body | unchanged (0) | system.go:43-57 recognizes demos; parsing only, no direct read added. |
+| `internal/edge/edge.go` `Edge.Reload` | sites | +whole:Route ×2, +whole:RouteAlias | 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. |
+| `internal/edge/edge.go` `Edge.ServeHTTP` | sites | +whole:Route | edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit. |
+| `internal/host/agent.go` `runAgent` | sites | +whole:Route | 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. |
+
+Envelopes re-pinned: `.`, `internal/demo`, `internal/demobuild`, `internal/edge`, `internal/edge/demo_assets`, `internal/host`, `internal/provision`.
+
+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:
+
+- `system.go` `runSystem`: authority, task B,C,D,F,G,J4. Basis: rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops the claims case (host.RunSystemClaims, deleted); every other branch unchanged; no read added;rev3=census-ruling-nearest-region-a;basis=adds the hosts-used family to the system dispatch (carlos system hosts-used status, one GET of a console door as the operator); every existing command branch unchanged; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops the "join" case (host.RunSystemJoin, deleted with internal/host/joinroot.go, its only caller) and its line in the usage text; every other branch unchanged; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the system verb dispatch gains named-units, routed to host.RunSystemNamedUnits; no read of its own;rev3=census-ruling-design-pdf-service;basis=add dispatch for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Adds managed-fleets operator CLI dispatch; no direct read added; existing root command branches unchanged.
+- `system.go` `systemVerb`: authority, task B,C,D,F,G,J4. Basis: rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops "claims" from the verb list, so it now falls to the unknown-verb message; no read added;rev3=census-ruling-nearest-region-a;basis=adds "hosts-used" to the verb list, routed to runSystemHostsUsedVerb; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops "join" from the verb list, so `carlos system join` now falls to the unknown-verb message; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the known-verb list gains named-units; no read of its own;rev3=census-ruling-design-pdf-service;basis=add recognition for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Recognizes managed-fleets as a CLI family; no read added.
+- `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.
+- `internal/edge/edge.go` `Edge.ServeHTTP`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.
+- `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.
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `internal/edge/demo.go:Edge.handleDemoRequest`: reads +whole:Route ×5; written legacy, accepted-legacy, frozen
+- new `internal/edge/demo.go:demoRefusalNames`: reads +registry:Alias ×2, +registry:Host ×2, +whole:Route ×3, +whole:RouteAlias; written legacy, accepted-legacy, frozen
+- new `internal/edge/demo_assets/banner.css:external`: reads +file:external; written legacy, accepted-legacy, frozen
+- new `internal/edge/demo_banner.go:transformDemoHTMLResponse`: reads +file:ReadAll; written legacy, accepted-legacy, frozen
+- new `internal/edge/demo_traffic.go:Edge.demoProxy`: reads +registry:Host; written legacy, accepted-legacy, frozen
+- new `internal/edge/demo_traffic.go:Edge.demoTrafficAllowed`: reads +registry:Account ×2, +registry:App ×2, +registry:Assigned ×2, +registry:DemoExpiresAt ×2, +registry:DemoID ×2, +registry:DemoLifetime ×2, +registry:FleetBox ×3, +registry:FleetLabel ×2, +registry:HoldOp, +registry:Host ×2, +registry:Region ×2, +registry:Status, +whole:Route ×4; written legacy, accepted-legacy, frozen
+- new `internal/edge/demo_traffic.go:Edge.serveDemoTraffic`: reads +registry:App, +registry:DemoExpiresAt, +whole:Route ×29; written legacy, accepted-legacy, frozen
+- new `internal/edge/demo_traffic.go:demoTrafficID`: reads +registry:DemoID, +registry:DemoLifetime, +registry:Host; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_serving.go:demoWorker.applyDemoServing`: reads +file:QueryRowContext, +registry:DemoExpiresAt, +registry:DemoID, +registry:DemoLifetime, +registry:FleetBox, +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_serving.go:demoWorker.beginDemoServing`: reads +file:QueryRow; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_serving.go:demoWorker.demoHeartbeat`: reads +file:Read; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_serving.go:demoWorker.demoServingAllowed`: reads +registry:Account, +registry:DemoExpiresAt, +registry:DemoID, +registry:DemoLifetime, +registry:FleetBox ×2, +registry:HoldOp, +registry:Host, +registry:Region, +registry:Status; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_traffic.go:demoTrafficStore.Initialize`: reads +file:QueryRowContext ×2; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_traffic.go:demoTrafficStore.Purge`: reads +file:QueryRowContext; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_traffic.go:demoTrafficStore.checkAssignment`: reads +file:QueryRowContext; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_traffic.go:demoTrafficStore.debit`: reads +file:QueryRowContext; written legacy, accepted-legacy, frozen
+- new `internal/host/demo_traffic.go:openDemoTraffic`: reads +file:Exec, +file:Open, +file:OpenFile, +file:Query; written legacy, accepted-legacy, frozen
+- reads `internal/host/demo_cleanup.go:demoWorker.retireDemo`: -registry:Assigned, +registry:DemoExpiresAt, +registry:FleetBox ×2; keeps legacy, task accepted-legacy
+- reads `internal/provision/demo_policy.go:stampDemoRoute`: +registry:FleetBox; keeps legacy, task accepted-legacy
+
+Seal: `ec831d3206622f34511bfbc2ec0cccb131fbd3861ec4c6a33a2dc6dff9a1791e` → `4cbf6f0184656467ec5d636632672e1210925d984e9682d0d8cd60a22bfbc3f2`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-agent-start-demo-2.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/console/claim_invariant_test.go b/internal/console/claim_invariant_test.go
index ad14e000e..44b10425b 100644
--- a/internal/console/claim_invariant_test.go
+++ b/internal/console/claim_invariant_test.go
@@ -184,7 +184,6 @@ type claimWindow struct {
// coverage step until a door reaches it or a reason is written here.
var claimWriterReasons = map[string]string{
"sql/demo_reports": "demo reports refuse claims mode; TestDemoSQLClaimsRefuseBuildState proves every write is denied even with an app permit",
- "sql/demo_serving": "demo serving refuses claims mode; TestDemoSQLClaimsRefuseBuildState proves every write is denied",
"sql/demo_caps": "demo caps refuse claims mode; TestDemoSQLClaimsRefuseBuildState proves every write is denied",
"sql/demo_retirements": "anonymous demo retirement refuses claims mode; TestDemoSQLClaimsRefuseBuildState proves every write is denied even with an app permit",
"sql/demo_host_tombstones": "anonymous demo host reservation refuses claims mode; TestDemoSQLClaimsRefuseBuildState proves every write is denied even with an app permit",
diff --git a/internal/console/demo_gate_test.go b/internal/console/demo_gate_test.go
index 0db70e215..a4b93d54f 100644
--- a/internal/console/demo_gate_test.go
+++ b/internal/console/demo_gate_test.go
@@ -3,11 +3,13 @@ package console
import (
"context"
"errors"
+ "net/http"
+ "net/http/httptest"
+ "path/filepath"
+ "testing"
"time"
"github.com/carlosframework/platform/internal/demo"
- "path/filepath"
- "testing"
)
// Demo lifecycle, build work and source bytes cannot be mutated in claims mode,
@@ -57,10 +59,8 @@ func TestDemoSQLClaimsRefuseBuildState(t *testing.T) {
}
err = s.withClaimSQL(context.Background(), []claimSQLScope{gateScope}, allowAllClaimSQL, func(v *Store) error {
for _, query := range []string{
- `INSERT INTO demo_serving(id,enabled,revision,changed_at,changed_by) VALUES(1,1,1,1,'')`,
`INSERT INTO demo_reports(id,demo_id,host,category,details,created_at,ip_hash) VALUES('other','demo','shop.example.com','other','',1,zeroblob(32))`,
`UPDATE demo_reports SET state='resolved'`, `DELETE FROM demo_reports`,
- `UPDATE demo_serving SET enabled=1`, `DELETE FROM demo_serving`,
`INSERT INTO demo_caps(demo_id,lifetime,request_cap,byte_cap) VALUES('other','life',2000,200000000)`,
`UPDATE demo_caps SET initialized=1`, `DELETE FROM demo_caps`,
`INSERT INTO demo_apps(demo_id,account_id,account_sqid,app,name,fleet,claim_token_hash,created_at,creating_ip,source_sha256,client) VALUES('other',7,'shop','other','other','demo',randomblob(32),1,'hash',X'','test')`,
@@ -83,3 +83,67 @@ func TestDemoSQLClaimsRefuseBuildState(t *testing.T) {
t.Fatal(err)
}
}
+
+func TestDemoProtectionsSQLScopes(t *testing.T) {
+ for _, name := range []string{"demo_serving", "demo_report_attempts"} {
+ rule := claimSQLTables[name]
+ if rule.NonApp == "" || rule.App != "" {
+ t.Errorf("%s must be deployment-wide NonApp", name)
+ }
+ }
+ rule := claimSQLTables["demo_reports"]
+ if rule.App != "demo_id" || rule.Refuse == "" {
+ t.Fatal("reports need refusal-only demo identity scope")
+ }
+ for _, name := range []string{"demo_traffic", "demo_assignments", "demo_control"} {
+ if _, ok := claimSQLTables[name]; ok {
+ t.Errorf("box-local %s in console inventory", name)
+ }
+ }
+}
+
+func TestDemoProtectionsClaimsMode(t *testing.T) {
+ fx := newConsoleFixture(t)
+ fx.srv.cfg.Demo = demoTestConfig(t)
+ fx.srv.registerDemoRoutes()
+ fx.srv.registerDemoOperatorRoutes()
+ fx.srv.cfg.SystemOperators = []string{"operator@example.com"}
+ token := cliToken(t, fx, "operator@example.com", "demo-claims")
+ if code, _, body := rawReq(t, "GET", fx.ts.URL+"/api/cli/system/demos", token, ""); code != 200 {
+ t.Fatalf("ungated operator precondition: %d %s", code, body)
+ }
+ fx.srv.cfg.HostClaim = true
+ for _, tc := range []struct{ method, path, body string }{
+ {"GET", "/api/cli/system/demos", ""},
+ {"PUT", "/api/cli/system/demos/serving", `{"enabled":true}`},
+ {"POST", "/api/cli/system/demos/takedown", `{"host":"shop.example.com"}`},
+ {"GET", "/api/cli/system/demos/takedown?host=shop.example.com", ""},
+ {"GET", "/api/cli/system/demos/reports", ""},
+ {"POST", "/api/cli/system/demos/reports/report/resolve", ""},
+ } {
+ code, _, body := rawReq(t, tc.method, fx.ts.URL+tc.path, token, tc.body)
+ if code != 404 {
+ t.Errorf("claims door %s: %d %s", tc.path, code, body)
+ }
+ }
+ for _, method := range []string{"GET", "HEAD", "POST"} {
+ out := httptest.NewRecorder()
+ fx.srv.mux.ServeHTTP(out, httptest.NewRequest(method, fx.srv.cfg.Origin+"/demo/report?host=shop.example.com", nil))
+ if out.Code != http.StatusBadRequest {
+ t.Errorf("claims report %s: %d", method, out.Code)
+ }
+ }
+ if err := fx.srv.setDemoServing(t.Context(), true, "operator@example.com", time.Now()); !errors.Is(err, demo.ErrConfig) {
+ t.Fatalf("claims switch mutation: %v", err)
+ }
+ for _, table := range []string{"demo_reports", "demo_report_attempts"} {
+ var count int
+ if err := fx.st.db.QueryRow("SELECT count(*) FROM " + table).Scan(&count); err != nil || count != 0 {
+ t.Fatalf("claims %s changed: %d %v", table, count, err)
+ }
+ }
+ var enabled bool
+ if err := fx.st.db.QueryRow(`SELECT enabled FROM demo_serving WHERE id=1`).Scan(&enabled); err != nil || enabled {
+ t.Fatalf("claims switch opened: %t %v", enabled, err)
+ }
+}
diff --git a/internal/console/demo_protections_e2e_test.go b/internal/console/demo_protections_e2e_test.go
new file mode 100644
index 000000000..3a907b461
--- /dev/null
+++ b/internal/console/demo_protections_e2e_test.go
@@ -0,0 +1,567 @@
+package console
+
+import (
+ "archive/tar"
+ "bytes"
+ "compress/gzip"
+ "context"
+ "encoding/json"
+ "fmt"
+ "io"
+ "net"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/demobuild"
+ "github.com/carlosframework/platform/internal/domains"
+ "github.com/carlosframework/platform/internal/edge"
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+func demoProtectionWait(t *testing.T, what string, f func() bool) {
+ t.Helper()
+ until := time.Now().Add(35 * time.Second)
+ for !f() {
+ if time.Now().After(until) {
+ t.Fatal("timed out: " + what)
+ }
+ time.Sleep(20 * time.Millisecond)
+ }
+}
+
+// All compiler invocations happen here on the development machine, offline.
+// The worker substitutes prebuilt arm64 output for root's isolated compiler;
+// the matching native binary runs with the real --socket/--db contract.
+func demoProtectionBuilds(t *testing.T, dir string) ([][]byte, []string, []string, string) {
+ t.Helper()
+ var archives [][]byte
+ var arm, native []string
+ for _, rev := range []string{"one", "two"} {
+ src := filepath.Join(dir, rev)
+ if err := os.Mkdir(src, 0700); err != nil {
+ t.Fatal(err)
+ }
+ var packed bytes.Buffer
+ gz := gzip.NewWriter(&packed)
+ tw := tar.NewWriter(gz)
+ for _, name := range []string{"go.mod", "go.sum", "main.go", "app.js", "style.css"} {
+ b, err := os.ReadFile(filepath.Join("../edge/testdata/demo-protections", name))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if name == "main.go" {
+ b = bytes.ReplaceAll(b, []byte(`var revision = "one"`), []byte(`var revision = "`+rev+`"`))
+ }
+ if err = tw.WriteHeader(&tar.Header{Name: name, Mode: 0600, Size: int64(len(b))}); err != nil {
+ t.Fatal(err)
+ }
+ if _, err = tw.Write(b); err != nil {
+ t.Fatal(err)
+ }
+ if err = os.WriteFile(filepath.Join(src, name), b, 0600); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if err := tw.Close(); err != nil {
+ t.Fatal(err)
+ }
+ if err := gz.Close(); err != nil {
+ t.Fatal(err)
+ }
+ lock, err := demobuild.DefaultLock()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, diags, err := demobuild.ValidateSource(bytes.NewReader(packed.Bytes()), lock); err != nil {
+ t.Fatalf("fixture source: %v %+v", err, diags)
+ }
+ archives = append(archives, packed.Bytes())
+ for i, arch := range []string{"arm64", runtime.GOARCH} {
+ out := filepath.Join(dir, fmt.Sprintf("%s-%d-%s", rev, i, arch))
+ cmd := exec.CommandContext(t.Context(), "go", "build", "-p", "1", "-mod=readonly", "-trimpath", "-buildvcs=false", "-o", out, ".")
+ cmd.Dir = src
+ buildOS := runtime.GOOS
+ if i == 0 {
+ buildOS = "linux"
+ }
+ cmd.Env = append(os.Environ(), "GOPROXY=off", "GOTOOLCHAIN=local", "CGO_ENABLED=0", "GOOS="+buildOS, "GOARCH="+arch)
+ if b, err := cmd.CombinedOutput(); err != nil {
+ t.Fatalf("offline fixture build: %v\n%s", err, b)
+ }
+ if i == 0 {
+ arm = append(arm, out)
+ } else {
+ native = append(native, out)
+ }
+ }
+ }
+ worker := filepath.Join(dir, "worker.test")
+ cmd := exec.CommandContext(t.Context(), "go", "test", "-p", "1", "-c", "-o", worker, "../host")
+ cmd.Env = append(os.Environ(), "GOPROXY=off")
+ if b, err := cmd.CombinedOutput(); err != nil {
+ t.Fatalf("build local worker helper: %v\n%s", err, b)
+ }
+ return archives, arm, native, worker
+}
+
+func TestDemoProtectionsSourceToLimitAndTakedown(t *testing.T) {
+ if os.Getenv("TMPDIR") == "" || filepath.Clean(os.Getenv("TMPDIR")) == "/tmp" {
+ t.Fatal("disk TMPDIR required")
+ }
+ dir, err := os.MkdirTemp(os.Getenv("TMPDIR"), "dp-")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer func() {
+ if t.Failed() {
+ if b, err := os.ReadFile(filepath.Join(dir, "worker.log")); err == nil {
+ if len(b) > 4096 {
+ b = b[len(b)-4096:]
+ }
+ t.Logf("worker log: %s", b)
+ }
+ }
+ _ = os.RemoveAll(dir)
+ }()
+ archives, arm, native, workerBinary := demoProtectionBuilds(t, dir)
+ s, storage := demoJobServer(t)
+ s.demoJobs.peers = nil
+ s.cfg.Demo.Account = domains.Sqid(42)
+ s.cfg.Demo.BandwidthCapBytes = 100000
+ s.cfg.Demo.RequestCap = 100
+ s.cfg.SystemOperators = []string{"operator@example.com"}
+ s.registerDemoOperatorRoutes()
+ bucket := filepath.Join(dir, "bucket")
+ storage.Store = release.NewDirStore(bucket)
+ if _, err = s.store.db.Exec(`UPDATE accounts SET sqid=? WHERE id=42`, s.cfg.Demo.Account); err != nil {
+ t.Fatal(err)
+ }
+ reg, err := registry.Open(s.cfg.Registry)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer reg.Close()
+ if err = reg.UpsertFleet(registry.Fleet{Name: s.cfg.Demo.Fleet, Account: s.cfg.Demo.Account, Bucket: "demo-data"}); err != nil {
+ t.Fatal(err)
+ }
+ acct, err := s.store.AccountByID(42)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err = WriteAccountManifest(t.Context(), storage, acct.ID, acct.Sqid, acct.Name, acct.CreatedAt); err != nil {
+ t.Fatal(err)
+ }
+ var consoleCalls atomic.Int64
+ api := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { consoleCalls.Add(1); s.mux.ServeHTTP(w, r) }))
+ defer api.Close()
+ api.Client().Timeout = 5 * time.Second
+ defer s.closeDemoPeers()
+ userCode, deviceCode, err := s.store.NewCLIAuth("local-test", "127.0.0.1", time.Now())
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err = s.store.ApproveCLIAuth(userCode, "operator@example.com", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ _, operator, _, err := s.store.PollCLIAuth(deviceCode, time.Now())
+ if err != nil || operator == "" {
+ t.Fatalf("operator token: %v", err)
+ }
+ op := func(method, path, body string) map[string]any {
+ t.Helper()
+ req, _ := http.NewRequestWithContext(t.Context(), method, api.URL+"/api/cli/system/demos"+path, strings.NewReader(body))
+ req.Header.Set("Authorization", "Bearer "+operator)
+ req.Header.Set("Content-Type", "application/json")
+ res, err := api.Client().Do(req)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer res.Body.Close()
+ b, err := io.ReadAll(res.Body)
+ if err != nil || (res.StatusCode != 200 && res.StatusCode != 202) {
+ t.Fatalf("operator %s: %d %s %v", path, res.StatusCode, b, err)
+ }
+ var v map[string]any
+ if err = json.Unmarshal(b, &v); err != nil {
+ t.Fatal(err)
+ }
+ return v
+ }
+ for _, k := range []string{"CARLOS_FLEET", "CARLOS_TUNNEL_HOST", "CARLOS_DEMO_BOX"} {
+ t.Setenv(k, "")
+ }
+ t.Setenv("CARLOS_TUNNEL_HOST", "127.0.0.1")
+ var hubs []*edge.Edge
+ var fronts []*httptest.Server
+ var hubURLs []string
+ for i := range 2 {
+ e, err := demoE2EEdge(t, fmt.Sprintf("ingress-%d", i), s.cfg.Demo, reg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ e.EnableTunnels(edge.NewTunnelHub("127.0.0.1", nil))
+ if err = e.Reload(); err != nil {
+ t.Fatal(err)
+ }
+ hs := httptest.NewServer(e)
+ defer hs.Close()
+ hubURLs = append(hubURLs, hs.URL)
+ front := httptest.NewTLSServer(e)
+ defer front.Close()
+ fronts = append(fronts, front)
+ hubs = append(hubs, e)
+ }
+ boxPath := filepath.Join(dir, "registry.db")
+ boxReg, err := registry.Open(boxPath)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer boxReg.Close()
+ data := filepath.Join(dir, "data")
+ if err = os.Mkdir(data, 0700); err != nil {
+ t.Fatal(err)
+ }
+ processPath := filepath.Join(dir, "process.json")
+ addressPath := filepath.Join(dir, "address")
+ trafficPath := filepath.Join(dir, "demo-traffic.db")
+ config := map[string]any{"Config": s.cfg.Demo, "Pub": s.cfg.ReleasePub, "Base": api.URL, "Registry": boxPath, "Traffic": trafficPath, "Store": bucket, "Data": data, "Process": processPath, "Address": addressPath, "Hubs": hubURLs, "Binaries": arm}
+ raw, _ := json.Marshal(config)
+ configPath := filepath.Join(dir, "worker.json")
+ if err = os.WriteFile(configPath, raw, 0600); err != nil {
+ t.Fatal(err)
+ }
+ var worker *exec.Cmd
+ var admin string
+ stopWorker := func() {
+ if worker != nil {
+ _ = worker.Process.Kill()
+ _ = worker.Wait()
+ worker = nil
+ }
+ }
+ defer stopWorker()
+ startWorker := func() {
+ _ = os.Remove(addressPath)
+ worker = exec.Command(workerBinary, "-test.run=^TestDemoProtectionsWorkerProcess$", "-test.timeout=5m")
+ worker.Dir = dir
+ worker.Env = []string{"PATH=" + os.Getenv("PATH"), "HOME=" + dir, "TMPDIR=" + dir, "CARLOS_DEMO_TEST_WORKER=" + configPath, "CARLOS_DEMO_EDGE_PROTECTIONS=1", "CARLOS_DEMO_ACCOUNT=" + s.cfg.Demo.Account, "CARLOS_DEMO_FLEET=" + s.cfg.Demo.Fleet, "CARLOS_DEMO_DOMAIN=" + s.cfg.Demo.Domain, "CARLOS_DEMO_CONSOLE_URL=" + s.cfg.Origin}
+ log, err := os.OpenFile(filepath.Join(dir, "worker.log"), os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer log.Close()
+ worker.Stdout = log
+ worker.Stderr = log
+ if err = worker.Start(); err != nil {
+ t.Fatal(err)
+ }
+ demoProtectionWait(t, "worker listener", func() bool { b, err := os.ReadFile(addressPath); admin = string(b); return err == nil })
+ }
+ state := func() map[string]int64 {
+ t.Helper()
+ res, err := api.Client().Get(admin + "/state")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer res.Body.Close()
+ v := map[string]int64{}
+ if err = json.NewDecoder(res.Body).Decode(&v); err != nil {
+ t.Fatal(err)
+ }
+ return v
+ }
+ reload := func() {
+ res, err := api.Client().Get(admin + "/reload")
+ if err != nil {
+ t.Fatal(err)
+ }
+ res.Body.Close()
+ if res.StatusCode != 204 {
+ t.Fatal("reload")
+ }
+ }
+ startWorker()
+ demoProtectionWait(t, "authenticated worker", func() bool {
+ s.demoJobs.mu.Lock()
+ defer s.demoJobs.mu.Unlock()
+ p := s.demoJobs.peers["box"]
+ return p != nil && p.ready.Valid()
+ })
+ transport := fronts[0].Client().Transport.(*http.Transport).Clone()
+ defer transport.CloseIdleConnections()
+ transport.TLSClientConfig.ServerName = "example.com"
+ transport.DialContext = func(ctx context.Context, network, _ string) (net.Conn, error) {
+ return (&net.Dialer{}).DialContext(ctx, network, fronts[0].Listener.Addr().String())
+ }
+ s.demoTransport = transport
+ var stopApp func()
+ defer func() {
+ if stopApp != nil {
+ stopApp()
+ }
+ }()
+ policies := provision.NewPolicyCache(nil)
+ opt := filepath.Join(dir, "opt")
+ var token, host, firstVersion string
+ var d DemoRow
+ var j demobuild.Job
+ var totalBytes int64
+ for generation := range 2 {
+ req, _ := http.NewRequestWithContext(t.Context(), "POST", api.URL+"/api/demo/apps", bytes.NewReader(archives[generation]))
+ req.Header.Set("Content-Type", "application/gzip")
+ if token != "" {
+ req.Header.Set("Authorization", "Bearer "+token)
+ }
+ accepted := demoE2EJSON(t, api.Client(), req, 202)
+ if generation == 0 {
+ token = accepted["claimToken"].(string)
+ } else if accepted["claimToken"] != nil {
+ t.Fatal("update reissued token")
+ }
+ jobID := accepted["jobId"].(string)
+ demoProtectionWait(t, "worker result", func() bool {
+ row, err := s.readDemoJob(t.Context(), jobID)
+ if err != nil {
+ return false
+ }
+ j = row.Job
+ return row.State == "ready"
+ })
+ if err = s.publishReadyDemos(t.Context()); err != nil {
+ t.Fatal(err)
+ }
+ ptr, err := release.Channel(t.Context(), storage, s.cfg.ReleasePub, j.Account, j.App, "edge")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if generation == 0 {
+ firstVersion = ptr.Version
+ host = j.Host
+ } else if host != j.Host || firstVersion == ptr.Version {
+ t.Fatal("update identity/version")
+ }
+ d, err = s.store.demoByID(t.Context(), j.DemoID)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err = provision.Reconcile(t.Context(), storage, boxReg, provision.ReconcileConfig{Region: "fleet/" + j.Fleet, FleetBox: j.Box, DataDir: data, ReleasePub: s.cfg.ReleasePub, Policies: policies}); err != nil {
+ t.Fatal(err)
+ }
+ if err = provision.Reconcile(t.Context(), storage, reg, provision.ReconcileConfig{Region: "home", DataDir: opt, FleetOwners: func() (map[string]string, error) { return map[string]string{j.Fleet: j.Account}, nil }}); err != nil {
+ t.Fatal(err)
+ }
+ for _, hub := range hubs {
+ if err = hub.Reload(); err != nil {
+ t.Fatal(err)
+ }
+ }
+ before := state()
+ if stopApp != nil {
+ stopApp()
+ }
+ socket := filepath.Join(dir, fmt.Sprintf("shop%d.sock", generation))
+ stopApp = demoE2EStart(t, native[generation], filepath.Join(data, "shop.db"), socket)
+ raw, _ = json.Marshal(edge.GenInfo{Socket: socket, N: uint64(generation + 1), Build: ptr.Version})
+ if err = os.WriteFile(processPath, raw, 0600); err != nil {
+ t.Fatal(err)
+ }
+ reload()
+ demoProtectionWait(t, "resident control", func() bool { return state()["ack"] > 0 })
+ if after := state(); after["requests"] != before["requests"] || after["bytes"] != before["bytes"] {
+ t.Fatal("update reset counters")
+ }
+ if ok, err := s.demoReady(t.Context(), d, ptr.Version); err != nil || !ok {
+ t.Fatalf("readiness: %t %v", ok, err)
+ }
+ if err = s.publishReadyDemos(t.Context()); err != nil {
+ t.Fatal(err)
+ }
+ for i, front := range fronts {
+ method := "GET"
+ if generation == 0 && i == 0 {
+ method = "POST"
+ }
+ req, _ = http.NewRequestWithContext(t.Context(), method, front.URL+"/shop", nil)
+ req.Host = host
+ req.Header.Set("Accept-Encoding", "identity")
+ res, err := front.Client().Do(req)
+ if err != nil {
+ t.Fatal(err)
+ }
+ b, err := io.ReadAll(res.Body)
+ res.Body.Close()
+ if err != nil || res.StatusCode != 200 || res.Header.Get("X-Shop-Revision") != []string{"one", "two"}[generation] || !bytes.Contains(b, []byte(`<p id="count">1</p>`)) || bytes.Count(b, []byte(`id="carlos-demo-warning"`)) != 1 {
+ t.Fatalf("ingress %d gen %d: %d %v %s", i, generation, res.StatusCode, err, b)
+ }
+ if res.Header.Get("Cache-Control") != "no-store" || !strings.Contains(res.Header.Get("Content-Security-Policy"), "script-src 'self'") {
+ t.Fatal("missing policy")
+ }
+ if bytes.Contains(b, []byte(token)) {
+ t.Fatal("private token leaked")
+ }
+ totalBytes += int64(len(b))
+ }
+ }
+ if state()["bytes"] < totalBytes {
+ t.Fatal("delivered bytes not durably charged")
+ }
+ demoProtectionWait(t, "initialization acknowledged", func() bool {
+ var v bool
+ return s.store.db.QueryRow(`SELECT initialized FROM demo_caps WHERE demo_id=?`, d.ID).Scan(&v) == nil && v
+ })
+ before := state()
+ storeBefore, callsBefore := storage.requests(), consoleCalls.Load()
+ for _, front := range fronts {
+ req, _ := http.NewRequestWithContext(t.Context(), "GET", front.URL+"/app.js", nil)
+ req.Host = host
+ req.Header.Set("Accept-Encoding", "identity")
+ b := demoE2EHTTP(t, front.Client(), req, 200)
+ totalBytes += int64(len(b))
+ }
+ after := state()
+ if after["requests"] != before["requests"]+2 || after["bytes"] <= before["bytes"] || after["store_calls"] != before["store_calls"] || storage.requests() != storeBefore || consoleCalls.Load() != callsBefore {
+ t.Fatal("traffic bypassed counters or contacted console/bucket")
+ }
+ t.Log("Two production tunnel ingresses share resident counters; browser traffic made zero console or bucket calls.")
+ before = after
+ stopWorker()
+ startWorker()
+ demoProtectionWait(t, "restart control", func() bool { return state()["ack"] > 0 && state()["tunnels"] >= 2 })
+ after = state()
+ if after["requests"] != before["requests"] || after["bytes"] != before["bytes"] {
+ t.Fatalf("crash reset counters: %v -> %v", before, after)
+ }
+ op("PUT", "/serving", `{"enabled":false}`)
+ for _, front := range fronts {
+ demoProtectionWait(t, "serving off", func() bool {
+ req, _ := http.NewRequest("GET", front.URL+"/", nil)
+ req.Host = host
+ res, err := front.Client().Do(req)
+ if err != nil {
+ return false
+ }
+ res.Body.Close()
+ return res.StatusCode == 503
+ })
+ }
+ op("PUT", "/serving", `{"enabled":true}`)
+ demoProtectionWait(t, "serving on control", func() bool {
+ setting, _ := s.demoServingSetting(t.Context())
+ return state()["ack"] == setting.Revision
+ })
+ before = state()
+ req, _ := http.NewRequestWithContext(t.Context(), "GET", fronts[0].URL+"/stream", nil)
+ req.Host = host
+ req.Header.Set("Accept-Encoding", "identity")
+ res, err := fronts[0].Client().Do(req)
+ if err != nil {
+ t.Fatal(err)
+ }
+ b, readErr := io.ReadAll(res.Body)
+ res.Body.Close()
+ after = state()
+ if res.StatusCode != 200 || readErr == nil || int64(len(b)) > 100000-before["bytes"] || after["bytes"] != 100000 {
+ t.Fatalf("stream cap: status=%d bytes=%d err=%v before=%v after=%v", res.StatusCode, len(b), readErr, before, after)
+ }
+ for _, front := range fronts {
+ req, _ = http.NewRequestWithContext(t.Context(), "GET", front.URL+"/", nil)
+ req.Host = host
+ demoE2EHTTP(t, front.Client(), req, 429)
+ }
+ cookie, form := reportForm(t, s, host)
+ if out := reportPost(s, cookie, form, s.cfg.Origin, "192.0.2.1"); out.Code != 200 {
+ t.Fatalf("report %d %s", out.Code, out.Body.String())
+ }
+ listed := op("GET", "/reports", "")
+ reports := listed["reports"].([]any)
+ if len(reports) != 1 {
+ t.Fatal("report not listed")
+ }
+ reportID := reports[0].(map[string]any)["id"].(string)
+ if resolved := op("POST", "/reports/"+reportID+"/resolve", ""); resolved["state"] != "resolved" {
+ t.Fatalf("resolution: %v", resolved)
+ }
+ stopWorker()
+ stopApp()
+ stopApp = nil
+ taken := op("POST", "/takedown", `{"host":"`+host+`"}`)
+ if taken["cleanup"] != "pending" {
+ t.Fatal("offline cleanup claimed complete")
+ }
+ if _, err = os.Stat(filepath.Join(data, "shop.db")); err != nil {
+ t.Fatal("offline data vanished")
+ }
+ if err = os.WriteFile(filepath.Join(data, "allow-purge"), nil, 0600); err != nil {
+ t.Fatal(err)
+ }
+ startWorker()
+ demoProtectionWait(t, "resumed purge acknowledgement", func() bool {
+ receipt, err := s.demoRetirement(t.Context(), d.ID)
+ return err == nil && receipt.Acknowledged && receipt.InitializedClean
+ })
+ s.expireDemos(t.Context(), time.Now(), true)
+ gone := op("GET", "/takedown?host="+host, "")
+ if gone["cleanup"] != "complete" {
+ t.Fatalf("cleanup: %v", gone)
+ }
+ for _, suffix := range []string{"", "-wal", "-shm"} {
+ if _, err = os.Stat(filepath.Join(data, "shop.db") + suffix); !os.IsNotExist(err) {
+ t.Fatal("app data remains")
+ }
+ }
+ if state()["requests"] != 0 || state()["bytes"] != 0 {
+ t.Fatal("local counters remain")
+ }
+ for _, front := range fronts {
+ req, _ = http.NewRequestWithContext(t.Context(), "GET", front.URL+"/", nil)
+ req.Host = host
+ demoE2EHTTP(t, front.Client(), req, 404)
+ }
+ t.Log("Offline worker takedown stayed pending; reconnect purged app data and counters through signed retirement and both authenticated acknowledgements. Root process deletion was substituted.")
+}
+
+func TestDemoProtectionsNoBucketTraffic(t *testing.T) {
+ s, d, _, _ := demoPublishFixture(t)
+ store := s.cfg.Releases.(*demoCountingStore)
+ before := store.requests()
+ for _, on := range []bool{false, true} {
+ if err := s.setDemoServing(t.Context(), on, "operator@example.com", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := s.demoOperatorView(t.Context(), time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ }
+ c, v := reportForm(t, s, d.Host)
+ if out := reportPost(s, c, v, s.cfg.Origin, "192.0.2.1"); out.Code != 200 {
+ t.Fatal(out.Body.String())
+ }
+ reports, _, err := s.store.ListDemoReports(t.Context(), "", 50)
+ if err != nil || len(reports) != 1 {
+ t.Fatalf("reports: %v", err)
+ }
+ if err = s.store.ResolveDemoReport(t.Context(), reports[0].ID, "operator@example.com", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ if store.requests() != before {
+ t.Fatal("direct report/status/switch path added bucket calls")
+ }
+ t.Run("forwarded-report-shared-key-cache-exception", TestDemoReportForwardingUsesSharedKeyCache)
+ if err = s.retireDemoLocked(t.Context(), d, time.Now(), "operator"); err != nil {
+ t.Fatal(err)
+ }
+ if store.requests() <= before {
+ t.Fatal("retirement store spy did not observe existing cleanup work")
+ }
+ t.Logf("Existing retirement separately used %d store operations (receipt/tombstone/record cleanup); reports may refresh the shared two-object edge-proof cache per the controller ruling.", store.requests()-before)
+}
diff --git a/internal/console/store_gate.go b/internal/console/store_gate.go
index 13824b8f0..909e5afab 100644
--- a/internal/console/store_gate.go
+++ b/internal/console/store_gate.go
@@ -190,7 +190,7 @@ var claimAppsTerminal = map[string][]string{
var claimSQLTables = map[string]claimSQLTable{
"demo_reports": {App: "demo_id", Refuse: "anonymous demo reports require claims mode off"},
"demo_report_attempts": {NonApp: "deployment report attempt budget keyed by salted IP hash and time; names no app"},
- "demo_serving": {App: "id", Refuse: "anonymous demo serving requires claims mode off"},
+ "demo_serving": {NonApp: "deployment-wide serving switch and revision; names no app; demo handlers refuse claims mode"},
"demo_caps": {App: "demo_id", Refuse: "anonymous demo caps require claims mode off"},
"demo_retirements": {App: "demo_id", Refuse: "anonymous demo retirement requires claims mode off"},
"demo_host_tombstones": {App: "demo_id", Refuse: "anonymous demo host reservations require claims mode off"},
diff --git a/internal/edge/demo.go b/internal/edge/demo.go
index ba59cb37e..481bad843 100644
--- a/internal/edge/demo.go
+++ b/internal/edge/demo.go
@@ -184,3 +184,9 @@ func (e *Edge) lookupDemoAware(m map[string]upstream, host string) (upstream, bo
}
return lookupIn(m, host)
}
+
+// Plan 3 must authenticate lifecycle evidence before this can serve moved
+// content. App headers and routes grant no claim or redirect authority here.
+func (e *Edge) demoMovedPage(w http.ResponseWriter, r *http.Request, host string) bool {
+ return false
+}
diff --git a/internal/edge/demo_banner_browser_test.go b/internal/edge/demo_banner_browser_test.go
index 9c6c0e244..ab26f6105 100644
--- a/internal/edge/demo_banner_browser_test.go
+++ b/internal/edge/demo_banner_browser_test.go
@@ -61,7 +61,7 @@ func TestDemoBannerBrowser(t *testing.T) {
if tmp == "" || filepath.Clean(tmp) == "/tmp" {
t.Fatal("set TMPDIR to disk scratch before browser tests")
}
- scratch, err := os.MkdirTemp(tmp, "demo-banner-browser-")
+ scratch, err := os.MkdirTemp(tmp, "db-")
if err != nil {
t.Fatal(err)
}
@@ -96,7 +96,25 @@ func TestDemoBannerBrowser(t *testing.T) {
return (&net.Dialer{}).DialContext(ctx, "unix", socket)
}}
defer upstream.CloseIdleConnections()
- target, _ := url.Parse("http://shop.example.com")
+ e, rt, counter := demoTrafficFixture(t, nil)
+ e.gzipOn = true
+ if err := e.reg.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ if err := e.Reload(); err != nil {
+ t.Fatal(err)
+ }
+ wrapped, ok := e.current()[rt.Host].proxy.(assetScrubbedProxy)
+ if !ok {
+ t.Fatal("missing production proxy wrapper")
+ }
+ transport, ok := wrapped.proxy.Transport.(demoBannerTransport)
+ if !ok {
+ t.Fatal("missing production banner transport")
+ }
+ transport.base = upstream
+ wrapped.proxy.Transport = transport
+
var mu sync.Mutex
requests := map[string]int{}
foreignRequests := 0
@@ -107,7 +125,7 @@ func TestDemoBannerBrowser(t *testing.T) {
w.WriteHeader(204)
}))
defer foreign.Close()
- handler := demoBannerTestProxy(t, target, upstream, "shop.example.com")
+ handler := e
site := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
mu.Lock()
requests[r.URL.Path]++
@@ -122,7 +140,7 @@ func TestDemoBannerBrowser(t *testing.T) {
}
spki := sha256.Sum256(cert.RawSubjectPublicKeyInfo)
profile := filepath.Join(scratch, "chromium")
- browser := exec.Command("/usr/bin/chromium", "--headless", "--no-sandbox", "--disable-gpu", "--no-first-run", "--no-default-browser-check", "--disable-background-networking", "--disable-component-update", "--disable-sync", "--disable-default-apps", "--no-proxy-server", "--remote-debugging-address=127.0.0.1", "--remote-debugging-port=0", "--remote-allow-origins=http://127.0.0.1", "--host-resolver-rules=MAP shop.example.com 127.0.0.1, MAP * ~NOTFOUND", "--ignore-certificate-errors-spki-list="+base64.StdEncoding.EncodeToString(spki[:]), "--user-data-dir="+profile, "about:blank")
+ browser := exec.Command("/usr/bin/chromium", "--headless", "--no-sandbox", "--disable-gpu", "--no-first-run", "--no-default-browser-check", "--disable-background-networking", "--disable-component-update", "--disable-sync", "--disable-default-apps", "--no-proxy-server", "--remote-debugging-address=127.0.0.1", "--remote-debugging-port=0", "--remote-allow-origins=http://127.0.0.1", "--host-resolver-rules=MAP "+rt.Host+" 127.0.0.1, MAP * ~NOTFOUND", "--ignore-certificate-errors-spki-list="+base64.StdEncoding.EncodeToString(spki[:]), "--user-data-dir="+profile, "about:blank")
browser.Env = []string{"PATH=" + os.Getenv("PATH"), "HOME=" + scratch, "TMPDIR=" + scratch}
demoBrowserProcess(t, browser, filepath.Join(scratch, "chromium.log"))
var port string
@@ -171,7 +189,7 @@ func TestDemoBannerBrowser(t *testing.T) {
cdp.call("Page.enable", nil)
cdp.call("Network.enable", nil)
parsed, _ := url.Parse(site.URL)
- origin := "https://shop.example.com:" + parsed.Port()
+ origin := "https://" + rt.Host + ":" + parsed.Port()
navigate := func(path string) {
cdp.call("Page.navigate", map[string]any{"url": origin + path})
cdp.wait(`window.demoReady === true && location.pathname === ` + demoJSON(strings.Split(path, "?")[0]))
@@ -180,7 +198,7 @@ func TestDemoBannerBrowser(t *testing.T) {
cdp.check(`document.querySelectorAll('#carlos-demo-warning').length===1 && document.querySelectorAll('link[href="/.carlos/demo/banner.css"]').length===1`)
cdp.check(`document.querySelector('#carlos-demo-warning').textContent.includes(` + demoJSON(demoCopy["DEMO-BANNER"]) + `) && getComputedStyle(document.querySelector('#carlos-demo-warning')).position==='fixed'`)
cdp.check(`window.externalRan===true && window.inlineRan!==true && document.querySelector('#fetched').textContent==='shop' && document.cookie.includes('shop_script=1') && document.cookie.includes('shop_server=1')`)
- cdp.check(`document.querySelector('#carlos-demo-warning a').href==='https://console.example.com/demo/report?host=shop.example.com' && document.querySelector('#carlos-demo-warning a').rel==='noopener noreferrer'`)
+ cdp.check(`document.querySelector('#carlos-demo-warning a').href==='https://console.example.com/demo/report?host=` + rt.Host + `' && document.querySelector('#carlos-demo-warning a').rel==='noopener noreferrer'`)
t.Log("Chromium DOM: one fixed warning and stylesheet; external same-origin script, self fetch, server cookie and script cookie work; inline script did not run; report URL contains only canonical host.")
cdp.eval(`document.querySelector('#self-form').submit(); true`)
cdp.wait(`location.pathname==='/shop' && window.demoReady===true && document.querySelector('#count').textContent==='1'`)
@@ -202,7 +220,7 @@ func TestDemoBannerBrowser(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- request.Host = "shop.example.com"
+ request.Host = rt.Host
noMetadata, err := site.Client().Do(request)
if err != nil {
t.Fatal(err)
@@ -224,7 +242,14 @@ func TestDemoBannerBrowser(t *testing.T) {
t.Fatalf("foreign server received %d requests", hits)
}
t.Logf("Hostile same-origin JavaScript removed the notice. CSP still blocked foreign form, fetch, image and script; violations=%s; foreign server requests=%d", cdp.eval("window.violations"), hits)
- t.Logf("Loopback app network observations: %s", observed)
+ counter.mu.Lock()
+ requestsCount, byteCount := counter.requests, counter.bytes
+ counter.mu.Unlock()
+ if requestsCount == 0 || byteCount == 0 {
+ t.Fatal("browser bypassed resident accounting")
+ }
+ t.Logf("Production resident pipeline: requests=%d bytes=%d", requestsCount, byteCount)
+ t.Logf("Loopback edge network observations: %s", observed)
for _, path := range []string{"/.carlos/demo/banner.css", "/static/tokens.css", "/static/theme.css", "/static/rastrillo.js", "/style.css", "/app.js", "/api/shop", "/shop", "/shop/deep"} {
mu.Lock()
n := requests[path]
diff --git a/internal/edge/demo_protections_test.go b/internal/edge/demo_protections_test.go
new file mode 100644
index 000000000..aa54e5552
--- /dev/null
+++ b/internal/edge/demo_protections_test.go
@@ -0,0 +1,46 @@
+package edge
+
+import (
+ "net/http"
+ "net/http/httptest"
+ "strings"
+ "testing"
+ "time"
+)
+
+func TestDemoMovedHookInert(t *testing.T) {
+ e, rt, counter := demoTrafficFixture(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Location", "https://example.com/moved")
+ w.Header().Set("X-Carlos-Demo-Moved", "https://example.com/moved")
+ w.WriteHeader(http.StatusMovedPermanently)
+ }))
+ r := httptest.NewRequest("GET", "https://"+rt.Host+"/", nil)
+ out := httptest.NewRecorder()
+ if e.demoMovedPage(out, r, rt.Host) || out.Body.Len() != 0 || len(out.Header()) != 0 {
+ t.Fatal("inert hook wrote a response")
+ }
+ e.ServeHTTP(out, r)
+ if out.Code != 502 || out.Header().Get("Location") != "" {
+ t.Fatalf("app selected moved page: %d %v", out.Code, out.Header())
+ }
+ rt.DemoExpiresAt = time.Now().Add(-time.Second).Unix()
+ demoSetProxy(e, rt, http.HandlerFunc(func(http.ResponseWriter, *http.Request) { t.Error("expired app dispatched") }))
+ for _, host := range []string{rt.Host, "unknown.example.com"} {
+ out = httptest.NewRecorder()
+ e.ServeHTTP(out, httptest.NewRequest("GET", "https://"+host+"/", nil))
+ if out.Code != 404 || out.Header().Get("Location") != "" || out.Body.String() != demoCopy["DEMO-GONE"]+"\n" || strings.Contains(out.Body.String(), "claim") {
+ t.Fatalf("gone response: %d %s", out.Code, out.Body.String())
+ }
+ assertDemoPolicy(t, out.Header())
+ }
+ if counter.requests != 1 {
+ t.Fatalf("expired host spent request: %d", counter.requests)
+ }
+}
+
+func TestDemoProtectionsOrdinaryUnchanged(t *testing.T) {
+ t.Run("headers-and-fallback", TestDemoPolicyOrdinaryUnchanged)
+ t.Setenv("CARLOS_DEMO_DOMAIN", "demos.example.com")
+ t.Run("cache-and-compression", TestEdgeCacheStoresIdentityBodies)
+ t.Run("upgrades", TestUpgradesUntrackedWhenNotGoverned)
+}
diff --git a/internal/edge/demo_traffic.go b/internal/edge/demo_traffic.go
index ea6d9fbb1..b225c25aa 100644
--- a/internal/edge/demo_traffic.go
+++ b/internal/edge/demo_traffic.go
@@ -139,6 +139,9 @@ func (e *Edge) serveDemoTraffic(dst http.ResponseWriter, r *http.Request, up ups
serveDemoPlain(dst, r, 503, "DEMO-UNAVAILABLE")
return
}
+ if !up.route.IsForward() && e.demoMovedPage(dst, r, host) {
+ return
+ }
r = r.Clone(r.Context())
r.Host = host
// Reuse transport authentication and header scrubbing. Client-supplied
diff --git a/internal/edge/testdata/demo-protections/app.js b/internal/edge/testdata/demo-protections/app.js
index ceaefb889..75a1a5696 100644
--- a/internal/edge/testdata/demo-protections/app.js
+++ b/internal/edge/testdata/demo-protections/app.js
@@ -2,7 +2,7 @@ window.violations = [];
document.addEventListener('securitypolicyviolation', e => window.violations.push(e.effectiveDirective));
document.cookie = 'shop_script=1; Path=/; Secure; SameSite=Lax';
window.externalRan = true;
-fetch('/api/shop').then(r => r.json()).then(data => {
+fetch(new URL('/api/shop', location.href)).then(r => r.json()).then(data => {
document.querySelector('#fetched').textContent = data.shop ? 'shop' : '';
window.demoReady = true;
});
diff --git a/internal/edge/testdata/demo-protections/main.go b/internal/edge/testdata/demo-protections/main.go
index 8b9bb251b..3d4bd7054 100644
--- a/internal/edge/testdata/demo-protections/main.go
+++ b/internal/edge/testdata/demo-protections/main.go
@@ -9,6 +9,7 @@ import (
"log"
"net/http"
"strings"
+ "time"
"amadan.net/rastrillo/rastrillo"
_ "amadan.net/rastrillo/rastrillo/locales/en"
@@ -21,6 +22,8 @@ var appJS string
//go:embed style.css
var appCSS string
+var revision = "one"
+
func main() {
socket := flag.String("socket", "", "")
db := flag.String("db", "", "")
@@ -54,6 +57,22 @@ func main() {
w.Header().Set("Content-Type", "text/css")
_, _ = fmt.Fprint(w, appCSS)
})
+ mux.HandleFunc("GET /stream", func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/event-stream")
+ for {
+ if _, err := fmt.Fprint(w, "data: "+strings.Repeat("shop", 1024)+"\n\n"); err != nil {
+ return
+ }
+ if err := http.NewResponseController(w).Flush(); err != nil {
+ return
+ }
+ select {
+ case <-r.Context().Done():
+ return
+ case <-time.After(time.Millisecond):
+ }
+ }
+ })
mux.HandleFunc("GET /api/shop", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, _ = fmt.Fprint(w, `{"shop":true}`)
@@ -71,8 +90,9 @@ func main() {
return
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ w.Header().Set("X-Shop-Revision", revision)
w.Header().Add("Set-Cookie", "shop_server=1; Domain=example.com; Path=/; Secure; SameSite=Lax")
- _, _ = fmt.Fprintf(w, `<!doctype html><html lang="en"><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>shop</title><link rel="stylesheet" href="/static/tokens.css"><link rel="stylesheet" href="/static/theme.css"><link rel="stylesheet" href="/style.css"><script src="/static/rastrillo.js" defer></script><script src="/app.js" defer></script><script>window.inlineRan=true</script></head><body><main class="rst-stack"><h1>shop</h1><p id="count">%d</p><a id="deep" href="/shop/deep">shop</a><form id="self-form" action="/shop" method="post"><input name="shop" value="shop"><button class="rst-btn rst-btn--primary" type="submit">shop</button></form><form id="foreign-form" action="%s/form" method="post"><input name="shop" value="shop"></form><p id="fetched"></p></main></body></html>`, count, html.EscapeString(r.URL.Query().Get("foreign")))
+ _, _ = fmt.Fprintf(w, `<!doctype html><html lang="en"><head><meta name="viewport" content="width=device-width, initial-scale=1"><title>shop</title><link rel="stylesheet" href="/static/tokens.css"><link rel="stylesheet" href="/static/theme.css"><link rel="stylesheet" href="/style.css"><script src="/static/rastrillo.js" defer></script><script src="/app.js" defer></script><script>window.inlineRan=true</script></head><body><main class="rst-stack"><h1>shop</h1><p id="count">%d</p><p id="revision">%s</p><a id="deep" href="/shop/deep">shop</a><form id="self-form" action="/shop" method="post"><input name="shop" value="shop"><button class="rst-btn rst-btn--primary" type="submit">shop</button></form><form id="foreign-form" action="%s/form" method="post"><input name="shop" value="shop"></form><p id="fetched"></p></main></body></html>`, count, html.EscapeString(revision), html.EscapeString(r.URL.Query().Get("foreign")))
})
return mux, nil
},
diff --git a/internal/edge/testdata/demo-protections/style.css b/internal/edge/testdata/demo-protections/style.css
index df89d62b6..6ede2570a 100644
--- a/internal/edge/testdata/demo-protections/style.css
+++ b/internal/edge/testdata/demo-protections/style.css
@@ -1,2 +1,4 @@
main { max-width: 48rem; margin: 1rem auto; padding: 1rem; }
input, button { font: inherit; max-width: 100%; }
+
+#revision { overflow-wrap: anywhere; }
diff --git a/internal/host/demo_protections_test.go b/internal/host/demo_protections_test.go
new file mode 100644
index 000000000..4f1b0d402
--- /dev/null
+++ b/internal/host/demo_protections_test.go
@@ -0,0 +1,222 @@
+package host
+
+import (
+ "context"
+ "crypto/ed25519"
+ "encoding/json"
+ "errors"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strings"
+ "sync/atomic"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/demo"
+ "github.com/carlosframework/platform/internal/demobuild"
+ "github.com/carlosframework/platform/internal/edge"
+ "github.com/carlosframework/platform/internal/instancectl"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+ "github.com/carlosframework/platform/internal/tunnelclient"
+)
+
+// The console integration test starts this test binary on the development
+// machine. Only root compilation, launch and deletion are substituted. The
+// worker, authenticated stream, counters and edge are the production code.
+func TestDemoProtectionsWorkerProcess(t *testing.T) {
+ path := os.Getenv("CARLOS_DEMO_TEST_WORKER")
+ if path == "" {
+ t.Skip("subprocess helper for console protection integration")
+ }
+ raw, err := os.ReadFile(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var c struct {
+ Config demo.Config
+ Pub ed25519.PublicKey
+ Base, Registry, Traffic, Store, Data, Process, Address string
+ Hubs []string
+ Binaries []string
+ }
+ if err = json.Unmarshal(raw, &c); err != nil {
+ t.Fatal(err)
+ }
+ reg, err := registry.Open(c.Registry)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer reg.Close()
+ traffic, err := openDemoTraffic(c.Traffic)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer traffic.Close()
+ process := &demoProtectionProcess{path: c.Process}
+ front, err := edge.New(reg, process)
+ if err != nil {
+ t.Fatal(err)
+ }
+ store := &demoProtectionStore{Store: release.NewDirStore(c.Store)}
+ w := &demoWorker{cfg: c.Config, pub: c.Pub, box: "box", base: c.Base, reg: reg, traffic: traffic, store: store, data: release.NewDirStore(c.Data), http: &http.Client{Timeout: 15 * time.Second}, credentials: func() (string, string, bool) { return c.Config.Fleet + "/box", "worker-token", true }}
+ w.stopTraffic = front.StopDemoTraffic
+ w.serving.cancel = front.CancelDemoResponses
+ front.SetDemoBoxLabel("box")
+ front.SetDemoTraffic(traffic, w.demoServingAllowed, w.demoServingGate())
+ w.notify = func() {
+ if err := front.Reload(); err != nil {
+ t.Error(err)
+ }
+ }
+ w.pickup = w.pickupHTTP
+ w.acknowledge = w.acknowledgeDemoHTTP
+ w.complete = func(ctx context.Context, wire []byte) error { return w.acknowledgeDemoPhaseHTTP(ctx, wire, true) }
+ w.readiness = func(context.Context) (demobuild.WorkerReady, error) {
+ return demobuild.WorkerReady{Capability: "anonymous-demo-v1", GOARCH: "arm64", Slots: 1, BundleSHA256: strings.Repeat("a", 64)}, nil
+ }
+ w.build = func(ctx context.Context, wire []byte, src io.Reader) (demobuild.BuildOutput, error) {
+ j, err := demobuild.VerifyJob(c.Pub, wire, time.Now())
+ if err != nil {
+ return demobuild.BuildOutput{}, err
+ }
+ lock, err := demobuild.DefaultLock()
+ if err != nil {
+ return demobuild.BuildOutput{}, err
+ }
+ source, _, err := demobuild.ValidateSource(src, lock)
+ if err != nil || source.SHA256 != j.SourceSHA256 {
+ return demobuild.BuildOutput{}, errors.New("source mismatch")
+ }
+ if j.Generation < 1 || j.Generation > uint64(len(c.Binaries)) {
+ return demobuild.BuildOutput{}, errors.New("unexpected generation")
+ }
+ b, err := os.ReadFile(c.Binaries[j.Generation-1])
+ return demobuild.BuildOutput{Binary: b}, err
+ }
+ // The parent stops the fixture before allowing purge. Root's own deletion
+ // and cgroup checks remain covered by the separate kernel witness.
+ w.purge = func(ctx context.Context, in instancectl.DemoPurgeRequest) error {
+ if _, err := os.Stat(filepath.Join(c.Data, "allow-purge")); err != nil {
+ return err
+ }
+ row, err := reg.Get(in.Demo.Host)
+ if err != nil || row == nil || !registry.IsHold(row.Status) {
+ return errors.New("purge before hold")
+ }
+ for _, suffix := range []string{"", "-wal", "-shm"} {
+ if err := os.Remove(filepath.Join(c.Data, "shop.db") + suffix); err != nil && !os.IsNotExist(err) {
+ return err
+ }
+ }
+ return nil
+ }
+ ctx, cancel := context.WithCancel(t.Context())
+ defer cancel()
+ done := make(chan struct{})
+ go func() { defer close(done); _ = w.Connect(ctx) }()
+ defer func() { cancel(); <-done }()
+ var connected atomic.Int32
+ for _, base := range c.Hubs {
+ finished := make(chan struct{})
+ go func() {
+ defer close(finished)
+ tunnelclient.Loop(ctx, tunnelclient.Config{URL: base, Name: c.Config.Fleet + "/box", Token: "worker-token", Handler: front, OnState: func(state string) {
+ if state == tunnelclient.StateConnected {
+ connected.Add(1)
+ }
+ }, Logf: func(string, ...any) {}})
+ }()
+ defer func() { cancel(); <-finished }()
+ }
+ admin := httptest.NewServer(http.HandlerFunc(func(dst http.ResponseWriter, r *http.Request) {
+ switch r.URL.Path {
+ case "/reload":
+ w.notify()
+ dst.WriteHeader(204)
+ case "/state":
+ w.serving.mu.Lock()
+ ack := w.serving.ack
+ w.serving.mu.Unlock()
+ var requests, bodyBytes int64
+ if err := traffic.db.QueryRowContext(r.Context(), `SELECT coalesce(sum(requests),0),coalesce(sum(body_bytes),0) FROM demo_traffic`).Scan(&requests, &bodyBytes); err != nil {
+ http.Error(dst, err.Error(), 503)
+ return
+ }
+ _ = json.NewEncoder(dst).Encode(map[string]any{"requests": requests, "bytes": bodyBytes, "ack": ack, "tunnels": connected.Load(), "store_calls": store.calls.Load()})
+ default:
+ http.NotFound(dst, r)
+ }
+ }))
+ defer admin.Close()
+ if err = os.WriteFile(c.Address, []byte(admin.URL), 0600); err != nil {
+ t.Fatal(err)
+ }
+ <-ctx.Done()
+}
+
+type demoProtectionProcess struct{ path string }
+
+func (p *demoProtectionProcess) ServeHTTP(w http.ResponseWriter, r *http.Request, _ registry.Route, h http.Handler) bool {
+ h.ServeHTTP(w, r)
+ return true
+}
+func (*demoProtectionProcess) RetireExcept(map[string]bool) {}
+func (*demoProtectionProcess) AdmitHeldLeg(context.Context, registry.Route) (edge.HeldLeg, error) {
+ return nil, errors.New("no held streams")
+}
+func (*demoProtectionProcess) HeldAdmissible(string) bool { return false }
+func (*demoProtectionProcess) SetHeldWakeHook(func(string)) {}
+func (*demoProtectionProcess) GenerationsOn() bool { return true }
+func (p *demoProtectionProcess) AppSocket(host string) (string, bool) {
+ g, ok := p.ServingGen(host)
+ return g.Socket, ok
+}
+func (p *demoProtectionProcess) ServingGen(string) (edge.GenInfo, bool) {
+ var g edge.GenInfo
+ b, err := os.ReadFile(p.path)
+ if err != nil {
+ return g, false
+ }
+ err = json.Unmarshal(b, &g)
+ return g, err == nil
+}
+func (p *demoProtectionProcess) CacheGen(host string) (uint64, bool) {
+ g, ok := p.ServingGen(host)
+ return g.N, ok
+}
+func (*demoProtectionProcess) OnGenRetired(func(string, string)) {}
+
+// Count every release-store operation, including streaming source reads.
+type demoProtectionStore struct {
+ release.Store
+ calls atomic.Int64
+}
+
+func (s *demoProtectionStore) Get(ctx context.Context, key string) ([]byte, string, error) {
+ s.calls.Add(1)
+ return s.Store.Get(ctx, key)
+}
+func (s *demoProtectionStore) Open(ctx context.Context, key string) (io.ReadCloser, string, error) {
+ s.calls.Add(1)
+ return release.OpenObjectStreaming(ctx, s.Store, key)
+}
+func (s *demoProtectionStore) Put(ctx context.Context, key string, b []byte, tag string) (string, error) {
+ s.calls.Add(1)
+ return s.Store.Put(ctx, key, b, tag)
+}
+func (s *demoProtectionStore) Delete(ctx context.Context, key string) error {
+ s.calls.Add(1)
+ return s.Store.Delete(ctx, key)
+}
+func (s *demoProtectionStore) List(ctx context.Context, key string) ([]string, error) {
+ s.calls.Add(1)
+ return s.Store.List(ctx, key)
+}
+func (s *demoProtectionStore) ListDirs(ctx context.Context, key string) ([]string, error) {
+ s.calls.Add(1)
+ return s.Store.ListDirs(ctx, key)
+}
diff --git a/internal/provision/testdata/plan14-root-reads-agent-start-demo-2.tsv b/internal/provision/testdata/plan14-root-reads-agent-start-demo-2.tsv
new file mode 100644
index 000000000..7a8681be1
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-agent-start-demo-2.tsv
@@ -0,0 +1,55 @@
+# Census overlay agent-start-demo-2, written by census-propose (#369). census-ruling-agent-start-demo-2, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-agent-start-demo-2.md.
+# 2 body, 3 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 19 new dispositions: 2 reads re-frozen at their disposition with the claim, 17 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy 214793f9874a3b19cf59a01cdd290715a405bef869359aa799916cbc127a83ac 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. whole:Route@325,whole:Route@392,whole:Route@433,whole:Route@649,whole:Route@691 1ff74da0221876fc60906249f91392e1e2cdc40f800ead73c58501d5408b6bec
+@legacy 1e7f3a6ae086913959bb636ce993459f0fdd5256af2e3763731f6528d473a00d internal/edge/demo.go demoRefusalNames legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:57-78 reads Host/IsDemo from the already-listed routes and Host/Alias from already-listed aliases to retain refusal identities after reload filtering. These names only prevent fallback; no query, file or target authority added. registry:Alias@484,registry:Alias@576,registry:Host@233,registry:Host@451,whole:Route@174,whole:Route@309,whole:Route@530,whole:RouteAlias@412 c16b7f87116677b1b7cfbc344fd33bb87067f13a283f047e811ace01573c8c3b
+@legacy f8d6a5b92cf447f30ce1bee38831c957b37047a74d6f667b736458ed2a5f8f3a internal/edge/demo_assets/banner.css external legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_assets/banner.css:1-31 is the fixed embedded warning layout, referenced by demo_banner.go:22 and served only under the reserved asset path at :91. No external imports, URLs, runtime path or app-selected content; stylesheet bytes are compiled into the edge. file:external@0 79c70df83d1bd23cb212aed4b38f65323f77c1248ff67300b3d98d74df590613
+@legacy cbe87b0615957d34b231c000d87409f4088be23984c7852d20641c281aa9dd51 internal/edge/demo_banner.go transformDemoHTMLResponse legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_banner.go:212-282 transforms the app HTTP response stream. The new ReadAll at :228 is bounded to 512 bytes of response Body for sniffing, not a filesystem read. HTML is streamed through the bounded-prefix injector; unsupported active types/charsets/encodings refuse and stale representation metadata is removed. file:ReadAll@683 9a8b64272a64eafec168611fcdb263a8f3eb3d3ab2a440ce8d68a795652a3195
+@legacy 772bdcf1a705e86ae613b78368b831c96b15809755733a3ea3d4878cf321d095 internal/edge/demo_traffic.go Edge.demoProxy legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:537-558 reads the supplied Route.Host and IsForward to install resident banner or forwarding transports before reload wrappers. No new registry lookup; resident content is transformed once, forwarded representations remain unchanged. registry:Host@658 74d688002285b38a7ca9973d6fe5d760369800930d09c59fdbfe8bd9bcedafc7
+@legacy 2a2599e3e20806d2ef49f70d36092e9edcff366f86680cdb9d3851fdd8f06e81 internal/edge/demo_traffic.go Edge.demoTrafficAllowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:92-115 compares the current in-memory Route identity, ownership, expiry, assignment and hold against the dispatch snapshot. Local serving also requires the assigned fleet box, nonterminal identity, counter and authenticated worker callback. Field/whole Route reads only, no new storage query. registry:Account@322,registry:Account@337,registry:App@351,registry:App@362,registry:Assigned@399,registry:Assigned@415,registry:DemoExpiresAt@281,registry:DemoExpiresAt@302,registry:DemoID@215,registry:DemoID@229,registry:DemoLifetime@242,registry:DemoLifetime@262,registry:FleetBox@430,registry:FleetBox@446,registry:FleetBox@790,registry:FleetLabel@461,registry:FleetLabel@479,registry:HoldOp@497,registry:Host@123,registry:Host@88,registry:Region@372,registry:Region@386,registry:Status@533,whole:Route@135,whole:Route@205,whole:Route@879,whole:Route@929 db78bc923ddc7310a43c590041e036c875a1790e63d812091721b497cc0fb60c
+@legacy 9f258140160f50d3443c287e9a0fec98215e8dee1be40bfb3b2d2e25a29e1441 internal/edge/demo_traffic.go Edge.serveDemoTraffic legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:128-334 reads the resolved Route and passes it to existing admission, metering, rate and activator helpers. Resident serving checks precede the inert moved hook (:143), retirement and durable request debit (:302); output debits use the writer below compression. Forwarders do not count or transform again. Existing expiry/control cancellations and five-second write bounds apply; no request-path console or bucket read. registry:App@2627,registry:DemoExpiresAt@1362,whole:Route@1061,whole:Route@1365,whole:Route@1504,whole:Route@1591,whole:Route@1714,whole:Route@223,whole:Route@2238,whole:Route@2554,whole:Route@2619,whole:Route@2630,whole:Route@2716,whole:Route@2812,whole:Route@2886,whole:Route@2933,whole:Route@2991,whole:Route@3020,whole:Route@3239,whole:Route@3270,whole:Route@3302,whole:Route@3675,whole:Route@375,whole:Route@4339,whole:Route@4389,whole:Route@4441,whole:Route@454,whole:Route@4680,whole:Route@5445,whole:Route@5988,whole:Route@6412 edae18eed837b95f5e416950bfd5eabfe222ebf60ba1a26f65a1593b64077e44
+@legacy 8c8823aa79b9629f0cf14adf80eaf66ed2f4d5bb5a1537a7bcc92ee802259168 internal/edge/demo_traffic.go demoTrafficID legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:88-90 copies DemoID, DemoLifetime and Host from the supplied Route into the local counter key; no query or filesystem read. registry:DemoID@94,registry:DemoLifetime@115,registry:Host@138 7d21658068585d230bf0598b5b49d329824a4e7e36b70be0a57b9e58e820fdd8
+@legacy a89c8c4e4c869d8e58eb856373492a7aba65f9b081ba37644f9d2958ecf033f0 internal/host/demo_serving.go demoWorker.applyDemoServing legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_serving.go:108-218 validates a control from the authenticated worker stream against connection-local probes, revision, time, duplicate identities and the local registry row (:145-150). Reads the private demo_control SQL revision (:175). Initialize is allowed only for the console-issued flag; missing initialized counters refuse. Transient entry failures withhold acknowledgement, accepted peers remain independent, and replay/deadline bounds are retained. No root execution target is derived from controls. file:QueryRowContext@2295,registry:DemoExpiresAt@1637,registry:DemoID@1581,registry:DemoLifetime@1603,registry:FleetBox@1557,whole:Route@1543 d4c3298aab68f3a52063191a3d397a29b9938546a1aed4a0ed87b5d89791736e
+@legacy 166e2a664f31d9fa7cd45fb7190bbc9440e5e86691f755499613671d8f73247c internal/host/demo_serving.go demoWorker.beginDemoServing legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_serving.go:35-55 closes memory permission first, then reads only demo_control.revision from the private traffic DB (:49). Stored control never reopens serving; a new authenticated session/probe is required. file:QueryRow@286 8534deee8c3bf6bd2113e8dbb77788b5b1589851fa407d53055db946d0d50f21
+@legacy 7f276be03d68e682ca4bf18e20c12eb8778ae5a4207703f8b3cf4a0c3e04aca2 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. file:Read@216 29ea9aef295221f825b78773e83d889fdafc05c19ae04cecdd646093ae3bf61a
+@legacy 2c947fcac828c61093a41c516468a8387665790ea72019a5e046f2c43e69758e 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. registry:Account@646,registry:DemoExpiresAt@516,registry:DemoID@316,registry:DemoLifetime@337,registry:FleetBox@564,registry:FleetBox@588,registry:HoldOp@677,registry:Host@360,registry:Region@609,registry:Status@713 966bd3e83e4e5de1bd6d6258ddc71409fa7cf66c605b0227cd1f3609fa1bfb9b
+@legacy c4ec7a6ba03403faf5a205d5dd3915f92de05d181b8b343aea36409365624e04 internal/host/demo_traffic.go demoTrafficStore.Initialize legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:102-129 adds parameterized reads of local assignment and counter rows (:110, :116) inside BEGIN IMMEDIATE. Identical initialization preserves totals; cap/host/terminal mismatch and missing counters under an existing assignment refuse. Sole production caller is applyDemoServing at demo_serving.go:155; no traffic request initializes a row. file:QueryRowContext@330,file:QueryRowContext@701 722fe08a4ed4ca07203b5be07671d32079a9c4602a9a37848857fef674052629
+@legacy 01ecd2eee99a2f0ebad21a181b012aebb103f806ec4065493d416550280d3b4a internal/host/demo_traffic.go demoTrafficStore.Purge legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:207-231 reads the local assignment host (:213), verifies it, marks terminal and deletes only the lifetime counter in one transaction. Missing legacy assignment creates a terminal refusal, not allowance. Called after signed retirement drains edge writers and root purge completes (demo_cleanup.go:72-88). file:QueryRowContext@238 0e004c65775ef270e8d5349c58eec13227a217e5e6da213f5facacab5446f853
+@legacy a1601a22f3473a16495d388eb250496bafcb6c76191ad565307d752aed0a7447 internal/host/demo_traffic.go demoTrafficStore.checkAssignment legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:234-245 reads one joined assignment/counter by demo ID and lifetime (:238). Requires host and cap equality and nonterminal state; missing rows refuse and are never recreated here. file:QueryRowContext@181 8503b04dd9b99bebd49058e178c580394d61fe75c52f22a98f2c356865c01907
+@legacy d13a3558148f57aa9f199c786f03d2e355b6bd421c5bd3cbaba731ab780928e0 internal/host/demo_traffic.go demoTrafficStore.debit legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:132-175 reads the private assignment/counter row (:147), checks host, caps, terminal and nonnegative totals, then commits the request or bounded remaining-byte debit before returning allowance. Transactions complete durably without caller cancellation; cancellation or unknown failure returns zero allowance. Storage faults poison admission, not retirement. No release-store read. file:QueryRowContext@631 622de071fd91348978ebc0e69f429153364ca236d174f9a32d6bf34af01113b2
+@legacy 7bea26b1eb38d09b2f919d06f0b1583fb8ed872e9f9842d7f01647199b2e6bce internal/host/demo_traffic.go openDemoTraffic legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:25-71 opens/creates the absolute configured adjacent database (:29), chmods 0600, opens SQLite (:47), enables WAL/FULL/foreign keys and creates fixed control/assignment/counter schemas (:53). Scanner Open/Exec/Query sites are this local DB setup, not a root command execution. Production path is derived at agent.go:314 from the operator registry path; no tenant input selects it. file:Exec@760,file:Open@626,file:OpenFile@146,file:Query@423 f6a23a52ef2db6de17abc83063b8cb6c51174a350b0c850c6bf033203a5c354c
+@legacy b7055676a170c80333e2745e5c06befffc8a13b4fa7d88761fa21ab539ec64b0 internal/host/demo_cleanup.go demoWorker.retireDemo legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Agent reads signed receipt, matching tombstone and registry binding; holds route, invokes root, acknowledges and removes only its remote initialization marker.;rev3=census-ruling-agent-start-demo-2;basis=demo_cleanup.go:20-103 retains signature, assigned-box, stored receipt/tombstone and original lifetime checks. At :54 reads DemoExpiresAt and FleetBox instead of incorrectly comparing the Assigned timestamp to a label; an empty legacy FleetBox is accepted only under the signed matching receipt, conflicting labels refuse. Adds local serving fence/drain and counter purge before acknowledgements. Root purge method/path derivation is unchanged, but signed operator receipts now permit early retirement via demobuild/retirement.go:26. registry:Account@1226,registry:App@1253,registry:DemoExpiresAt@1092,registry:DemoHost@1196,registry:DemoID@1132,registry:DemoLifetime@1158,registry:FleetBox@1273,registry:FleetBox@1294,registry:HoldOp@1435,registry:Host@1409,registry:Host@1976,registry:Region@1319,whole:Route@1075,whole:Route@1919 3869922ca9beebbce6c00b10ad1717b4e5ddd85fb93d0e00d88c836fe17a0811
+@legacy 157ff3c423ad7d991757bf112b73c03696d9c4f0b100c9c7a31b5ff43c751221 internal/provision/demo_policy.go stampDemoRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Copies public descriptor fields from the already-read record into the route; no new external read.;rev3=census-ruling-agent-start-demo-2;basis=demo_policy.go:70-78 additionally copies the provision record FleetBox into the demo Route for owner verification. Assigned remains its original timestamp; no new registry query, external read or placement authority. registry:DemoExpiresAt@302,registry:DemoHost@272,registry:DemoID@261,registry:DemoLifetime@285,registry:FleetBox@233 ba586f1cd47e8a980862b379b45a0b24208a92d34ac6a53e69bb96f78dcf90d2
+@legacy b1bb4ef4303481aed4a5a663e78f8adb2581fee34f6f7894908d01db16c1c86d 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. registry:Account@9912,registry:Alias@24906,registry:Alias@24993,registry:Alias@25573,registry:App@9928,registry:Health@13653,registry:Health@13779,registry:Hibernate@29502,registry:Host@11239,registry:Host@11296,registry:Host@11332,registry:Host@12075,registry:Host@14262,registry:Host@14357,registry:Host@14645,registry:Host@14671,registry:Host@14723,registry:Host@19368,registry:Host@21275,registry:Host@21583,registry:Host@21610,registry:Host@22425,registry:Host@22997,registry:Host@25327,registry:Host@25376,registry:Host@28042,registry:Host@28067,registry:Host@28084,registry:Host@4397,registry:Host@4766,registry:Host@4820,registry:Host@4870,registry:Host@5890,registry:Host@6079,registry:Kind@17704,registry:Kind@17726,registry:Prefix@22972,registry:Socket@12139,registry:Socket@17583,registry:Socket@21591,registry:Status@4691,registry:Target@22984,registry:Tunnel@9772,registry:Tunnel@9943,registry:Version@17685,registry:Version@17787,whole:RegionalDomain@26215,whole:Route@11387,whole:Route@11495,whole:Route@12195,whole:Route@14796,whole:Route@14860,whole:Route@14911,whole:Route@17493,whole:Route@21643,whole:Route@21650,whole:Route@21746,whole:Route@22860,whole:Route@24028,whole:Route@26207,whole:Route@26263,whole:Route@26303,whole:Route@27948,whole:Route@27982,whole:Route@28070,whole:Route@28149,whole:Route@294,whole:Route@29504,whole:Route@3417,whole:Route@3475,whole:Route@4405,whole:Route@5919,whole:Route@6182,whole:Route@6315,whole:Route@6338,whole:Route@6353,whole:Route@7199,whole:Route@7307,whole:Route@9834,whole:RouteAlias@24877,whole:RouteAlias@26271,whole:RoutePath@22403 38055d988b04893c5b8a35edd492446be283b6b9c6380066b4eb968600914d73
+@legacy fab497b1510451282b65edb9c8417508171c0a2fdb9134ad1d614ec14f89612d internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit. file:ReadAll@16178,registry:Account@7621,registry:App@22335,registry:App@7645,registry:ClaimStamp@7675,registry:Gate@15152,registry:Gate@26726,registry:Gate@26786,registry:Gate@26844,registry:Host@26829,registry:Host@7852,registry:ImportGate@34229,registry:Incarnation@7710,registry:Kind@21197,registry:Kind@24635,registry:Kind@34171,registry:Kind@34200,registry:ServingSeq@7744,whole:Route@15047,whole:Route@15158,whole:Route@17975,whole:Route@18759,whole:Route@19217,whole:Route@19409,whole:Route@21200,whole:Route@22261,whole:Route@22327,whole:Route@22338,whole:Route@22591,whole:Route@22686,whole:Route@22762,whole:Route@22806,whole:Route@23108,whole:Route@23138,whole:Route@24638,whole:Route@24923,whole:Route@26729,whole:Route@26789,whole:Route@26832,whole:Route@26847,whole:Route@27765,whole:Route@29828,whole:Route@34174,whole:Route@34203,whole:Route@34232,whole:Route@34264,whole:Route@36112,whole:Route@5750,whole:Route@5849,whole:Route@5944,whole:Route@7624,whole:Route@7648,whole:Route@7678,whole:Route@7713,whole:Route@7747,whole:Route@7855 3cad9cc2b82ebed918995468d83388621af481113f7035de7ad7a6e0887a28ea
+system.go runSystem authority B,C,D,F,G,J4 rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops the claims case (host.RunSystemClaims, deleted); every other branch unchanged; no read added;rev3=census-ruling-nearest-region-a;basis=adds the hosts-used family to the system dispatch (carlos system hosts-used status, one GET of a console door as the operator); every existing command branch unchanged; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops the "join" case (host.RunSystemJoin, deleted with internal/host/joinroot.go, its only caller) and its line in the usage text; every other branch unchanged; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the system verb dispatch gains named-units, routed to host.RunSystemNamedUnits; no read of its own;rev3=census-ruling-design-pdf-service;basis=add dispatch for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Adds managed-fleets operator CLI dispatch; no direct read added; existing root command branches unchanged.;rev3=census-ruling-agent-start-demo-2;basis=system.go:62-66 adds the demos family dispatch to the console-only operator client (system_demos.go:19, system_demos_api.go:23); no direct read added and other root commands are unchanged. 32862a9255dce644a08ec5f3bec144e4c35b91fff47594c483e8b464eb2e0ed7
+system.go systemVerb authority B,C,D,F,G,J4 rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops "claims" from the verb list, so it now falls to the unknown-verb message; no read added;rev3=census-ruling-nearest-region-a;basis=adds "hosts-used" to the verb list, routed to runSystemHostsUsedVerb; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops "join" from the verb list, so `carlos system join` now falls to the unknown-verb message; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the known-verb list gains named-units; no read of its own;rev3=census-ruling-design-pdf-service;basis=add recognition for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Recognizes managed-fleets as a CLI family; no read added.;rev3=census-ruling-agent-start-demo-2;basis=system.go:43-57 recognizes demos; parsing only, no direct read added. bb2bc2f1eb4b53eef26642c7b00dc28a7aefff0a7ca45289afa8407f4aa70116
+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. whole:Route@325,whole:Route@392,whole:Route@433,whole:Route@649,whole:Route@691 1ff74da0221876fc60906249f91392e1e2cdc40f800ead73c58501d5408b6bec
+internal/edge/demo.go demoRefusalNames legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo.go:57-78 reads Host/IsDemo from the already-listed routes and Host/Alias from already-listed aliases to retain refusal identities after reload filtering. These names only prevent fallback; no query, file or target authority added. registry:Alias@484,registry:Alias@576,registry:Host@233,registry:Host@451,whole:Route@174,whole:Route@309,whole:Route@530,whole:RouteAlias@412 c16b7f87116677b1b7cfbc344fd33bb87067f13a283f047e811ace01573c8c3b
+internal/edge/demo_assets/banner.css external legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_assets/banner.css:1-31 is the fixed embedded warning layout, referenced by demo_banner.go:22 and served only under the reserved asset path at :91. No external imports, URLs, runtime path or app-selected content; stylesheet bytes are compiled into the edge. file:external@0 79c70df83d1bd23cb212aed4b38f65323f77c1248ff67300b3d98d74df590613
+internal/edge/demo_banner.go transformDemoHTMLResponse legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_banner.go:212-282 transforms the app HTTP response stream. The new ReadAll at :228 is bounded to 512 bytes of response Body for sniffing, not a filesystem read. HTML is streamed through the bounded-prefix injector; unsupported active types/charsets/encodings refuse and stale representation metadata is removed. file:ReadAll@683 9a8b64272a64eafec168611fcdb263a8f3eb3d3ab2a440ce8d68a795652a3195
+internal/edge/demo_traffic.go Edge.demoProxy legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:537-558 reads the supplied Route.Host and IsForward to install resident banner or forwarding transports before reload wrappers. No new registry lookup; resident content is transformed once, forwarded representations remain unchanged. registry:Host@658 74d688002285b38a7ca9973d6fe5d760369800930d09c59fdbfe8bd9bcedafc7
+internal/edge/demo_traffic.go Edge.demoTrafficAllowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:92-115 compares the current in-memory Route identity, ownership, expiry, assignment and hold against the dispatch snapshot. Local serving also requires the assigned fleet box, nonterminal identity, counter and authenticated worker callback. Field/whole Route reads only, no new storage query. registry:Account@322,registry:Account@337,registry:App@351,registry:App@362,registry:Assigned@399,registry:Assigned@415,registry:DemoExpiresAt@281,registry:DemoExpiresAt@302,registry:DemoID@215,registry:DemoID@229,registry:DemoLifetime@242,registry:DemoLifetime@262,registry:FleetBox@430,registry:FleetBox@446,registry:FleetBox@790,registry:FleetLabel@461,registry:FleetLabel@479,registry:HoldOp@497,registry:Host@123,registry:Host@88,registry:Region@372,registry:Region@386,registry:Status@533,whole:Route@135,whole:Route@205,whole:Route@879,whole:Route@929 db78bc923ddc7310a43c590041e036c875a1790e63d812091721b497cc0fb60c
+internal/edge/demo_traffic.go Edge.serveDemoTraffic legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:128-334 reads the resolved Route and passes it to existing admission, metering, rate and activator helpers. Resident serving checks precede the inert moved hook (:143), retirement and durable request debit (:302); output debits use the writer below compression. Forwarders do not count or transform again. Existing expiry/control cancellations and five-second write bounds apply; no request-path console or bucket read. registry:App@2627,registry:DemoExpiresAt@1362,whole:Route@1061,whole:Route@1365,whole:Route@1504,whole:Route@1591,whole:Route@1714,whole:Route@223,whole:Route@2238,whole:Route@2554,whole:Route@2619,whole:Route@2630,whole:Route@2716,whole:Route@2812,whole:Route@2886,whole:Route@2933,whole:Route@2991,whole:Route@3020,whole:Route@3239,whole:Route@3270,whole:Route@3302,whole:Route@3675,whole:Route@375,whole:Route@4339,whole:Route@4389,whole:Route@4441,whole:Route@454,whole:Route@4680,whole:Route@5445,whole:Route@5988,whole:Route@6412 edae18eed837b95f5e416950bfd5eabfe222ebf60ba1a26f65a1593b64077e44
+internal/edge/demo_traffic.go demoTrafficID legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:88-90 copies DemoID, DemoLifetime and Host from the supplied Route into the local counter key; no query or filesystem read. registry:DemoID@94,registry:DemoLifetime@115,registry:Host@138 7d21658068585d230bf0598b5b49d329824a4e7e36b70be0a57b9e58e820fdd8
+internal/host/demo_serving.go demoWorker.applyDemoServing legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_serving.go:108-218 validates a control from the authenticated worker stream against connection-local probes, revision, time, duplicate identities and the local registry row (:145-150). Reads the private demo_control SQL revision (:175). Initialize is allowed only for the console-issued flag; missing initialized counters refuse. Transient entry failures withhold acknowledgement, accepted peers remain independent, and replay/deadline bounds are retained. No root execution target is derived from controls. file:QueryRowContext@2295,registry:DemoExpiresAt@1637,registry:DemoID@1581,registry:DemoLifetime@1603,registry:FleetBox@1557,whole:Route@1543 d4c3298aab68f3a52063191a3d397a29b9938546a1aed4a0ed87b5d89791736e
+internal/host/demo_serving.go demoWorker.beginDemoServing legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_serving.go:35-55 closes memory permission first, then reads only demo_control.revision from the private traffic DB (:49). Stored control never reopens serving; a new authenticated session/probe is required. file:QueryRow@286 8534deee8c3bf6bd2113e8dbb77788b5b1589851fa407d53055db946d0d50f21
+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. file:Read@216 29ea9aef295221f825b78773e83d889fdafc05c19ae04cecdd646093ae3bf61a
+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. registry:Account@646,registry:DemoExpiresAt@516,registry:DemoID@316,registry:DemoLifetime@337,registry:FleetBox@564,registry:FleetBox@588,registry:HoldOp@677,registry:Host@360,registry:Region@609,registry:Status@713 966bd3e83e4e5de1bd6d6258ddc71409fa7cf66c605b0227cd1f3609fa1bfb9b
+internal/host/demo_traffic.go demoTrafficStore.Initialize legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:102-129 adds parameterized reads of local assignment and counter rows (:110, :116) inside BEGIN IMMEDIATE. Identical initialization preserves totals; cap/host/terminal mismatch and missing counters under an existing assignment refuse. Sole production caller is applyDemoServing at demo_serving.go:155; no traffic request initializes a row. file:QueryRowContext@330,file:QueryRowContext@701 722fe08a4ed4ca07203b5be07671d32079a9c4602a9a37848857fef674052629
+internal/host/demo_traffic.go demoTrafficStore.Purge legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:207-231 reads the local assignment host (:213), verifies it, marks terminal and deletes only the lifetime counter in one transaction. Missing legacy assignment creates a terminal refusal, not allowance. Called after signed retirement drains edge writers and root purge completes (demo_cleanup.go:72-88). file:QueryRowContext@238 0e004c65775ef270e8d5349c58eec13227a217e5e6da213f5facacab5446f853
+internal/host/demo_traffic.go demoTrafficStore.checkAssignment legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:234-245 reads one joined assignment/counter by demo ID and lifetime (:238). Requires host and cap equality and nonterminal state; missing rows refuse and are never recreated here. file:QueryRowContext@181 8503b04dd9b99bebd49058e178c580394d61fe75c52f22a98f2c356865c01907
+internal/host/demo_traffic.go demoTrafficStore.debit legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:132-175 reads the private assignment/counter row (:147), checks host, caps, terminal and nonnegative totals, then commits the request or bounded remaining-byte debit before returning allowance. Transactions complete durably without caller cancellation; cancellation or unknown failure returns zero allowance. Storage faults poison admission, not retirement. No release-store read. file:QueryRowContext@631 622de071fd91348978ebc0e69f429153364ca236d174f9a32d6bf34af01113b2
+internal/host/demo_traffic.go openDemoTraffic legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:25-71 opens/creates the absolute configured adjacent database (:29), chmods 0600, opens SQLite (:47), enables WAL/FULL/foreign keys and creates fixed control/assignment/counter schemas (:53). Scanner Open/Exec/Query sites are this local DB setup, not a root command execution. Production path is derived at agent.go:314 from the operator registry path; no tenant input selects it. file:Exec@760,file:Open@626,file:OpenFile@146,file:Query@423 f6a23a52ef2db6de17abc83063b8cb6c51174a350b0c850c6bf033203a5c354c
+internal/host/demo_cleanup.go demoWorker.retireDemo legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Agent reads signed receipt, matching tombstone and registry binding; holds route, invokes root, acknowledges and removes only its remote initialization marker.;rev3=census-ruling-agent-start-demo-2;basis=demo_cleanup.go:20-103 retains signature, assigned-box, stored receipt/tombstone and original lifetime checks. At :54 reads DemoExpiresAt and FleetBox instead of incorrectly comparing the Assigned timestamp to a label; an empty legacy FleetBox is accepted only under the signed matching receipt, conflicting labels refuse. Adds local serving fence/drain and counter purge before acknowledgements. Root purge method/path derivation is unchanged, but signed operator receipts now permit early retirement via demobuild/retirement.go:26. registry:Account@1226,registry:App@1253,registry:DemoExpiresAt@1092,registry:DemoHost@1196,registry:DemoID@1132,registry:DemoLifetime@1158,registry:FleetBox@1273,registry:FleetBox@1294,registry:HoldOp@1435,registry:Host@1409,registry:Host@1976,registry:Region@1319,whole:Route@1075,whole:Route@1919 3869922ca9beebbce6c00b10ad1717b4e5ddd85fb93d0e00d88c836fe17a0811
+internal/provision/demo_policy.go stampDemoRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Copies public descriptor fields from the already-read record into the route; no new external read.;rev3=census-ruling-agent-start-demo-2;basis=demo_policy.go:70-78 additionally copies the provision record FleetBox into the demo Route for owner verification. Assigned remains its original timestamp; no new registry query, external read or placement authority. registry:DemoExpiresAt@302,registry:DemoHost@272,registry:DemoID@261,registry:DemoLifetime@285,registry:FleetBox@233 ba586f1cd47e8a980862b379b45a0b24208a92d34ac6a53e69bb96f78dcf90d2
+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. registry:Account@9912,registry:Alias@24906,registry:Alias@24993,registry:Alias@25573,registry:App@9928,registry:Health@13653,registry:Health@13779,registry:Hibernate@29502,registry:Host@11239,registry:Host@11296,registry:Host@11332,registry:Host@12075,registry:Host@14262,registry:Host@14357,registry:Host@14645,registry:Host@14671,registry:Host@14723,registry:Host@19368,registry:Host@21275,registry:Host@21583,registry:Host@21610,registry:Host@22425,registry:Host@22997,registry:Host@25327,registry:Host@25376,registry:Host@28042,registry:Host@28067,registry:Host@28084,registry:Host@4397,registry:Host@4766,registry:Host@4820,registry:Host@4870,registry:Host@5890,registry:Host@6079,registry:Kind@17704,registry:Kind@17726,registry:Prefix@22972,registry:Socket@12139,registry:Socket@17583,registry:Socket@21591,registry:Status@4691,registry:Target@22984,registry:Tunnel@9772,registry:Tunnel@9943,registry:Version@17685,registry:Version@17787,whole:RegionalDomain@26215,whole:Route@11387,whole:Route@11495,whole:Route@12195,whole:Route@14796,whole:Route@14860,whole:Route@14911,whole:Route@17493,whole:Route@21643,whole:Route@21650,whole:Route@21746,whole:Route@22860,whole:Route@24028,whole:Route@26207,whole:Route@26263,whole:Route@26303,whole:Route@27948,whole:Route@27982,whole:Route@28070,whole:Route@28149,whole:Route@294,whole:Route@29504,whole:Route@3417,whole:Route@3475,whole:Route@4405,whole:Route@5919,whole:Route@6182,whole:Route@6315,whole:Route@6338,whole:Route@6353,whole:Route@7199,whole:Route@7307,whole:Route@9834,whole:RouteAlias@24877,whole:RouteAlias@26271,whole:RoutePath@22403 38055d988b04893c5b8a35edd492446be283b6b9c6380066b4eb968600914d73
+internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit. file:ReadAll@16178,registry:Account@7621,registry:App@22335,registry:App@7645,registry:ClaimStamp@7675,registry:Gate@15152,registry:Gate@26726,registry:Gate@26786,registry:Gate@26844,registry:Host@26829,registry:Host@7852,registry:ImportGate@34229,registry:Incarnation@7710,registry:Kind@21197,registry:Kind@24635,registry:Kind@34171,registry:Kind@34200,registry:ServingSeq@7744,whole:Route@15047,whole:Route@15158,whole:Route@17975,whole:Route@18759,whole:Route@19217,whole:Route@19409,whole:Route@21200,whole:Route@22261,whole:Route@22327,whole:Route@22338,whole:Route@22591,whole:Route@22686,whole:Route@22762,whole:Route@22806,whole:Route@23108,whole:Route@23138,whole:Route@24638,whole:Route@24923,whole:Route@26729,whole:Route@26789,whole:Route@26832,whole:Route@26847,whole:Route@27765,whole:Route@29828,whole:Route@34174,whole:Route@34203,whole:Route@34232,whole:Route@34264,whole:Route@36112,whole:Route@5750,whole:Route@5849,whole:Route@5944,whole:Route@7624,whole:Route@7648,whole:Route@7678,whole:Route@7713,whole:Route@7747,whole:Route@7855 3cad9cc2b82ebed918995468d83388621af481113f7035de7ad7a6e0887a28ea
+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. file:Exec@19019,file:Open@1707,file:Statfs@49473,registry:App@12731,whole:Route@12723,whole:Route@45050 c0ec4fb11635e502febad3064bee74e7cfbf291b6fe19a4665406f104f17443d
+@coverage . 8ac925b80f2f6edeac52168ee2932f8e4a6c995c76b99a9d26dcc7a714f4c2fb
+@coverage internal/demo d74754f9a1beb66f7f6bb44b8475af1ef14e5274294f102258f9f5667ed42224
+@coverage internal/demobuild 0b4b6da352f0d12018f4a47ec618d5b806fdc1335aaf1b0c35e26332f65b224e
+@coverage internal/edge ee0d9847c89c1822de8d53b1f60077fa0aa7a6a2645c5ca85ddc33b7187fc41a
+@coverage internal/edge/demo_assets 7c45805b150f04db2914907ed36d8af4383536c6126c3b9731f1b80bfd42d756
+@coverage internal/host de3c9e4726c1fa9e4cb61fbdaaf016a5f21d72452c745a6d008d587c65c06b7d
+@coverage internal/provision a0dc14b2a1addc249d8e238cd0bc96ce52446dbb06c1b3409a9391494dfc50d4
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index cc8f5cb2c..5e514269b 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -91,3 +91,4 @@ plan14-root-reads-region-ha-p3b1-fixes.tsv 86aa1e39a21072d17678411a4047983a75649
plan14-root-reads-stateless-failed-release-held.tsv 657f81eeea52785b75f92a42064f63f218787f712ef313e2acf44f7e664e16b9
plan14-root-reads-static-markdown-twins.tsv ec831d3206622f34511bfbc2ec0cccb131fbd3861ec4c6a33a2dc6dff9a1791e
plan14-root-reads-agent-start-demo-1-followups.tsv ec831d3206622f34511bfbc2ec0cccb131fbd3861ec4c6a33a2dc6dff9a1791e
+plan14-root-reads-agent-start-demo-2.tsv 4cbf6f0184656467ec5d636632672e1210925d984e9682d0d8cd60a22bfbc3f2