Skip to content

feat(skills): move Amazon SES sends to PostHog - #464

Draft
Silthus wants to merge 581 commits into
mainfrom
feat/migrate-email-amazon-ses
Draft

Silthus wants to merge 581 commits into
mainfrom
feat/migrate-email-amazon-ses

Conversation

@Silthus

@Silthus Silthus commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Parked until after 2026-11-25. Michael chose SendGrid as the first migrate-email provider on 2026-11-14; this PR stays a draft and resumes after that date, with the slim pass from research/2026-11-14-review-bloat-retro before its next review round.

Problem

A person who sends with Amazon SES and asks to move those sends to PostHog gets no help: migrate-email covers Resend and, with #459 and the PRs stacked on it, SendGrid, Postmark, Mailgun, Loops and SMTP, but has no Amazon SES variant.

With this PR, migrate-email-amazon-ses moves Amazon SES sends to PostHog's email send in each language where both the AWS SDK and PostHog have one, and wizard migrate amazon-ses runs it.

Important

Built on #472, the core migrate-email skill, which has merged. It no longer needs the other provider PRs: each adds its own provider and lands in any order. The lists they all touch, config.yaml, AGENTS.md and the skill test, conflict in one line each as they land.
It adds one provider folder, one config variant, one AGENTS.md row and the provider in the bundle test. The shared steps it uses come from #472.
Like #459, it waits for the PostHog SDK releases with the code-form email send. Nothing merges until code sends are live and usable for customers: Michael's rule for #451 and every PR stacked on it.
The base is main since #472 merged; 73f702d merges main in.

Impact

Sends that arrive with migratedFrom: 'amazon-ses' show whether people use this skill to move off Amazon SES. Read it 14 days after the Wizard runs migrate as a family.

Merge risk

Caution

🔴 Merge risk: high · two-way door until the next context-mill release ships the skill; one-way door once agents run it: a migration's changes persist in each app's code and PostHog account

  • Everyone who runs wizard migrate amazon-ses goes from no Amazon SES variant to one whose agent rewrites their send code. A wrong instruction in the skill silently changes how the agent rewrites those sends, such as a throttled send no longer retried, a network failure taking another path, a template rendered differently, or a suppressed address mailed, and it reaches every such run once the next context-mill release ships the skill after merge.
  • Moved sites in more than one Region or AWS account, or whose configuration sets leave out BOUNCE while another moved site's suppresses it, go from Amazon SES checking each send against its own account's and Region's list and its set's reasons to PostHog checking one project-wide list that holds every imported entry. PostHog refuses a moved send only for an entry imported as a bounce, so only BOUNCE entries count here. PostHog then refuses mail Amazon SES delivered, and the rewritten code treats that refusal like a sent email, so nothing in the app shows it: silent non-delivery. Since ea4f117 such sites move only with the person's yes, and otherwise stay with suppression list wider than Amazon SES's; since b01f9d5 a later run also asks before its import widens the list for sites an earlier run moved. The agent working out which sites the list widens is uncovered until the live run.
  • A deployment that runs the moved code but sends into another PostHog project gets no import in the run: its moved sends mail addresses Amazon SES suppressed for a bounce until they are imported there. The report lists it under "Not imported" with its account ID, Regions and reasons, and gives a re-import into that project, right before the code deploys there and weekly while any site stays on Amazon SES. Since 10624e8 it no longer asks for a hand add in PostHog, which records a manual entry that doesn't block a moved send. Since 3918294 that re-import names the deployment and its AWS account ID, confirms the MCP is on the project the report records for it, and takes the deployment's whole record each time (d5fdf52). Since 248342d the run records each such deployment's sites with their lists and reasons, carried across runs; the re-import works out which of them its own entries refuse, asks about another app's import, gathers every site the import could refuse (those recorded sites, every other "Not imported" entry recorded as sending into that project, another AWS account of the same deployment included, this app's moved sites in the migrated project, named as mapping.md does, and the other app's), keeps only those its BOUNCE entries reach beyond their own list and reasons, counting a site with unknown lists as reached, imports when there are none, and otherwise asks each time, naming them per deployment and what a no costs, and stops without a yes.
  • A site whose IAM policies, judged together as AWS does, limit its send action, by a Resource limit on the ARNs the send uses or any Condition, such as on ses:Recipients, ses:FromAddress or aws:ResourceTag/<key>, in a way that could refuse one of its sends, stays unless the person agrees: Amazon SES refused sends outside that limit, and PostHog's project key has none. A policy the code doesn't hold depends on the person's answer, and no answer keeps the site.
  • The import also reaches the project's other sends: a bounce entry it adds blocks every transactional send of that PostHog project, such as native sends or sends moved from another provider, as feat(migrate-email): move Resend sends in every PostHog SDK's language #472's Step 5 import does for every provider. The re-import's widening check names only Amazon SES sites, the moved ones and another app's the person names.
  • An address PostHog already holds keeps its entry whatever a later import sends, as PostHog's import tool says for every provider. One an earlier import stored as a complaint, or a person added by hand, stays open to moved sends when Amazon SES later suppresses it for a bounce. Within one import, 0dd749d merges every list's entries per address with bounce winning; across imports the fix belongs in PostHog's import.
  • An address Amazon SES suppressed for COMPLAINT gets the moved sends: PostHog imports it as a complaint, which blocks only its marketing email, as feat(migrate-email): move Resend sends in every PostHog SDK's language #472's Step 5 and report say for every provider.
  • Every other bundle is unchanged: the shadow diff against main (8cd7381) shows only the new migrate-email-amazon-ses bundle, whose 21 shared files are byte-identical to migrate-email-resend's, and its manifest and menu entries.
  • Uncovered: the live run of this migration on a real app, which waits for the released email SDKs, and real customer send code and Amazon SES accounts (prod-shape), which no store holds. Until they run, a wrong rewrite shows only in a person's app after they deploy.
  • Switch-off: none: live with the next context-mill release, fix forward. A revert only stops new runs; a migration an agent already ran stays.
  • Tier: critical: the skill rewrites how apps send email, and its failure is silent non-delivery; agents decide process only, and the gaps stay Michael's.

Rollout

  • Decided: high; two-way door until the next context-mill release ships the skill, one-way once agents run it; no switch-off, since a revert only stops new runs. Set in the final pass of this stack.
  • Watch: no alert. Sends with migratedFrom: 'amazon-ses', as the Impact section says.

Summary

