Repository navigation
Conversation
…opens_and_clicks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…_and_clicks PostHog never tracks clicks on a code send, so click tracking that is off needs nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace track_opens_and_clicks with tracking in the rewrite step and every SDK's rewrite file. A provider's open tracking that is off turns off the opens switch only, so engagement events stay on. The skill never turns on click tracking, because a link can carry a token, and it notes sites whose provider tracked clicks for the report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ates Use the Go, Rust and .NET names for tracking. A site that moves to a template made in PostHog sends no tracking, because the template uses its own setting, so the report asks the person to check it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o sensitive A code send takes an optional sensitive flag, and its clicks follow it unless tracking sets them. The skill marks a send sensitive when the old call turned off click tracking for that email or marked it sensitive. It never marks a send as not sensitive, and drops the claim that clicks are always off by default for code sends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A code send that leaves sensitive out takes the setting of a PostHog template with the same key. The skill can't see the project's templates or tell whether a link carries a token, so a key that matched a template without protection would start rewriting a reset link. Pin the flag on every code send, and say so in the report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ack-opens-and-clicks Keeps the base's error-handling rules, setup and write-down additions, and Elixir's named-instance send, with this branch's tracking and sensitive rules on top. Step 7 now turns opens off from the plan note instead of waiting for the person's yes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A site whose emails had no open pixel, or whose provider's open tracking nobody can confirm, now moves with the opens switch off instead of staying or waiting for the person's yes. The plan notes it as opens off with its reason, and the report lists those sites, the clicks PostHog no longer counts, and that every code send is marked sensitive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resend's attachments map to the send's attachments in posthog-node: filename, content, content type and inline content ID. A file with a path, no filename, a refused extension, or more than 10 files keeps the site on Resend, as do sites outside JavaScript and TypeScript. Step 8 sends an email with files when a moved site has them, and puts those sites back when PostHog doesn't take files from the project yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 3 decides when a site with files stays, whatever the provider, and lists every extension PostHog refuses. Resend's mapping keeps only its own file fields. The report says what would let a staying site move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o feat/migrate-email-resend-attachments
…nd-clicks' into feat/migrate-email-resend-attachments # Conflicts: # context/skills/migrate-email/references/9-report.md # context/skills/migrate-email/references/resend/mapping.md
Step 7 says what every SDK's code send does with files: the 10-file and 40 MB limits, the upload before the send, and its errors. Each rewrite file names its SDK's field and the form its content takes, since some take only bytes and some read any text string as Base64. The bundled api.md may still call attachments unavailable, so the steps win for files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… list A provider with no suppression list of its own, such as a mailbox provider behind an SMTP host, has no list that grows while sites stay. Step 5 writes that into the plan, and the report then leaves out the weekly re-import ask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o feat/migrate-email-resend-attachments
A run of migrate-email-resend on an app with a calendar invite showed where the steps fell short. They now cover: - preflight when the MCP sees another project, or the app already sends code emails - a PostHog key under the app's own name, or in the hosting platform's environment - code and docs around the sends: provider-key switches, counts and limits, promises in legal docs and specs, and the app's own PostHog sends, whose engagement setting moved sends follow - a send moved into a runtime the SDK runs in, such as a Convex "use node" action - a deadline that now limits each request of a send with files - an idempotency key built from a hash of the request body - tests of sends with files: the upload requests, and hashing under a faked clock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- preflight: an app that already sends code emails wins over an MCP that can't see the project; suppressions never import into another project - Step 3 reads the rewrite file's send for the files check, and counts the release Step 7 would install - the email client splits a shared config function, and goes in the file of the runtime the send runs in - one template key for a site that sends several kinds of email - a used-up quota that the old code retried as a 429 is noted - tests: answer at once under a faked clock, answer the app's own PostHog capture, assert on the added fields, and keep the Node digest stub in a setup file outside Convex's folder - the report's notes placeholder closes where it should Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pp's own distinct ID helper Also reads Step 5's MCP check from what Step 2 found, not what it recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a legal text Run 4 worked around both by hand within Step 8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce PostHog takes them The real send on prod-eu refused `text/calendar; charset=utf-8; method=REQUEST` with `not_mime_type`: PostHog takes a bare type only. Taking `method` out makes a mail app show a calendar invite as a file. Step 3 marks such a site, Step 8's check email decides, and a refusal puts the site back on the provider rather than stripping the parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map content.attachments and content.inline_images onto the PostHog send's attachments: name to filename, an inline image's name to its content ID and filename, type as it is, and data as Base64 or decoded bytes per the rewrite file. Python's filename path is read in the app. A stored template takes no files, except an RFC 822 template, which stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🧙 Wizard CIRun 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:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a wizard branch:
Add Results will be posted here when complete. |
PostHog refuses a filename with a path, and a SparkPost name can hold one, such as images/logo.png as an inline image's content ID. The filename becomes the part after the last / or \, the content ID keeps the whole name, and a name ending in a separator keeps the site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt ID in Step 3 A filename takes at most 255 characters and no path separator or control character (unsafe_filename), a content type at most 78 characters, and a content ID at most 78 characters and no angle bracket or control character (unsafe_content_id), as code_send_fields.py on PostHog's master refuses them. A site whose value breaks one stays on its provider with a reason, so each provider's attachments follow-up points here instead of restating them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An inline image's name, kept as the content ID, and the filename taken from a name keep the header rules Step 3 now lists under "Files": a SparkPost name can run to 255 bytes, past a content ID's 78 characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recheck every SDK claim in references/sparkpost/ against SparkPost's API reference, its developer hub samples, and the SDKs' own docs pages (python-sparkpost on Read the Docs, gosparkpost on pkg.go.dev, the Elixir library on HexDocs). Claims those pages don't back are dropped or softened: - Error classes and their properties (Node.js, Ruby, PHP, .NET) are no longer named. The skill reads the HTTP status and the API's errors from whatever the site's own handler reads. - Python's EU host is the second positional argument, as its docs show; EU_API, the Django base URI setting, track_initial_opens, and the tornado client are dropped. - Elixir's SparkPost.Endpoint.Error is an exception per its docs, so a rescue of it moves like a match on it. - A Node.js transmission wrapped in transmissionBody now stays: no docs describe that older SDK's key renaming. - A Ruby send_message with positional arguments stays unless the site's code names each field: the gem's docs couldn't be read. - Whether an SDK's error covers a network failure is undocumented, so a handler that named only SparkPost's error takes network_error and the plan row says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A handler that named only SparkPost's error now lets network_error pass, as Step 7 says, instead of taking it: SparkPost's docs don't say whether its error covered a network failure, and widening would swallow one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… content cell Run 5 (Steps 1 to 3 on a fixture with three Resend sends with files) held a user-built filename and passed a fixed one, as the header rules mean, but also held `contentId: "<logo>"`, which Resend's mapping already turns into the bare `logo` the HTML shows. The rules now hold for the value the send passes after the mapping. The re-run moved that site and still held the user-built filename. Each file of a moving site now goes in the plan row's content cell, where both runs had to guess. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…does A reraise inside a handler skips the later handlers of the same try, so network_error now runs a later handler's code that took network failures, and is raised or returned past the site only when none did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e silent Where SparkPost's docs and the SDKs' docs pages don't give a fact the mapping needs, the migrating agent now reads the SparkPost client installed in the app (node_modules, the virtualenv, vendor, the bundle, the Go module cache, deps), decides from it, and names the file in the plan row. A site stays only when the installed client doesn't settle it either. This replaces the stays the docs-only recheck added: a Node.js transmissionBody send, a Ruby send_message with positional arguments, a key, argument, keyword, or property the docs don't list, and a handler that named only SparkPost's error, for network failures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
migrate-email-sparkpostkeeps every SparkPost send with attachments or inline images on SparkPost, because PostHog's send didn't take files. #510 taught the shared steps and the Resend variant to move files. This PR maps SparkPost's file fields onto that, so a SparkPost send with an invoice, a receipt, or an inline logo can move too.Important
Stacked on #468, the SparkPost variant, and merges #510, which brings #486. Until those land and this PR is retargeted to
main, the diff includes #486's and #510's shared changes. Onlycontext/skills/migrate-email/references/sparkpost/is this PR's change. Merge order: #472, the providers, #486, #510, then this one.Impact
Sends that arrive with
migratedFrom: 'sparkpost'and files show whether SparkPost sends with attachments move. Read it 14 days after the release that ships this skill.Merge risk
Note
🟢 Merge risk: low · two-way door until the next context-mill release ships the skill; one-way per migration once an agent runs it, since its rewrite stays in the app's code
Tier: critical
content.attachmentsorcontent.inline_imagesnow moves to PostHog by Step 3's "Files" rules, where it stayed before. Separate commits rewrite the SDK claims SparkPost's docs don't back (see "Corrected SDK claims"): where the docs say nothing, the migrating agent reads the SparkPost client installed in the app and decides from it.Changes
references/sparkpost/mapping.md:content.attachmentsandcontent.inline_imagesrows move each list to the PostHog send'sattachments, by Step 3's "Files" rules, which count both lists together.nameof an attachment becomes the filename. PostHog refuses a filename with a path, so a name with/or\keeps only its last part, and a name ending in one keeps the site.nameof an inline image becomes the content ID, unchanged, so the HTML'scid:reference still finds it. Its last part after any/or\also becomes the filename, which PostHog requires and SparkPost never set, with a note in the plan row.typerow, point to PostHog's header rules in Step 3's "Files" from feat(migrate-email): move a Resend send's attachments to posthog-node #510: a filename of at most 255 characters with no path separator or control character, a content type of at most 78, and a content ID of at most 78 with no<,>, or control character. SparkPost takes a name of up to 255 bytes, so a longer content ID keeps the site.typestays as it is, parameters included. SparkPost's docs ask for acharsetparameter where needed, and such a type moves as Step 3 says.data, Base64, becomes the content: the same Base64 string or its decoded bytes, as each rewrite file says.filenamepath becomes the bytes the code reads from that file. SparkPost's Python library reads and encodes it in the app, so SparkPost fetches nothing..batand.exe, and PostHog's list in Step 3 is longer.the template is a raw MIME message.attachmentslist, attachments first.references/sparkpost/account.md: the dashboard copy of a template version also asks whether it is stored as a raw RFC 822 message.Corrected SDK claims
Separate commits recheck every SDK claim in
references/sparkpost/against SparkPost's docs and the SDKs' own docs pages only. #468 lands as it is. Where those pages say nothing, the agent reads the SparkPost client installed in the person's app (node_modules, the virtualenv,vendor, the bundle, the Go module cache, Elixir'sdeps), decides from it, and names the file it read in the plan row, as Mandrill's #515 does. A site stays only when the installed client doesn't settle it either, with the reasoninstalled SparkPost client doesn't show <the fact>.SparkPostErrorwitherr.statusCodeanderr.errors(Node.js),SparkPost::DeliveryException(Ruby),SparkPostExceptionwithgetCode()andgetBody()(PHP), andResponseExceptionwithResponse.StatusCode(.NET) are no longer named, and nor are Python'se.statusande.errors. The Python docs name onlySparkPostAPIException. The agent reads what the site's handler reads, and the installed client for which property holds the HTTP status and which the API'serrors.network_errorgoes where Step 7 says; where it gave SparkPost's error,network_errortakes the same branch. Unsettled, the site stays.SparkPost(key, 'https://api.eu.sparkpost.com/api'), as its docs show.base_uri=,sparkpost.EU_API, the DjangoSPARKPOST_BASE_URIsetting,track_initial_opens, and thesparkpost.tornadoclient are dropped. A keyword the docs don't list is read from the installed package.SparkPost.Endpoint.Erroramong the library's exceptions, raised on anerrorsanswer. Arescueof it now moves like a match on it. The claim that it covers network errors, andapi_endpoint, are dropped: the installed library settles both.originandendpointoptions, the SDK's handling ofccandbcc, the second argument as query parameters, andclient.requestandclient.postare dropped. The oldertransmissionBodycall and its key renaming are read from the installed client.send_message(to, from, subject, html, ...)argument order,SPARKPOST_API_HOST, andsend_payloadare dropped. Positional arguments are read from the installed gem.'host'option, .NET's response type,RecipientType,Content.TemplateId, andClient.ApiHost, Java's Maven coordinates andResourceTransmissions, and the claim that Go'serrholds the API's errors are dropped, and read from the installed client where a site needs them. Go'sSendsignature,Response,SPErrors,Content,Attachment, andTxOptionsstay, as its package docs list them.client.suppressionList.*examples became Go's documentedclient.SuppressionDeleteandclient.SuppressionUpsert.Live run fixtures
Only the live run tests the installed-client reads, so its fixture app holds one site for each:
catchthat reads the HTTP status and the API'serrorsfrom SparkPost's error, and one that branches on400or422.transmissionBodywith camelCase keys, such assubstitutionData: { firstName }, rendered by a stored template.ccandbcc, and a second argument tosendthat isn't a callback.except SparkPostAPIExceptionthat reads the HTTP status, and a keyword the docs don't list, such astrack_initial_opens.send_messagewith positional arguments, and arescueof SparkPost's error.->wait(), and acatchthat reads the status and the body'serrors.errand onres.HTTP.StatusCode.catchof SparkPost's exception that reads the status, and a property the hub's sample doesn't set, such as a template id on the content.rescueofSparkPost.Endpoint.Error, and a match on it.Sources
name,type,data;cid:NAME), the 20 MB content limit, the ban on malicious files, and the "Send a Template" content, which takes onlytemplate_idanduse_draft_template.from,headers,text,html, andamp_html, or an RFC 822 message.filenamein place ofdatamakes the library do the Base64 conversion.send's keywords, its answer, andSparkPostAPIException), the Go package's docs (v0.2.0), and the Elixir library's docs (v0.5.2).gh apifor theSparkPostanddarrencauthonorgs, andSparkPost/ruby-sparkpostreturns 404. The mapping is written against the HTTP fields, which every SDK sends, and claims only the API reference and docs back.How did you test this code?
vitest run scripts: 344 tests pass, including the check that every reference path in the builtmigrate-email-sparkpostbundle resolves.node scripts/build.jsbuilds every skill.5652ee3; round 2 came back clean. After the merge of feat(migrate-email): move a Resend send's attachments to posthog-node #510's new head (0fbc1c9), rounds 3 to 5 read the header-rule pointers and the SDK claims commit (Fleet bases a round on the last reviewed commit, so round 3 read from5652ee3): rounds 3 and 4 found that the network-error fallback first widened a SparkPost-only catch, then reraised past later handlers, both fixed by following Step 7; round 5 came back clean. Round 6, on the installed-client reads (a0f4640), came back clean.ec7d3e7then merges feat(migrate-email): move a Resend send's attachments to posthog-node #510's head41e37f1, which checks Step 3's header rules on the value the provider's mapping passes: SparkPost's rows already check the filename after taking the part after the last/or\, and the content ID as the image's name unchanged, so no SparkPost text changed. Round 7, a fixes-scope read of that merge froma0f4640, past Fleet's six-round ceiling as a recorded agent decision, came back clean.🤖 Generated with Claude Code