Repository navigation
Conversation
This was referenced Oct 27, 2026
A successful sandbox send records email_sandbox_sent next to email_sent, so the sending tier can leave it out while the workflow metrics still show it. The CDP API's SES webhook captures a workflows sandbox email delivered event for deliveries on the sandbox configuration set. Refs Silthus/personal#199 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs Silthus/personal#199 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus
force-pushed
the
workflows-sandbox-delivery/sandbox-metric
branch
from
October 28, 2026 10:00
69afe3e to
7e95863
Compare
This was referenced Oct 28, 2026
Silthus
added a commit
that referenced
this pull request
Oct 28, 2026
…sandbox metric Merge workflows-sandbox-delivery/sandbox-metric (#610) without a force-push. The block migration moves to 0040, above 0039_sandbox_sender_tenant_state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps master's email status updates beside the sandbox deliveries in the SES webhook. The tracking service takes the sandbox sender before master's optional status service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus
added a commit
that referenced
this pull request
Oct 31, 2026
…the block migration Merge workflows-sandbox-delivery/sandbox-metric (#610) without a force-push. The block migration moves to 0041, above 0040_sandbox_sender_tenant_state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 2, 2026
Closed
Owner
Author
|
Replaced by PostHog#128412. |
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
The sending tier now subtracts
email_sandbox_sent(#609), but nothing records it yet.Sandbox delivery also has no event of its own.
This PR records sandbox sends as their own metric, and captures an event when SES delivers one.
Part of Silthus/personal#199 (sandbox delivery). Stacked on #609.
Replaces the worker half of #606. Originally #454.
Stack
workflows-sandbox-delivery/tier-exclusion(feat(workflows): subtract sandbox sends from the sending tier #609). Lands after feat(workflows): subtract sandbox sends from the sending tier #609 and every PR below it.1bb35bd788e: Node typecheck and lint clean, touched Node suites 405 passed, thecdp-apiserial suite 141 passed. Pre-pushhogli ci:preflight --strictpassed. Review: GPT-6.1 Sol (high) read the conflict resolutions of the master merge, no findings.1bb35bd788e:1bb35bd788e: a real Django server,cdp-apiand email worker, with SES, the SNS certificate host, MX and personhog stubbed. A sent email recordedemail_sentandemail_sandbox_sentonce each, and master's SES metrics counted each SES call once. A signed delivery on the sandbox configuration set recordeddeliveredand one delivered event. Another configuration set got no event, and a tampered signature got 403.cigap (exit 3). Fork CI cannot run Semgrep or the Depot jobs, and the lane check counts the layers below, because it diffs againstmaster.Impact
Grow Workflows, activation rate: sandbox delivery becomes a separate funnel step, and the tier keeps measuring a team's own sending.
No production team sees this yet:
WORKFLOWS_SANDBOX_SENDER_ENABLEDstays off.Merge Danger
Warning
🟡 Merge risk: medium · two-way door (merge-risk rubric)
email_sandbox_sentnext toemail_sent. Own-domain sends record the same metrics as before.SES_SANDBOX_CONFIGURATION_SET, and does nothing new while that setting is empty.Production lines: 97 changed (
git diff --numstatagainst #609, tests and docs excluded).Changes
email_sentemail_sentandemail_sandbox_sentworkflows sandbox email deliveredwith the recipient count, test sends includedemail_sentstays, so the workflow's metrics tab still shows sandbox sends.How did you test this code?
Live run on the slice tip
Live run of the V3 tip
7e95863f7a0on a PostHog preview. Stubs: a local SES endpoint that records each call, andexample.comseeded as a valid MX domain; a local SNS signing certificate, so a signed delivery webhook verifies; the trigger event produced straight onto the CDP events topic; personhog pointed at the persons database.SES tenant
DISABLED, then the Django sync: the mirror row readsDISABLED, and the next sandbox send is skipped with "the sandbox sender is paused right now".ENABLEDand a sync: the next send goes out. The worker picked up each change without a restart.A live workflow send on the sandbox sender recorded
email_sentandemail_sandbox_sentonce each, the pair the sending tier subtracts.A signed SES
Deliverynotification for that message on the sandbox configuration set returned 200 and capturedworkflows sandbox email delivered. The same envelope with a forged signature returned 403.Lane gate on HEAD:
tscpasses, and the pre-pushhogli ci:preflight --strictpasses. The lane classifier puts this PR on the Node side only.Red: on feat(workflows): subtract sandbox sends from the sending tier #609's code, 2 worker cases miss
email_sandbox_sentand 4 SES webhook cases capture no delivered event.Review fix: the own-domain send test fails on a mutant that drops the
isSandboxguard.Green on HEAD:
email-tracking.service.test.ts,email.service.test.ts,sandbox-email-sender.test.tsandhelpers/ses.test.ts, 359 passed.Test seams:
EmailService.executeSendEmailmetrics for sandbox sends, andEmailTrackingServiceon a signed SES delivery notification.Proofs owed (
fleet proof gate):69afe3e4b1f(own-domain sends never recordemail_sandbox_sent); final read: no findings.69afe3e4b1f), recorded on every delivery head. One real email worker process (cdp-cyclotron-worker-email) on scratch Postgres, with real Redis, Kafka and ClickHouse: a member received the email, a non-member was skipped, a paused tenant was skipped, the daily team cap held, and each delivered send recordedemail_sandbox_sent, which the tier's own ClickHouse read then left out. Stubbed: the SES endpoint (a local HTTP stub behind the real SESv2 client), the MX verdict for the reservedexample.comdomain, and the tenant-state rows the Django sync would write.master, so it reads as mixed until the Node layers below land. Land the stack bottom-first, not with onetrunk mergeon the top layer.Silthus/posthog.Test rationale: the regressions that matter are a sandbox send that the tier still counts, and a delivery event on the wrong configuration set or an unsigned code.
Release status
Docs update
docs/internal/workflows-email-sending-tiers.mddocuments the sandbox metric and the delivered event.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (implementation). Review by Codex, GPT-6.1 Sol.
Split out of #605 and #606 so each PR passes upstream's merge rules: a migration does not share a PR with
nodejs/, and Python does not share a PR with Node. The code is carved by file from those reviewed heads without changes; the stack's tip has the same tree as #606.Skills:
tdd,/writing-tests,pr-description,merge-risk.Public artifact: all test data is invented.
Decisions
master, so each layer passes once the layers below it landemail_sentfor the workflow metrics tab, addemail_sandbox_sent, and subtract it in the tier per day and in the allowance per workflow, floored at zeroemail_sandbox_sentstays a team app metric; master's SES counters count each call once, so nothing counts twiceInvolvement: no grilling rounds; design pass carried from #605 and #606 (the code is unchanged); review (GPT-6.1 Sol, 1 round and a final read, 1 finding fixed); proof captured as test output and a live run; master merge on 2026-10-31: review of its conflict resolutions (GPT-6.1 Sol, no findings) and a fresh live run at the slice tip.
🤖 Generated with Claude Code