docs, census: switch-off checks keys; SMTP settings out first
The plan's ruling 6 note records Paul's two rulings of 2026-11-14, how each was built, the unreadable-key choice (refuse), and the week-7 reap order applied as the same rule. The mailSubmits claim notes the exported MailUnknownSubmits; overlay re-proposed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+11
−8
docs/superpowers/notes/census-claims-platform-mail-submission.tsv+1 −1docs/superpowers/notes/census-proposal-platform-mail-submission.md+1 −1docs/superpowers/plans/2026-11-13-platform-mail-submission.md+5 −2internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv+3 −3
CI failed — 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 9d472b1ed..55da59e17 100644 |
| --- a/docs/superpowers/notes/census-claims-platform-mail-submission.tsv |
| +++ b/docs/superpowers/notes/census-claims-platform-mail-submission.tsv |
| @@ -35,7 +35,7 @@ internal/activator/backend_exec.go:ExecBackend.controlMount Task 4, new: the one |
| 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. Task 6: also calls warnUndeclaredMailBuild with the route and the version being spawned (a log line and an instance event, never a refusal). |
| 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. Fable final P2-2: passes fileEnv to mailSubmits, which reads it only to decide an unknown switch; CARLOS_MAIL is still set or stripped by the agent alone. No read added. |
| -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. Fable final P2-2: MailSwitch is three-valued. An unknown switch (the agent could not read the record) is decided from fileEnv, the environment the instance is about to start with and already read by the spawn: submit when it holds a non-empty *_MAIL_FROM and no non-empty *_SMTP_HOST (mailUnknownSubmits), logged once per host. A tenant can write fileEnv, so it can make its own instance submit; the mailer reads the switch itself and refuses an unswitched app, so that grants nothing. Agent, not root; no file read added (+registry:Host for the log key). |
| +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. Fable final P2-2: MailSwitch is three-valued. An unknown switch (the agent could not read the record) is decided from fileEnv, the environment the instance is about to start with and already read by the spawn: submit when it holds a non-empty *_MAIL_FROM and no non-empty *_SMTP_HOST (MailUnknownSubmits), logged once per host. A tenant can write fileEnv, so it can make its own instance submit; the mailer reads the switch itself and refuses an unswitched app, so that grants nothing. Agent, not root; no file read added (+registry:Host for the log key). Astra census review of 76f4f582c, ruled 2026-11-14: the decision function is exported as MailUnknownSubmits (unchanged), so the console's simulation test can judge every bundle by the agent's own rule. No read added. |
| 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; at most 2 messages per socket in the agent at once, the next 429 RATE (review round 1, Task 4 P3). 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. Fable P2-9 (2026-11-14): takes the agent's switch read (ExecBackend.MailSwitch) and answers 403 SUBMISSION_OFF before reading the body when the route's app is not switched; a package-level bound of MaxInFlight messages across every socket answers 503 MAILER_UNAVAILABLE. No read added: the switch is the agent's in-memory cache. |
| 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 eb.MailSwitch to a mailSwitchCache's On that opens the deploy store itself through openDeployStore, retried at most once a minute with an error line until it opens (review round 1, Task 4 P3), armed for the serial-move refresh (armedMailSwitch). Task 6: also sets the ExecBackend's ManifestOf, the same staged-manifest read as TierOf (rt.App and RouteAccount(rt), hence +registry:App and +whole:Route), for the spawn-time check of decision 10, which logs and emits an event and never refuses. Agent, not root. Fable final P2-2: eb.MailSwitch is the cache's State (three-valued: on, off, unknown) in place of On; an unreadable switch is unknown, never off. No read added. |
diff --git a/docs/superpowers/notes/census-proposal-platform-mail-submission.md b/docs/superpowers/notes/census-proposal-platform-mail-submission.md| index 6d9407010..f4459d4c5 100644 |
| --- a/docs/superpowers/notes/census-proposal-platform-mail-submission.md |
| +++ b/docs/superpowers/notes/census-proposal-platform-mail-submission.md |
| @@ -88,6 +88,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the |
| - 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: `5603979dfa1a34a1b30784d1f9252f20b0ed95c114bde54e8b173f9262fe8f46` → `fcddd17b6ff602f8de505aa64a109bf16d1424e38b9378c24c2ffff2e50aa4e5`. |
| +Seal: `5603979dfa1a34a1b30784d1f9252f20b0ed95c114bde54e8b173f9262fe8f46` → `c2d49cb1edf68b4e5296d9a328bcefae6bf2186f5f6027143ef9d8a576d59524`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/plans/2026-11-13-platform-mail-submission.md b/docs/superpowers/plans/2026-11-13-platform-mail-submission.md| index 5050c9f2b..3e469e132 100644 |
| --- a/docs/superpowers/plans/2026-11-13-platform-mail-submission.md |
| +++ b/docs/superpowers/plans/2026-11-13-platform-mail-submission.md |
| @@ -76,10 +76,13 @@ Plan choices that are not gaps, for the plan reviewer (each resolves an item on |
| 6. **Fable's final whole-branch review of `b0aba39b0`: APPROVE, no P1**, so the review stops and its P2s are fixed without another round; Astra's census verdict (M1: the mailer unit unsets `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` too; L1: `statusLoop` has seven sites) is applied. Fixed on the branch: the reap runs from the hourly pass for every account, with or without a plan catalog (P2-5); `email status` reports a switched app's state and pause from its pause block, with no false drift (P2-6); a third concurrent send waits up to 5 s for a sender slot (P2-7); "armed" means AWS accepted the key once (P2-8); the verb answers `403 SUBMISSION_OFF` before reading an unswitched app's body, and bounds the agent's messages across every socket (P2-9); the rollback rule (P2-10, runbook 5c and operator step 12); and the copy fixes (P2-4), with every string of the code now a row of the record and the record checked both ways. P2-1 to P2-3 of that review, in the one-working-channel family, were **ruled by Paul, 2026-11-14: fix as the reviewer named them**, under ruling 2's option 1, and are fixed: |
| - **P2-1, a flip's restart could respawn on the agent's stale answer:** a serial move marks every cached switch answer stale, synchronously, before the move's pass set and restart leg (`mailSwitchCache.MarkStale` in `fastTick`), and `State` reads a stale answer again, bounded. A read that a `MarkStale` overtook stores a stale entry and never replaces a later one. Pinned by `TestFastTickMarksMailSwitchStaleBeforeTheBounce` (a spawn in the pass set and one in the restart leg, both before `Refresh`) and `TestMailSwitchMarkStale`. |
| - - **P2-2, an unreadable switch read as off:** of the reviewer's two options, **the second**: the switch is three-valued (`activator.MailSwitchState`), and an unknown one is decided from the environment the instance is about to start with: submit when it holds a `*_MAIL_FROM` and no `*_SMTP_HOST`, otherwise the SMTP its bundle carries (`mailUnknownSubmits`). Chosen over persisting the last good answer because it also covers an app the agent has never read (a new placement, or the deploy store not yet open), needs no new agent-written file, and follows from the switch's own write order, so the bundle is always the channel the console delivered. The verb forwards an unknown app; the mailer reads the switch itself and refuses an unswitched one. A failed read is unknown even with an older answer cached, since that answer may be the one the move changed. Pinned by `TestMailSwitchCache` and `TestMailUnknownSwitchDecidedByTheBundle`. |
| + - **P2-2, an unreadable switch read as off:** of the reviewer's two options, **the second**: the switch is three-valued (`activator.MailSwitchState`), and an unknown one is decided from the environment the instance is about to start with: submit when it holds a `*_MAIL_FROM` and no `*_SMTP_HOST`, otherwise the SMTP its bundle carries (`MailUnknownSubmits`). Chosen over persisting the last good answer because it also covers an app the agent has never read (a new placement, or the deploy store not yet open), needs no new agent-written file, and follows from the switch's own write order, so the bundle is always the channel the console delivered. The verb forwards an unknown app; the mailer reads the switch itself and refuses an unswitched one. A failed read is unknown even with an older answer cached, since that answer may be the one the move changed. Pinned by `TestMailSwitchCache` and `TestMailUnknownSwitchDecidedByTheBundle`. |
| - **P2-3, the week-7 reap could race a switch-off:** each app's reap (`reapSubmittedAppUser`) takes the account lock, then the app lock (`beginCopiesMutation`), the door's order, and reads the record under them. `TestSubmissionChannelSimulation` runs a whole switch-off inside a reap paused before its deletes, and for that step checks that every SMTP key the switch-off delivered is one AWS still holds, active. |
| - Each fix was watched to fail with its fix removed. |
| - - **Found while doing it, not fixed (same family, for Paul):** with that key check on every step, the scripted sequence shows a switch-on that fails after reaping an owned environment's IAM user but before taking the five out of its bundle (team's write #2). The environment record still names the deleted user, so the next switch-off's `EnableEnvironment` treats the bundle as delivered and mints nothing: instances in that environment end on SMTP with a deleted key. The check is scoped to the P2-3 step until this is ruled. |
| + - **Ruled by Paul, 2026-11-14: switch-off checks keys, and switch-on removes SMTP settings before deleting the user.** Two further findings in the family, both fixed: |
| + - *The stronger simulation check* (every SMTP key a bundle holds must be live) showed a switch-on that failed after deleting an owned environment's IAM user but before taking the five out of its bundle. The record still named the deleted user, so the next switch-off's `EnableEnvironment` read the bundle as delivered and minted nothing. Fix: before any delivery walk skips a mint because a bundle already holds the recorded key (`Enable`, `EnableEnvironment`, so switch-off's step 1 among them), it asks IAM through a new read, `Provisioner.KeyState` (IAM `ListAccessKeys`; the in-memory fake has it too), and re-mints unless the key exists under that user and is active (or inactive, for a paused sender: a pause deactivates keys on purpose). **An unreadable key state refuses the walk** rather than reading as missing: a switch-off then stops before it writes the switch, so the app stays switched and keeps submitting, whereas reaping and re-minting on a read failure would delete a key running instances may still use. |
| + - *Astra's census review of 76f4f582c* (all units accepted; P2-1 and P2-3 resolved, P2-2 partly): `ReapEnvironment` deleted the keys and user before taking the five out of the bundle, so a failed bundle write left a switched app's environment with its From beside a dead key, and a spawn with the switch unreadable took SMTP from it. Fix: the bundle write comes first, then the keys and the user; a re-run finishes the deletion. **The same order is applied to the week-7 reap of the app-level user** (`ReapAppUserAfterSubmission`): the default bundle is made a switched app's (From, none of the five) before the user goes. The seed sweep found that sibling (seed 2009: a switch-on failed after `On:true` with the five still in the default bundle, then the hourly reap deleted the user under them). This applies Paul's ruled order to the second place a switched app's user is deleted, so he should confirm it. |
| + - The simulation now checks, at every step, every SMTP key that an instance would use: after a switch-off, and while switched wherever `activator.MailUnknownSubmits` (the agent's own rule for an unreadable switch) picks SMTP. Scripted steps cover a key lost in AWS before a switch-off and a switch-off whose key state is unreadable (refused, still switched). Mutation-checked: without the key check, the lost-key step fails; with the old reap order, the part-failed switch-on (team's write #2) fails; without the week-7 reap's bundle write, seed 2009 fails. |
| The copy review (Task 6 P2-6) is still Paul's; the copy record stays a draft. |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 1a09074df..c32cade58 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -217,4 +217,4 @@ plan14-root-reads-g6-pool.tsv 94ccbabaf19c3a449cec248a0c32fcc8593c82d3f7f433c6a4 |
| plan14-root-reads-pdf-host-client-groups.tsv e8beda8fd31db92f742943be631e8d034bbb4880225e69a680d5a0be893807af |
| plan14-root-reads-log-retention-knobs.tsv e8beda8fd31db92f742943be631e8d034bbb4880225e69a680d5a0be893807af |
| plan14-root-reads-fleet-record-labels-m1.tsv 5603979dfa1a34a1b30784d1f9252f20b0ed95c114bde54e8b173f9262fe8f46 |
| -plan14-root-reads-platform-mail-submission.tsv fcddd17b6ff602f8de505aa64a109bf16d1424e38b9378c24c2ffff2e50aa4e5 |
| +plan14-root-reads-platform-mail-submission.tsv c2d49cb1edf68b4e5296d9a328bcefae6bf2186f5f6027143ef9d8a576d59524 |
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 e89068068..159f80a5f 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv |
| @@ -25,7 +25,7 @@ |
| @legacy 1dfce6c598f867f9f8e3251758ab91e9a1d16656d9831806b5fab5b8c5421952 infra/modules/region-host/tests/mailer.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 8, new: plan-only runs under mock_provider: off by default; the user's name and path; the policy's two statements exactly; no ListBucket, Put, delete, SendEmail, IAM or wildcard action; KMS adds decrypt through S3 only; another account refused; a bad region refused; the host role gains no SES. Test-only. file:external@0 d8f1e5acb446a2e33848958b3ea036ab81c1f17565ab8df5409883b0afb39164 |
| @legacy e22f1e9844d61fe949ab40748b17135bde43efa378e310b484c471ffbce7eed9 infra/modules/region-host/tests/mailer_group.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 8, new: plan-only runs under mock_provider with group.tftest.hcl's fixtures (plus an AMI override): the two region parameters' names and values with mailer set, none without. Test-only. file:external@0 c36b70fc72d0b317db438c66a7e669a49a92ddce904ae8307f3503031c53f73f |
| @legacy 695579261117dd7b8ecd6ebbe00980d65f627ec951aa51633bec2feb1c1aaab7 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. Fable P2-9: passes b.MailSwitch to mailsubmit.Mount. No read added. Fable final P2-2: passes b.mailVerbSwitched (b.MailSwitch, with an unknown switch forwarded to the mailer, which reads the switch itself and refuses an unswitched app) in place of b.MailSwitch. No read added. registry:Host@292,registry:Host@347,registry:Host@426,whole:Route@515 f6030dc1c42e45b98226a433509a7550abf15525ad8ff05c1a93d4facc3be084 |
| -@legacy 920e4835a37f7525008217f8ce9f46ae7217c46d495d5a684bba4498204b803c 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. Fable final P2-2: MailSwitch is three-valued. An unknown switch (the agent could not read the record) is decided from fileEnv, the environment the instance is about to start with and already read by the spawn: submit when it holds a non-empty *_MAIL_FROM and no non-empty *_SMTP_HOST (mailUnknownSubmits), logged once per host. A tenant can write fileEnv, so it can make its own instance submit; the mailer reads the switch itself and refuses an unswitched app, so that grants nothing. Agent, not root; no file read added (+registry:Host for the log key). registry:App@1044,registry:App@243,registry:App@666,registry:Host@1029,registry:Host@386,registry:Host@674,registry:Host@835,registry:Provisioned@764,whole:Route@212 9a30f4766509ef6e113775cabcd824d7984353b7cc4f3c9be0e53d0fa3759738 |
| +@legacy 311dfcf6c08eec3bbbaea47b2fe4739eb4fc5e290fc0b2a5136c60ed5213c89f 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. Fable final P2-2: MailSwitch is three-valued. An unknown switch (the agent could not read the record) is decided from fileEnv, the environment the instance is about to start with and already read by the spawn: submit when it holds a non-empty *_MAIL_FROM and no non-empty *_SMTP_HOST (MailUnknownSubmits), logged once per host. A tenant can write fileEnv, so it can make its own instance submit; the mailer reads the switch itself and refuses an unswitched app, so that grants nothing. Agent, not root; no file read added (+registry:Host for the log key). Astra census review of 76f4f582c, ruled 2026-11-14: the decision function is exported as MailUnknownSubmits (unchanged), so the console's simulation test can judge every bundle by the agent's own rule. No read added. registry:App@1044,registry:App@243,registry:App@666,registry:Host@1029,registry:Host@386,registry:Host@674,registry:Host@835,registry:Provisioned@764,whole:Route@212 04f3ef67c0d1fb7f641657eb9d9fd7e8b024a5c9b89161accc45e5d7615e787b |
| @legacy 537d412b155b7dec261d1a571e8ae25295706d796cf273ffe240b868839853e7 internal/activator/mailbuild.go ExecBackend.warnUndeclaredMailBuild legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 6, new: design decision 10's loud log, never a refusal (a refused wake would turn a mail gap into a site outage). Asks the agent's switch cache (MailSwitch) and reads the staged manifest of the version being spawned through ManifestOf (release.ReadStagedManifest, the read TierOf already makes); logs at error level and emits one instance event per (host, version). Agent, not root; reads only what the spawn already reads. Fable final P2-2: MailSwitch is three-valued; logs only for a switch read as on, never for an unknown one. No read added. registry:App@1216,registry:App@218,registry:App@863,registry:Host@1192,registry:Host@264,registry:Host@834,whole:Route@1243,whole:Route@191,whole:Route@383 55a0c1dc213858a9172ed5af4477e778f488470f109cb0ea1a2ca108bae0befe |
| @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 |
| @@ -69,7 +69,7 @@ infra/modules/region-host/mailer.tf external legacy accepted-legacy accepted-leg |
| infra/modules/region-host/tests/mailer.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 8, new: plan-only runs under mock_provider: off by default; the user's name and path; the policy's two statements exactly; no ListBucket, Put, delete, SendEmail, IAM or wildcard action; KMS adds decrypt through S3 only; another account refused; a bad region refused; the host role gains no SES. Test-only. file:external@0 d8f1e5acb446a2e33848958b3ea036ab81c1f17565ab8df5409883b0afb39164 |
| infra/modules/region-host/tests/mailer_group.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 8, new: plan-only runs under mock_provider with group.tftest.hcl's fixtures (plus an AMI override): the two region parameters' names and values with mailer set, none without. Test-only. file:external@0 c36b70fc72d0b317db438c66a7e669a49a92ddce904ae8307f3503031c53f73f |
| 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. Fable P2-9: passes b.MailSwitch to mailsubmit.Mount. No read added. Fable final P2-2: passes b.mailVerbSwitched (b.MailSwitch, with an unknown switch forwarded to the mailer, which reads the switch itself and refuses an unswitched app) in place of b.MailSwitch. No read added. registry:Host@292,registry:Host@347,registry:Host@426,whole:Route@515 f6030dc1c42e45b98226a433509a7550abf15525ad8ff05c1a93d4facc3be084 |
| -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. Fable final P2-2: MailSwitch is three-valued. An unknown switch (the agent could not read the record) is decided from fileEnv, the environment the instance is about to start with and already read by the spawn: submit when it holds a non-empty *_MAIL_FROM and no non-empty *_SMTP_HOST (mailUnknownSubmits), logged once per host. A tenant can write fileEnv, so it can make its own instance submit; the mailer reads the switch itself and refuses an unswitched app, so that grants nothing. Agent, not root; no file read added (+registry:Host for the log key). registry:App@1044,registry:App@243,registry:App@666,registry:Host@1029,registry:Host@386,registry:Host@674,registry:Host@835,registry:Provisioned@764,whole:Route@212 9a30f4766509ef6e113775cabcd824d7984353b7cc4f3c9be0e53d0fa3759738 |
| +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. Fable final P2-2: MailSwitch is three-valued. An unknown switch (the agent could not read the record) is decided from fileEnv, the environment the instance is about to start with and already read by the spawn: submit when it holds a non-empty *_MAIL_FROM and no non-empty *_SMTP_HOST (MailUnknownSubmits), logged once per host. A tenant can write fileEnv, so it can make its own instance submit; the mailer reads the switch itself and refuses an unswitched app, so that grants nothing. Agent, not root; no file read added (+registry:Host for the log key). Astra census review of 76f4f582c, ruled 2026-11-14: the decision function is exported as MailUnknownSubmits (unchanged), so the console's simulation test can judge every bundle by the agent's own rule. No read added. registry:App@1044,registry:App@243,registry:App@666,registry:Host@1029,registry:Host@386,registry:Host@674,registry:Host@835,registry:Provisioned@764,whole:Route@212 04f3ef67c0d1fb7f641657eb9d9fd7e8b024a5c9b89161accc45e5d7615e787b |
| internal/activator/mailbuild.go ExecBackend.warnUndeclaredMailBuild legacy accepted-legacy accepted-legacy;rev3=census-ruling-platform-mail-submission;basis=Task 6, new: design decision 10's loud log, never a refusal (a refused wake would turn a mail gap into a site outage). Asks the agent's switch cache (MailSwitch) and reads the staged manifest of the version being spawned through ManifestOf (release.ReadStagedManifest, the read TierOf already makes); logs at error level and emits one instance event per (host, version). Agent, not root; reads only what the spawn already reads. Fable final P2-2: MailSwitch is three-valued; logs only for a switch read as on, never for an unknown one. No read added. registry:App@1216,registry:App@218,registry:App@863,registry:Host@1192,registry:Host@264,registry:Host@834,whole:Route@1243,whole:Route@191,whole:Route@383 55a0c1dc213858a9172ed5af4477e778f488470f109cb0ea1a2ca108bae0befe |
| 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 |
| @@ -91,7 +91,7 @@ internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve- |
| @coverage . 295f50675373126c17b6adc286bad9a8935f6e1020fca5daa1ad23f71b6f27db |
| @coverage infra/modules/region-host d1a978ca67367880d0940ae7aa460f311addd4335c196a279d86caa6fe1e1721 |
| @coverage infra/modules/region-host/tests 1aa5c549b79e7d8b19a266a2aeae8e4e2bb22b40072f36362da95bcf2c439a07 |
| -@coverage internal/activator 984e8c0efea814d70afdf235f2a32319a5c08b02629144125d89e85cbc22fbb1 |
| +@coverage internal/activator b012f29b5dd1553787f8da773d38794c687d34826e88c03a0c33044ccabf8995 |
| @coverage internal/host d9794415522e074dd3d14a51222349918b3fd3ed06144581ce2cb1abbdd5af65 |
| @coverage internal/host/demo_units 3a34238356068c6176879f3ee189c81af8e08bfcc0246c5feba80d7169f7af6a |
| @coverage internal/host/units 1c742096c3a89946d8539b0113ea2ce07a833356d4a0262e55f8d5defb566055 |