Repository navigation
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Silthus
force-pushed
the
feat/email-send-policy
branch
2 times, most recently
from
October 21, 2026 19:31
1efd601 to
619d742
Compare
This was referenced Oct 22, 2026
A message template gets a code key unique per team, an owner, a source and a content hash, so code can upload and lock a template by key. Part 1 of 3 of PostHog#118924. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lates Code uploads an email template by key, which locks it against edits in PostHog. Giving a template a key adopts it. A send names the template by key or id and carries a content hash, so a stale upload is refused. Part 2 of 3 of PostHog#118924. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus
force-pushed
the
feat/email-send-policy
branch
from
October 23, 2026 17:25
619d742 to
02d26ce
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus
force-pushed
the
feat/email-send-policy
branch
from
October 23, 2026 21:24
02d26ce to
8ce89fa
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The template library marks a code-managed template with its source and key, shows it read-only, and offers a release back to PostHog. Part 3 of 3 of PostHog#118924. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ield Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EmailSendPolicy.check(send, phase) holds the team suspension, workflow pause, sender and suppression checks, each with a code, why and fix. Delivery runs them through check(send, 'delivery') and keeps its logs, metrics and skip handling. The step-level suppression check shares the policy's lookup. Nothing calls the admission phase yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus
force-pushed
the
feat/email-send-policy
branch
from
October 24, 2026 17:28
8ce89fa to
8728de2
Compare
13 of 16 tasks
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.
Problem
202, so a202never hides a send the worker later skips (contract #120921, "Errors"). It can't reuse checks that are woven into the worker's send.Stacked on #118924. This fork PR targets
master, so the diff here includes #118924. This layer alone:spec/code-managed-templates...feat/email-send-policy.Impact
Pays into Grow Workflows through billed
workflows_emailsactions per paying org, by way of the code-content send API this refactor prepares. Not measured yet as a monthly count. In scope: Messaging, email API sends. Expected move: none from this PR alone. Run cost: n/a.Merge Danger
Warning
🟡 Merge risk: medium · one-way door (merge-risk rubric)
email.service.test.ts,recipient-preferences.service.test.tsandhog_function.test.ts. The one added case is a suppressed-cc row in the missing-recipient table.Changes
EmailSendPolicy.check(send)innodejs/src/cdp/services/messaging/email-send-policy.ts. Admission and delivery run the same checks, sochecktakes no phase.to,ccandbcc.{ ok: true, sender }or a rejection with aPolicyCode(sending_suspended,template_paused,sender_not_verified,recipient_suppressed),detail,whyandfix.detailis the run-log text delivery shows today.whyandfixare new, for the API's errors later.EmailService.executeSendEmailcallscheck(send)and keeps its logs, metrics,skippedflags and thrown sender errors, now from one table per code.RecipientPreferencesService) uses the policy'sfindSuppressedRecipients. It still fails open on a lookup error.checkat admission in a later slice.masteron 2026-10-21.master's skip for a send with notokeeps its place: after suspension, pause and the sender checks, before suppression. With noto, the policy gets no recipients, so a suppressed cc or bcc can't turn that skip into a suppression (619d7421be0).causefield (stafforprovider), as onmaster.PolicyCodeto a skip or a failure in one total table, so a new code must pick one before it compiles.How did you test this code?
Test seam: the policy's public
check, with team config and the suppression list faked at their service interfaces.email-send-policy.test.tsruns each case once, because both callers use the samecheck.detail, so a later change to admission can't drift from delivery.master's missing-recipient cases got a row with a suppressed cc, red before the fix.987b927630e, which holds this head unchanged: CDP jest 3690 (1 skipped), cdp-api serial 288,tscclean, with the rest of the gate green.Proofs owed:
email_suppressed,email_suspendedandemail_pausedmetrics for a drop.causelog field and the partial presentation table in round 1, and a comment in round 2. Final read 1 and the rebase check in final read 3 found nothing.Release status
Docs update
None. No behavior change.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (
claude-opus-5-5)/tdd,/writing-tests,/writing-pr-descriptions, plus Michael'simpact,qa-swarm(proof rules),merge-riskandpr-description.Decisions
check(send, phase), called by cdp-api at admission and the email worker at deliverysender_not_verified, and a pass carries the approved sender. Alternative: leave the sender checks in the worker, which would put them after suppression or duplicate them.check(send)takes no phase, because no check read it. Replacescheck(send, phase)from the send policy row.Involvement: no grilling for this slice. Stack QA swarm: design pass (GPT-6.1 Sol high), round 1 (review and team lanes GPT-6.1 Sol high, fresh eyes Claude Opus 5.5 high), round 2 on the fixes (review lane GPT-6.1 Sol high, fresh eyes Claude Opus 5.5 high), final read 1 and final read 3 over the rebase (GPT-6.1 Sol high, both clean); fixers Claude Opus 5.5 high. Proof is the unchanged delivery suites.
🤖 Generated with Claude Code