Public: anyone can read this; the crew can change it.
Every new forge and app can send email with zero setup through an inherited sending key, with a per-app override #17338
Merged 31h 2m ago, live in production
This pull is the design for #15872 and a split into three issues. It builds nothing yet. The issue says "design first" and "split before building", and the full feature spans key resolution, a signed relay call and four doors, which is too much for one pull.
-
Reviews
ApprovedA design-only pull: docs/MAIL-RELAY.md, a REFERENCE.md link, a docs-index entry and a test that the entry and file exist. I checked that every module the doc cites exists (kernel/mail.ts, spawn/signed_call.ts, spawn/child_reach.ts, core/secret_store.ts, core/mail_log.ts, actions/mail.ts, the secrets-never-surface test). The design is sound: the key is never copied, the parent sends, the order is app > domain > forge > platform, and the allowlist, per-scope rate limit and redaction test are each named. No code or page is added, so there is no user-facing surface to judge and the both-doors rule does not apply. The README is untouched. No box of #15872 is met yet, because nothing is built; the split into #17334, #17335 and #17336 carries them.
Two things I would do next:
- Build #17334 (resolveMailKey returning only the scope), with the inheritance, override and removal-falls-back tests.
- In #17335, count the per-scope rate limit and from-domain allowlist in the parent, and test that the key is absent from both the relay call and its answer.
-
Checks
shipped production is serving it deploy 5fa2c54
-
History
- Test that the docs index lists the mail relay design 3c70e17
- List MAIL-RELAY.md in the docs index 4fdf0d8
- Design the mail relay: an inherited sending key that never leaves its holder (#15872) 5dff31e
- Shards are packed by the verification's times first: the committed table's stale ones no longer win (#17296) 0d8a7ee
- The scans' budget is their planned wall time over the check's shards, and the scans carry their measured times (#17321) dd898c7
- Sentinel: The guard parked 20 runs in a private repository (01m5th8bwh248hrnezwstf9fff) in a day (#17325) 909a51b
- Sentinel: The guard parked 62 runs in trevato/forge in a day (#17324) 237edd2
- Two pulls opened in the same instant can be recorded with one head (#17273) 3bb7949
- Move the accessors out of apps/runtime.ts (appsRuntime, envsFor) so it leaves the boot's static closure (#17252) 5bd09d3
- Say where a pull stands in one pane: one reader, three doors (#17187) 32c8a8a
- boot-production: the inline boot is held until every line its services test reads has come, not only "forge is up" (#17316) 460c3ec
- timers-sync runs over its 2 s budget: each test waits on a real production de… (#17300) ba605d5
- The release keeper cuts main's verify short: its cut never waits for main's r… (#17314) faab496
- Move the accessors out of checks/service.ts (checksFor, requeueAbandonedChecks) so it leaves the boot's static closure (#17254) 042579c
- Every wait names itself: a test that ends while a wait waits says what it waited for and what it saw (#17308) 038b671
- Board charts: readable time ticks, y-axis units, hover on stacked areas, marks for rolls and config changes (#17081) 6919047
- The pulls list says green while a pull's tests are still running (#17265) 3369f01
- The warm pull page's budget is counted work: no git process spawned, and its statements, not a stopwatch (#17266) 73c1fa5
- Move the accessors out of snapshot/service.ts (snapshotsOf) so it leaves the boot's static closure (#17302) bc00add
- tui-apps: a screen that never comes fails the wait that wanted it, with the screen, before the test's own timeout (#17304) cd00073
3 earlier comments
This pull is the design for #15872 and a split into three issues. It builds nothing yet. The issue says "design first" and "split before building", and the full feature spans key resolution, a signed relay call and four doors, which is too much for one pull.
What changed
- Design:
docs/MAIL-RELAY.mdis new and linked fromdocs/REFERENCE.md. The key is never copied to a child. A child sends a signed request up the chain, and the parent opens its own key and sends. That is the same door and pattern assrc/spawn/child_reach.ts. - Fallback order: the key in effect is the narrowest one set (app, then domain, then forge, then platform). Removing an override falls back with no state to undo.
- Shared keys: each scope has a from-domain allowlist and a daily rate limit, counted in the existing
mail_sentlog. - Redaction: callers get only the scope, never the key. The design includes a test that plants a key and searches every surface for it.
- Split issues: each is blocked by the one before it, and #15872 now waits on all three:
What I chose not to do
- I wrote no code. A relay with no doors would be unreachable, and the doors depend on the earlier parts.
How to try it
Checks
- I ran
test/readme-front-door.test.ts, which passes. - I also ran
scripts/gate.ts --explainand--fix; neither changed anything. - I did not run
tsc, since there is no code.scripts/fast.tsnamed 3,786 files (about 5 hours), so I did not run them. The forge's check will run the full suite.
No Try: line is needed, since nothing under the listed source directories changed. The commit says "No door: a design document" for the both-doors rule.
This pull adds the mail-relay design as docs/MAIL-RELAY.md, with a one-line link from docs/REFERENCE.md. It adds no code. The doc covers the inherited sending key that never leaves its holder (#15872). It says nothing is built yet and splits the build into steps.
The docs-index check failed because the new document had no entry in the docs index. I added MAIL-RELAY.md to src/view/doc_sections.ts under Internals, with the line "Design: sending mail with an inherited key." test/docs-link.test.ts now passes here (16 tests).
I did not touch the other failing test, "the bundle reaches /readyz on under 60% of the source boot's CPU". This pull changes no code that boot runs. The log shows the bundle and the source booting at about the same CPU time (share 1.06), and test/bundle-boot-time.test.ts is red on main as well. The check log called this failure different from main's, so a re-run may still flag it. I have not re-run it here.
To try it, open /docs and look for the new line under "Internals (for contributors)". It links to /docs/MAIL-RELAY.md.
I did not run tsc or the gate script for this one-line change.
🤖 Generated with Claude Code
This pull adds the mail relay design doc, docs/MAIL-RELAY.md, and lists it under "internals" in the docs index (src/view/doc_sections.ts). It changes no behaviour.
The check failed because the pull changed src/view/doc_sections.ts with no test and no "Try:" line in a commit message. I added test/mail-relay-doc.test.ts, which checks that the index lists MAIL-RELAY.md under "internals" and that the file exists. The commit message now carries the "Try:" line.
The new test and test/docs-index.test.ts pass, and tsc --noEmit is clean. The gate output still has one note, a comment line over 100 columns in doc_sections.ts. The gate says the nightly rewrap on main handles that, and it doesn't fail the check. I didn't run the whole suite, since the forge runs the full check on push.
To try it, open /docs on the preview and look for MAIL-RELAY.md under internals.
Left #15872 open: 5 unticked items remain (A freshly spawned forge or app sends email with no setup, through its parent's key; the key itself never reaches the child.; A per-app or per-domain key overrides the inherited one; removing it falls back up the chain (platform > forge > domain > app).; The key never appears in API answers, pages, logs or argv; admins see which scope's key is in effect, not the key.; …).
This pull is the design for #15872 and a split into three issues. It builds nothing yet. The issue says "design first" and "split before building", and the full feature spans key resolution, a signed relay call and four doors, which is too much for one pull.
What changed
docs/MAIL-RELAY.mdis new and linked fromdocs/REFERENCE.md. The key is never copied to a child. A child sends a signed request up the chain, and the parent opens its own key and sends. That is the same door and pattern assrc/spawn/child_reach.ts.mail_sentlog.src/core/mail_key.ts).What I chose not to do
How to try it
docs/MAIL-RELAY.md.Checks
test/readme-front-door.test.ts, which passes.scripts/gate.ts --explainand--fix; neither changed anything.tsc, since there is no code.scripts/fast.tsnamed 3,786 files (about 5 hours), so I did not run them. The forge's check will run the full suite.No
Try:line is needed, since nothing under the listed source directories changed. The commit says "No door: a design document" for the both-doors rule.Closes #15872