email: per-app submission switch, its door and its preconditions
Task 6 of the platform mail submission plan, with Paul's 2026-11-13
rulings on G3, G4, G6, G9 and G10 recorded in the plan.
The switch: `carlos email submission on|off --app <a>`, door
POST /api/cli/apps/{account}/{app}/email/submission (admin). On refuses,
409 with its remedy, unless the app's mail is declared and enabled, its
prefix ends in _SMTP, the deployment has SES event ingest and every
granted domain a configuration set, every instance record's route is
reported by a fresh box running a build that declares `--mail submit`,
every channel the records follow heads one, a tenant-attributed
sender's identities and configuration sets are associated with the
tenant (G8, via the provisioner's ListTenantResources), and every box
hosting the app has its mailer armed (G6). Then mail.SwitchOn, a serial
bump and an app-wide restart. Off re-mints through Enable.
Delivery: switched bundles hold no <P>_SMTP_* and no AWS key, only
TrimSuffix(EnvPrefix, "_SMTP") + "_MAIL_FROM" (CARLOS_MAIL_FROM,
TITO_MAIL_FROM; never CARLOS_SMTP_MAIL_FROM), in the default bundle and
every owned environment, including one created after the flip
(mintOwnedEnvironmentMail checks the switch explicitly and calls
DeliverMailFromIn). Release removes it. Enable delivers nothing while
switched; Rotate and EnableEnvironment refuse. The app-level user is
kept for the overlap week and reaped by the hourly grace pass once G4
holds (7 days on, a mailer send, no app_user send for 7 days).
While on, every console door that changes what a route serves refuses
an undeclared build ("switch submission off first"), pinned by
TestSubmissionGateCoversEveryServeDoor and its second-door guard; a wake
is never refused, the agent logs and emits an event instead. The
release manifest gains `mail` (`carlos ship --mail submit`, echo-checked;
refused for rootfs for now). The mailer_unarmed alert flags a box that
hosts a switched app's route with no armed mailer. Status and
`carlos email status` gain a submission block.
Also fixes the branch's red CI since Task 3: `mailer` is now a pinned
top-level word, and the CLI golden is re-recorded (Linux) with the
mailer, email submission and ship --mail cases. Copy is a DRAFT record
(platform-mail-submission-copy.json) awaiting Paul's review. Census:
Task 6 claims and the record-write census layer updated, overlay
re-proposed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apimode.go+8 −1approved_platform_mail_submission_copy_test.go+39 −0cli.go+8 −1commands_test.go+2 −0docs/mailer-runbook.md+4 −3docs/parity.md+4 −2docs/site/cli.md+17 −0docs/superpowers/notes/census-claims-platform-mail-submission.tsv+7 −1docs/superpowers/notes/census-proposal-platform-mail-submission.md+12 −5docs/superpowers/plans/2026-11-13-platform-mail-submission.md+5 −5docs/superpowers/plans/platform-mail-submission-copy.json+247 −0internal/activator/backend_exec.go+18 −0internal/activator/mailbuild.go+59 −0internal/activator/mailbuild_test.go+199 −0internal/activator/rootfs.go+1 −0internal/console/alertmailer_test.go+183 −0internal/console/alertnotify.go+9 −0internal/console/alertpages.go+2 −1internal/console/alertsignals.go+206 −5internal/console/apicli.go+34 −1internal/console/apiinstances.go+12 −0internal/console/apimail.go+44 −0internal/console/apiship_mail_test.go+67 −0internal/console/apisubmission.go+429 −0internal/console/apisubmission_test.go+365 −0internal/console/apiupdates.go+4 −0internal/console/channelmove.go+7 −0internal/console/pendinghandlers.go+4 −1internal/console/plangracepass.go+6 −0internal/console/routedecls.go+1 −0internal/console/server.go+10 −2internal/console/submissioncopy.go+41 −0internal/console/submissiongate.go+263 −0internal/console/submissiongate_test.go+662 −0internal/console/teamcreds.go+11 −2internal/console/teamcreds_test.go+2 −1internal/console/updatescore.go+6 −0internal/host/agent.go+6 −0internal/mail/aws.go+33 −0internal/mail/memprovisioner.go+18 −0internal/mail/submission.go+419 −0internal/mail/submission_test.go+567 −0internal/mail/sweep.go+104 −0internal/mail/walk.go+16 −0internal/mail/walk_environment.go+25 −10internal/provision/platform_mail_submission_census_test.go+34 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsv+17 −9internal/release/manifest_mail_test.go+119 −0internal/release/release.go+23 −0mail_cli.go+133 −1mail_cli_test.go+1 −1parity/cli.tsv+2 −0parity/parity.tsv+1 −0ship_mail.go+41 −0ship_mail_test.go+129 −0ship_rootfs.go+1 −1ship_rootfs_test.go+1 −0testdata/clireg-golden.jsonl+37 −20
CI cancelled — superseded by a newer push — run details
apimode.goLoading diff…
approved_platform_mail_submission_copy_test.goLoading diff…
cli.goLoading diff…
commands_test.goLoading diff…
docs/mailer-runbook.mdLoading diff…
docs/parity.mdLoading diff…
docs/site/cli.mdLoading diff…
docs/superpowers/notes/census-claims-platform-mail-submission.tsvLoading diff…
docs/superpowers/notes/census-proposal-platform-mail-submission.mdLoading diff…
docs/superpowers/plans/2026-11-13-platform-mail-submission.mdLoading diff…
docs/superpowers/plans/platform-mail-submission-copy.jsonLoading diff…
internal/activator/backend_exec.goLoading diff…
internal/activator/mailbuild.goLoading diff…
internal/activator/mailbuild_test.goLoading diff…
internal/activator/rootfs.goLoading diff…
internal/console/alertmailer_test.goLoading diff…
internal/console/alertnotify.goLoading diff…
internal/console/alertpages.goLoading diff…
internal/console/alertsignals.goLoading diff…
internal/console/apicli.goLoading diff…
internal/console/apiinstances.goLoading diff…
internal/console/apimail.goLoading diff…
internal/console/apiship_mail_test.goLoading diff…
internal/console/apisubmission.goLoading diff…
internal/console/apisubmission_test.goLoading diff…
internal/console/apiupdates.goLoading diff…
internal/console/channelmove.goLoading diff…
internal/console/pendinghandlers.goLoading diff…
internal/console/plangracepass.goLoading diff…
internal/console/routedecls.goLoading diff…
internal/console/server.goLoading diff…
internal/console/submissioncopy.goLoading diff…
internal/console/submissiongate.goLoading diff…
internal/console/submissiongate_test.goLoading diff…
internal/console/teamcreds.goLoading diff…
internal/console/teamcreds_test.goLoading diff…
internal/console/updatescore.goLoading diff…
internal/host/agent.goLoading diff…
internal/mail/aws.goLoading diff…
internal/mail/memprovisioner.goLoading diff…
internal/mail/submission.goLoading diff…
internal/mail/submission_test.goLoading diff…
internal/mail/sweep.goLoading diff…
internal/mail/walk.goLoading diff…
internal/mail/walk_environment.goLoading diff…
internal/provision/platform_mail_submission_census_test.goLoading diff…
internal/provision/testdata/plan14-root-reads-chain.tsvLoading diff…
internal/provision/testdata/plan14-root-reads-platform-mail-submission.tsvLoading diff…
internal/release/manifest_mail_test.goLoading diff…
internal/release/release.goLoading diff…
mail_cli.goLoading diff…
mail_cli_test.goLoading diff…
parity/cli.tsvLoading diff…
parity/parity.tsvLoading diff…
ship_mail.goLoading diff…
ship_mail_test.goLoading diff…
ship_rootfs.goLoading diff…
ship_rootfs_test.goLoading diff…
testdata/clireg-golden.jsonlLoading diff…