references/amazon-ses/ holds the three files each variant has:

  • sdk-reference.md: the v2 and v1 Amazon SES APIs in the AWS SDKs for Node.js, Python, Ruby, PHP, Go, .NET, Rust and Java, the community ex_aws_ses in Elixir, the HTTP API, SMTP, Nodemailer's SES transport and framework mailers, with which sends belong to the v1 clients and which to the v2 ones. It covers AWS credentials and roles, the Region and endpoint setting each SDK picks its host with (boto3 reads AWS_DEFAULT_REGION, the other SDKs AWS_REGION), how each reports errors (v2 answers too many requests with TooManyRequestsException and 429, v1 with Throttling and 400), stored and inline templates, status reads, webhooks through configuration sets and SNS, and the APIs that are not sends.
  • mapping.md:
    • Fields. Each v2 and v1 field maps to PostHog's or names what keeps a site on Amazon SES: Headers, EmailTags, ListManagementOptions, feedback forwarding, identity ARNs, EndpointId, TenantName, raw MIME sends, bulk sends, Nodemailer's SES transport, SMTP and framework mailers. A Charset moves when it spells UTF-8 in any case, with or without - or _. A ReplyToAddresses value from an env variable moves when .env.example, the config or the person shows a bare address. Sites with CcAddresses, BccAddresses or Attachments stay, because no PostHog SDK takes them yet.
    • Configuration sets. A ConfigurationSetName, or the identity's default set when the send names none, moves unless a webhook handler matches the set's events by message id or tag, or the set requires TLS (TlsPolicy: REQUIRE) or limits delivery time (MaxDeliverySeconds below 50400), signs with S/MIME (MessageSecurityOptions.SigningScheme.SmimeScheme) or archives to Mail Manager (ArchivingOptions.ArchiveArn), which PostHog's send can't do. The plan notes that the set's destinations stop getting the site's events.
    • Tracking. Opens and clicks are worked out per site: a ConfigurationOverrides.Tracking value first (ENABLED takes effect only under the conditions AWS documents), then VDM engagement tracking from the set or the account, then an enabled event destination that lists OPEN or CLICK. Tracking never maps to captureEngagement: PostHog adds its open pixel to every email and counts no clicks for a sensitive send: the code form, or a template made in PostHog marked sensitive. Opens untracked move only with the person's yes, as Step 3 asks under "Opens the provider didn't track", else stay (open tracking off); a site whose set or account open tracking can't be read stays (open tracking not checked). Every site that moves, with opens tracked or with the person's yes, gets a plan-row note that PostHog counts no clicks when Amazon SES tracked them, or nobody can tell, and the site moves to a sensitive send. When Amazon SES didn't track its clicks, or nobody can tell, and it moves to a template made in PostHog, the person is asked to mark the template sensitive; if they don't, the site stays with click tracking off or click tracking not checked, as Step 3 says.
    • Errors. Never widen a catch. A branch on TooManyRequestsException or v1 Throttling checks status 429, and a retry on it skips quota_limited. A branch on BadRequestException or status 400 reads validation_error, and in a v1 site also status 429, since v1's 400 took throttling. Rust branches move like Go's, through EmailError's status() (an Option<u16>) and kind().as_str(). In Go, Rust and Elixir, a branch that matched only Amazon SES's answers skips network_error, so a network failure takes the path it took before. Any other Amazon SES error name keeps the site. Python, Ruby and .NET raise network_error again before the handler logs, since ClientError and the service exceptions never covered a network failure; .NET puts a when (e.Code != "network_error") filter on the catch. When a later handler of the same try, such as except BotoCoreError or catch (Exception), took every network failure, PostHog's catch runs that handler's code for network_error instead. A handler of one kind of network failure, such as except EndpointConnectionError, keeps the site (moves: no — catches one kind of network failure). Several handlers on one try become one catch that branches in their order, as Step 7 says. Deadlines follow feat(migrate-email): move Resend sends in every PostHog SDK's language #472's shared rule, and mapping.md "HTTP" names which count. A raw HTTP request that never retried, such as fetch with AbortSignal.timeout(5000), keeps its timeout and moves, unless Step 7 says the SDK can't keep it, such as axios's or ky's timeout, or a limit on connecting alone. A library's default timeout is no deadline. These keep the site, because the moved send would retry differently: a deadline on an AWS SDK or aws4fetch AwsClient call, a timeout or retry setting in the AWS client's config, and a raw HTTP client that retries the POST (a retry setting alone stays with its own reason). The agent traces a signal, context, or token back through the callers: one built from a timeout is a deadline. One that only cancels, or a deadline the runtime sets, such as Lambda's, is not. Callers with different deadlines keep a site whose send can't take the signal. A base AWS exception handler, or one guarding other AWS calls, stays next to PostHog's. Raw HTTP sends fail as their client did.
    • Templates. A stored template send moves by bringing the template into the code, as feat(migrate-email): move Resend sends in every PostHog SDK's language #472's template-to-code.md says: the code renders its subject, HTML and text from the object of TemplateData. An inline template (Content.Template.TemplateContent) moves the same way from the content the code passed, and stays when it uses more than {{name}} or a path. The Handlebars table covers values, if, unless, each, with, lookup, inline partials and whitespace control, with Handlebars truth written out for if and unless, and names what keeps a template on Amazon SES (other helpers, {{amazonSESUnsubscribeUrl}}, and a {{#with}} whose value can be 0, since the Handlebars docs don't say whether 0 is empty for with). A template made in PostHog, with Liquid, only when the person asks for one: values that hold HTML, triple braces, other helpers, partials, @index and ../ keep that path closed. For a template made in PostHog, a printed value that a send can leave out or pass as null is checked in the code before the send, only where the branch that prints it runs, since Liquid renders it empty where Amazon SES failed the render.
    • Auto Validation. A site whose sends Amazon SES Auto Validation covers, by its set's ValidationOptions or else the account's ValidationAttributes, stays in any deployment that runs it (Amazon SES Auto Validation checks its recipients): PostHog has no per-recipient check. When the deciding setting can't be read, the agent asks, and no answer counts as on.
    • Sending turned off. A site whose configuration set has SendingOptions.SendingEnabled false, or whose account in its Region has SendingEnabled false, an EnforcementStatus of SHUTDOWN, or no production access (the sandbox, which sends only to verified addresses), stays (Amazon SES sending is off for it, the Amazon SES account is in the sandbox), since Amazon SES delivered nothing, or only to verified addresses, and PostHog would deliver it. It moves only when the person explicitly agrees, and its plan row records that agreement. An unreadable setting is asked, and no answer counts as off. On the same terms, a site whose sending role or identity policy allows its send action (ses:SendEmail, ses:SendTemplatedEmail, or a wildcard that covers it) only on some ARNs in Resource or only under a Condition, whatever its key, or denies it on some or under one, stays when the limit could refuse one of its sends (an IAM policy limits its sends). The policies are judged together, as AWS does: a wider Allow among the role's own policies cancels a narrow one, while a permissions boundary, session policy or SCP limits on its own, and a Deny always does: the agent reads the app's infrastructure code and each identity's Policies, asks about policies outside the code, and no answer counts as limited.
    • Suppression list calls. PutSuppressedDestination, DeleteSuppressedDestination and CreateImportJob are not sends and stay on Amazon SES; feat(migrate-email): move Resend sends in every PostHog SDK's language #472's Step 3 and Step 5 say what to do with them.
    • Webhooks. Each eventType maps to a $workflows_email_* event, and a click maps to $workflows_email_link_clicked only for a template made in PostHog that is not marked sensitive: PostHog counts no clicks for a code send. A handler that matches by mail.messageId or mail.tags keeps every site whose events reach it: the sites naming its set, the sites naming no set when it hangs off the identity's default set, and every site of an identity whose SNS notifications feed it. A site whose tracked clicks reach any handler that acts on Click events moves only to a template made in PostHog that is not marked sensitive, else stays (its clicks feed a webhook handler), as on Resend: PostHog counts no clicks for a code send. A handler that acts on an event with no PostHog event that the site's sends can produce (Reject and DeliveryDelay; Rendering Failure for a templated send; Subscription for a ListManagementOptions send) keeps the site (its <event> events feed a webhook handler), as on Resend.
    • Client. The AWS SDK package and credentials stay while other AWS services use them.
  • account.md: Easy DKIM, custom MAIL FROM and DMARC records next to PostHog's, per Region and endpoint. Template content, configuration sets with their suppression, VDM and TLS settings, the account's VDM, suppression, Auto Validation and sending status (SendingEnabled, EnforcementStatus, ProductionAccessEnabled), each set's SendingOptions, each identity's default set and sending authorization Policies, for the IAM recipient rule, each identity's SNS notification topics (get-identity-notification-attributes, since get-email-identity doesn't return them), and the suppression list come from AWS CLI commands the person runs, or from a read-only IAM key with eight read actions that they delete at the end of Step 5; commands run without an inherited session token, and a template file lost after that is read again by the person's CLI command. The import pages through the account-level list in each Region and takes each entry whose reason (BOUNCE or COMPLAINT) applies to at least one moved site, by its set's reasons or the account's, as PostHog's bounce or complaint. Only a bounce entry refuses a moved send. A set whose SuppressionOptions is {} or lists no reason turns suppression off; one that is null or overrides only SuppressionScope keeps the account's reasons. A moved site whose reasons leave out BOUNCE, or in another Region or AWS account than a BOUNCE entry's list, moves only with the person's yes. It names where people add entries by hand (console, put-suppressed-destination, an import job) for feat(migrate-email): move Resend sends in every PostHog SDK's language #472's Step 3 question, which leaves out sites whose sends Amazon SES checked against no reason. After an earlier run, found by its report, by the provider name on the PostHog client, or by asking the person whether a migration from any app imported into the project, the import also takes the lists and reasons the earlier import took, by AWS account ID and Region, read from posthog-migrate-email-amazon-ses-report.md or asked of the person, and asks before adding any that the earlier sites would get. A deployment that sends into another PostHog project gets no import; the report lists it under "Not imported", carried by later runs as recorded, with a re-import into that deployment's project, named by deployment and account ID and confirmed against the active project, before deploy and weekly. The global suppression list and contact list unsubscribes are left out, with the reason why.

The mapping names PostHog's fields, client and errors through the rewrite file for the site's language, from #472: one references/rewrite-<language>.md per PostHog SDK (Node.js, Python, Go, Ruby, PHP, .NET, Rust and Elixir), and Step 7's single list of what every SDK's send takes.

Evidence

  • Lane gate on d23dd92: vitest run scripts passes 344 tests, including the core's "Step N says under" pointer check on the Amazon SES bundle, and node scripts/build.js builds with a clean tree.
  • Shadow diff on d23dd92 against main 8cd7381: 288 bundles before, 289 after; only migrate-email-amazon-ses is new, its shared files are byte-identical to migrate-email-resend's, and manifest.json and skill-menu.json gain its entries. Every other bundle is byte-identical.
  • Forward merge of feat(migrate-email): move Resend sends in every PostHog SDK's language #472 at 8ead8e1 (7f3f7ef, no conflicts). The folder then follows the core's shared deadline rule (4bc0c7f, 3b0eee8, 8058b02, 0f0a1f8, fe11d8c): a raw HTTP request that never retried keeps its timeout and moves; an AWS SDK or aws4fetch deadline, a timeout or retry setting in the AWS client, or a raw HTTP client that retries the POST keeps the site. Click and key cleanup text now points at Step 7 and Step 5.
  • Second forward merge of feat(migrate-email): move Resend sends in every PostHog SDK's language #472 at 7ccc0ee (4f3b5c9, no conflicts), which adds the shared rules for a branch on one kind of network failure and for a connect-only or split timeout. f0db321 defers to both: "HTTP" points to Step 7 for limits the SDK can't keep and names one-number requests and httpx timeouts, and the errors bullets name a handler of one network failure kind as a stay, as Step 7 says. Final read 15 on f0db321 (both families): correctness clean; fresh eyes found this description behind the head, fixed here, and library default timeouts in httpx and ky, which is a question for feat(migrate-email): move Resend sends in every PostHog SDK's language #472's shared deadline rule.
  • Third forward merge of feat(migrate-email): move Resend sends in every PostHog SDK's language #472 at f658354 (6e3e43b, no conflicts), which settles library-default timeouts, the kinds of axios's and ky's timeout, Ruby's whole-request limits, untracked clicks, and the message ID's format. 14c8813, 6dab8eb and 0fcee1e agree with it: "HTTP" no longer lists axios's or ky's timeout as kept, names got's timeout.request, and points to rewrite-ruby.md for which Net::HTTP and Faraday timeouts the SDK keeps; and an untracked-click site asks for a sensitive template, as Step 3 says. Final read 16 on 14c8813 (both families): correctness clean; fresh eyes found this description behind the head, fixed here, and the Net::HTTP wording, fixed in 6dab8eb; final read 17 found that wording stricter than rewrite-ruby.md, so 0fcee1e defers to it.
  • Fourth forward merge of feat(migrate-email): move Resend sends in every PostHog SDK's language #472 at 17c6ca1 (95b52d2, no conflicts), the last planned one: untracked opens, "must be marked sensitive" notes, real-SDK tests in Step 8, and the stay for a handler acting on an event with no PostHog event. 47fc6c3 follows it: an untracked-opens site moves only with the person's yes, as Step 3 asks under "Opens the provider didn't track", else stays with open tracking off; unread VDM or set settings stay with open tracking not checked; account.md points Step 3 to the reads that tell it; and a handler acting on Reject, Rendering Failure, DeliveryDelay or Subscription keeps the site. The folder had no sensitive-note or mocked-test text to change. Final read 19 on 47fc6c3: correctness clean; fresh eyes found the click notes missing for sites that move with untracked opens and the event stay too wide for events a send can't produce, both fixed in 2dd9392, and that feat(migrate-email): move Resend sends in every PostHog SDK's language #472's section-pointer test builds only Resend's bundle, a core Follow-up (a throwaway run on the Amazon SES bundle passes). Final read 20 on 2dd9392: correctness clean; fresh eyes found the no-clicks note missing when click tracking can't be checked, fixed in ab3c64e.
  • Suppression union (ea4f117), from the proof gate's risk judge on ab3c64e: a moved site whose Region or configuration-set reasons differ from another moved site's had its PostHog sends refused where Amazon SES delivered them, with only a plan-row note, and the rewrite logs that refusal and goes on. Such sites now move only with the person's yes, else stay, and account.md names them for the report. A site that uses the message id of a refused send now stays (uses the message id of a suppressed send), as on Resend. Final reads 22 to 43 covered it, below.
  • Fifth forward merge of feat(migrate-email): move Resend sends in every PostHog SDK's language #472 at 090ac92 (2b33dc4, no conflicts): Step 8 tests never mock the PostHog send, the pointer check runs for every provider, Step 5's "Re-import only" with a weekly re-import while any site stays on the provider, and project-get for the token. The folder had no re-import, token or mock text to change. 6a5e5d7 adds what is specific to Amazon SES: a moved send no longer names its Region or configuration set, so the report records the Regions and reasons the first import took, and a re-import takes the same.
  • Final reads 22 to 43 (both families, on 6a5e5d7, 7676984, b01f9d5, ec69730, 3265715, a8b894c, 53abfa3, 8a0a092, f2735b7, 6286105, a970687, 88b846c, 81ebe8e, 4e3fb63, fcc18cb, b23e591, bf6e9c5, eb0e57b, dccbd62, 987aa08, fc62648 and 429a566): a re-import reads the earlier import's Regions and reasons from posthog-migrate-email-amazon-ses-report.md under "Suppression list", or asks the person, and stops before importing when neither can say (7676984). A later run counts the earlier import as one more moved site and also asks before its import adds a Region or reason that the sites the earlier run moved would get. It spots an earlier run by its report or by the provider name on the PostHog client in each SDK's spelling, and otherwise asks the person once whether a migration from any app, such as another repository on the same account, imported into the project (b01f9d5, ec69730). The report records the Regions and reasons an import took even when a list was empty, and names the earlier sites a later run widened (ec69730). Each list is keyed by AWS account ID and Region, with the reasons that applied to a moved site whether or not entries existed. Every run outside a re-import asks once about another app's import, and the question names every earlier moved site from the code and the report (3265715). The agent asks which AWS account each site sends with, checks each read's credentials with aws sts get-caller-identity before reading, stops on another account, and keys the import and the widening check by account and Region (a8b894c). The STS check runs without the app's SES endpoint, the account ID comes from the app's own credentials or role and is checked against any the repository shows, and the list-changing calls, the report's widened line and the template rule name the account with the Region (53abfa3). The account is the one the SES client's credentials or assumed role belong to, checked against the repository's role ARN or deployment config; the agent asks which deployment when there are several, leaves sending-authorization identity ARNs out, stops when the IDs still differ, and reads templates per account and Region (8a0a092). When the code runs in several deployments, each that sends into the PostHog project counts as an account the sites send with, and a template site moves only when its content is the same in each (its template differs between deployments otherwise); the person reads the ID with get-caller-identity where the app runs or from the role (f2735b7). Such a site counts once per deployment in every check, with that account's templates, sets and lists, and moves only when it would move in each; every deployment that runs the code counts by its account and Region, whatever PostHog project it sends into, and a site stays when a deployment's account can't be read; only the suppression import is limited to the migrated project, and the report names the other projects' lists (6286105, a970687). The agent asks every run which deployments run the code and which account each sends with, using Terraform or CDK only to check the answers; a deployment it can't read keeps its sites (its AWS account in <deployment> not checked) and the run goes on, and the report names the account, Regions and reasons another project should import (88b846c). Each deployment's account comes with its Regions, read only there (81ebe8e). As in the core, the run imports into the migrated project only: for a deployment into another project, the report names the entries to add there by hand, and says when two lists would widen that project's (4e3fb63). The report keeps those deployments under "Not imported", which no re-import or later run takes, and gives each one's read per Region with the hand add before deploy and weekly (fcc18cb). That read pages and keeps the client's endpoint, and a later run carries the earlier report's "Not imported" deployments forward (b23e591). The read starts with the STS account check (bf6e9c5). A carried deployment keeps its recorded account, Regions and reasons, since they belong to sites that no longer send with Amazon SES; only its project follows this run's answers. In the migrated project its record stays unchanged, and each run compares it both ways with what this run's and earlier imports take: next to the record, the report names the lists it still needs by hand, whom that add affects, and the lists PostHog now refuses its sends for; the check, read and add cover only the first, and it gets its add now (eb0e57b, dccbd62, 987aa08, fc62648, 429a566). The MessageId row now keeps a site that returns or stores the id, matching the suppressed-send rule (7676984).
  • ReviewHog on 429a566 and two older open threads, fixed in 5adde11: a site whose sends Amazon SES Auto Validation covers, by its set's ValidationOptions or the account's ValidationAttributes, now stays (Amazon SES Auto Validation checks its recipients), since PostHog has no per-recipient check; and a PostHog template's value that a send can leave out or pass as null is checked in the code before the send, since Liquid renders it empty where Amazon SES failed the render. The thread on a suppressed send's missing message id was already covered by ea4f117. All three threads are answered and resolved. Final read 44 scoped both fixes (7f8377c): Auto Validation has its own section, so it counts in every deployment, the agent asks whenever the deciding setting can't be read, the missing-value check covers only printed values, and a set overriding only ValidationOptions keeps the account's reasons. Final read 45 limited the check to the branch that prints the value (155e54b), and final read 46 left its example on a boolean only (f61e261). ReviewHog on f61e261 found that a set's S/MIME signing (MessageSecurityOptions.SigningScheme) and Mail Manager archive (ArchivingOptions.ArchiveArn) were not read; both now keep the set's sites, since PostHog's send does neither (36c5348), and both threads are answered. Final read 48 narrowed signing to SmimeScheme, since DefaultScheme adds no signature, and has the agent check that the AWS CLI knows the signing, archiving and Auto Validation settings, which otherwise count as unread and keep their sites (b6f245f); final read 49 ran that check with the CLI that does the reads and left a missing Auto Validation field to the Auto Validation rule (7620051); final reads 50 to 52 replaced the per-field fallbacks with one rule: the agent checks that the AWS CLI names every set and account field the skill reads, runs no reads until it does, and keeps every site (its Amazon SES settings not checked) when the person can't update it (d96d763, 5841b06, 3a996f2); final read 53 moved that check to the top of "Configuration sets" and final read 54 made it read the input skeletons of create-configuration-set and the two account put-* calls, with --region, which need no groff, send no request and validate no stubbed answer (8c6a9b0, 29f712a). ReviewHog on 29f712a (must-fix) found that a configuration set with SendingOptions.SendingEnabled false was not read, so a moved site would resume delivery Amazon SES refused; the account's own sending pause, SHUTDOWN status and sandbox are the same class. All now keep their sites unless the person explicitly agrees, recorded in the plan row (6c0843b). Final read 56 made the configuration-set row defer to that agreement (b36fa9a), and final read 57 was clean. ReviewHog on b36fa9a (should-fix) found that the {{#with}} row used if's truth test, which sends 0 to {{else}}; the docs say only "empty" for with, so a with that can take 0 now keeps the template (703962c). Final read 58 was clean on correctness. ReviewHog on 703962c (should-fix) said PostHog drops Amazon SES's ses:no-track and tracks those links. Disputed finding: feat(skills): move Amazon SES sends to PostHog #464 (comment), PostHog sends through Amazon SES in ses mode, which keeps each anchor's attributes, so ses:no-track still reaches Amazon SES, and PostHog's own link-tags.ts recognizes it.
  • feat(migrate-email): move Resend sends in every PostHog SDK's language #472 merged (418cc5a, main 8cd7381). 49aa120 merges the former base and 73f702d merges main; the one conflict, the skill test, had the same blob on main and 418cc5a, so the branch's version stands. 0e7e0e3 maps BOUNCE to PostHog's bounce and COMPLAINT to complaint, counts only BOUNCE entries as refusing a moved send, names where Amazon SES entries are added by hand for the new Step 3 question, and drops the "entries that count" text Step 5 no longer reads. Final read 59 was clean on correctness; fresh eyes found this description stale and asked what a hand add in PostHog records. PostHog's source settles it: add_manual_suppression writes a manual entry without hard_bounced_at, so it doesn't block a transactional send, while the import marks a bounce entry hard-bounced. 10624e8 therefore gives a "Not imported" deployment a re-import into its project instead of a hand add. Final read 60 found that this re-import went through Step 5's production-only project check, named the deployment only by its project, and could widen another app's project unasked; 3918294 keys it on the deployment and its account ID, confirms that project by name, switching or stopping as Step 5 does, and asks before widening. Final read 61 found that the question left out this app's own import into the migrated project, and that taking only the lists no import took skipped new bounces; d5fdf52 counts every earlier import, names this app's moved sites, and takes the whole record each time. Final read 62 found widening inside one deployment's own record unasked; b982006 recorded a widening answer in the run, and final read 63 found that a recorded no could never change and that two deployments sharing one project each recorded none. 407c66a drops the record: the re-import asks every time, naming every site it could refuse, and stops without a yes. Final read 64 found that the re-import couldn't know which of a deployment's own sites widen, missed earlier runs' moved sites, and asked with nothing to agree to; b457005 records those sites in the run, names this app's sites as mapping.md does, and asks only when a site would be refused. Final read 65 found that a later run's merge could add a list without marking the earlier sites; 248342d records every site with its list and reasons and works out widening at the re-import. Final read 66 found a deployment with two AWS accounts missed; 50d429f gathers every other "Not imported" entry for the project. Final read 67 found it asked about sites the import doesn't widen; f61304b keeps only the sites its BOUNCE entries reach beyond their own list and reasons, and 35cfefd, after final read 68, counts a site whose lists nobody can give as reached. ReviewHog on 35cfefd (1 must-fix) found that an IAM policy limiting ses:Recipients refused sends PostHog would deliver; 2e7aa20 keeps those sites unless the person agrees, and 82939da, after final read 70, covers ses:SendTemplatedEmail and wildcards and reads identity policies in account.md, where its endpoint and account checks apply. ReviewHog on 82939da (1 must-fix, 1 should-fix) found that a ses:FromAddress or ses:FromDisplayName condition refused sends from other senders; f95ef3e counts them too. Its should-fix, that an HTML-only send gains a text part PostHog makes from the HTML, was declined here as a content change that doesn't change whether a send goes out. Final read 72 added ses:FeedbackAddress and let a site whose every value is a literal the condition allows move; a51bf29 does both. Final read 73 found that test read recipients for a sender-only condition and left an unset key undecided; 3293a8d checks only the values the condition reads and counts an unset one as refusable. ReviewHog on 3293a8d (1 must-fix, 1 should-fix) found that a Resource limit on identity ARNs refuses sends like a condition does, and that PostHog's import keeps the first entry for an address, so a COMPLAINT entry from one list sent before a BOUNCE entry from another left the address open to moved sends; 0dd749d counts Resource limits and merges every list's entries into one per address before the first batch, with bounce winning. Final read 75 found a Resource limit can name configuration-set and template ARNs; 21a02e5 counts every Resource and Condition limit on the send action and checks each value it reads, under the reason an IAM policy limits its sends. Its other finding, that an address an earlier import stored as a complaint isn't upgraded by a later bounce, is PostHog's import keeping existing entries, shared by every provider, and is named in the callout. Final read 76 found the general rule counted a wider Allow, another principal's statement, or a condition about the caller, such as aws:SourceIp; 5a3513a judges the policies together, as AWS does, and counts only conditions on ses: keys. Final read 77 found that let a wide Allow cancel a permissions boundary, session policy or SCP, and dropped aws:ResourceTag conditions; 39a0937 lets a wider Allow cancel only among the role's own policies, keeps those limits on their own, and counts a condition whenever its value can differ between the site's sends. Final read 78 found that test skipped a constant condition every send failed; 1b387d9 counts every condition, and a value the code doesn't hold, such as a tag or the app's network, counts as one that could be refused, so the site moves only with the person's yes. Final read 79 found the question about policies outside the code didn't ask about network, Region or tag limits, where service control policies sit; d23dd92 names boundaries and service control policies and asks about every kind of limit.
  • Final pass reads: final reads 6 to 11 ran both families (correctness on GPT-6.1 Sol, fresh eyes on Claude Opus 5.5) on each fix head from 4bc0c7f; their findings tightened the deadline rule above. ReviewHog on fe11d8c found a set's MaxDeliverySeconds and click handlers, fixed in 9cc33c7; final read 11 widened the click rule to every click handler, as Resend has it, in 62d1721, and 4b30dd1 and 5894fad limit the no-clicks note to sensitive sends.
  • Test seams (migrate-email-skill.test.js): Amazon SES is in PROVIDERS, so the shared tests build migrate-email-amazon-ses with its three provider files and the eight rewrite files and no other provider's, and check that it is a wizard migrate subcommand in the menu the Wizard reads. The core removed its wording tests, so the template, migratedFrom and deadline rules are owed to the live run, recorded as a gap.
  • QA swarm: round 1 on 622ce8b, eight lenses (fresh-eyes, correctness, risk, design, anti-overengineering, sweep, and the author's and the wizard-docs owners' ReviewHog perspectives). Fixed in 54dfdae: the wording test, Region detection for boto3, Rust error branches, the SMTP pointer, a lost template file after the key is deleted, the cross-Region suppression note, the calls that change the suppression list, and the v1 and v2 send lists. Round 2 on 54dfdae (fresh-eyes, correctness, risk, design, anti-overengineering, systems, the author's perspective) found four, fixed in 6fc36d4: Rust's status() compares with Some(429), a Go, Rust or Elixir branch that matched only service errors skips network_error, the SMTP row drops a pointer the agent couldn't check, and a repeated pointer is gone. The final read on 6fc36d4 found nothing. ReviewHog then reviewed three heads: on 6fc36d4 it found the sibling-handler order, a later network handler that a raise or filter would skip, and the unread SNS notification topics, fixed in 2e89589, and an ENABLED tracking override without prerequisites, kept as written because the SES Developer Guide says it has no effect then; on 2e89589, send deadlines; on a2ab0e1, required TLS and empty suppression options, fixed in 60ae0c1. Final reads on 2e89589 (the .NET filter made the moved network handler unreachable, fixed in a2ab0e1), a2ab0e1 (a deadline needs more than a plan note, fixed in 60ae0c1) and 60ae0c1 (a scope-only suppression override keeps the account's reasons, fixed in 42a6e1d) found one each.
  • Gaps:
    • Live run. An agent run of this provider's migration on a real app needs the released email SDKs and the production send API; Michael's planned trial on generated codebases runs it after both land.
    • CI. Accepted while the base was not main. Since feat(migrate-email): move Resend sends in every PostHog SDK's language #472 merged, build.yml runs on this PR; the lane gate also ran vitest and build.js locally on HEAD.
Earlier dry runs, on heads before templates moved into the code (last at b3dac8e)

These runs predate this head's template rule and don't prove it. They shaped the field, tracking and error rules that still hold.

Dry run on c94a490. Claude Code on Sonnet 5.5 ran the built skill as a dry run, headless, with only read tools, on a fixture app with eleven Amazon SES sends in TypeScript, Python, Go and C#, on the v2 and v1 APIs, plus an SNS webhook route. The app runs with an IAM role, not AWS keys. The person's answers were in the prompt (one Region; VDM off; no default set; the set transactional publishes only bounces and complaints; the stored invoice template already made in PostHog); the expected outcomes were written before each run. The fixture was unchanged after the run.

Site Expected Result
welcome.ts: v2, To with a name, catch logs err.name and the status moves moved. Throws an error with code, name and statusCode, and the log reads err.code and err.statusCode. The plan notes the To line loses the name
receipt.ts: CcAddresses, a PDF attachment, ConfigurationSetName moves moved with cc and the attachment. Notes that transactional stops getting its events, and logs data.id where it logged MessageId (stays from b3dac8e: cc and attachments)
invoice.ts: stored template invoice stays: open and click tracking off stays, same reason: the template form takes no captureEngagement (old rule; now: stays, open tracking off)
digest.ts: SendBulkEmail stays stays: bulk send
trial.ts: ListManagementOptions stays stays: ListManagementOptions
export-ready.ts: Nodemailer's SES transport stays stays: Nodemailer's SES transport
support-reply.ts: v1, ReplyToAddresses from SUPPORT_EMAIL, Charset: 'utf8', a branch on 400 that returns false moves moved. replyTo reads the env value, Charset dropped, and the branch reads validation_error or status 429
worker/password_reset.py: boto3, except ClientError reads code and status moves moved. except EmailError raises network_error again, then returns True on recipient_suppressed and False on the rest, as before
worker/weekly_report.py: Headers with List-Unsubscribe stays stays: Headers
notifier/alert.go: errors.As on TooManyRequestsException, then re-queues moves; a 429 that is not quota_limited re-queues moved. StatusCode == 429 && Code != "quota_limited" returns ErrRateLimited; other errors are wrapped as before
PaymentFailedMailer.cs: .NET v1, catch logs ErrorCode and StatusCode and rethrows moves moved to Emails.SendAsync. catch (EmailException e) when (e.Code != "network_error") logs and rethrows, so a network failure passes unlogged as before; recipient_suppressed is logged first

Every moved site sends captureEngagement: false, worked out from the set and account settings (old rule; now: each of them stays, open tracking off, since neither the set nor the account tracked opens), and logs recipient_suppressed and goes on. The webhook route is listed: Bounce and Complaint by recipient address map to $workflows_email_bounced and $workflows_email_blocked, and the report names the webhook destination. The suppression section names both reasons as applying to every moved site, and gives the export command for the Region. Summary block: from: amazon-ses, sites_found: 11, sites_rewritten: 6, sites_left: 5, as expected.

What changed over the review, by rule. The invoice moved through run-113a4fe (11/7/4); the tracking rule then kept it, with its expected outcome rewritten first (11/6/5). At e6e1f3d the .NET site logged a network failure before it rethrew; c94a490 adds the when filter, and this run shows it.

Decisions

Question Answer Who Where
When this merges Not before code sends are live and usable for customers, for #451 and every PR on it 👤 Human this PR
Which providers Mailgun, Loops, SendGrid, Postmark and SMTP, plus the providers the Wizard detects that a real codebase sends transactional email from 👤 Human Silthus/posthog#461
Amazon SES tracking Work out opens and clicks from the override, VDM and the set's event destinations. Tracking never maps to captureEngagement: opens untracked move only with the person's yes, else stay (open tracking off), and unread settings stay (open tracking not checked), as Step 3 says; opens tracked moves, with a plan-row note when PostHog counts no clicks for a sensitive send that had them; untracked clicks ask for a sensitive PostHog template, or stay, as Step 3 says 👤 Michael this PR
Stack shape One PR per provider, each on #472, landing in any order 🤖 Agent #472
Templates A stored or inline template moves into the code by default, per #472; a template made in PostHog only when the person asks. Replaced moving every template to a template made in PostHog 🤖 Agent this PR
How the agent reads templates, sets and suppressions The person runs the AWS CLI with their own credentials. A read-only IAM key with eight read actions only when they choose it, used without an inherited session token, deleted at the end of Step 5 🤖 Agent this PR
Which suppressions move Each entry of the account-level list, per Region, whose reason applies to at least one moved site, merged into one per address with bounce winning, since PostHog keeps an address's first entry; a re-import or later run takes the Regions and reasons the report records from an earlier import, or the person names, and a re-import stops when neither can say; Step 5 and the report ask for it weekly while any site stays on Amazon SES. Each entry imports as PostHog's bounce or complaint, and only a bounce entry refuses a moved send, so PostHog's one list refuses mail Amazon SES delivered to a moved site whose reasons leave out BOUNCE or in another Region, so such a site moves only with the person's yes (suppressions widened: the person agreed, named in the report), else stays (suppression list wider than Amazon SES's); a later run asks the same before its import widens the list for the sites an earlier run moved 🤖 Agent this PR
A send with a configuration set Moves, unless a webhook handler matches the set's events by message id or tag, or the set requires TLS or limits delivery time, or signs with S/MIME, or archives to Mail Manager, or Auto Validation covers its sends, by the set's override or the account's setting; a set or account whose sending is off, or an account in the sandbox, keeps it unless the person explicitly agrees; the identity's default set and SNS identity notifications count too 🤖 Agent this PR
A branch on one Amazon SES error TooManyRequestsException and v1 Throttling check status 429, BadRequestException checks validation_error, a v1 400 checks both, in every language including Rust; any other name keeps the site. Replaced keeping every Rust branch. A branch that matched only service errors skips network_error in Go, Rust and Elixir 🤖 Agent this PR
Deadlines and retries A raw HTTP request that never retried keeps its timeout and moves when Step 7 and the rewrite file say the SDK can keep that limit, under #472's rule; a library default is no deadline. An AWS SDK or AwsClient deadline, an AWS client timeout or retry setting, or a raw client that retries the POST keeps the site. Signals and contexts are traced through the callers; runtime deadlines don't count 🤖 Agent this PR
Network errors after the move Raised again before the handler logs, in Python, Ruby and .NET, with a when filter in .NET, unless a later handler of the same try took the network failure: then that handler's code runs for network_error. A handler of one kind of network failure keeps the site, as Step 7 says 🤖 Agent this PR
IAM limits on a send A Resource limit on the ARNs a site's send uses (identity, configuration set, template) or any Condition, on its send action, judged with the role's other policies as AWS does (a boundary, session policy or SCP limits on its own), that could refuse one of its sends, checked only on the values it reads: one built at run time, left unset, not held in the code, such as a tag or the app's network, or a literal it doesn't let through, keeps the site (an IAM policy limits its sends) unless the person agrees, like the sandbox; no answer counts as limited 🤖 Agent this PR
The AWS SDK package after cutover Stays while other AWS services use it 🤖 Agent this PR
Proof kinds Live run, prod-shape and shadow diff, owed at high. The shadow diff runs against main, and against #472's head before it merged; the live run and prod-shape (no store holds real customer code or Amazon SES accounts) are gaps Michael accepted, as was CI while the base was not main 🤖 Agent this PR
Merge risk grade Medium: silent harm in the person's app at reach few. Round 1's Risk lens graded high through the rubric's 400-changed-lines raise while the live run is a gap 🤖 Agent this PR

Involvement: qa-swarm round 1 on 622ce8b (8 lenses, two of them ReviewHog perspectives), round 2 on 54dfdae (7 lenses), a clean final read on 6fc36d4, three ReviewHog rounds and final reads on 2e89589, a2ab0e1, 60ae0c1 and 42a6e1d, on top of 2 panel rounds and 17 final reads on earlier heads; then final-pass and core-merge final reads 6 to 21 in both families (correctness on GPT-6.1 Sol, fresh eyes on Claude Opus 5.5), ending clean on ab3c64e, and ReviewHog on fe11d8c; the risk judge on ab3c64e found the suppression union, fixed in ea4f117; final reads 22 to 43 and ReviewHog on 429a566 on the fifth merge and its fixes in 7676984, b01f9d5, ec69730, 3265715, a8b894c, 53abfa3, 8a0a092, f2735b7, 6286105, a970687, 88b846c, 81ebe8e, 4e3fb63, fcc18cb, b23e591, bf6e9c5, eb0e57b, dccbd62, 987aa08, fc62648, 429a566 and 5adde11, final read 44 on 5adde11, its fixes in 7f8377c, 155e54b and f61e261, final reads 45 to 47, ReviewHog on f61e261, its fix in 36c5348, final read 48, its fixes in b6f245f, final read 49, its fix in 7620051, final read 50, its fixes in d96d763, 5841b06, 3a996f2, 8c6a9b0 and 29f712a, final reads 51 to 55, ReviewHog on 29f712a, its fix in 6c0843b, final read 56, its fix in b36fa9a, final read 57, ReviewHog on b36fa9a, its fix in 703962c, final read 58, ReviewHog on 703962c (disputed), the merge of main after #472 with its fix in 0e7e0e3, final read 59, its fix in 10624e8, final read 60, its fix in 3918294, final read 61, its fix in d5fdf52, final read 62, its fix in b982006, final read 63, its fix in 407c66a, final read 64, its fix in b457005, final read 65, its fix in 248342d, final read 66, its fix in 50d429f, final read 67, its fix in f61304b, final read 68, its fix in 35cfefd, final read 69, ReviewHog on 35cfefd, its fix in 2e7aa20, final read 70, its fix in 82939da, final read 71, ReviewHog on 82939da, its fix in f95ef3e, final read 72, its fix in a51bf29, final read 73, its fix in 3293a8d, final read 74, ReviewHog on 3293a8d, its fix in 0dd749d, final read 75, its fix in 21a02e5, final read 76, its fix in 5a3513a, final read 77, its fix in 39a0937, final read 78, its fix in 1b387d9, final read 79, its fix in d23dd92, and final read 80. Proof: earlier dry runs and a prod-shape survey on older heads; the shadow diff on d23dd92; CI is green; the live run and prod-shape are gaps.

🤖 Agent context

Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5, high), as the migration-skills slice of Silthus/posthog#461. Reviews on GPT-6.1 Sol (high), the fresh-eyes lens on Opus 5.5; fixes on Opus 5.5 (high). Dry runs on Claude Sonnet 5.5 (claude-sonnet-5-5).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

Silthus and others added 28 commits November 5, 2026 12:55
A send with its own content and legacy substitutions stayed on SendGrid
only because SendGrid put the values in. The code now does the same
replace before the send, under the escaping rule of template-to-code.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Postmark template send now moves by bringing the template, inside its
layout, into the code and rendering TemplateModel there. A template made
in PostHog is used only when the person asks for one.

Moves now that stayed before: raw {{{x}}} and {{& x}} values, sections
on any value that is never a list, tested with Mustachio's truth test,
inverted sections used as fallbacks, ../ to any outer scope, and
template sends with opens or links untracked. The email carries the
CSS that InlineCss inlined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Mailgun template site now moves by bringing the version's HTML into
the code, rendered with its Handlebars semantics, with the version's
From, Subject, and Reply-To headers where the site sets none. A
template made in PostHog is used only when the person asks for one.

What moves that stayed before: t:text (the code writes the text part),
triple braces, if/unless on non-boolean values, each with else, @index,
@FIRST, @last, ../, with that can be missing or has an else, tracking
fields next to a template, and a send to one address with
recipient-variables, whose %recipient.<name>% values the code now puts
into the subject and content itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stored template sent with SendTemplatedEmail or SendEmail's
Content.Template now moves by bringing its subject, HTML, and text into
the code, rendered from the object behind TemplateData. An inline
template (TemplateContent) is rendered in the code too, where it used to
wait for a template made in PostHog.

Handlebars parts that kept a template on Amazon SES now move: raw and
HTML values, {{#with}}, {{lookup}}, inline partials, @index, @key,
../ and each over an object. A send with tracking off moves with
captureEngagement: false. A template made in PostHog is used only when
the person asks for one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Loops send renders an email stored at Loops, so no Loops site could
move unless the person rebuilt the email as a template in PostHog. Each
site now moves by bringing its Loops email into the code.

- The Content API's LMX, its theme, and its components become email-safe
  HTML, tag by tag; a preview send's source covers the dashboard way,
  MJML emails, and what LMX leaves out, such as social icon images.
- Data variables, fallbacks, every conditional section operator, and
  array blocks render in the code, with Loops' text truth test written out.
- Subject, preview text, Name, From, Reply, and language come from the
  email's settings; a data variable in them is rendered.
- Values the code builds as HTML, Nodemailer sends through smtp.loops.so,
  and the email settings with variables now move. CC, BCC, contact and
  event properties, number or boolean operators, and MJML unsubscribe
  links still keep a site.
- The Liquid conversion stays, for a template the person asks for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-email-mailgun

# Conflicts:
#	scripts/lib/tests/migrate-email-skill.test.js
…email-loops

# Conflicts:
#	scripts/lib/tests/migrate-email-skill.test.js
…il-amazon-ses

# Conflicts:
#	scripts/lib/tests/migrate-email-skill.test.js
A send of a template stored at Resend now moves by bringing the email
into the code: its HTML and text become a file next to the send, the
code renders the variables, and the site sends the code form. A
template made in PostHog, sent by its ID, is used only when the person
asks for one.

- template-to-code.md, from the provider stack (#459's 4b15d2e), as is.
- Steps 3, 7 and 9 and description.md: the same change as 4b15d2e,
  ported onto this base's text.
- Resend: a "Templates" part with the in-code table. Resend never
  escapes a value, so the shared escaping rule applies. A fallback
  covers a missing value only, since Resend inserts "" as it is. A
  value the site passes for from, reply-to or subject wins over the
  template's, as Resend does. The Liquid conversion moves under
  "Templates made in PostHog".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pture is on

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…of turning engagement capture off

captureEngagement only decides whether engagement events land on the
recipient's person. PostHog still adds its open pixel and never rewrites
a code send's links, so provider tracking never maps to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…of turning engagement capture off

captureEngagement only decides whether engagement events land on the
recipient's person. PostHog still adds its open pixel and never rewrites
a code send's links, so provider tracking never maps to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f turning engagement capture off

captureEngagement only decides whether engagement events land on the
recipient's person. PostHog still adds its open pixel and never rewrites
a code send's links, so provider tracking never maps to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is on

captureEngagement only decides whether engagement events land on the
recipient's person. PostHog still adds its open pixel and never rewrites
a code send's links, so provider tracking never maps to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urning engagement capture off

captureEngagement only decides whether engagement events land on the
recipient's person. PostHog still adds its open pixel and never rewrites
a code send's links, so provider tracking never maps to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d of turning engagement capture off

captureEngagement only decides whether engagement events land on the
recipient's person. PostHog still adds its open pixel and never rewrites
a code send's links, so provider tracking never maps to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus changed the base branch from feat/migrate-email-all-sdks to main November 13, 2026 16:26
Silthus and others added 13 commits November 13, 2026 16:27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ter #472

BOUNCE imports as bounce and COMPLAINT as complaint. PostHog refuses a moved send only for a bounce entry, so the widening checks count only BOUNCE entries. Name where Amazon SES entries are added by hand for Step 3's question, and drop the entries-that-count text Step 5 no longer reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nces instead of a hand add

A hand add in PostHog's Suppression list is a manual entry, which blocks only marketing email, so it doesn't stop a moved send. The report now gives a re-import for that deployment's project, which writes bounce entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ployment and project

The prompt names the deployment and its AWS account ID. The re-import confirms the active project is the one the report records, switching or stopping as Step 5 does, and asks before it widens a project another import used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… re-import widens a project

The consent question covers every earlier import into the target project, this app's run and re-imports included, and names the moved sites it would refuse. Each re-import takes the deployment's whole record, so a list's new bounces reach PostHog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment's import widens, and record it

The run works out widening per deployment, its own lists and BOUNCE reasons included, asks once naming the refused sites per deployment and the cost of a no, and writes widening: agreed, declined or none. The re-import follows that record and asks again only for an import the record doesn't name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t instead of recording consent

A recorded widening answer couldn't change after a no and missed two deployments sharing one project. The re-import now asks each time, naming per deployment every site the import can refuse and what a no costs, and stops without a yes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t's own record, and ask only when a site would be refused

The run names, per deployment, the sites its own entries would refuse, with their lists and reasons. The re-import asks first about another app's import, names this app's moved sites as mapping.md does, and imports without asking when no site would be refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reasons, and work out widening at re-import

A merged record can gain a list, and moved code no longer names its Region, so the report keeps each site's list and reasons and the re-import works out the widening sites over all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… another account of the same deployment included

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its BOUNCE entries reach beyond their own list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed by a not-imported re-import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 35cfefd: 1 Must fix.

This is review round 11 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.

Silthus and others added 2 commits November 13, 2026 17:21
An IAM policy that allows SendEmail only for some ses:Recipients refused
sends outside it; PostHog's project key has no such limit. Keep those
sites unless the person agrees, like the sandbox rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ipient rule

Count a ses:Recipients condition on ses:SendTemplatedEmail and on
wildcards too, and read identity policies in account.md, where the
endpoint and account checks apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 82939da: 1 Must fix, 1 Should fix.

This is review round 12 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.

Silthus and others added 3 commits November 13, 2026 17:41
A ses:FromAddress or ses:FromDisplayName condition refused sends from
other senders, which PostHog would deliver from a verified domain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… amazon-ses sites

Add the last Amazon SES address condition key, and let a site whose
every value is a literal the condition allows move without asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… reads

An unset value counts as one the condition could refuse, and a run-time
recipient no longer keeps a site whose condition reads only the sender.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 3293a8d: 1 Must fix, 1 Should fix.

This is review round 13 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.

Silthus and others added 6 commits November 13, 2026 17:55
…M Resource limits

PostHog keeps the first entry for an address, so merge every list's
entries first with bounce winning. A Resource limit on identity ARNs
refuses sends like a condition does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n amazon-ses send

A Resource limit can name configuration sets and templates as well as
identities, and a condition can test any key; check every value the
limit reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only send keys

A wider Allow, another principal's statement, or a condition about the
caller doesn't limit the app's sends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e amazon-ses IAM rule

A boundary, session policy or SCP limits whatever the role grants, and a
condition counts when its value can differ between sends, such as
aws:ResourceTag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A value the code doesn't hold, such as a tag or the app's network, counts
as one the limit could refuse, so the site moves only with a yes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ide the code

Name boundaries and service control policies, and network, Region and
tag limits, in the question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus marked this pull request as draft November 14, 2026 17:46

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed d23dd92: 1 Should fix.

This is review round 14 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.

- A timeout or retry setting in the AWS client's config, such as `requestTimeout`, `maxAttempts`, `read_timeout`, `connect_timeout`, `retries`, `http_read_timeout`, `retry_limit`, PHP's `'http' => ['timeout' => ...]`, Rust's `timeout_config` or `retry_config`, `ex_aws`'s `recv_timeout`, or `AwsClient`'s `retries`.
- A raw request's HTTP client that retries the POST, such as `got` or `ky` with `POST` in `retry.methods`, `axios-retry`, Faraday's `retry` middleware with `:post` in `methods` or a `retry_if`, a Guzzle retry middleware, or a `requests` adapter with a `Retry`.

Follow a context, token, or abort signal back through the callers, as for the distinct ID. One that any caller builds from a timeout, such as `AbortSignal.timeout` or an `AbortSignal.any` that holds one, is a deadline. One that only cancels, such as a request's, is no deadline, and neither is a deadline the runtime or framework puts on the request, such as Lambda's or an incoming gRPC call's. When the callers pass different deadlines, or some pass none, and the send can't take the signal, context, or token, the site stays with the deadline reason. Pass it where the send takes one, as Go's context and .NET's token do. Where the send takes none, as in Node.js, the send goes on after a cancel: note it in the plan row.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · Preserve cancellation before moving SES sends

When a Node.js SES call receives an already-aborted AbortSignal, AWS refuses the request; this rule still migrates it and drops the signal. PostHog then sends the email and retries after cancellation, defeating request-abort and worker-shutdown recovery. Keep cancellable sites on SES when the target SDK cannot carry the signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant