carlos / platform Public

activator: POST /v1/mail on the control socket; CARLOS_MAIL agent-owned

Task 4 of the platform mail submission plan. internal/mailsubmit holds the
verb and the agent's client to the mailer. POST /v1/mail checks the
bearer by the existing verbs' rule (an empty or unreadable token refuses
everything; SHA-256 constant-time compare), the envelope's shape and
limits (14 MiB body, 10 MiB raw, 1-50 recipients), stamps the message
with the socket's route, never the body's, and forwards it to
/run/carlos-mailer/mailer.sock, passing the mailer's answer back.

Both bind sites (flat spawnChildFrom, nested listenControl) now mount
through one composer, controlMount, and the mail verb has its own
condition (Mail != nil). CARLOS_MAIL=submit follows the bind: the socket
bound, the verb mounted, the app switched, and the route Provisioned
(round 1 P2-2); otherwise it is stripped, a tenant's value included, and
a hand-made route of a switched app is logged once at error level.
agentOwnedNames and moves.AgentOwnedVars gain it as a pinned pair, and
seedVars strips it. The agent reads each app's switch from the app
sender record through a small cache refreshed on every serial move.

TestMailerSidePackagesDoNotImportMail checks internal/mail and
internal/console for all five packages, and the IAM SDK for the three
mailer-side ones only: the root binary already links IAM through
internal/awsinv and internal/objstore.

