chadtmiller.com/monolith
An atproto PDS
Each email with an HTML part in the pages' look
MergedThis gives every email a text/html part after its text/plain one, as multipart/alternative, from one template built in web/. I read email.rs, build.rs, harness/lib/mail.mjs, spec/EMAIL.md and email.html. I did not read the rest of the diff: vite.config.ts, the other harness files (smtp.mjs, env.mjs, look.mjs), the web/ docs and skill, and OAUTH-PAGES.md. I ran nothing and did not check the runs.
- Spec:
spec/EMAIL.md("The message", the heading table, the new SMTP checks) matches the code and the harness.HEADINGinmail.mjsmatchesPurpose::heading. - Escaping:
escapecovers& < > " '. Slots hold only the host, fixed strings and the token, so nothing from the account or its request is drawn. - Loading: the template has no
src,hreforurl(, so it passes the harness check. - Harness: the new check is stricter. It sets the text part against the HTML part and tests the token, host, heading and loaded resources.
- Server code: no new crates, and nothing is taken from the reference or an SDK.
conformance.yaml: untouched.
Minor point, no change needed: html fills slots one after another, so a PDS_HOSTNAME that contained {{code}} would be re-filled. It is operator-set and harmless.
I read what changed since the approved commit. It adds just look email all, plus a just look-emails recipe that runs it, and updates the ui skill to match. look.mjs runs each kind in a child process, so each has its own server, and exits non-zero if any kind failed. spawn was already imported. set positional-arguments makes "$@" work in the look recipe. This touches nothing in server behaviour, spec/, or conformance.yaml, and no harness check is loosened. My earlier approval stands. I ran nothing.
Carried forward: the change this pull makes at c63bb23d0519e2605c221c35d2d147757eff08aa is the one reviewed at 4d8d914b69af2c428b1e342122a9277d5038a68a, so that review stands. What is new comes from its base.
Carried forward: the change this pull makes at acec0db21c3df5eeb65c2cc6cbd98520070748e8 is the one reviewed at c63bb23d0519e2605c221c35d2d147757eff08aa, so that review stands. What is new comes from its base.
Carried forward: the change this pull makes at 1e23cad8fe40a9ce0d7477a851a967b959394295 is the one reviewed at acec0db21c3df5eeb65c2cc6cbd98520070748e8, so that review stands. What is new comes from its base.
Carried forward: the change this pull makes at 16a4eccdb8c547c3e8468d53b23f127d5e487b38 is the one reviewed at 1e23cad8fe40a9ce0d7477a851a967b959394295, so that review stands. What is new comes from its base.
Every email the server sends now carries an HTML part in the pages' Monolith look beside its plain text, from one template in
web/built with the pages' tokens.just look email <kind>draws it as the server sent it.Claude Opus 5.5 · high
What changes
Spec.
spec/EMAIL.mdgains "The message": each email ismultipart/alternative,text/plainthentext/html. The HTML part holds the server's host (PDS_HOSTNAME), the kind's heading (a table of six), the token and the 15-minute note; nothing from the account or its request; every value escaped; it loads nothing. "How it is checked" names the new SMTP checks.spec/OAUTH-PAGES.mdsays the build also writesweb/dist/email.html.web.
web/src/email/email.html: a table-laid template, styles on the elements,var(--x)anddark(--x)token references that a small Vite plugin invite.config.tswrites in as values (rem as px) intoweb/dist/email.html. Dark throughprefers-color-schemewith!importantclass rules; a phone size throughmax-width: 640px; Outlook conditional comments for a fixed column width and fallback fonts; detected links in the host drawn as plain text. One new token,--tracking-code.@types/nodeadded as a dev dependency for the config'snode:fs.pds-server.
build.rsembedsweb/dist/email.htmlasTEMPLATE(a build without it fails, as without the rest ofweb/dist).email.rs:Purpose::heading,lead,html(slots filled, each value escaped);SmtpkeepsPDS_HOSTNAME;sendbuildsMultiPart::alternative_plain_html. Text part unchanged.harness.
lib/smtp.mjspartsOf;lib/mail.mjsholds each SMTP message to "The message": its type and parts' order, the token in each part, the host and heading in the HTML part's text, and nosrc,hreforurl(.lib/env.mjsexportsHOSTNAME.look.mjs email <kind>starts an SMTP catcher, asks for the kind as alice would (confirming her email first forupdateEmailandsignInAuthFactor), and draws the HTML part.Docs.
web/AGENTS.md, theuiskill and the Justfile'slookline.Why
The emails were plain text, the one surface of the server not in its look. One hand-written template over Svelte SSR or MJML: page components do not carry into mail clients, and only the tokens need sharing, which the build does. The plain text part stays for clients that want it.
How it was checked
cargo test -p pds-server --lib email::tests::: 14 pass, among themsmtp(now assertsmultipart/alternative, text before HTML) and a newhtml(escaping, slots filled, none left).node compare.mjs --steps 40 --seed 1 --only requestEmailConfirmation,passwordReset,emailFactor,requestEmailUpdate: passes. Planted bug: the HTML part filled with an empty host; the same run fails at step 1 withhtml.host: falseagainsttrue. Put back.npm run check0/0;contrast.mjs40 pairs ≥ 4.5:1;layers.mjsok.just look email <kind>for all six kinds; pictures below. A fresh-eye critique's findings were fixed (Outlook width and fonts, auto-linked host, the code wrapping and off centre, host size and gap, phone heading size, lead size,<h1>).Shortcomings
prefers-color-scheme(Apple Mail and few others); the rest show light or invert it themselves.Review
Stacked on the
web/monolith-lookpull; lands with the Monolith pulls. Start withspec/EMAIL.md, "The message", thenweb/src/email/email.html.