Repository navigation
R4: declared, templated, golden-tested mailers; per-mail send transactions - #219
Merged
Merged
Conversation
R4 gets its task table: a mail contract with typed inputs, samples, text/html templates and per-sample goldens; the 14 mails converted in parallel; a /dev/mail preview behind a DEV_ROUTES flag; and the mail sender moved to one transaction per mail. The job queue becomes its own wave, R8, which takes over Q9. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
… retry settings Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
…ry, sample goldens LoginCode and ConfirmSignup are the reference conversions. Their goldens differ only in whitespace. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
…UTES Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
…schedule as a setting Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
…ng alias and the emptied admin files Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Comment samples are literal inputs rather than built by the constructors' own mapper; samples use a site with a root, so a constructor that ignores its site fails; the post-prompt-answer sample tells the post id from the prompt's post id; the send-error test that exercised no mail code moves to the posts service as a rollback test; redundant admin asserts are dropped. Golden changes: links gain https://pcom.test, and post_prompt_answer's unique id is post-2. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
can3p
commented
Oct 7, 2026
…V_ROUTES is off Review feedback on #219. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave R4 (refactor). Merge with a merge or rebase merge, not a squash. Each commit is one task.
What changed
pkg/mail/mail.go): each mail is declared in its own file with a typed input, in-memory samples and embedded templates. Subject and text go throughtext/template, HTML throughhtml/template.mail.All()is the registry.Outgoingis folded intomail.Envelope. No call site builds a mail body withfmt.Sprintfanymore.pkg/adminintopkg/mailasAdmin….pkg/adminkeeps onlyClonedCustomRecovery.TestMails_Goldenswrites one golden per sample. Every pre-existing golden changed only in whitespace when it moved to templates. Afterwards, samples got a site with a root, so links are now absolute (https://pcom.test), and the post-prompt-answer sample's post id becamepost-2. Each constructor has a_MatchesSampletest./dev/mailshows every sample. It is mounted only with--dev-routes/DEV_ROUTES, which is off by default and on indocker-compose.ymland.env.example.dbsendersends each due mail in its own transaction (it used to send the whole batch in one, so a failed update resent everything). The retry schedule is--email-retry-intervals, default10s,60s,30m, with the same attempt count as before.docs/plan/r8.md), which takes over open question Q9.wave-runskill updated; history indocs/archive/history/r4.md.Checks
make check-qpasses, and so domake coverandmake cover-check(total 87.0%).docs/testing.mdlists as failing only in the sandbox. CI'sbrowserjob decides those.pkg/admin/panics_test.go, which this wave didn't change).🤖 Generated with Claude Code
https://claude.ai/code/session_01UmD6gdC2ENrRcg4XZVZuxd
Generated by Claude Code