Census: Task 4 claims added, overlay re-proposed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 5523cb8420a8f60b95459e929fda6ff7fddfd73c parent cec42ac
17 files changed, +1,315 −53
  • docs/superpowers/notes/census-claims-platform-mail-submission.tsv +11 −0
  • docs/superpowers/notes/census-proposal-platform-mail-submission.md +17 −3
  • internal/activator/agentowned_moves_test.go +16 −12
  • internal/activator/backend_exec.go +81 −14
  • internal/activator/mailverb_test.go +228 −0
  • internal/activator/prepare.go +3 −16
  • internal/host/agent.go +22 −0
  • internal/host/mailswitch.go +156 −0
  • internal/host/mailswitch_test.go +177 −0
  • internal/mailsubmit/forward.go +68 −0
  • internal/mailsubmit/forward_test.go +75 −0
  • internal/mailsubmit/proto.go +67 −0
  • internal/mailsubmit/verb.go +102 −0
  • internal/mailsubmit/verb_test.go +263 −0
  • internal/moves/envreport.go +5 −4
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv +23 −3

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-claims-platform-mail-submission.tsv b/docs/superpowers/notes/census-claims-platform-mail-submission.tsv
index ec55b80ff..a59144507 100644
--- a/docs/superpowers/notes/census-claims-platform-mail-submission.tsv
+++ b/docs/superpowers/notes/census-claims-platform-mail-submission.tsv
@@ -29,3 +29,14 @@ internal/host/units/carlos-mailer-arm.path:external Task 3, new: [Path] PathExis
internal/host/units/carlos-mailer.socket:external Task 3, new: ConditionPathExists=/etc/carlos-mailer/keys, ListenStream=/run/carlos-mailer/mailer.sock, SocketUser=carlos, SocketGroup=carlos, SocketMode=0600, Accept=no; not enabled, started only by the arming path. PID 1 binds a socket in a root-owned directory, as carlos-instance-control.socket does in /run/carlos-control. No read added.
internal/host/units/carlos-mailer.service:external Task 3, new: runs /opt/carlos/carlos mailer serve as the static user carlos-mailer (never root), socket-activated, ConditionPathExists=/etc/carlos-mailer/keys, EnvironmentFile=-/etc/carlos/host.env (read by PID 1, as every carlos service's) with UnsetEnvironment=CARLOS_SECRETS_KEY, AWS_EC2_METADATA_DISABLED=true, IPAddressDeny=169.254.169.254/32 fd00:ec2::254/128, StateDirectory=carlos-mailer 0700, and the relay's hardening block with no ReadWritePaths. No root process reads anything new; the mailer reads its own key file and state.
internal/status/snapshot.go:CollectBox Task 3: copies Probes.MailerArmed into BoxMetrics.MailerArmed (json mailer_armed, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added.
+#
+# Task 4 (the verb at both bind sites, CARLOS_MAIL agent-owned).
+internal/activator/backend_exec.go:ExecBackend.controlMount Task 4, new: the one composer of a control socket's verbs, for both bind sites. Mounts the schedule verbs and GET /updates exactly as the two inline copies did (same conditions, same host, token reader and write fence), and POST /v1/mail (mailsubmit.Mount) under its own condition, b.Mail != nil. Reads rt.Host and passes the route to Mount; returns nil when nothing is mounted. The agent (carlos-edge.service, user carlos), not root.
+internal/activator/backend_exec.go:ExecBackend.spawnChildFrom Task 4: the inline mount (Timers, UpdatesReader) is replaced by b.controlMount(rt, tokenReader, n): the same verbs under the same conditions, plus the mail verb when b.Mail is set. The three rt.Host reads move into controlMount; the route is passed whole. Agent, not root; nothing else changes.
+internal/activator/prepare.go:ExecBackend.listenControl Task 4: the same replacement as spawnChildFrom, with gen as the write fence's generation, so the nested and rootfs listener mounts exactly what the flat one does. Agent, not root.
+internal/activator/backend_exec.go:ExecBackend.agentOwnedVars Task 4: also decides CARLOS_MAIL through mailSubmits: set to "submit" only when the control socket bound, the verb is mounted, the app sender's switch is on and the route is Provisioned; stripped otherwise, a tenant-supplied value from fileEnv included. agentOwnedNames and moves.AgentOwnedVars gain it as a pinned pair. Only narrows what a tenant's files can set. Agent, not root.
+internal/activator/backend_exec.go:ExecBackend.mailSubmits Task 4, new: the CARLOS_MAIL rule. Reads rt.App, rt.Host, rt.Provisioned and RouteAccount(rt) from the agent's own registry row, and asks b.MailSwitch (the agent's cache of the console-written app sender record, internal/host/mailswitch.go: one bounded Get of apps/<acct>/<app>/email/senders/app.json through the agent's deploy store). Logs once per host at error level for an unprovisioned route of a switched app. Agent, not root; no file read.
+internal/mailsubmit/verb.go:Mount Task 4, new: POST /v1/mail on an instance's control socket. The bearer by the existing verbs' rule (empty or unreadable token refuses everything; SHA-256 constant-time compare); MaxBytesReader(14 MiB), the JSON envelope, base64 raw of at most 10 MiB, 1 to 50 non-empty recipients, a non-empty from, else 400 BAD_REQUEST. Stamps account, app and host from the route the socket was bound for, never from the body, and forwards; a transport error or an answer outside 200/400/403/429/503 is 503 MAILER_UNAVAILABLE. Runs in the agent, as carlos; the body is a tenant's and is only decoded and forwarded, never used to name a path, route or account.
+internal/mailsubmit/forward.go:SocketForwarder.Send Task 4, new: the agent's client to the mailer: one HTTP POST of /v1/send over a fresh dial of the constant /run/carlos-mailer/mailer.sock, 60 s timeout, answer read to at most 64 KiB and decoded. Runs in the agent, as carlos. The socket's directory is root's; the mailer at the other end is a separate uid.
+internal/host/agent.go:runAgent Task 4: sets eb.Mail = mailsubmit.SocketForwarder{} on every box and, when a deploy store opens, eb.MailSwitch to a new mailSwitchCache's On, armed for the serial-move refresh (armedMailSwitch). One more openDeployStore call, as the fleet and coordinator wiring beside it already make. Agent, not root.
+internal/host/agent.go:fastTick Task 4: on a serial move, after the schedule leg, starts the armed mail switch cache's Refresh on its own goroutine (each read bounded at 2 s, overlapping refreshes skipped). It re-reads the app sender records already cached, through the agent's deploy store. Agent, not root; the tick waits on nothing new.
diff --git a/docs/superpowers/notes/census-proposal-platform-mail-submission.md b/docs/superpowers/notes/census-proposal-platform-mail-submission.md
index 58e6f9b9f..81c94a1ee 100644
--- a/docs/superpowers/notes/census-proposal-platform-mail-submission.md
+++ b/docs/superpowers/notes/census-proposal-platform-mail-submission.md
@@ -1,9 +1,11 @@
# Census approval: platform-mail-submission
-Ruling `census-ruling-platform-mail-submission`. The independent reviewer approves or rejects every change below, 4 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-platform-mail-submission`. The independent reviewer approves or rejects every change below, 8 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
+| `internal/host/agent.go` `fastTick` | body | unchanged (1) | Task 4: on a serial move, after the schedule leg, starts the armed mail switch cache's Refresh on its own goroutine (each read bounded at 2 s, overlapping refreshes skipped). It re-reads the app sender records already cached, through the agent's deploy store. Agent, not root; the tick waits on nothing new. |
+| `internal/host/agent.go` `runAgent` | body | unchanged (6) | Task 4: sets eb.Mail = mailsubmit.SocketForwarder{} on every box and, when a deploy store opens, eb.MailSwitch to a new mailSwitchCache's On, armed for the serial-move refresh (armedMailSwitch). One more openDeployStore call, as the fleet and coordinator wiring beside it already make. Agent, not root. |
| `internal/host/agent.go` `statusLoop` | body | unchanged (6) | Task 3 (plan gap G6 (b)): the status tick also fills Probes.MailerArmed from mailerArmed(mailwire.MailerSocket, 2s): a stat of /run/carlos-mailer/mailer.sock and, only when it is a socket, GET /v1/health on it. The agent (carlos-edge.service, user carlos), not root; reported in the private BoxMetrics block only. The same six sites; no store request, no read of /etc/carlos-mailer (which uid carlos cannot traverse). |
| `internal/host/bootstrap.go` `bootstrapWithGroup` | body | unchanged (3) | Task 3: the sysusers.d/carlos.conf it writes is now the constant sysusersConf, which adds "u carlos-mailer - \"CARLOS mailer\" - /usr/sbin/nologin" ahead of the existing "g carlos-sockets -" line, so the tmpfiles line naming group carlos-mailer resolves on a box whose confs arrive by a staged-tree refresh. Constant text, no input; no read added. |
| `internal/host/bootstrap.go` `const tmpfilesConf` | body | unchanged (7) | Task 3: two constant lines, "d /run/carlos-mailer 0750 root carlos -" (the mailer's socket directory, beside /run/carlos-control and shaped like it) and "d /etc/carlos-mailer 0750 root carlos-mailer -" (the key directory, which uid carlos cannot traverse). Root creates two root-owned directories; no file inside either is created, owned or seeded (the key is the operator's, by hand). No input; no read added. |
@@ -20,13 +22,18 @@ Ruling `census-ruling-platform-mail-submission`. The independent reviewer approv
| `internal/host/units/carlos-instance-tty@.service` `external` | body | unchanged (1) | Task 3: InaccessiblePaths= gains -/run/carlos-mailer -/etc/carlos-mailer (optional). Only hides more; no read added. |
| `internal/host/units/carlos-instance@.service` `external` | body | unchanged (1) | Task 3: InaccessiblePaths= gains -/run/carlos-mailer -/etc/carlos-mailer (optional). Only hides more; no read added. |
| `internal/status/snapshot.go` `CollectBox` | body | unchanged (28) | Task 3: copies Probes.MailerArmed into BoxMetrics.MailerArmed (json mailer_armed, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added. |
+| `internal/activator/backend_exec.go` `ExecBackend.agentOwnedVars` | sites | +whole:Route | Task 4: also decides CARLOS_MAIL through mailSubmits: set to "submit" only when the control socket bound, the verb is mounted, the app sender's switch is on and the route is Provisioned; stripped otherwise, a tenant-supplied value from fileEnv included. agentOwnedNames and moves.AgentOwnedVars gain it as a pinned pair. Only narrows what a tenant's files can set. Agent, not root. |
+| `internal/activator/backend_exec.go` `ExecBackend.spawnChildFrom` | sites | -registry:Host ×3, +whole:Route | Task 4: the inline mount (Timers, UpdatesReader) is replaced by b.controlMount(rt, tokenReader, n): the same verbs under the same conditions, plus the mail verb when b.Mail is set. The three rt.Host reads move into controlMount; the route is passed whole. Agent, not root; nothing else changes. |
+| `internal/activator/prepare.go` `ExecBackend.listenControl` | sites | -registry:Host ×3, +whole:Route | Task 4: the same replacement as spawnChildFrom, with gen as the write fence's generation, so the nested and rootfs listener mounts exactly what the flat one does. Agent, not root. |
-Envelopes re-pinned: `.`, `internal/host`, `internal/host/demo_units`, `internal/host/units`, `internal/instancectl`, `internal/mailer`, `internal/mailwire`, `internal/status`.
+Envelopes re-pinned: `.`, `internal/activator`, `internal/host`, `internal/host/demo_units`, `internal/host/units`, `internal/instancectl`, `internal/mailer`, `internal/mailsubmit`, `internal/mailwire`, `internal/moves`, `internal/status`.
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
Recorded dispositions, which each change must still satisfy:
+- `internal/host/agent.go` `fastTick`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged;rev3=census-ruling-agent-start-demo-3;basis=Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1).;rev3=census-ruling-stateless-replicas-4-task1;basis=Signals the owned replica swap worker (armedReplicaDeploy.tick) beside the placement worker on the existing tick; coalesced background pass, no timer, no bucket read. Its transitions go through the console's authenticated /deploy.
+- `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained.;rev3=census-ruling-w6-ingress-drain;basis=agent (user carlos), not root. Builds the ingress drain (newIngressDrain) with arming read at ask time from os.Getenv (CARLOS_REGION_HA, CARLOS_INGRESS_TARGET_GROUPS, both from the root-owned host.env), the fixed admission and lease.CurrentSelf (existing IMDS identity); its reader is awstg.Load, the box role's credentials calling ELB DescribeTargetHealth/DescribeTargetGroupAttributes (new AWS reads, by the agent). Wires admission.closeStartsForIngressDrain, the lbhealth drain condition, ingress.setEdge, and ingress.shutdownStarted in WithShutdownStarted. The drain socket (/run/carlos/.ha-drain/drain.sock, agent-user only, existing) is now also served on a fixed box with the drain configured (was group members only), routing /v1/ingress/* to the ingress drain and the group drain verbs to 404 there. armHADepartures now takes fixtureDepartureGetenv() and MakeQueue fixtureDepartureQueue(), which in a production (non-rootrunner) build are os.Getenv and nil, as before. Read sites unchanged (9).;rev3=census-ruling-stateless-replicas-4-task1;basis=Arms the fleet-only replica swap worker next to the placement worker: same console URL and fleet token as the existing replicaCoordinatorAPI, the existing activator Service; stops and joins at shutdown. No new read site, credential or bucket reader.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: sets deployWorker.step to the rollout scheduler answer for the record permit (replicaStepOf over armedRollout), an in-memory callback; no read site, credential or bucket reader added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the swap worker step is armedReplicaStep, the same lazy scheduler lookup as before as a named function; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (01d6ca78, linked-deployments-slice1) starts linkLoop beside tunnelLoop; this branch keeps its replica coordinator wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 2: wires the swap worker's drive (armedReplicaDrive, the armed rollout manager's DriveReplicaRelease); no read added;rev3=census-ruling-stateless-replicas-4-merge-main2;basis=Merge of main af871da0 (v0.34.49): both sides changed it. Main (178dcfe5, member-backups-2a) moves the inline duty-view closure into armDutyView/dutyView and starts verifyAssignLoop; its sites drop by registry:Host and whole:Route x2 as main recorded them. This branch keeps its replica coordinator, swap worker and drive wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-drill3;basis=drill 3 R24: makes one in-memory channel, closes it (once) inside the edge's existing shutdown-started callback after ingress.shutdownStarted, and passes it to tunnelLoop, which drains only a fleet channel name; no read added, same six sites; touches no admission, lease, ingress drain, listener or file; the agent process, no root decision;rev3=census-ruling-edge-ppv2;basis=Agent (uid carlos), not root. memwatchLoop now gets edgeProxyCounters(&demoEdge) (in-process counters, no read). The drain socket's driver is newAgentDrainSocket(ingress, e, os.Getenv), which attaches the edge trust handler only when CARLOS_INGRESS_PROXY_SOURCES in the agent's environment (from the root-owned host.env) parses to a non-empty list; the socket is served when drainSocketServed: a group member or a configured ingress drain (both as before), or a box armed for PROXY protocol (new). The socket's path and agent-user-only permissions are unchanged. Read sites unchanged (6).
- `internal/host/agent.go` `statusLoop`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action.;rev3=census-ruling-agent-start-demo-3;basis=Report moved capability only when the serving edge reports readiness; report claim-seed support only with CARLOS_DEMO_CLAIM=1. Reads the explicit capability flag from the process environment; no new filesystem or registry read.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 fix round 1 (#511 R16 amendment): the status tick also fills Probes.ApplyFinished from systemApplyFinished(release.OptDir()), an Lstat of root's apply journal <opt>/system/router/journal.json in the root-owned, world-readable state directory: finished only when the journal is absent, any other answer unknown and so unfinished. Round 0: Probes.PrevRelease from prevReleaseOf (carlos.prev and carlos.prev.version, the files withMovesFields already reads). Reported in the private BoxMetrics block; no bucket request or cadence change.
- `internal/host/bootstrap.go` `bootstrapWithGroup`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move bootstrapWith body here, retaining host.env, embedded unit reads and tmpfiles execution. Group live caller holds root mutation guard; skip automatic update/recovery units, preserve Restart=no/nftables drop-in and masks, and write separate root-owned /run/carlos-group-maintenance tmpfiles rule outside service ownership walk. No agent receipt read.;rev3=census-ruling-gvisor-demos;basis=Create the rootfs parent at 0700 and runtime root at 0755. Existing host.env/unit reads unchanged; workload templates remain unarmed.
- `internal/host/bootstrap.go` `const tmpfilesConf`: authority, task A,C,G,J4. Basis: root-input;kept=A,C,G;scope=protected-decision-only
@@ -43,14 +50,21 @@ Recorded dispositions, which each change must still satisfy:
- `internal/host/units/carlos-instance-tty@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.
- `internal/host/units/carlos-instance@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-execstop-528;basis=one line added after ExecStart=, ExecStop=-+/opt/carlos/carlos instance-stop $MAINPID (#528, Paul's option 2), plus TimeoutStopFailureMode=kill after TimeoutStopSec=20: PID 1 runs the platform binary's instance-stop as root (the + prefix) at a stop with $MAINPID, a value systemd supplies; instance-stop reads only that argument, /proc/self/cgroup and /proc/<MAINPID>/cgroup (kernel-written), and acts only through a pidfd on the unit's own main process (refused unless in the unit's own cgroup); no bind source, user, mount or tenant-writable path read added;rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.
- `internal/status/snapshot.go` `CollectBox`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read.;rev3=census-ruling-agent-start-demo-3;basis=Report claim-seed protocol capability only when explicitly configured and runtime moved readiness only when armed; dormant status keeps its original JSON shape. Census read-site delta: unchanged (28).;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 (#511 R16 and its amendment): copies Probes.PrevRelease and Probes.ApplyFinished into BoxMetrics (json prev_release and apply_finished, omitempty; private, like Release) and counts them in the condition that builds Metrics; the same 28 sites, no read added.
+- `internal/activator/backend_exec.go` `ExecBackend.agentOwnedVars`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.
+- `internal/activator/backend_exec.go` `ExecBackend.spawnChildFrom`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos (the flat start body): the same change as seedChild: ensureAdminTokenFor(ctx, rt, paths) for the token (the same flat path), the key's producer carrying the HA mint decision, and launchEnvLayer(ctx, rt) for the env and key layer the replica gate reads; a non-HA host's token, key and env are produced and read as before; +whole:Route; only adds refusals for HA hosts;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-edge-page-cache-1;basis=the control listener is now built with the whole route (edge.ListenControl(controlSocket, rt, ...)), the +whole:Route site; it computes the launch inputs once from the build it execs by path (a staged exe's caller-named build, or the gate-resolved pinned version; "" for an unpinned live link) and fileEnv it already read, keeps them on the childProc, and for a live-link spawn publishes them to the in-memory cache (NoteProcessInputs) beside the existing purge; no new file read;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main build parameter, pinned live identity, launchInputs from captured build/environment, and current-process input publication. edge.ListenControl now receives the whole Route as main requires (+whole:Route); no new filesystem or storage input. Branch sandboxLaunch remains before preparation and spawn; existing direct primitive gate unchanged.;rev3=census-ruling-security-review-mitigations;basis=Enforce the unchanged never-served resident refusal once at the shared flat/foreign primary binary spawn sink, before placement, live-link/token/env/control preparation or execution. Covers plain, generation and staged Service wakes; existing served/explicit-flat exemptions and other gates retained. No new filesystem/store source.
+- `internal/activator/prepare.go` `ExecBackend.listenControl`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-edge-page-cache-1;basis=passes the whole route to edge.ListenControl instead of rt.Host (the -registry:Host +whole:Route change); nothing else
New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+- new `internal/activator/backend_exec.go:ExecBackend.controlMount`: reads +registry:Host ×3, +whole:Route; written legacy, accepted-legacy, frozen
+- new `internal/activator/backend_exec.go:ExecBackend.mailSubmits`: reads +registry:App ×2, +registry:Host ×2, +registry:Provisioned, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/host/mailerreport.go:mailerArmed`: reads +file:Stat; written legacy, accepted-legacy, frozen
- new `internal/host/units/carlos-mailer-arm.path:external`: reads +file:external; written legacy, accepted-legacy, frozen
- new `internal/host/units/carlos-mailer.service:external`: reads +file:external; written legacy, accepted-legacy, frozen
- new `internal/host/units/carlos-mailer.socket:external`: reads +file:external; written legacy, accepted-legacy, frozen
+- new `internal/mailsubmit/forward.go:SocketForwarder.Send`: reads +file:ReadAll; written legacy, accepted-legacy, frozen
+- new `internal/mailsubmit/verb.go:Mount`: reads +registry:App, +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
-Seal: `07b748a749084fdaf61c5087a6edfca8a79273962822ce551dd4d42b0d20c063` → `f949639f333c9a2e89bb120f64724ead4c55ee522914416b3ccc98bed460e49a`.
+Seal: `07b748a749084fdaf61c5087a6edfca8a79273962822ce551dd4d42b0d20c063` → `615b17f291546a3de0c068258e6b76e72fe06b14f809df308fa6ed018c00e5fd`.
Overlay: `internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/activator/agentowned_moves_test.go b/internal/activator/agentowned_moves_test.go
index c48a66e89..b4e8c48e1 100644
--- a/internal/activator/agentowned_moves_test.go
+++ b/internal/activator/agentowned_moves_test.go
@@ -35,26 +35,30 @@ func TestAgentOwnedVarsAreMovesBoxOwned(t *testing.T) {
}
cache := edge.NewCache(16, 1<<20)
absent := "<absent>"
+ switched := func(string, string) bool { return true }
+ mailRT := rt
+ mailRT.Provisioned = true
for _, c := range []struct {
name string
b *ExecBackend
+ rt registry.Route
control bool
want map[string]string
}{
- {"everything on", &ExecBackend{ServedPools: eligibleSharedPools, Region: "uk", Cache: cache}, true,
- map[string]string{"CARLOS_CONTROL_SOCKET": control, "CARLOS_PURGE": "header", "CARLOS_REGION": "uk", "CARLOS_HOST": rt.Host}},
- {"everything off", &ExecBackend{ServedPools: eligibleSharedPools}, false,
- map[string]string{"CARLOS_CONTROL_SOCKET": absent, "CARLOS_PURGE": absent, "CARLOS_REGION": absent, "CARLOS_HOST": rt.Host}},
- {"no control channel", &ExecBackend{ServedPools: eligibleSharedPools, Region: "uk", Cache: cache}, false,
- map[string]string{"CARLOS_CONTROL_SOCKET": absent, "CARLOS_PURGE": "header", "CARLOS_REGION": "uk", "CARLOS_HOST": rt.Host}},
- {"no cache", &ExecBackend{ServedPools: eligibleSharedPools, Region: "uk"}, true,
- map[string]string{"CARLOS_CONTROL_SOCKET": control, "CARLOS_PURGE": absent, "CARLOS_REGION": "uk", "CARLOS_HOST": rt.Host}},
- {"a home box, no region", &ExecBackend{ServedPools: eligibleSharedPools, Cache: cache}, true,
- map[string]string{"CARLOS_CONTROL_SOCKET": control, "CARLOS_PURGE": "header", "CARLOS_REGION": absent, "CARLOS_HOST": rt.Host}},
+ {"everything on", &ExecBackend{ServedPools: eligibleSharedPools, Region: "uk", Cache: cache, Mail: &mailRecorder{}, MailSwitch: switched}, mailRT, true,
+ map[string]string{"CARLOS_CONTROL_SOCKET": control, "CARLOS_PURGE": "header", "CARLOS_REGION": "uk", "CARLOS_HOST": rt.Host, "CARLOS_MAIL": "submit"}},
+ {"everything off", &ExecBackend{ServedPools: eligibleSharedPools}, rt, false,
+ map[string]string{"CARLOS_CONTROL_SOCKET": absent, "CARLOS_PURGE": absent, "CARLOS_REGION": absent, "CARLOS_HOST": rt.Host, "CARLOS_MAIL": absent}},
+ {"no control channel", &ExecBackend{ServedPools: eligibleSharedPools, Region: "uk", Cache: cache, Mail: &mailRecorder{}, MailSwitch: switched}, mailRT, false,
+ map[string]string{"CARLOS_CONTROL_SOCKET": absent, "CARLOS_PURGE": "header", "CARLOS_REGION": "uk", "CARLOS_HOST": rt.Host, "CARLOS_MAIL": absent}},
+ {"no cache", &ExecBackend{ServedPools: eligibleSharedPools, Region: "uk"}, rt, true,
+ map[string]string{"CARLOS_CONTROL_SOCKET": control, "CARLOS_PURGE": absent, "CARLOS_REGION": "uk", "CARLOS_HOST": rt.Host, "CARLOS_MAIL": absent}},
+ {"a home box, no region", &ExecBackend{ServedPools: eligibleSharedPools, Cache: cache}, rt, true,
+ map[string]string{"CARLOS_CONTROL_SOCKET": control, "CARLOS_PURGE": "header", "CARLOS_REGION": absent, "CARLOS_HOST": rt.Host, "CARLOS_MAIL": absent}},
} {
t.Run(c.name, func(t *testing.T) {
for _, file := range []map[string]string{{}, tenant} {
- got := c.b.agentOwnedVars(rt, control, file, c.control)
+ got := c.b.agentOwnedVars(c.rt, control, file, c.control)
for k, want := range c.want {
v, ok := got[k]
if want == absent && ok {
@@ -76,7 +80,7 @@ func TestAgentOwnedVarsAreMovesBoxOwned(t *testing.T) {
}
// The configurations above cover exactly moves' set, and every member
// is box-owned and never pinned.
- covered := slices.Sorted(maps.Keys(map[string]string{"CARLOS_CONTROL_SOCKET": "", "CARLOS_PURGE": "", "CARLOS_REGION": "", "CARLOS_HOST": ""}))
+ covered := slices.Sorted(maps.Keys(map[string]string{"CARLOS_CONTROL_SOCKET": "", "CARLOS_PURGE": "", "CARLOS_REGION": "", "CARLOS_HOST": "", "CARLOS_MAIL": ""}))
if want := slices.Sorted(maps.Keys(moves.AgentOwnedVars)); !slices.Equal(covered, want) {
t.Fatalf("the test covers %v, moves.AgentOwnedVars is %v", covered, want)
}
diff --git a/internal/activator/backend_exec.go b/internal/activator/backend_exec.go
index 2959a2e4f..a10ca5c7f 100644
--- a/internal/activator/backend_exec.go
+++ b/internal/activator/backend_exec.go
@@ -34,6 +34,7 @@ import (
"github.com/carlosframework/platform/internal/instancekey"
"github.com/carlosframework/platform/internal/instanceupdates"
"github.com/carlosframework/platform/internal/lease"
+ "github.com/carlosframework/platform/internal/mailsubmit"
"github.com/carlosframework/platform/internal/moves"
"github.com/carlosframework/platform/internal/provision"
"github.com/carlosframework/platform/internal/registry"
@@ -221,6 +222,20 @@ type ExecBackend struct {
// UpdatesReader answers the control socket's read-only GET /updates
// (instance update settings spec §5.1); nil mounts nothing.
UpdatesReader func(host string) (instanceupdates.Report, error)
+ // Mail, when non-nil, mounts POST /v1/mail on every spawned instance's
+ // control socket (platform mail submission design §4, decision 1),
+ // under its own condition and never under Timers' or UpdatesReader's.
+ // The verb stamps each message with the socket's route and forwards it
+ // to the box-local mailer through this. Nil mounts nothing.
+ Mail mailsubmit.Forwarder
+ // MailSwitch reports whether an app is switched to the submit transport
+ // (the app sender's submission block, cached by the agent). It decides
+ // CARLOS_MAIL with the bind (agentOwnedVars). Nil is off for every app.
+ MailSwitch func(acct, app string) bool
+ // mailUnprovisionedLogged holds the hosts agentOwnedVars has logged as
+ // unable to submit for want of an instance record, so each is logged
+ // once.
+ mailUnprovisionedLogged sync.Map
// LayoutFacts supplies the box facts the classification of §8.1 needs
// beyond the row: journals and peers. Zero value: never fenced, never
// conflict. Named apart from the Layout method (the Classifier
@@ -2543,18 +2558,7 @@ func (b *ExecBackend) spawnChildFrom(ctx context.Context, rt registry.Route, soc
}
return env["CARLOS_ADMIN_TOKEN"], nil
}
- var mount func(*http.ServeMux)
- if b.Timers != nil || b.UpdatesReader != nil {
- mount = func(mux *http.ServeMux) {
- if b.Timers != nil {
- schedule.MountGated(mux, rt.Host, b.Timers, tokenReader, time.Now, b.writeFence(rt.Host, n))
- }
- if b.UpdatesReader != nil {
- instanceupdates.Mount(mux, rt.Host, tokenReader, b.UpdatesReader)
- }
- }
- }
- ctl, err := edge.ListenControl(controlSocket, rt, b.Cache, mount)
+ ctl, err := edge.ListenControl(controlSocket, rt, b.Cache, b.controlMount(rt, tokenReader, n))
if err != nil {
log.Printf("activator: control listener for %s: %v (continuing without it)", rt.Host, err)
ctl = nil
@@ -2742,11 +2746,37 @@ func (b *ExecBackend) spawnChildFrom(ctx context.Context, rt registry.Route, soc
return p, spawnVer, nil
}
+// controlMount is the one composer of a control socket's verbs, for both
+// bind sites: the flat spawn (spawnChildFrom) and the nested and rootfs
+// listener (listenControl), so the two cannot drift. The scheduled-work
+// verbs and GET /updates are mounted as before. POST /v1/mail is mounted
+// under its own condition, b.Mail != nil (platform mail submission design,
+// decision 1). Nil when there is nothing to mount.
+//
+// gen is the generation the listener serves (0 for the original
+// templates): its schedule writes go through that generation's write fence.
+func (b *ExecBackend) controlMount(rt registry.Route, tokenReader func() (string, error), gen uint64) func(*http.ServeMux) {
+ if b.Timers == nil && b.UpdatesReader == nil && b.Mail == nil {
+ return nil
+ }
+ return func(mux *http.ServeMux) {
+ if b.Timers != nil {
+ schedule.MountGated(mux, rt.Host, b.Timers, tokenReader, time.Now, b.writeFence(rt.Host, gen))
+ }
+ if b.UpdatesReader != nil {
+ instanceupdates.Mount(mux, rt.Host, tokenReader, b.UpdatesReader)
+ }
+ if b.Mail != nil {
+ mailsubmit.Mount(mux, rt, tokenReader, b.Mail)
+ }
+ }
+}
+
// agentOwnedNames are the variables agentOwnedVars decides: it sets or
// removes each of them on every launch, whatever the instance's files say.
// moves.AgentOwnedVars is the same set (TestAgentOwnedVarsAreMovesBoxOwned
// pins both against agentOwnedVars itself).
-var agentOwnedNames = []string{"CARLOS_CONTROL_SOCKET", "CARLOS_PURGE", "CARLOS_REGION", "CARLOS_HOST"}
+var agentOwnedNames = []string{"CARLOS_CONTROL_SOCKET", "CARLOS_PURGE", "CARLOS_REGION", "CARLOS_HOST", "CARLOS_MAIL"}
// agentOwnedVars composes the child's agent-owned environment variables,
// namely the control socket, the purge channel, and the region, on top of
@@ -2772,6 +2802,11 @@ func (b *ExecBackend) agentOwnedVars(rt registry.Route, control string, fileEnv
} else {
childVars = withoutVars(childVars, "CARLOS_REGION")
}
+ if b.mailSubmits(rt, haveControl) {
+ childVars = withVar(childVars, "CARLOS_MAIL", "submit")
+ } else {
+ childVars = withoutVars(childVars, "CARLOS_MAIL")
+ }
// The hostname, always, from the row (discussion #256 item 2). An app
// used to learn it from its socket's file name, /run/carlos/<host>.sock,
// and the nested layout's app.sock names nothing; three instances
@@ -2781,13 +2816,45 @@ func (b *ExecBackend) agentOwnedVars(rt registry.Route, control string, fileEnv
return storageVars(rt, withVar(childVars, "CARLOS_HOST", rt.Host))
}
+// mailSubmits decides CARLOS_MAIL=submit (platform mail submission design,
+// decision 11). It follows the BIND, not the mailer's health: set when the
+// control socket bound (so POST /v1/mail exists), the verb is mounted, and
+// the app is switched. Mailer health is what 503 MAILER_UNAVAILABLE is for;
+// a probe here would leave an instance with no channel for its lifetime.
+//
+// The route must also be Provisioned (plan round 1 P2-2): a hand-made row
+// with no instance record is invisible to the switch's door, and the
+// mailer would refuse it ROUTE_NOT_ON_BOX on every send. Such a route of a
+// switched app is never told it can submit; with its SMTP variables gone
+// it has neither channel, and the app refuses at boot (decision 11's loud
+// failure, plan gap G10). That is logged here at error level, once per
+// host, with the remedy.
+//
+// Everything else strips the variable, including a tenant-supplied one.
+func (b *ExecBackend) mailSubmits(rt registry.Route, haveControl bool) bool {
+ if !haveControl || b.Mail == nil || b.MailSwitch == nil {
+ return false
+ }
+ acct := release.RouteAccount(rt)
+ if !b.MailSwitch(acct, rt.App) {
+ return false
+ }
+ if !rt.Provisioned {
+ if _, seen := b.mailUnprovisionedLogged.LoadOrStore(rt.Host, true); !seen {
+ log.Printf("activator: ERROR: route %s has no instance record, so it cannot submit mail for switched app %s/%s; give it a record (adoption) or switch submission off", rt.Host, acct, rt.App)
+ }
+ return false
+ }
+ return true
+}
+
// seedVars is the seed's environment over fileEnv: the control-channel
// variables stripped (a seed has no listener for either; see seedChild's
// comment), and CARLOS_HOST set, since a seed initialising a host's
// database is as entitled to know which host as the instance is. One
// composer for both seed paths, as agentOwnedVars is for both run paths.
func seedVars(fileEnv map[string]string, host string) map[string]string {
- return withVar(withoutVars(fileEnv, "CARLOS_CONTROL_SOCKET", "CARLOS_PURGE"), "CARLOS_HOST", host)
+ return withVar(withoutVars(fileEnv, "CARLOS_CONTROL_SOCKET", "CARLOS_PURGE", "CARLOS_MAIL"), "CARLOS_HOST", host)
}
// normalizeSocketMode is the PLATFORM's 0660 on a spawned instance's socket
diff --git a/internal/activator/mailverb_test.go b/internal/activator/mailverb_test.go
new file mode 100644
index 000000000..680582d3f
--- /dev/null
+++ b/internal/activator/mailverb_test.go
@@ -0,0 +1,228 @@
+package activator
+
+import (
+ "bytes"
+ "context"
+ "encoding/base64"
+ "encoding/json"
+ "io"
+ "net/http"
+ "os"
+ "strings"
+ "sync"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/instancectl"
+ "github.com/carlosframework/platform/internal/mailsubmit"
+ "github.com/carlosframework/platform/internal/registry"
+)
+
+// mailRecorder is a mailsubmit.Forwarder that records the stamped requests
+// and accepts every one.
+type mailRecorder struct {
+ mu sync.Mutex
+ calls []mailsubmit.SendRequest
+}
+
+func (m *mailRecorder) Send(_ context.Context, req mailsubmit.SendRequest) (int, mailsubmit.Answer, string, error) {
+ m.mu.Lock()
+ defer m.mu.Unlock()
+ m.calls = append(m.calls, req)
+ return http.StatusOK, mailsubmit.Answer{MessageID: "m-1"}, "", nil
+}
+
+func (m *mailRecorder) hosts() []string {
+ m.mu.Lock()
+ defer m.mu.Unlock()
+ var out []string
+ for _, c := range m.calls {
+ out = append(out, c.Host)
+ }
+ return out
+}
+
+// mailPost sends one well-formed POST /v1/mail on a control socket.
+func mailPost(t *testing.T, ctl, bearer string) int {
+ t.Helper()
+ body, _ := json.Marshal(map[string]any{
+ "from": "hello@docs.example.com", "to": []string{"x@example.org"},
+ "raw": base64.StdEncoding.EncodeToString([]byte("From: hello@docs.example.com\r\n\r\nhi\r\n")),
+ // The body naming another host changes nothing (test 8.2).
+ "host": "someone-else.example.com",
+ })
+ req, err := http.NewRequest(http.MethodPost, "http://carlos/v1/mail", bytes.NewReader(body))
+ if err != nil {
+ t.Fatal(err)
+ }
+ req.Header.Set("Authorization", "Bearer "+bearer)
+ resp, err := socketClient(ctl).Do(req)
+ if err != nil {
+ t.Fatalf("dial control socket %s: %v", ctl, err)
+ }
+ defer resp.Body.Close()
+ _, _ = io.Copy(io.Discard, resp.Body)
+ return resp.StatusCode
+}
+
+// POST /v1/mail is mounted at BOTH bind sites (design decision 1): the flat
+// spawn and the nested listener. It is mounted under its own condition, so
+// with Timers and UpdatesReader both nil it is still there, and with Mail
+// nil it is absent at both.
+func TestMailVerbMountedAtBothBindSites(t *testing.T) {
+ t.Run("flat, mounted", func(t *testing.T) {
+ b := testExecBackend(t) // Timers and UpdatesReader nil
+ rec := &mailRecorder{}
+ b.Mail = rec
+ ctl, token, stop := startAndReachControlSocket(t, b, "flatmail.example.com")
+ defer stop()
+ if code := mailPost(t, ctl, token); code != http.StatusOK {
+ t.Fatalf("POST /v1/mail on the flat socket = %d", code)
+ }
+ if h := rec.hosts(); len(h) != 1 || h[0] != "flatmail.example.com" {
+ t.Fatalf("stamped hosts %v, want the socket's", h)
+ }
+ if code := mailPost(t, ctl, "not-the-token"); code != http.StatusUnauthorized {
+ t.Fatalf("wrong bearer = %d", code)
+ }
+ })
+ t.Run("flat, not mounted", func(t *testing.T) {
+ b := testExecBackend(t)
+ ctl, token, stop := startAndReachControlSocket(t, b, "flatnomail.example.com")
+ defer stop()
+ if code := mailPost(t, ctl, token); code != http.StatusNotFound {
+ t.Fatalf("POST /v1/mail with Mail nil = %d, want 404", code)
+ }
+ })
+ nested := func(t *testing.T, mail mailsubmit.Forwarder) (string, string, func()) {
+ b, rt := nestedBackend(t, &fakeControl{}, &fakeUnit{})
+ b.GenContainment = true
+ b.Mail = mail
+ p0 := b.pathsFor(rt)
+ if err := os.MkdirAll(p0.runDir, 0o750); err != nil {
+ t.Fatal(err)
+ }
+ sock := nestedGenSocketIn(p0.runDir, 7)
+ p, ctl, logs, _, err := b.prepareAt(rt, instancectl.RoleRun, sock, 7)
+ if err != nil {
+ t.Fatalf("prepareAt: %v", err)
+ }
+ if ctl == nil {
+ t.Fatal("prepareAt bound no control listener")
+ }
+ env, err := readEnvFileBeneath(p.dataDir, rt.Host+".env")
+ if err != nil {
+ t.Fatal(err)
+ }
+ return sock + ".control", env["CARLOS_ADMIN_TOKEN"], func() {
+ ctl.Close()
+ if logs != nil {
+ logs.Close()
+ }
+ }
+ }
+ t.Run("nested, mounted", func(t *testing.T) {
+ rec := &mailRecorder{}
+ ctl, token, stop := nested(t, rec)
+ defer stop()
+ if code := mailPost(t, ctl, token); code != http.StatusOK {
+ t.Fatalf("POST /v1/mail on the nested socket = %d", code)
+ }
+ if h := rec.hosts(); len(h) != 1 || h[0] == "someone-else.example.com" {
+ t.Fatalf("stamped hosts %v", h)
+ }
+ })
+ t.Run("nested, not mounted", func(t *testing.T) {
+ ctl, token, stop := nested(t, nil)
+ defer stop()
+ if code := mailPost(t, ctl, token); code != http.StatusNotFound {
+ t.Fatalf("POST /v1/mail with Mail nil = %d, want 404", code)
+ }
+ })
+}
+
+// Test 8.7 (design decision 11): CARLOS_MAIL=submit follows the bind, not
+// mailer health; it needs the switch, the bound socket, the mounted verb and
+// an instance record, and anything else strips it, a tenant's own value
+// included.
+func TestCarlosMailFollowsTheBind(t *testing.T) {
+ on := func(acct, app string) bool { return acct == "abcxyz" && app == "docs" }
+ off := func(string, string) bool { return false }
+ provisioned := registry.Route{Host: "a.docs.example.com", Account: "abcxyz", App: "docs", Provisioned: true}
+ handMade := provisioned
+ handMade.Provisioned = false
+ handMade.Host = "handmade.docs.example.com"
+ tenant := map[string]string{"CARLOS_MAIL": "submit", "APP": "1"}
+ // A forwarder that would fail every send: health is not consulted.
+ failing := &failingForwarder{}
+ for _, c := range []struct {
+ name string
+ mail mailsubmit.Forwarder
+ sw func(string, string) bool
+ rt registry.Route
+ control bool
+ want bool
+ }{
+ {"switched, bound, provisioned", failing, on, provisioned, true, true},
+ {"switched, no control socket", failing, on, provisioned, false, false},
+ {"switched, bound, hand-made route", failing, on, handMade, true, false},
+ {"switch off", failing, off, provisioned, true, false},
+ {"another app is switched", failing, on, registry.Route{Host: "s.example.com", Account: "abcxyz", App: "sheets", Provisioned: true}, true, false},
+ {"no switch reader", failing, nil, provisioned, true, false},
+ {"verb not mounted", nil, on, provisioned, true, false},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ b := &ExecBackend{ServedPools: eligibleSharedPools, Mail: c.mail, MailSwitch: c.sw}
+ for _, file := range []map[string]string{{}, tenant} {
+ got := b.agentOwnedVars(c.rt, "/run/carlos/x.sock.control", file, c.control)
+ v, ok := got["CARLOS_MAIL"]
+ if c.want && (!ok || v != "submit") {
+ t.Fatalf("file %v: CARLOS_MAIL = %q (present %v), want submit", file, v, ok)
+ }
+ if !c.want && ok {
+ t.Fatalf("file %v: CARLOS_MAIL = %q, want it stripped", file, v)
+ }
+ if got["APP"] != file["APP"] {
+ t.Fatalf("the tenant's own variable changed: %v", got)
+ }
+ }
+ })
+ }
+ if failing.calls != 0 {
+ t.Fatal("composing CARLOS_MAIL called the mailer")
+ }
+
+ // A hand-made route of a switched app is logged at error level, once
+ // per host, with the remedy.
+ buf := captureLog(t)
+ b := &ExecBackend{ServedPools: eligibleSharedPools, Mail: failing, MailSwitch: on}
+ for range 3 {
+ b.agentOwnedVars(handMade, "/run/carlos/x.sock.control", nil, true)
+ }
+ if n := strings.Count(buf.String(), "has no instance record"); n != 1 {
+ t.Fatalf("logged %d times, want once: %q", n, buf.String())
+ }
+ if !strings.Contains(buf.String(), "ERROR") || !strings.Contains(buf.String(), handMade.Host) || !strings.Contains(buf.String(), "switch submission off") {
+ t.Fatalf("log line %q", buf.String())
+ }
+}
+
+type failingForwarder struct{ calls int }
+
+func (f *failingForwarder) Send(context.Context, mailsubmit.SendRequest) (int, mailsubmit.Answer, string, error) {
+ f.calls++
+ return 0, mailsubmit.Answer{}, "", io.ErrUnexpectedEOF
+}
+
+// A seed has no control socket, so it can never submit: a tenant-supplied
+// CARLOS_MAIL is stripped with the two control-channel variables.
+func TestSeedVarsStripCarlosMail(t *testing.T) {
+ got := seedVars(map[string]string{"CARLOS_MAIL": "submit", "CARLOS_CONTROL_SOCKET": "/x", "CARLOS_PURGE": "header", "APP": "1"}, "h.example.com")
+ for _, k := range []string{"CARLOS_MAIL", "CARLOS_CONTROL_SOCKET", "CARLOS_PURGE"} {
+ if _, ok := got[k]; ok {
+ t.Errorf("seedVars kept %s", k)
+ }
+ }
+ if got["APP"] != "1" || got["CARLOS_HOST"] != "h.example.com" {
+ t.Fatalf("seedVars = %v", got)
+ }
+}
diff --git a/internal/activator/prepare.go b/internal/activator/prepare.go
index 07e86baa5..48a7c95f8 100644
--- a/internal/activator/prepare.go
+++ b/internal/activator/prepare.go
@@ -11,7 +11,6 @@ import (
"errors"
"fmt"
"log"
- "net/http"
"os"
"path/filepath"
"strings"
@@ -22,11 +21,9 @@ import (
"github.com/carlosframework/platform/internal/instancectl"
"github.com/carlosframework/platform/internal/instancefs"
"github.com/carlosframework/platform/internal/instancekey"
- "github.com/carlosframework/platform/internal/instanceupdates"
"github.com/carlosframework/platform/internal/provision"
"github.com/carlosframework/platform/internal/registry"
"github.com/carlosframework/platform/internal/release"
- "github.com/carlosframework/platform/internal/schedule"
)
// prepare is everything a nested role needs before its unit starts
@@ -268,7 +265,8 @@ func exitPrefix(role instancectl.Role, gen uint64) string {
}
// listenControl binds the control socket exactly as startChild does for an
-// exec child (the tokenReader and schedule mount are unchanged, aside from
+// exec child, through the same mount composer (controlMount; the tokenReader
+// is unchanged, aside from
// reading beneath the instance directory rather than following a plain
// path, design §3.2); a bind failure is logged and the instance runs
// without its control verbs, as today.
@@ -284,18 +282,7 @@ func (b *ExecBackend) listenControl(rt registry.Route, control, envPath string,
}
return env["CARLOS_ADMIN_TOKEN"], nil
}
- var mount func(*http.ServeMux)
- if b.Timers != nil || b.UpdatesReader != nil {
- mount = func(mux *http.ServeMux) {
- if b.Timers != nil {
- schedule.MountGated(mux, rt.Host, b.Timers, tokenReader, time.Now, b.writeFence(rt.Host, gen))
- }
- if b.UpdatesReader != nil {
- instanceupdates.Mount(mux, rt.Host, tokenReader, b.UpdatesReader)
- }
- }
- }
- ctl, err := edge.ListenControl(control, rt, b.Cache, mount)
+ ctl, err := edge.ListenControl(control, rt, b.Cache, b.controlMount(rt, tokenReader, gen))
if err != nil {
log.Printf("activator: control listener for %s: %v (continuing without it)", rt.Host, err)
return nil
diff --git a/internal/host/agent.go b/internal/host/agent.go
index 98cfb7b2b..ce5d1ca27 100644
--- a/internal/host/agent.go
+++ b/internal/host/agent.go
@@ -200,6 +200,7 @@ import (
"github.com/carlosframework/platform/internal/layout"
"github.com/carlosframework/platform/internal/lbhealth"
"github.com/carlosframework/platform/internal/lease"
+ "github.com/carlosframework/platform/internal/mailsubmit"
"github.com/carlosframework/platform/internal/mailwire"
"github.com/carlosframework/platform/internal/metrics"
"github.com/carlosframework/platform/internal/moves"
@@ -549,6 +550,20 @@ func runAgent(args []string, buildClaims ClaimFactory) {
if claims.Writes.Enabled {
eb.Timers = schedule.ClaimTimers{TimerStore: reg, Writes: claims.Writes, Context: agentCtx}
}
+ // POST /v1/mail on every control socket (platform mail submission
+ // design, decision 1), forwarded to the box-local mailer, and the
+ // per-app switch that decides CARLOS_MAIL (decision 11), read from
+ // the app sender record and refreshed on every serial move. With no
+ // deploy store the switch reads off for every app: the verb is
+ // still there, and the mailer refuses an unswitched app itself.
+ eb.Mail = mailsubmit.SocketForwarder{}
+ if store, err := openDeployStore(context.Background()); err == nil {
+ cache := newMailSwitchCache(store)
+ eb.MailSwitch = cache.On
+ armedMailSwitch.Store(cache)
+ } else {
+ log.Printf("agent: mail switch: no deploy store (%v); every app reads as not switched", err)
+ }
// Region HA P1a: the lifetime index the reconcile passes fill, the
// registry and files store an HA restore reads, the startup sweep's
// proof, and the obligation store, opened before the Service
@@ -3324,6 +3339,13 @@ func fastTick(ctx context.Context, d *fastDeps, now time.Time) {
if d.scheduleLeg != nil {
d.scheduleLeg(ctx)
}
+ // The mail switch rides the move too (platform mail submission
+ // plan Task 4): the console's switch door bumps the serial, and
+ // the next spawn of a switched app must see it. Its own
+ // goroutine: each read is bounded, and the tick waits on none.
+ if c := armedMailSwitch.Load(); c != nil {
+ go c.Refresh(context.WithoutCancel(ctx))
+ }
// The layout pass converges to the fleet's recorded layout on
// every move, after the pass set has minted and staged whatever
// the move carried, so a freshly minted row is seen. It only
diff --git a/internal/host/mailswitch.go b/internal/host/mailswitch.go
new file mode 100644
index 000000000..b0cd28355
--- /dev/null
+++ b/internal/host/mailswitch.go
@@ -0,0 +1,156 @@
+package host
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "log"
+ "os"
+ "sync"
+ "sync/atomic"
+ "time"
+
+ "github.com/carlosframework/platform/internal/mailwire"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// mailSwitchReadTimeout bounds one read of an app sender record.
+const mailSwitchReadTimeout = 2 * time.Second
+
+// mailSwitchRetryErr is how long an answer the agent could not read is
+// kept before the next On asks the store again.
+const mailSwitchRetryErr = 30 * time.Second
+
+// mailSwitchLogEvery is the least time between two logged read failures
+// for one app.
+const mailSwitchLogEvery = time.Minute
+
+// mailSwitchCache is the agent's copy of each app's submission switch
+// (platform mail submission design, decision 10; plan "where the agent
+// reads the switch"): the app sender record's submission block,
+// apps/<acct>/<app>/email/senders/app.json, read on first use and re-read
+// on every serial bump. The console's switch door bumps the serial, so a
+// flip reaches the next spawn within seconds. The activator asks On when it
+// composes CARLOS_MAIL (agentOwnedVars).
+type mailSwitchCache struct {
+ store release.Store
+ now func() time.Time
+ logf func(string, ...any)
+
+ mu sync.Mutex
+ entries map[mailSwitchKey]mailSwitchEntry
+ logged map[mailSwitchKey]time.Time
+
+ refreshing atomic.Bool
+}
+
+type mailSwitchKey struct{ acct, app string }
+
+type mailSwitchEntry struct {
+ on bool
+ etag string
+ at time.Time
+ err bool // the last read failed; on is the last good answer, or false
+}
+
+func newMailSwitchCache(s release.Store) *mailSwitchCache {
+ return &mailSwitchCache{store: s, now: time.Now, logf: log.Printf,
+ entries: map[mailSwitchKey]mailSwitchEntry{}, logged: map[mailSwitchKey]time.Time{}}
+}
+
+// armedMailSwitch is the agent's cache, for the serial-bump refresh in
+// fastTick. Nil until runAgent arms one.
+var armedMailSwitch atomic.Pointer[mailSwitchCache]
+
+// On reports whether the app is switched. A cached answer is used; on a
+// miss, or on an answer whose read failed more than mailSwitchRetryErr ago,
+// the record is read once, bounded. A read that fails with no good answer
+// cached is false, and logged at most once a minute per app: a wake with
+// the switch unreadable gets its SMTP variables if the bundle has them, or
+// neither channel, and the app refuses at boot (decision 11's loud
+// failure).
+func (c *mailSwitchCache) On(acct, app string) bool {
+ if c == nil || c.store == nil {
+ return false
+ }
+ k := mailSwitchKey{acct, app}
+ c.mu.Lock()
+ e, ok := c.entries[k]
+ c.mu.Unlock()
+ if ok && (!e.err || c.now().Sub(e.at) < mailSwitchRetryErr) {
+ return e.on
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), mailSwitchReadTimeout)
+ defer cancel()
+ return c.read(ctx, k).on
+}
+
+// Refresh re-reads every cached app. fastTick runs it on each serial move,
+// on its own goroutine; a refresh still running when the next move comes
+// is not doubled.
+func (c *mailSwitchCache) Refresh(ctx context.Context) {
+ if c == nil || c.store == nil || !c.refreshing.CompareAndSwap(false, true) {
+ return
+ }
+ defer c.refreshing.Store(false)
+ c.mu.Lock()
+ keys := make([]mailSwitchKey, 0, len(c.entries))
+ for k := range c.entries {
+ keys = append(keys, k)
+ }
+ c.mu.Unlock()
+ for _, k := range keys {
+ rctx, cancel := context.WithTimeout(ctx, mailSwitchReadTimeout)
+ c.read(rctx, k)
+ cancel()
+ }
+}
+
+// read fetches and stores one app's switch, and returns what it stored. An
+// absent record is off. A failed read or an undecodable body keeps the last
+// good answer (or false), marked as an error so On asks again later.
+func (c *mailSwitchCache) read(ctx context.Context, k mailSwitchKey) mailSwitchEntry {
+ body, etag, err := c.store.Get(ctx, mailwire.SenderKey(k.acct, k.app, "app"))
+ now := c.now()
+ var e mailSwitchEntry
+ switch {
+ case errors.Is(err, os.ErrNotExist):
+ e = mailSwitchEntry{on: false, at: now}
+ case err != nil:
+ e = c.failed(k, now, err)
+ default:
+ c.mu.Lock()
+ prev, had := c.entries[k]
+ c.mu.Unlock()
+ if had && !prev.err && etag != "" && prev.etag == etag {
+ e = mailSwitchEntry{on: prev.on, etag: etag, at: now}
+ break
+ }
+ var v mailwire.SenderView
+ if derr := json.Unmarshal(body, &v); derr != nil {
+ e = c.failed(k, now, derr)
+ break
+ }
+ e = mailSwitchEntry{on: v.Submission != nil && v.Submission.On, etag: etag, at: now}
+ }
+ c.mu.Lock()
+ c.entries[k] = e
+ c.mu.Unlock()
+ return e
+}
+
+// failed is a failed read's entry: the last good answer, or false.
+func (c *mailSwitchCache) failed(k mailSwitchKey, now time.Time, err error) mailSwitchEntry {
+ c.mu.Lock()
+ prev, had := c.entries[k]
+ last := c.logged[k]
+ report := last.IsZero() || now.Sub(last) >= mailSwitchLogEvery
+ if report {
+ c.logged[k] = now
+ }
+ c.mu.Unlock()
+ if report {
+ c.logf("agent: mail switch for %s/%s unreadable: %v (answering %v until a read succeeds)", k.acct, k.app, err, had && prev.on)
+ }
+ return mailSwitchEntry{on: had && prev.on, etag: prev.etag, at: now, err: true}
+}
diff --git a/internal/host/mailswitch_test.go b/internal/host/mailswitch_test.go
new file mode 100644
index 000000000..d7cb23061
--- /dev/null
+++ b/internal/host/mailswitch_test.go
@@ -0,0 +1,177 @@
+package host
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/mailwire"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// switchStore is a release.Store holding sender records by key, counting
+// reads, with an injectable failure.
+type switchStore struct {
+ release.Store
+ mu sync.Mutex
+ objs map[string]string
+ etags map[string]string
+ fail error
+ reads int
+}
+
+func (s *switchStore) Get(_ context.Context, key string) ([]byte, string, error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ s.reads++
+ if s.fail != nil {
+ return nil, "", s.fail
+ }
+ b, ok := s.objs[key]
+ if !ok {
+ return nil, "", fmt.Errorf("%s: %w", key, os.ErrNotExist)
+ }
+ return []byte(b), s.etags[key], nil
+}
+
+func (s *switchStore) set(acct, app string, on bool, etag string) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ k := mailwire.SenderKey(acct, app, "app")
+ s.objs[k] = fmt.Sprintf(`{"id":"app","declared":{"from":"a@b.example.com"},"submission":{"on":%v,"at":"2026-11-13T00:00:00Z"}}`, on)
+ s.etags[k] = etag
+}
+
+func (s *switchStore) n() int { s.mu.Lock(); defer s.mu.Unlock(); return s.reads }
+
+func TestMailSwitchCache(t *testing.T) {
+ st := &switchStore{objs: map[string]string{}, etags: map[string]string{}}
+ st.set("abcxyz", "docs", true, `"e1"`)
+ clock := time.Unix(1_700_000_000, 0)
+ var logs []string
+ c := newMailSwitchCache(st)
+ c.now = func() time.Time { return clock }
+ c.logf = func(f string, a ...any) { logs = append(logs, fmt.Sprintf(f, a...)) }
+
+ // A miss reads once; a hit does not read again.
+ if !c.On("abcxyz", "docs") {
+ t.Fatal("a switched app reads off")
+ }
+ if !c.On("abcxyz", "docs") || st.n() != 1 {
+ t.Fatalf("a hit read the store again (%d reads)", st.n())
+ }
+ // An app with no sender record is off, and cached.
+ if c.On("abcxyz", "sheets") || c.On("abcxyz", "sheets") || st.n() != 2 {
+ t.Fatalf("absent record: %d reads", st.n())
+ }
+ // A record with no submission block, or one switched off, is off.
+ k := mailwire.SenderKey("abcxyz", "slides", "app")
+ st.objs[k] = `{"id":"app","provisioned":{"active":true}}`
+ if c.On("abcxyz", "slides") {
+ t.Fatal("no submission block reads on")
+ }
+
+ // Refresh flips a cached value once the record changes.
+ st.set("abcxyz", "docs", false, `"e2"`)
+ if !c.On("abcxyz", "docs") {
+ t.Fatal("the cache moved without a refresh")
+ }
+ c.Refresh(context.Background())
+ if c.On("abcxyz", "docs") {
+ t.Fatal("a refresh did not flip the switch off")
+ }
+ st.set("abcxyz", "sheets", true, `"e3"`)
+ c.Refresh(context.Background())
+ if !c.On("abcxyz", "sheets") {
+ t.Fatal("a refresh did not see a new switch-on")
+ }
+
+ // A read error with nothing cached is off, logged once a minute, and
+ // retried only after mailSwitchRetryErr.
+ st.fail = errors.New("store down")
+ if c.On("abcxyz", "calendar") || c.On("abcxyz", "calendar") {
+ t.Fatal("an unreadable switch reads on")
+ }
+ if len(logs) != 1 || !strings.Contains(logs[0], "abcxyz/calendar") {
+ t.Fatalf("logs %q", logs)
+ }
+ before := st.n()
+ c.On("abcxyz", "calendar")
+ if st.n() != before {
+ t.Fatal("a failed read was retried inside the retry window")
+ }
+ clock = clock.Add(mailSwitchRetryErr + time.Second)
+ c.On("abcxyz", "calendar")
+ if st.n() != before+1 {
+ t.Fatal("a failed read was not retried after the window")
+ }
+ // A failed refresh keeps the last good answer.
+ c.Refresh(context.Background())
+ if !c.On("abcxyz", "sheets") {
+ t.Fatal("a failed refresh dropped a good answer")
+ }
+ // The store comes back: the next read after the window is believed.
+ st.fail = nil
+ st.set("abcxyz", "calendar", true, `"e4"`)
+ clock = clock.Add(mailSwitchRetryErr + time.Second)
+ if !c.On("abcxyz", "calendar") {
+ t.Fatal("a recovered read was not believed")
+ }
+
+ // A nil cache, or one with no store, is off.
+ var nilCache *mailSwitchCache
+ if nilCache.On("abcxyz", "docs") || newMailSwitchCache(nil).On("abcxyz", "docs") {
+ t.Fatal("no store reads on")
+ }
+}
+
+// The mailer side never reaches internal/mail (plan round 1 P3): the
+// mailer, the verb, the wire package and the agent are all in the root
+// binary, and internal/mail's IAM and SES walks must stay out of it and
+// out of census scope. internal/console likewise. The walk is go list -deps
+// for linux on both root architectures.
+//
+// The IAM SDK is checked for the three mailer-side packages only: the root
+// binary already links it through internal/awsinv and internal/objstore
+// (true before this plan), so it cannot be a property of internal/host or
+// of the binary. What the guard keeps is that the mailer itself, which
+// holds a sending key, never carries an IAM client.
+func TestMailerSidePackagesDoNotImportMail(t *testing.T) {
+ const mod = "github.com/carlosframework/platform"
+ mailerSide := []string{mod + "/internal/mailer", mod + "/internal/mailsubmit", mod + "/internal/mailwire"}
+ for _, arch := range []string{"amd64", "arm64"} {
+ for _, set := range []struct {
+ pkgs []string
+ iamFree bool
+ }{
+ {mailerSide, true},
+ {[]string{mod + "/internal/host", mod}, false},
+ } {
+ cmd := exec.Command("go", append([]string{"list", "-deps"}, set.pkgs...)...)
+ cmd.Env = append(os.Environ(), "GOOS=linux", "GOARCH="+arch, "CGO_ENABLED=0")
+ out, err := cmd.Output()
+ if err != nil {
+ t.Fatalf("go list (linux/%s) %v: %v", arch, set.pkgs, err)
+ }
+ deps := strings.Fields(string(out))
+ if len(deps) < 20 {
+ t.Fatalf("go list named %d packages for %v; the walk is not seeing the tree", len(deps), set.pkgs)
+ }
+ for _, d := range deps {
+ switch {
+ case d == mod+"/internal/mail", strings.HasPrefix(d, mod+"/internal/mail/"),
+ d == mod+"/internal/console", strings.HasPrefix(d, mod+"/internal/console/"):
+ t.Errorf("linux/%s: %v reaches %s", arch, set.pkgs, d)
+ case set.iamFree && strings.Contains(d, "aws-sdk-go-v2/service/iam"):
+ t.Errorf("linux/%s: the mailer side reaches %s", arch, d)
+ }
+ }
+ }
+ }
+}
diff --git a/internal/mailsubmit/forward.go b/internal/mailsubmit/forward.go
new file mode 100644
index 000000000..e71be86f2
--- /dev/null
+++ b/internal/mailsubmit/forward.go
@@ -0,0 +1,68 @@
+package mailsubmit
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "net"
+ "net/http"
+ "time"
+)
+
+// SocketForwarder is the agent's client to the mailer: one HTTP POST of
+// /v1/send over a fresh unix dial per message. The zero value dials
+// MailerSocket with a 60 s timeout.
+type SocketForwarder struct {
+ Path string
+ Timeout time.Duration
+}
+
+// maxAnswer bounds what the agent reads of a mailer answer.
+const maxAnswer = 64 << 10
+
+func (f SocketForwarder) Send(ctx context.Context, req SendRequest) (int, Answer, string, error) {
+ path := f.Path
+ if path == "" {
+ path = MailerSocket
+ }
+ timeout := f.Timeout
+ if timeout <= 0 {
+ timeout = 60 * time.Second
+ }
+ body, err := json.Marshal(req)
+ if err != nil {
+ return 0, Answer{}, "", err
+ }
+ client := &http.Client{Timeout: timeout, Transport: &http.Transport{
+ DisableKeepAlives: true,
+ DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) {
+ var d net.Dialer
+ return d.DialContext(ctx, "unix", path)
+ },
+ }}
+ hreq, err := http.NewRequestWithContext(ctx, http.MethodPost, "http://mailer/v1/send", bytes.NewReader(body))
+ if err != nil {
+ return 0, Answer{}, "", err
+ }
+ hreq.Header.Set("Content-Type", "application/json")
+ resp, err := client.Do(hreq)
+ if err != nil {
+ return 0, Answer{}, "", err
+ }
+ defer resp.Body.Close()
+ b, err := io.ReadAll(io.LimitReader(resp.Body, maxAnswer+1))
+ if err != nil {
+ return 0, Answer{}, "", err
+ }
+ if len(b) > maxAnswer {
+ return 0, Answer{}, "", errors.New("mailsubmit: mailer answer too large")
+ }
+ var ans Answer
+ if err := json.Unmarshal(b, &ans); err != nil {
+ return 0, Answer{}, "", fmt.Errorf("mailsubmit: mailer answered %d with no answer: %w", resp.StatusCode, err)
+ }
+ return resp.StatusCode, ans, resp.Header.Get("Retry-After"), nil
+}
diff --git a/internal/mailsubmit/forward_test.go b/internal/mailsubmit/forward_test.go
new file mode 100644
index 000000000..4f317c38c
--- /dev/null
+++ b/internal/mailsubmit/forward_test.go
@@ -0,0 +1,75 @@
+package mailsubmit
+
+import (
+ "context"
+ "encoding/json"
+ "io"
+ "net"
+ "net/http"
+ "os"
+ "path/filepath"
+ "testing"
+ "time"
+)
+
+func serveUnix(t *testing.T, h http.Handler) string {
+ t.Helper()
+ dir, err := os.MkdirTemp("", "fwd")
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { os.RemoveAll(dir) })
+ sock := filepath.Join(dir, "m.sock")
+ ln, err := net.Listen("unix", sock)
+ if err != nil {
+ t.Fatal(err)
+ }
+ srv := &http.Server{Handler: h}
+ go srv.Serve(ln)
+ t.Cleanup(func() { srv.Close() })
+ return sock
+}
+
+func TestSocketForwarderSends(t *testing.T) {
+ var got SendRequest
+ sock := serveUnix(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.Method != http.MethodPost || r.URL.Path != "/v1/send" {
+ http.NotFound(w, r)
+ return
+ }
+ b, _ := io.ReadAll(r.Body)
+ _ = json.Unmarshal(b, &got)
+ w.Header().Set("Retry-After", "7")
+ w.WriteHeader(429)
+ _, _ = w.Write([]byte(`{"code":"RATE"}`))
+ }))
+ req := SendRequest{Account: "abc", App: "docs", Host: "h", From: "a@b.c", To: []string{"x@y.z"}, Raw: []byte("raw\x00bytes")}
+ status, ans, ra, err := SocketForwarder{Path: sock}.Send(context.Background(), req)
+ if err != nil || status != 429 || ans.Code != CodeRate || ra != "7" {
+ t.Fatalf("got %d %+v %q %v", status, ans, ra, err)
+ }
+ if got.Account != "abc" || got.Host != "h" || string(got.Raw) != "raw\x00bytes" {
+ t.Fatalf("mailer saw %+v", got)
+ }
+}
+
+func TestSocketForwarderErrors(t *testing.T) {
+ ctx := context.Background()
+ if _, _, _, err := (SocketForwarder{Path: "/nonexistent/m.sock"}).Send(ctx, SendRequest{}); err == nil {
+ t.Fatal("dialling nothing succeeded")
+ }
+ // A mailer with no /v1/send (404 page) is not an answer.
+ sock := serveUnix(t, http.NotFoundHandler())
+ if _, _, _, err := (SocketForwarder{Path: sock}).Send(ctx, SendRequest{}); err == nil {
+ t.Fatal("a 404 page read as an answer")
+ }
+ // A mailer that never answers is cut off at the timeout.
+ slow := serveUnix(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(3 * time.Second) }))
+ start := time.Now()
+ if _, _, _, err := (SocketForwarder{Path: slow, Timeout: 200 * time.Millisecond}).Send(ctx, SendRequest{}); err == nil {
+ t.Fatal("a silent mailer answered")
+ }
+ if time.Since(start) > 2*time.Second {
+ t.Fatal("the timeout was not applied")
+ }
+}
diff --git a/internal/mailsubmit/proto.go b/internal/mailsubmit/proto.go
new file mode 100644
index 000000000..0c978317a
--- /dev/null
+++ b/internal/mailsubmit/proto.go
@@ -0,0 +1,67 @@
+// Package mailsubmit is the control socket's mail verb and the agent's
+// client to the box-local mailer (platform mail submission design,
+// docs/superpowers/specs/2026-11-12-platform-mail-submission-design.md §4).
+//
+// An instance submits one message by POST /v1/mail on its own control
+// socket. The agent checks the bearer and the envelope's shape, stamps the
+// message with the route that owns the socket (never anything the body
+// says), and forwards it to the mailer, whose answer it passes back. The
+// sender's policy (From, pause, cap, rate, header hygiene) is the mailer's
+// alone, so it lives in one place.
+//
+// This package is the wire both sides share. It imports neither
+// internal/mail nor any AWS client.
+package mailsubmit
+
+import "github.com/carlosframework/platform/internal/mailwire"
+
+// Envelope is the instance's body on POST /v1/mail. Raw is the RFC 5322
+// message, base64. Unknown fields are ignored and never read: in
+// particular, nothing in it names the account, app or host.
+type Envelope struct {
+ From string `json:"from"`
+ To []string `json:"to"`
+ Raw string `json:"raw"`
+}
+
+// SendRequest is the agent's stamped request to the mailer's POST
+// /v1/send. Account, App and Host are the socket's route, set by the agent.
+type SendRequest struct {
+ Account string `json:"account"`
+ App string `json:"app"`
+ Host string `json:"host"`
+ From string `json:"from"`
+ To []string `json:"to"`
+ Raw []byte `json:"raw"`
+}
+
+// Answer is the mailer's answer, and the verb's: a message id on 200, a
+// code otherwise.
+type Answer struct {
+ MessageID string `json:"message_id,omitempty"`
+ Code string `json:"code,omitempty"`
+}
+
+// The answer codes (design §4, and the plan's three beyond it).
+const (
+ CodeFromNotAllowed = "FROM_NOT_ALLOWED"
+ CodeCapReached = "CAP_REACHED"
+ CodePaused = "PAUSED"
+ CodeRate = "RATE"
+ CodeMailerUnavailable = "MAILER_UNAVAILABLE"
+ CodeRouteNotOnBox = "ROUTE_NOT_ON_BOX"
+ CodeSubmissionOff = "SUBMISSION_OFF"
+ CodeRejected = "REJECTED"
+ CodeBadRequest = "BAD_REQUEST"
+)
+
+// Limits (design §4 and §9.0). MaxRaw is the decoded message, MaxBody the
+// whole request body on the control socket.
+const (
+ MaxRaw = 10 << 20
+ MaxRecipients = 50
+ MaxBody = 14 << 20
+)
+
+// MailerSocket is the mailer's socket.
+const MailerSocket = mailwire.MailerSocket
diff --git a/internal/mailsubmit/verb.go b/internal/mailsubmit/verb.go
new file mode 100644
index 000000000..fa965873d
--- /dev/null
+++ b/internal/mailsubmit/verb.go
@@ -0,0 +1,102 @@
+package mailsubmit
+
+import (
+ "context"
+ "crypto/sha256"
+ "crypto/subtle"
+ "encoding/base64"
+ "encoding/json"
+ "net/http"
+ "strings"
+
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// Forwarder hands a stamped request to the mailer and returns its answer:
+// the status, the decoded answer and its Retry-After. An error is a dial
+// or transport failure, or an answer that is not the mailer's shape.
+type Forwarder interface {
+ Send(ctx context.Context, req SendRequest) (status int, ans Answer, retryAfter string, err error)
+}
+
+// passThrough are the statuses the verb copies from the mailer. Anything
+// else (a mailer from before /v1/send, a crash page) is MAILER_UNAVAILABLE.
+var passThrough = map[int]bool{
+ http.StatusOK: true, http.StatusBadRequest: true, http.StatusForbidden: true,
+ http.StatusTooManyRequests: true, http.StatusServiceUnavailable: true,
+}
+
+// Mount adds POST /v1/mail. rt is the route that owns this control socket:
+// it is fixed here, and the request is stamped with it, never with anything
+// the body says. tokenReader is read on every request (the env file can
+// change under a running instance); an empty or unreadable token refuses
+// everything.
+func Mount(mux *http.ServeMux, rt registry.Route, tokenReader func() (string, error), fwd Forwarder) {
+ account, app, host := release.RouteAccount(rt), rt.App, rt.Host
+ mux.HandleFunc("POST /v1/mail", func(w http.ResponseWriter, r *http.Request) {
+ // 1. The bearer, by the existing verbs' rule (instanceupdates,
+ // schedule): an empty or unreadable token is 401 whatever the
+ // request carries, and the compare is constant-time over SHA-256.
+ want, err := tokenReader()
+ if err != nil || want == "" {
+ http.Error(w, "unauthorized", http.StatusUnauthorized)
+ return
+ }
+ got := sha256.Sum256([]byte(r.Header.Get("Authorization")))
+ exp := sha256.Sum256([]byte("Bearer " + want))
+ if subtle.ConstantTimeCompare(got[:], exp[:]) != 1 {
+ http.Error(w, "unauthorized", http.StatusUnauthorized)
+ return
+ }
+ // 2. The envelope's shape and size.
+ env, raw, ok := readEnvelope(w, r)
+ if !ok {
+ answer(w, http.StatusBadRequest, Answer{Code: CodeBadRequest}, "")
+ return
+ }
+ req := SendRequest{Account: account, App: app, Host: host, From: env.From, To: env.To, Raw: raw}
+ status, ans, retryAfter, err := fwd.Send(r.Context(), req)
+ if err != nil || !passThrough[status] || (status == http.StatusOK && ans.MessageID == "") || (status != http.StatusOK && ans.Code == "") {
+ answer(w, http.StatusServiceUnavailable, Answer{Code: CodeMailerUnavailable}, "")
+ return
+ }
+ answer(w, status, ans, retryAfter)
+ })
+}
+
+// readEnvelope decodes and checks the body: at most MaxBody bytes, the
+// JSON shape, base64 raw of at most MaxRaw decoded bytes, 1 to
+// MaxRecipients non-empty recipients, and a non-empty from.
+func readEnvelope(w http.ResponseWriter, r *http.Request) (Envelope, []byte, bool) {
+ var env Envelope
+ if err := json.NewDecoder(http.MaxBytesReader(w, r.Body, MaxBody)).Decode(&env); err != nil {
+ return env, nil, false
+ }
+ if strings.TrimSpace(env.From) == "" || len(env.To) == 0 || len(env.To) > MaxRecipients {
+ return env, nil, false
+ }
+ for _, to := range env.To {
+ if strings.TrimSpace(to) == "" {
+ return env, nil, false
+ }
+ }
+ if base64.StdEncoding.DecodedLen(len(env.Raw)) > MaxRaw+2 {
+ return env, nil, false
+ }
+ raw, err := base64.StdEncoding.DecodeString(env.Raw)
+ if err != nil || len(raw) == 0 || len(raw) > MaxRaw {
+ return env, nil, false
+ }
+ return env, raw, true
+}
+
+// answer writes ans as JSON with status, and Retry-After when one is set.
+func answer(w http.ResponseWriter, status int, ans Answer, retryAfter string) {
+ w.Header().Set("Content-Type", "application/json")
+ if retryAfter != "" {
+ w.Header().Set("Retry-After", retryAfter)
+ }
+ w.WriteHeader(status)
+ _ = json.NewEncoder(w).Encode(ans)
+}
diff --git a/internal/mailsubmit/verb_test.go b/internal/mailsubmit/verb_test.go
new file mode 100644
index 000000000..1e014073a
--- /dev/null
+++ b/internal/mailsubmit/verb_test.go
@@ -0,0 +1,263 @@
+package mailsubmit
+
+import (
+ "context"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "net/http"
+ "net/http/httptest"
+ "strings"
+ "sync"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// recorder is a Forwarder that records what it was asked and answers as
+// told.
+type recorder struct {
+ mu sync.Mutex
+ calls []SendRequest
+ status int
+ ans Answer
+ retryAfter string
+ err error
+}
+
+func (f *recorder) Send(_ context.Context, req SendRequest) (int, Answer, string, error) {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ f.calls = append(f.calls, req)
+ if f.err != nil {
+ return 0, Answer{}, "", f.err
+ }
+ return f.status, f.ans, f.retryAfter, nil
+}
+
+func (f *recorder) n() int { f.mu.Lock(); defer f.mu.Unlock(); return len(f.calls) }
+
+var routeA = registry.Route{Host: "a.shop.example.com", Account: "abcxyz", App: "docs"}
+
+const goodRaw = "From: Docs <hello@docs.example.com>\r\nTo: x@example.org\r\nSubject: hi\r\n\r\nbody\r\n"
+
+func mux(t *testing.T, rt registry.Route, token func() (string, error), fwd Forwarder) *http.ServeMux {
+ t.Helper()
+ m := http.NewServeMux()
+ Mount(m, rt, token, fwd)
+ return m
+}
+
+func staticToken(tok string) func() (string, error) {
+ return func() (string, error) { return tok, nil }
+}
+
+func envelope(from string, to []string, raw string) string {
+ b, _ := json.Marshal(map[string]any{"from": from, "to": to, "raw": base64.StdEncoding.EncodeToString([]byte(raw))})
+ return string(b)
+}
+
+func post(m http.Handler, bearer, body string) *httptest.ResponseRecorder {
+ req := httptest.NewRequest(http.MethodPost, "/v1/mail", strings.NewReader(body))
+ if bearer != "" {
+ req.Header.Set("Authorization", "Bearer "+bearer)
+ }
+ w := httptest.NewRecorder()
+ m.ServeHTTP(w, req)
+ return w
+}
+
+func code(t *testing.T, w *httptest.ResponseRecorder) string {
+ t.Helper()
+ var a Answer
+ _ = json.Unmarshal(w.Body.Bytes(), &a)
+ return a.Code
+}
+
+// Test 8.2: a message on host A's socket is stamped A, whatever the body
+// says.
+func TestMailVerbStampsSocketRoute(t *testing.T) {
+ fwd := &recorder{status: 200, ans: Answer{MessageID: "m-1"}}
+ m := mux(t, routeA, staticToken("tok"), fwd)
+ var body map[string]any
+ _ = json.Unmarshal([]byte(envelope("hello@docs.example.com", []string{"x@example.org"}, goodRaw)), &body)
+ body["host"], body["account"], body["app"], body["sender"] = "b.other.example.com", "x", "y", "z"
+ raw, _ := json.Marshal(body)
+ w := post(m, "tok", string(raw))
+ if w.Code != 200 {
+ t.Fatalf("status %d %s", w.Code, w.Body)
+ }
+ if fwd.n() != 1 {
+ t.Fatalf("forwarded %d times", fwd.n())
+ }
+ got := fwd.calls[0]
+ if got.Account != "abcxyz" || got.App != "docs" || got.Host != "a.shop.example.com" {
+ t.Fatalf("stamped %+v, want the socket's route", got)
+ }
+ if got.From != "hello@docs.example.com" || len(got.To) != 1 || string(got.Raw) != goodRaw {
+ t.Fatalf("forwarded %+v", got)
+ }
+ var a Answer
+ if err := json.Unmarshal(w.Body.Bytes(), &a); err != nil || a.MessageID != "m-1" {
+ t.Fatalf("answer %s", w.Body)
+ }
+}
+
+// A route with no valid account is stamped with the ops account, by
+// release.RouteAccount's rule, never left empty.
+func TestMailVerbStampsRouteAccountRule(t *testing.T) {
+ fwd := &recorder{status: 200, ans: Answer{MessageID: "m"}}
+ m := mux(t, registry.Route{Host: "h.example.com", App: "docs"}, staticToken("tok"), fwd)
+ post(m, "tok", envelope("a@b.example.com", []string{"x@example.org"}, goodRaw))
+ if fwd.n() != 1 || fwd.calls[0].Account != release.OpsAccount {
+ t.Fatalf("calls %+v, want the ops account", fwd.calls)
+ }
+}
+
+func TestMailVerbAuth(t *testing.T) {
+ fwd := &recorder{status: 200, ans: Answer{MessageID: "m"}}
+ tok := "first"
+ m := mux(t, routeA, func() (string, error) { return tok, nil }, fwd)
+ body := envelope("a@docs.example.com", []string{"x@example.org"}, goodRaw)
+ for _, bearer := range []string{"", "wrong", "first "} {
+ if w := post(m, bearer, body); w.Code != http.StatusUnauthorized {
+ t.Fatalf("bearer %q = %d, want 401", bearer, w.Code)
+ }
+ }
+ // Not a Bearer header at all.
+ req := httptest.NewRequest(http.MethodPost, "/v1/mail", strings.NewReader(body))
+ req.Header.Set("Authorization", "first")
+ w := httptest.NewRecorder()
+ m.ServeHTTP(w, req)
+ if w.Code != http.StatusUnauthorized {
+ t.Fatalf("a bare token = %d", w.Code)
+ }
+ if fwd.n() != 0 {
+ t.Fatal("forwarded without a good bearer")
+ }
+ if w := post(m, "first", body); w.Code != 200 {
+ t.Fatalf("the right bearer = %d", w.Code)
+ }
+ // The token is re-read per request: after a rotation the old one fails
+ // and the new one works.
+ tok = "second"
+ if w := post(m, "first", body); w.Code != http.StatusUnauthorized {
+ t.Fatalf("the rotated-out token = %d", w.Code)
+ }
+ if w := post(m, "second", body); w.Code != 200 {
+ t.Fatalf("the rotated-in token = %d", w.Code)
+ }
+}
+
+// Plan round 1 P2-6: an empty or unreadable token refuses everything,
+// including a request that carries an empty bearer.
+func TestMailVerbRefusesEmptyToken(t *testing.T) {
+ for name, tr := range map[string]func() (string, error){
+ "empty": staticToken(""),
+ "unreadable": func() (string, error) { return "", errors.New("env file gone") },
+ "error with a value": func() (string, error) {
+ return "tok", errors.New("partial read")
+ },
+ } {
+ t.Run(name, func(t *testing.T) {
+ fwd := &recorder{status: 200, ans: Answer{MessageID: "m"}}
+ m := mux(t, routeA, tr, fwd)
+ body := envelope("a@docs.example.com", []string{"x@example.org"}, goodRaw)
+ for _, auth := range []string{"Bearer ", "Bearer", "", "Bearer tok", "Bearer anything"} {
+ req := httptest.NewRequest(http.MethodPost, "/v1/mail", strings.NewReader(body))
+ if auth != "" {
+ req.Header.Set("Authorization", auth)
+ }
+ w := httptest.NewRecorder()
+ m.ServeHTTP(w, req)
+ if w.Code != http.StatusUnauthorized {
+ t.Errorf("Authorization %q = %d, want 401", auth, w.Code)
+ }
+ }
+ if fwd.n() != 0 {
+ t.Fatalf("forwarded %d times", fwd.n())
+ }
+ })
+ }
+}
+
+func TestMailVerbLimits(t *testing.T) {
+ fwd := &recorder{status: 200, ans: Answer{MessageID: "m"}}
+ m := mux(t, routeA, staticToken("tok"), fwd)
+ many := func(n int) []string {
+ out := make([]string, n)
+ for i := range out {
+ out[i] = "x@example.org"
+ }
+ return out
+ }
+ big := strings.Repeat("a", MaxRaw+1)
+ for name, body := range map[string]string{
+ "raw over MaxRaw": envelope("a@docs.example.com", []string{"x@example.org"}, big),
+ "51 recipients": envelope("a@docs.example.com", many(51), goodRaw),
+ "no recipients": envelope("a@docs.example.com", nil, goodRaw),
+ "an empty recipient": envelope("a@docs.example.com", []string{"x@example.org", " "}, goodRaw),
+ "no from": envelope("", []string{"x@example.org"}, goodRaw),
+ "empty raw": envelope("a@docs.example.com", []string{"x@example.org"}, ""),
+ "bad base64": `{"from":"a@docs.example.com","to":["x@example.org"],"raw":"!!!not base64"}`,
+ "not JSON": `from=a`,
+ "body over MaxBody": `{"from":"a@docs.example.com","to":["x@example.org"],"raw":"` + strings.Repeat("A", MaxBody+8) + `"}`,
+ } {
+ w := post(m, "tok", body)
+ if w.Code != http.StatusBadRequest || code(t, w) != CodeBadRequest {
+ t.Errorf("%s: %d %s, want 400 BAD_REQUEST", name, w.Code, w.Body)
+ }
+ }
+ if fwd.n() != 0 {
+ t.Fatalf("forwarded %d bad requests", fwd.n())
+ }
+ // The boundaries themselves are accepted.
+ if w := post(m, "tok", envelope("a@docs.example.com", many(50), strings.Repeat("a", MaxRaw))); w.Code != 200 {
+ t.Fatalf("50 recipients and MaxRaw bytes = %d %s", w.Code, w.Body)
+ }
+}
+
+func TestMailVerbPassesThroughAnswers(t *testing.T) {
+ body := envelope("a@docs.example.com", []string{"x@example.org"}, goodRaw)
+ fwd := &recorder{status: 429, ans: Answer{Code: CodeCapReached}, retryAfter: "3600"}
+ w := post(mux(t, routeA, staticToken("tok"), fwd), "tok", body)
+ if w.Code != 429 || w.Header().Get("Retry-After") != "3600" || code(t, w) != CodeCapReached {
+ t.Fatalf("got %d %q %s", w.Code, w.Header().Get("Retry-After"), w.Body)
+ }
+ for _, c := range []struct {
+ status int
+ code string
+ }{{403, CodeFromNotAllowed}, {403, CodeRouteNotOnBox}, {403, CodeSubmissionOff}, {400, CodeRejected}, {429, CodePaused}, {429, CodeRate}, {503, CodeMailerUnavailable}} {
+ w := post(mux(t, routeA, staticToken("tok"), &recorder{status: c.status, ans: Answer{Code: c.code}}), "tok", body)
+ if w.Code != c.status || code(t, w) != c.code {
+ t.Errorf("%d %s came back as %d %s", c.status, c.code, w.Code, w.Body)
+ }
+ }
+ // A transport error, an unexpected status, a 200 with no id or a
+ // refusal with no code is MAILER_UNAVAILABLE.
+ for name, f := range map[string]*recorder{
+ "dial error": {err: errors.New("connection refused")},
+ "404": {status: 404, ans: Answer{Code: "x"}},
+ "500": {status: 500, ans: Answer{Code: "x"}},
+ "200 with no id": {status: 200},
+ "403 no code": {status: 403},
+ } {
+ w := post(mux(t, routeA, staticToken("tok"), f), "tok", body)
+ if w.Code != 503 || code(t, w) != CodeMailerUnavailable {
+ t.Errorf("%s: %d %s", name, w.Code, w.Body)
+ }
+ }
+}
+
+// The verb is POST only; nothing else is served.
+func TestMailVerbIsPostOnly(t *testing.T) {
+ m := mux(t, routeA, staticToken("tok"), &recorder{status: 200, ans: Answer{MessageID: "m"}})
+ req := httptest.NewRequest(http.MethodGet, "/v1/mail", nil)
+ req.Header.Set("Authorization", "Bearer tok")
+ w := httptest.NewRecorder()
+ m.ServeHTTP(w, req)
+ if w.Code != http.StatusMethodNotAllowed {
+ t.Fatalf("GET = %d", w.Code)
+ }
+}
diff --git a/internal/moves/envreport.go b/internal/moves/envreport.go
index 58cd020ee..4b4f7ed2d 100644
--- a/internal/moves/envreport.go
+++ b/internal/moves/envreport.go
@@ -54,12 +54,13 @@ var (
}
// AgentOwnedVars are the variables the agent sets, overwrites or
// removes on every launch (activator ExecBackend.agentOwnedVars): the
- // control socket, the purge channel, the box's region and the host
- // row's name. A tenant's env file never decides them, and each box sets
- // its own, so they are box-owned (BoxOwned).
+ // control socket, the purge channel, the box's region, the host row's
+ // name and the mail submit channel (platform mail submission design,
+ // decision 11). A tenant's env file never decides them, and each box
+ // sets its own, so they are box-owned (BoxOwned).
// TestAgentOwnedVarsAreMovesBoxOwned (internal/activator) pins this set
// against agentOwnedVars.
- AgentOwnedVars = map[string]bool{RegionVar: true, "CARLOS_CONTROL_SOCKET": true, "CARLOS_PURGE": true, "CARLOS_HOST": true}
+ AgentOwnedVars = map[string]bool{RegionVar: true, "CARLOS_CONTROL_SOCKET": true, "CARLOS_PURGE": true, "CARLOS_HOST": true, "CARLOS_MAIL": true}
)
// BoxOwned reports a variable whose value can be the box's rather than the
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index cce7692ec..17deae282 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -203,4 +203,4 @@ plan14-root-reads-edge-ppv2.tsv 44e5745a1d22ea2ddd6e73d775d87759afe7121666212b6e
plan14-root-reads-static-site-geo-962.tsv 5e8a72175700a3e60c1e283b133c1ee25e36f292e2e319f02a19138f15186376
plan14-root-reads-member-backups-drill-nodb.tsv 07b748a749084fdaf61c5087a6edfca8a79273962822ce551dd4d42b0d20c063
plan14-root-reads-spread-every-schedule-ticks.tsv 07b748a749084fdaf61c5087a6edfca8a79273962822ce551dd4d42b0d20c063
-plan14-root-reads-platform-mail-submission.tsv f949639f333c9a2e89bb120f64724ead4c55ee522914416b3ccc98bed460e49a
+plan14-root-reads-platform-mail-submission.tsv 615b17f291546a3de0c068258e6b76e72fe06b14f809df308fa6ed018c00e5fd
diff --git a/internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv b/internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv
index 96a7f60b6..8588a4278 100644
--- a/internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv
+++ b/internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv
@@ -1,6 +1,7 @@
# Census overlay platform-mail-submission, written by census-propose (#369). census-ruling-platform-mail-submission, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-platform-mail-submission.md.
-# 16 body, 0 sites, 8 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 4 new dispositions: 0 reads re-frozen at their disposition with the claim, 4 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+# 18 body, 3 sites, 11 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 8 new dispositions: 0 reads re-frozen at their disposition with the claim, 8 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy 2d0d5c7d06f3d3299a7b17609928866ebb192d07468a1876e0ad9df56571ace8 internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged;rev3=census-ruling-agent-start-demo-3;basis=Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1).;rev3=census-ruling-stateless-replicas-4-task1;basis=Signals the owned replica swap worker (armedReplicaDeploy.tick) beside the placement worker on the existing tick; coalesced background pass, no timer, no bucket read. Its transitions go through the console's authenticated /deploy.;rev3=census-ruling-platform-mail-submission;basis=Task 4: on a serial move, after the schedule leg, starts the armed mail switch cache's Refresh on its own goroutine (each read bounded at 2 s, overlapping refreshes skipped). It re-reads the app sender records already cached, through the agent's deploy store. Agent, not root; the tick waits on nothing new. registry:Host@5822 a1cd273f24047c63670f8c32c000a84f1a3861d058da38c5318551929f312390
@legacy 589908d713736c8e6a9e3ff35f04288a44aa15643b899bdd3ec8e0b97d43d808 internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action.;rev3=census-ruling-agent-start-demo-3;basis=Report moved capability only when the serving edge reports readiness; report claim-seed support only with CARLOS_DEMO_CLAIM=1. Reads the explicit capability flag from the process environment; no new filesystem or registry read.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 fix round 1 (#511 R16 amendment): the status tick also fills Probes.ApplyFinished from systemApplyFinished(release.OptDir()), an Lstat of root's apply journal <opt>/system/router/journal.json in the root-owned, world-readable state directory: finished only when the journal is absent, any other answer unknown and so unfinished. Round 0: Probes.PrevRelease from prevReleaseOf (carlos.prev and carlos.prev.version, the files withMovesFields already reads). Reported in the private BoxMetrics block; no bucket request or cadence change.;rev3=census-ruling-platform-mail-submission;basis=Task 3 (plan gap G6 (b)): the status tick also fills Probes.MailerArmed from mailerArmed(mailwire.MailerSocket, 2s): a stat of /run/carlos-mailer/mailer.sock and, only when it is a socket, GET /v1/health on it. The agent (carlos-edge.service, user carlos), not root; reported in the private BoxMetrics block only. The same six sites; no store request, no read of /etc/carlos-mailer (which uid carlos cannot traverse). whole:Route@10554,whole:Route@12628,whole:Route@12909,whole:Route@6583,whole:Route@6610,whole:Route@7918 4dd7407a53e445f78e63f160bee068d835b26d5d8fd3300d389ba5dbcab26d5a
@legacy 722920e1d095fe935962342d131ef5e8d5c97481b52b7ddc38dc214bf84ee9a5 internal/host/bootstrap.go bootstrapWithGroup legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move bootstrapWith body here, retaining host.env, embedded unit reads and tmpfiles execution. Group live caller holds root mutation guard; skip automatic update/recovery units, preserve Restart=no/nftables drop-in and masks, and write separate root-owned /run/carlos-group-maintenance tmpfiles rule outside service ownership walk. No agent receipt read.;rev3=census-ruling-gvisor-demos;basis=Create the rootfs parent at 0700 and runtime root at 0755. Existing host.env/unit reads unchanged; workload templates remain unarmed.;rev3=census-ruling-platform-mail-submission;basis=Task 3: the sysusers.d/carlos.conf it writes is now the constant sysusersConf, which adds "u carlos-mailer - \"CARLOS mailer\" - /usr/sbin/nologin" ahead of the existing "g carlos-sockets -" line, so the tmpfiles line naming group carlos-mailer resolves on a box whose confs arrive by a staged-tree refresh. Constant text, no input; no read added. file:Command@12045,file:ReadFile@564,file:ReadFile@7111 62fa76ad0fa812a0effc7c6add43ddcf54313450c13f20fbb2fee9d004488588
@legacy aea72efedb3cc995ae9c791962e3e80f7dfe0b54d87da8c3ca13616baf7a433b internal/host/bootstrap.go privilegedPlan legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-platform-mail-submission;basis=Task 3: one more constant argv, useradd --system --user-group --no-create-home --shell /usr/sbin/nologin carlos-mailer, right after carlos's, behind runPrivileged's existing guard (user.Lookup of the argv's own last word). No input; no read added. data-literal@382 4f353dc38a329ff88fdec4bc2611c44b7ac483eee308b73f58100abc539707cc
@@ -15,10 +16,19 @@
@legacy 0a4d139cf9839189f90e09f4c57e29ddacc5eb320287a237770a080167db91df internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: InaccessiblePaths= gains -/run/carlos-mailer -/etc/carlos-mailer (optional). Only hides more; no read added. file:external@0 a316b14b25091ff3ed3dc2186378cc0b88bc23471d6ad45ede8302f278668034
@legacy 1d51de12094b335de855b3620973b88ae3938185b243b820641dbd5adf48a875 internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-execstop-528;basis=one line added after ExecStart=, ExecStop=-+/opt/carlos/carlos instance-stop $MAINPID (#528, Paul's option 2), plus TimeoutStopFailureMode=kill after TimeoutStopSec=20: PID 1 runs the platform binary's instance-stop as root (the + prefix) at a stop with $MAINPID, a value systemd supplies; instance-stop reads only that argument, /proc/self/cgroup and /proc/<MAINPID>/cgroup (kernel-written), and acts only through a pidfd on the unit's own main process (refused unless in the unit's own cgroup); no bind source, user, mount or tenant-writable path read added;rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: InaccessiblePaths= gains -/run/carlos-mailer -/etc/carlos-mailer (optional). Only hides more; no read added. file:external@0 348dd223f7f1bcd8cb2db90c7acb25f4cf3e9b29568c0b4b63ce13d6d1ab3af9
@legacy 5a4d8a4a9ea0e00aa0186c84c18f49f5ae434c340651f4bbe636d3311cf39dfd internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read.;rev3=census-ruling-agent-start-demo-3;basis=Report claim-seed protocol capability only when explicitly configured and runtime moved readiness only when armed; dormant status keeps its original JSON shape. Census read-site delta: unchanged (28).;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 (#511 R16 and its amendment): copies Probes.PrevRelease and Probes.ApplyFinished into BoxMetrics (json prev_release and apply_finished, omitempty; private, like Release) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: copies Probes.MailerArmed into BoxMetrics.MailerArmed (json mailer_armed, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added. registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 b2a6b68d0c028970efee40812263bf1e4a6214b90c568d8275deb81b61ff1e66
+@legacy 5cd628b73d71ab551cb5451e3b7ca0cfa184638efa4b210e2dbef51e32c30b91 internal/activator/backend_exec.go ExecBackend.controlMount legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: the one composer of a control socket's verbs, for both bind sites. Mounts the schedule verbs and GET /updates exactly as the two inline copies did (same conditions, same host, token reader and write fence), and POST /v1/mail (mailsubmit.Mount) under its own condition, b.Mail != nil. Reads rt.Host and passes the route to Mount; returns nil when nothing is mounted. The agent (carlos-edge.service, user carlos), not root. registry:Host@292,registry:Host@347,registry:Host@426,whole:Route@515 827650c1147231c19b6da7e41f3fc97fa4c28e3eda76961dfa788bc9c25f536e
+@legacy bce32b49d764738f9b80e81a4b6473b446149bb1e62062886297d1431cc4cc4e internal/activator/backend_exec.go ExecBackend.mailSubmits legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: the CARLOS_MAIL rule. Reads rt.App, rt.Host, rt.Provisioned and RouteAccount(rt) from the agent's own registry row, and asks b.MailSwitch (the agent's cache of the console-written app sender record, internal/host/mailswitch.go: one bounded Get of apps/<acct>/<app>/email/senders/app.json through the agent's deploy store). Logs once per host at error level for an unprovisioned route of a switched app. Agent, not root; no file read. registry:App@213,registry:App@526,registry:Host@317,registry:Host@511,registry:Provisioned@246,whole:Route@185 cfd7494b38dc64c2710233dbc2da850eb7b89fc9aecfa648cd7affd5e9a354d0
@legacy d6700cb69f36e6e7cb8fdf4f4b747269ba9bf6545143e4dd943acedc018bc4b1 internal/host/mailerreport.go mailerArmed legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: the agent's MailerArmed probe. Stats the constant socket path and dials it for GET /v1/health with a 2 s timeout; true only on a 200. Runs in the agent as carlos, never as root; the path is a constant, in a root-owned 0750 root:carlos directory nothing a tenant or an app can write. Answers a bool into the private status block. file:Stat@72 6fd83d5c27429d06864d02a141f7036c2f3e1e8e89366ad6d2a232d417420052
@legacy 85d678c6a608ff70b7a60141d0efde911544f4b7aa9a7d9508f0e13cf2b7e724 internal/host/units/carlos-mailer-arm.path external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: [Path] PathExists=/etc/carlos-mailer/keys, Unit=carlos-mailer.socket, WantedBy=multi-user.target; enabled and armed by bootstrap like every .path. PID 1 watches a path in a root-owned 0750 root:carlos-mailer directory only root (the operator) writes; it starts a socket unit and reads nothing. file:external@0 6b28c6282ee930560f859f20c752c65f0e550412b9c6ffb1fc10c292a3941a2a
@legacy f99b76edb6264d669d69dee1931907a85d99256a5f891eda8be179f49c658492 internal/host/units/carlos-mailer.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: runs /opt/carlos/carlos mailer serve as the static user carlos-mailer (never root), socket-activated, ConditionPathExists=/etc/carlos-mailer/keys, EnvironmentFile=-/etc/carlos/host.env (read by PID 1, as every carlos service's) with UnsetEnvironment=CARLOS_SECRETS_KEY, AWS_EC2_METADATA_DISABLED=true, IPAddressDeny=169.254.169.254/32 fd00:ec2::254/128, StateDirectory=carlos-mailer 0700, and the relay's hardening block with no ReadWritePaths. No root process reads anything new; the mailer reads its own key file and state. file:external@0 3f9bd1c2d6e1a4d5d1c72d0c24b000e122cc95290cca8b0d2e62d86576e2dd5f
@legacy 486f70ac08ac5f675d91dc3b7bddf949c908db227e4596af5706df846c4fb32f internal/host/units/carlos-mailer.socket external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: ConditionPathExists=/etc/carlos-mailer/keys, ListenStream=/run/carlos-mailer/mailer.sock, SocketUser=carlos, SocketGroup=carlos, SocketMode=0600, Accept=no; not enabled, started only by the arming path. PID 1 binds a socket in a root-owned directory, as carlos-instance-control.socket does in /run/carlos-control. No read added. file:external@0 275aae364c39e89bdf3d76d7e66aea9cf65b398ac0c16c087db353cfd5140c34
+@legacy 92d90fe8f4ae11810f6e85c8df7ceb2a4024c8da10e42c8788ee154f5b8a60ce internal/mailsubmit/forward.go SocketForwarder.Send legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: the agent's client to the mailer: one HTTP POST of /v1/send over a fresh dial of the constant /run/carlos-mailer/mailer.sock, 60 s timeout, answer read to at most 64 KiB and decoded. Runs in the agent, as carlos. The socket's directory is root's; the mailer at the other end is a separate uid. file:ReadAll@885 b1c14436f42f60c4157ad0dffb1b998931a58b3a2ebf545578ff6d2e243dcd58
+@legacy dcfde0fc6cf86e118ad58646b43a41481c115f7eae91a5bb137f4d00e079d607 internal/mailsubmit/verb.go Mount legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: POST /v1/mail on an instance's control socket. The bearer by the existing verbs' rule (empty or unreadable token refuses everything; SHA-256 constant-time compare); MaxBytesReader(14 MiB), the JSON envelope, base64 raw of at most 10 MiB, 1 to 50 non-empty recipients, a non-empty from, else 400 BAD_REQUEST. Stamps account, app and host from the route the socket was bound for, never from the body, and forwards; a transport error or an answer outside 200/400/403/429/503 is 503 MAILER_UNAVAILABLE. Runs in the agent, as carlos; the body is a tenant's and is only decoded and forwarded, never used to name a path, route or account. registry:App@152,registry:Host@160,whole:Route@147 170951db97d14dc471251211b1526d2a640a0c7aba3f5eec1e6c12bc0ae81d2c
+@legacy 9d438dcdbaabed1854fa668aa67b6b86f60ede58d5d3d2ba3c3dcb410a9f1976 internal/activator/backend_exec.go ExecBackend.agentOwnedVars legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-platform-mail-submission;basis=Task 4: also decides CARLOS_MAIL through mailSubmits: set to "submit" only when the control socket bound, the verb is mounted, the app sender's switch is on and the route is Provisioned; stripped otherwise, a tenant-supplied value from fileEnv included. agentOwnedNames and moves.AgentOwnedVars gain it as a pinned pair. Only narrows what a tenant's files can set. Agent, not root. registry:Host@1209,whole:Route@1171,whole:Route@631 7cc1bcb0b415ee478350a0519799542e0b1e5419c94121519c6e1b349d613c10
+@legacy efaa7c1113d4186ab422cb6350f2a53d99468bb7e8d5e71bf22b1f11612a7687 internal/activator/backend_exec.go ExecBackend.spawnChildFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos (the flat start body): the same change as seedChild: ensureAdminTokenFor(ctx, rt, paths) for the token (the same flat path), the key's producer carrying the HA mint decision, and launchEnvLayer(ctx, rt) for the env and key layer the replica gate reads; a non-HA host's token, key and env are produced and read as before; +whole:Route; only adds refusals for HA hosts;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-edge-page-cache-1;basis=the control listener is now built with the whole route (edge.ListenControl(controlSocket, rt, ...)), the +whole:Route site; it computes the launch inputs once from the build it execs by path (a staged exe's caller-named build, or the gate-resolved pinned version; "" for an unpinned live link) and fileEnv it already read, keeps them on the childProc, and for a live-link spawn publishes them to the in-memory cache (NoteProcessInputs) beside the existing purge; no new file read;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main build parameter, pinned live identity, launchInputs from captured build/environment, and current-process input publication. edge.ListenControl now receives the whole Route as main requires (+whole:Route); no new filesystem or storage input. Branch sandboxLaunch remains before preparation and spawn; existing direct primitive gate unchanged.;rev3=census-ruling-security-review-mitigations;basis=Enforce the unchanged never-served resident refusal once at the shared flat/foreign primary binary spawn sink, before placement, live-link/token/env/control preparation or execution. Covers plain, generation and staged Service wakes; existing served/explicit-flat exemptions and other gates retained. No new filesystem/store source.;rev3=census-ruling-platform-mail-submission;basis=Task 4: the inline mount (Timers, UpdatesReader) is replaced by b.controlMount(rt, tokenReader, n): the same verbs under the same conditions, plus the mail verb when b.Mail is set. The three rt.Host reads move into controlMount; the route is passed whole. Agent, not root; nothing else changes. file:Command@11030,registry:Host@12313,registry:Host@12674,registry:Host@12768,registry:Host@258,registry:Host@4236,registry:Stateless@10961,whole:Route@10853,whole:Route@11002,whole:Route@11410,whole:Route@13065,whole:Route@13157,whole:Route@1527,whole:Route@189,whole:Route@1944,whole:Route@2305,whole:Route@287,whole:Route@4091,whole:Route@4119,whole:Route@4430,whole:Route@476,whole:Route@6501,whole:Route@8766 dacd2d37b38491f11ba1be34795d5fe40915aa044d6732ccf2bae467c733f80e
+@legacy fa76f66ed1ce2b9e9b96dd442f08e32b99d090fa72055b83bb9c2fa35a4907db internal/activator/prepare.go ExecBackend.listenControl legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-edge-page-cache-1;basis=passes the whole route to edge.ListenControl instead of rt.Host (the -registry:Host +whole:Route change); nothing else;rev3=census-ruling-platform-mail-submission;basis=Task 4: the same replacement as spawnChildFrom, with gen as the write fence's generation, so the nested and rootfs listener mounts exactly what the flat one does. Agent, not root. registry:Host@508,whole:Route@361,whole:Route@389 f6534861cdbeef80dbcfaf6b07df685e4ac2f2a86650db54f174871526a50aff
+internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: signals the owned replica worker on the existing tick; coalesced asynchronous execution, no timer or bucket scan added. merge of origin/main 7920cccf: Retain main box-role reader pass on the existing tick alongside the replica worker signal; merge-only body change, unchanged read sites.;rev3=census-ruling-restart-new-box-gap;basis=calls the optional restartGain hook (restartGainSeed) once per existing tick before the serial read; no new root path, timer or read kind; nil hook is unchanged;rev3=census-ruling-agent-start-demo-3;basis=Refresh moved notices through the shared watch before normal convergence; no new per-box poll. Census read-site delta: unchanged (1).;rev3=census-ruling-stateless-replicas-4-task1;basis=Signals the owned replica swap worker (armedReplicaDeploy.tick) beside the placement worker on the existing tick; coalesced background pass, no timer, no bucket read. Its transitions go through the console's authenticated /deploy.;rev3=census-ruling-platform-mail-submission;basis=Task 4: on a serial move, after the schedule leg, starts the armed mail switch cache's Refresh on its own goroutine (each read bounded at 2 s, overlapping refreshes skipped). It re-reads the app sender records already cached, through the agent's deploy store. Agent, not root; the tick waits on nothing new. registry:Host@5822 a1cd273f24047c63670f8c32c000a84f1a3861d058da38c5318551929f312390
+internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained.;rev3=census-ruling-w6-ingress-drain;basis=agent (user carlos), not root. Builds the ingress drain (newIngressDrain) with arming read at ask time from os.Getenv (CARLOS_REGION_HA, CARLOS_INGRESS_TARGET_GROUPS, both from the root-owned host.env), the fixed admission and lease.CurrentSelf (existing IMDS identity); its reader is awstg.Load, the box role's credentials calling ELB DescribeTargetHealth/DescribeTargetGroupAttributes (new AWS reads, by the agent). Wires admission.closeStartsForIngressDrain, the lbhealth drain condition, ingress.setEdge, and ingress.shutdownStarted in WithShutdownStarted. The drain socket (/run/carlos/.ha-drain/drain.sock, agent-user only, existing) is now also served on a fixed box with the drain configured (was group members only), routing /v1/ingress/* to the ingress drain and the group drain verbs to 404 there. armHADepartures now takes fixtureDepartureGetenv() and MakeQueue fixtureDepartureQueue(), which in a production (non-rootrunner) build are os.Getenv and nil, as before. Read sites unchanged (9).;rev3=census-ruling-stateless-replicas-4-task1;basis=Arms the fleet-only replica swap worker next to the placement worker: same console URL and fleet token as the existing replicaCoordinatorAPI, the existing activator Service; stops and joins at shutdown. No new read site, credential or bucket reader.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: sets deployWorker.step to the rollout scheduler answer for the record permit (replicaStepOf over armedRollout), an in-memory callback; no read site, credential or bucket reader added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the swap worker step is armedReplicaStep, the same lazy scheduler lookup as before as a named function; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (01d6ca78, linked-deployments-slice1) starts linkLoop beside tunnelLoop; this branch keeps its replica coordinator wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 2: wires the swap worker's drive (armedReplicaDrive, the armed rollout manager's DriveReplicaRelease); no read added;rev3=census-ruling-stateless-replicas-4-merge-main2;basis=Merge of main af871da0 (v0.34.49): both sides changed it. Main (178dcfe5, member-backups-2a) moves the inline duty-view closure into armDutyView/dutyView and starts verifyAssignLoop; its sites drop by registry:Host and whole:Route x2 as main recorded them. This branch keeps its replica coordinator, swap worker and drive wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-drill3;basis=drill 3 R24: makes one in-memory channel, closes it (once) inside the edge's existing shutdown-started callback after ingress.shutdownStarted, and passes it to tunnelLoop, which drains only a fleet channel name; no read added, same six sites; touches no admission, lease, ingress drain, listener or file; the agent process, no root decision;rev3=census-ruling-edge-ppv2;basis=Agent (uid carlos), not root. memwatchLoop now gets edgeProxyCounters(&demoEdge) (in-process counters, no read). The drain socket's driver is newAgentDrainSocket(ingress, e, os.Getenv), which attaches the edge trust handler only when CARLOS_INGRESS_PROXY_SOURCES in the agent's environment (from the root-owned host.env) parses to a non-empty list; the socket is served when drainSocketServed: a group member or a configured ingress drain (both as before), or a box armed for PROXY protocol (new). The socket's path and agent-user-only permissions are unchanged. Read sites unchanged (6).;rev3=census-ruling-platform-mail-submission;basis=Task 4: sets eb.Mail = mailsubmit.SocketForwarder{} on every box and, when a deploy store opens, eb.MailSwitch to a new mailSwitchCache's On, armed for the serial-move refresh (armedMailSwitch). One more openDeployStore call, as the fleet and coordinator wiring beside it already make. Agent, not root. file:Exec@21141,file:Open@2191,file:Statfs@56665,registry:App@13287,whole:Route@13279,whole:Route@50143 8c29c4f2bb4562560e304a5ab66a3be6f8a354949819cb19a22d9005d06d5a39
internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action.;rev3=census-ruling-agent-start-demo-3;basis=Report moved capability only when the serving edge reports readiness; report claim-seed support only with CARLOS_DEMO_CLAIM=1. Reads the explicit capability flag from the process environment; no new filesystem or registry read.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 fix round 1 (#511 R16 amendment): the status tick also fills Probes.ApplyFinished from systemApplyFinished(release.OptDir()), an Lstat of root's apply journal <opt>/system/router/journal.json in the root-owned, world-readable state directory: finished only when the journal is absent, any other answer unknown and so unfinished. Round 0: Probes.PrevRelease from prevReleaseOf (carlos.prev and carlos.prev.version, the files withMovesFields already reads). Reported in the private BoxMetrics block; no bucket request or cadence change.;rev3=census-ruling-platform-mail-submission;basis=Task 3 (plan gap G6 (b)): the status tick also fills Probes.MailerArmed from mailerArmed(mailwire.MailerSocket, 2s): a stat of /run/carlos-mailer/mailer.sock and, only when it is a socket, GET /v1/health on it. The agent (carlos-edge.service, user carlos), not root; reported in the private BoxMetrics block only. The same six sites; no store request, no read of /etc/carlos-mailer (which uid carlos cannot traverse). whole:Route@10554,whole:Route@12628,whole:Route@12909,whole:Route@6583,whole:Route@6610,whole:Route@7918 4dd7407a53e445f78e63f160bee068d835b26d5d8fd3300d389ba5dbcab26d5a
internal/host/bootstrap.go bootstrapWithGroup legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3b;basis=Move bootstrapWith body here, retaining host.env, embedded unit reads and tmpfiles execution. Group live caller holds root mutation guard; skip automatic update/recovery units, preserve Restart=no/nftables drop-in and masks, and write separate root-owned /run/carlos-group-maintenance tmpfiles rule outside service ownership walk. No agent receipt read.;rev3=census-ruling-gvisor-demos;basis=Create the rootfs parent at 0700 and runtime root at 0755. Existing host.env/unit reads unchanged; workload templates remain unarmed.;rev3=census-ruling-platform-mail-submission;basis=Task 3: the sysusers.d/carlos.conf it writes is now the constant sysusersConf, which adds "u carlos-mailer - \"CARLOS mailer\" - /usr/sbin/nologin" ahead of the existing "g carlos-sockets -" line, so the tmpfiles line naming group carlos-mailer resolves on a box whose confs arrive by a staged-tree refresh. Constant text, no input; no read added. file:Command@12045,file:ReadFile@564,file:ReadFile@7111 62fa76ad0fa812a0effc7c6add43ddcf54313450c13f20fbb2fee9d004488588
internal/host/bootstrap.go const tmpfilesConf authority A,C,G,J4 root-input;kept=A,C,G;scope=protected-decision-only;rev3=census-ruling-platform-mail-submission;basis=Task 3: two constant lines, "d /run/carlos-mailer 0750 root carlos -" (the mailer's socket directory, beside /run/carlos-control and shaped like it) and "d /etc/carlos-mailer 0750 root carlos-mailer -" (the key directory, which uid carlos cannot traverse). Root creates two root-owned directories; no file inside either is created, owned or seeded (the key is the operator's, by hand). No input; no read added. data-literal@1237,data-literal@1309,data-literal@1927,data-literal@21,data-literal@2328,data-literal@311,data-literal@810 d9849c0d887ce4c8698d67dfc9cf136f5b9922300b058fda6186d2fd4b42411a
@@ -35,15 +45,25 @@ internal/host/units/carlos-instance-sidecar@.service external legacy accepted-le
internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: InaccessiblePaths= gains -/run/carlos-mailer -/etc/carlos-mailer (optional). Only hides more; no read added. file:external@0 a316b14b25091ff3ed3dc2186378cc0b88bc23471d6ad45ede8302f278668034
internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates);rev3=census-ruling-instance-stop-execstop-528;basis=one line added after ExecStart=, ExecStop=-+/opt/carlos/carlos instance-stop $MAINPID (#528, Paul's option 2), plus TimeoutStopFailureMode=kill after TimeoutStopSec=20: PID 1 runs the platform binary's instance-stop as root (the + prefix) at a stop with $MAINPID, a value systemd supplies; instance-stop reads only that argument, /proc/self/cgroup and /proc/<MAINPID>/cgroup (kernel-written), and acts only through a pidfd on the unit's own main process (refused unless in the unit's own cgroup); no bind source, user, mount or tenant-writable path read added;rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: InaccessiblePaths= gains -/run/carlos-mailer -/etc/carlos-mailer (optional). Only hides more; no read added. file:external@0 348dd223f7f1bcd8cb2db90c7acb25f4cf3e9b29568c0b4b63ce13d6d1ab3af9
internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read.;rev3=census-ruling-agent-start-demo-3;basis=Report claim-seed protocol capability only when explicitly configured and runtime moved readiness only when armed; dormant status keeps its original JSON shape. Census read-site delta: unchanged (28).;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 (#511 R16 and its amendment): copies Probes.PrevRelease and Probes.ApplyFinished into BoxMetrics (json prev_release and apply_finished, omitempty; private, like Release) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-platform-mail-submission;basis=Task 3: copies Probes.MailerArmed into BoxMetrics.MailerArmed (json mailer_armed, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added. registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 b2a6b68d0c028970efee40812263bf1e4a6214b90c568d8275deb81b61ff1e66
+internal/activator/backend_exec.go ExecBackend.controlMount legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: the one composer of a control socket's verbs, for both bind sites. Mounts the schedule verbs and GET /updates exactly as the two inline copies did (same conditions, same host, token reader and write fence), and POST /v1/mail (mailsubmit.Mount) under its own condition, b.Mail != nil. Reads rt.Host and passes the route to Mount; returns nil when nothing is mounted. The agent (carlos-edge.service, user carlos), not root. registry:Host@292,registry:Host@347,registry:Host@426,whole:Route@515 827650c1147231c19b6da7e41f3fc97fa4c28e3eda76961dfa788bc9c25f536e
+internal/activator/backend_exec.go ExecBackend.mailSubmits legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: the CARLOS_MAIL rule. Reads rt.App, rt.Host, rt.Provisioned and RouteAccount(rt) from the agent's own registry row, and asks b.MailSwitch (the agent's cache of the console-written app sender record, internal/host/mailswitch.go: one bounded Get of apps/<acct>/<app>/email/senders/app.json through the agent's deploy store). Logs once per host at error level for an unprovisioned route of a switched app. Agent, not root; no file read. registry:App@213,registry:App@526,registry:Host@317,registry:Host@511,registry:Provisioned@246,whole:Route@185 cfd7494b38dc64c2710233dbc2da850eb7b89fc9aecfa648cd7affd5e9a354d0
internal/host/mailerreport.go mailerArmed legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: the agent's MailerArmed probe. Stats the constant socket path and dials it for GET /v1/health with a 2 s timeout; true only on a 200. Runs in the agent as carlos, never as root; the path is a constant, in a root-owned 0750 root:carlos directory nothing a tenant or an app can write. Answers a bool into the private status block. file:Stat@72 6fd83d5c27429d06864d02a141f7036c2f3e1e8e89366ad6d2a232d417420052
internal/host/units/carlos-mailer-arm.path external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: [Path] PathExists=/etc/carlos-mailer/keys, Unit=carlos-mailer.socket, WantedBy=multi-user.target; enabled and armed by bootstrap like every .path. PID 1 watches a path in a root-owned 0750 root:carlos-mailer directory only root (the operator) writes; it starts a socket unit and reads nothing. file:external@0 6b28c6282ee930560f859f20c752c65f0e550412b9c6ffb1fc10c292a3941a2a
internal/host/units/carlos-mailer.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: runs /opt/carlos/carlos mailer serve as the static user carlos-mailer (never root), socket-activated, ConditionPathExists=/etc/carlos-mailer/keys, EnvironmentFile=-/etc/carlos/host.env (read by PID 1, as every carlos service's) with UnsetEnvironment=CARLOS_SECRETS_KEY, AWS_EC2_METADATA_DISABLED=true, IPAddressDeny=169.254.169.254/32 fd00:ec2::254/128, StateDirectory=carlos-mailer 0700, and the relay's hardening block with no ReadWritePaths. No root process reads anything new; the mailer reads its own key file and state. file:external@0 3f9bd1c2d6e1a4d5d1c72d0c24b000e122cc95290cca8b0d2e62d86576e2dd5f
internal/host/units/carlos-mailer.socket external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 3, new: ConditionPathExists=/etc/carlos-mailer/keys, ListenStream=/run/carlos-mailer/mailer.sock, SocketUser=carlos, SocketGroup=carlos, SocketMode=0600, Accept=no; not enabled, started only by the arming path. PID 1 binds a socket in a root-owned directory, as carlos-instance-control.socket does in /run/carlos-control. No read added. file:external@0 275aae364c39e89bdf3d76d7e66aea9cf65b398ac0c16c087db353cfd5140c34
+internal/mailsubmit/forward.go SocketForwarder.Send legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: the agent's client to the mailer: one HTTP POST of /v1/send over a fresh dial of the constant /run/carlos-mailer/mailer.sock, 60 s timeout, answer read to at most 64 KiB and decoded. Runs in the agent, as carlos. The socket's directory is root's; the mailer at the other end is a separate uid. file:ReadAll@885 b1c14436f42f60c4157ad0dffb1b998931a58b3a2ebf545578ff6d2e243dcd58
+internal/mailsubmit/verb.go Mount legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 4, new: POST /v1/mail on an instance's control socket. The bearer by the existing verbs' rule (empty or unreadable token refuses everything; SHA-256 constant-time compare); MaxBytesReader(14 MiB), the JSON envelope, base64 raw of at most 10 MiB, 1 to 50 non-empty recipients, a non-empty from, else 400 BAD_REQUEST. Stamps account, app and host from the route the socket was bound for, never from the body, and forwards; a transport error or an answer outside 200/400/403/429/503 is 503 MAILER_UNAVAILABLE. Runs in the agent, as carlos; the body is a tenant's and is only decoded and forwarded, never used to name a path, route or account. registry:App@152,registry:Host@160,whole:Route@147 170951db97d14dc471251211b1526d2a640a0c7aba3f5eec1e6c12bc0ae81d2c
+internal/activator/backend_exec.go ExecBackend.agentOwnedVars legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-platform-mail-submission;basis=Task 4: also decides CARLOS_MAIL through mailSubmits: set to "submit" only when the control socket bound, the verb is mounted, the app sender's switch is on and the route is Provisioned; stripped otherwise, a tenant-supplied value from fileEnv included. agentOwnedNames and moves.AgentOwnedVars gain it as a pinned pair. Only narrows what a tenant's files can set. Agent, not root. registry:Host@1209,whole:Route@1171,whole:Route@631 7cc1bcb0b415ee478350a0519799542e0b1e5419c94121519c6e1b349d613c10
+internal/activator/backend_exec.go ExecBackend.spawnChildFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos (the flat start body): the same change as seedChild: ensureAdminTokenFor(ctx, rt, paths) for the token (the same flat path), the key's producer carrying the HA mint decision, and launchEnvLayer(ctx, rt) for the env and key layer the replica gate reads; a non-HA host's token, key and env are produced and read as before; +whole:Route; only adds refusals for HA hosts;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-edge-page-cache-1;basis=the control listener is now built with the whole route (edge.ListenControl(controlSocket, rt, ...)), the +whole:Route site; it computes the launch inputs once from the build it execs by path (a staged exe's caller-named build, or the gate-resolved pinned version; "" for an unpinned live link) and fileEnv it already read, keeps them on the childProc, and for a live-link spawn publishes them to the in-memory cache (NoteProcessInputs) beside the existing purge; no new file read;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main build parameter, pinned live identity, launchInputs from captured build/environment, and current-process input publication. edge.ListenControl now receives the whole Route as main requires (+whole:Route); no new filesystem or storage input. Branch sandboxLaunch remains before preparation and spawn; existing direct primitive gate unchanged.;rev3=census-ruling-security-review-mitigations;basis=Enforce the unchanged never-served resident refusal once at the shared flat/foreign primary binary spawn sink, before placement, live-link/token/env/control preparation or execution. Covers plain, generation and staged Service wakes; existing served/explicit-flat exemptions and other gates retained. No new filesystem/store source.;rev3=census-ruling-platform-mail-submission;basis=Task 4: the inline mount (Timers, UpdatesReader) is replaced by b.controlMount(rt, tokenReader, n): the same verbs under the same conditions, plus the mail verb when b.Mail is set. The three rt.Host reads move into controlMount; the route is passed whole. Agent, not root; nothing else changes. file:Command@11030,registry:Host@12313,registry:Host@12674,registry:Host@12768,registry:Host@258,registry:Host@4236,registry:Stateless@10961,whole:Route@10853,whole:Route@11002,whole:Route@11410,whole:Route@13065,whole:Route@13157,whole:Route@1527,whole:Route@189,whole:Route@1944,whole:Route@2305,whole:Route@287,whole:Route@4091,whole:Route@4119,whole:Route@4430,whole:Route@476,whole:Route@6501,whole:Route@8766 dacd2d37b38491f11ba1be34795d5fe40915aa044d6732ccf2bae467c733f80e
+internal/activator/prepare.go ExecBackend.listenControl legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-edge-page-cache-1;basis=passes the whole route to edge.ListenControl instead of rt.Host (the -registry:Host +whole:Route change); nothing else;rev3=census-ruling-platform-mail-submission;basis=Task 4: the same replacement as spawnChildFrom, with gen as the write fence's generation, so the nested and rootfs listener mounts exactly what the flat one does. Agent, not root. registry:Host@508,whole:Route@361,whole:Route@389 f6534861cdbeef80dbcfaf6b07df685e4ac2f2a86650db54f174871526a50aff
@coverage . 90e9af87273bc6003300b0ae91d6e615c0c9c900518c03837f34e9038a7bfec5
-@coverage internal/host 733290c0356d5508cf2ea4510d2b91806889243e8be2c8de5079ec1541142bf6
+@coverage internal/activator 2fe6860f1b7ef4f5644e17f59fe3cf75759ec2ffe597994c1478edd0512cbc38
+@coverage internal/host 80665fe1e921b049292c71a9e4c4e102c3d72b525cb4ed1d3a46d681fadcf2ad
@coverage internal/host/demo_units 3a34238356068c6176879f3ee189c81af8e08bfcc0246c5feba80d7169f7af6a
@coverage internal/host/units 460478599582ed846a1b6c2d5273c8b2460dc40dcb2e82807a4d404d64c7a330
@coverage internal/instancectl 50d4d80f1f1a86bbed67676f4e439eb79a08bb546ea85ff01a3b433925b9d984
@coverage internal/mailer 3a1c42f8892a49d986a12078be8b5b8c7e69f066b265928b72eaaf3b6a19910d
+@coverage internal/mailsubmit 56f6a85fb8ec114b259da26d7bbc7e5a605fc2013693f19012facc248e10b3d8
@coverage internal/mailwire 63e4ea297d1030ee6dc397f0a2a107f58b3ecff029513199b8e64489b2c454c1
+@coverage internal/moves 9390702695d308a327f5572f4ff5967718141c5d385dff7671ff1e2c825ef407
@coverage internal/status 7cdc110ec7df53cc754816f7333a90f665fb27a55caa7d2f4988fb7b02f8263f