Repository navigation
Conversation
campaign analytics renders the A/B criterion, outcome, holdout and reserve counts and a per-variant table with the winner marked. campaign view (and create) show the variant count and outcome, and the number of weighted message alternatives. campaign create help and the README describe the variants, variantStrategy and messageVariations beta input fields. The published SDK pin types these fields as unknown or omits them, so the CLI narrows them at runtime with local types that accept the SDK main types from polymorfa/sdks#344.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
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.
Summary
polymorfa campaign analyticsandcampaign viewnow show campaign A/B test results (polymorfa/polymorfa#406) and weighted message variation (polymorfa/polymorfa#409) in human output. Both features are betas.campaign analyticsadds the winning criterion, the outcome (winner, inconclusive with its reason, or no winner yet), holdout and reserve counts, and a per-variant table. The table shows label and key, the criterion rate first, then sent, assigned, delivered, read and replied. The winner row is marked(winner).campaign viewandcampaign createshow the variant count and outcome of an A/B campaign, and the number of weighted alternatives whenmessageVariationsis set.campaign create --helpand the README campaign section describe thevariants,variantStrategyandmessageVariationsinput fields, their limits and the403 feature_unavailableresponse for teams that are not enrolled.createalready sends the--inputobject unchanged, so these fields worked before this PR. There is no campaign update command.The published SDK pin (
0.1.0-dev.20261004024706) typesvariantsandvariantStrategyasunknownand has noexperiment,experimentOutcomeormessageVariations. The CLI reads them as unknown values and narrows them at runtime (src/services/campaign-experiments.ts). A value that does not match the expected shape printsUnreadable in this CLI version; use --json for the full response.and nothing partial. API-supplied labels and keys go throughterminalText, so control characters are escaped.--jsonoutput is unchanged.Impact
Impact table
campaign analytics,viewandcreatehuman outputsrc/services/campaign-experiments.ts,src/services/campaigns.tscampaign createdescription lists the beta fields and an examplesrc/commands/campaign/create.tsREADME.md@polymorfa/sdkprerelease containing polymorfa/sdks#344 (ff51567) is not published; the scheduled publish workflow fails on a missing GitHub App secret. The pin stays at0.1.0-dev.20261004024706; the code compiles against it and against the SDK main typespackage.json,package-lock.jsonunchangedNo impact table
src/services/campaign-experiments.tscreatestill passes the JSON body through; the server API key requirement and errors (including403 feature_unavailable) are unchangedsrc/services/campaigns.tscampaignInput--jsonwrites the API data unchanged; the local MCP server exposes no campaign toolstest/commands/campaign-experiments.test.tsJSON case;grep campaign src/mcpreturns nothingdocs/guides/campaigns/ab-test-a-campaign.mdx,send-a-campaign.mdxon polymorfadev) and do not reference CLI campaign commands; CLI usage lives in this READMEgit grep "polymorfa campaign" origin/dev -- docsreturns nothingVerification
Tested revision:
afc9e01on top oforigin/main43e55a4, with the published SDK pin0.1.0-dev.20261004024706.npm run format:check,npm run lint,npm run typecheck,npm run buildandnpm pack --dry-run --ignore-scriptspass.test/commands/campaign-experiments.test.ts(13 tests) runs the commands against a local HTTP fixture: promoted, inconclusive, no winner yet,experiment: null,experimentabsent, an unreadable shape, control characters in a label, unchanged JSON output,viewfor promoted, undecided, weighted-variation and broadcast campaigns, andcreate --help. Campaign, recipient and conversion test files pass: 4 files, 53 tests.CampaignExperimentResultsandCampaignExperimentOutcomefrom sdksff51567packages/typescript/src/messaging/types.tsto the CLI's local types undertsc --strict; it compiles.cloud-group,project-contextandevent-stream-process, and the same tests also fail on a cleanorigin/maincheckout on this machine. Later runs timed out widely because the machine load average was about 170 on 15 cores. CI is the authoritative full-suite result.Session provenance and UI evidence
internal/agent-sessions/sessions/purpshell-t3-claude/campaigns-betas-merge/5e2bb467f1fa750b82bee255e87ee372d1f156c82e8ae302ec53e43e3e63e0f0.mdin polymorfa/polymorfa at3e21bef9c1a8e6ecc48b478c05ab1702e4a52362. This CLI subtask has no separate checkpoint yet.afc9e01.afc9e01against a local fixture server (synthetic data, no customer data):Other outcomes render as
A/B outcome Inconclusive (insufficient_evidence); the reserve was not sentandA/B outcome No winner yet. A weighted-variation campaign addsMessage variations 2 weighted alternativestoview.Rollout and rollback
dev(#406, #409) and reach only enrolled teams. This CLI change displays whatever the API returns and grants no access.@polymorfa/sdkpin bump to the SDK types follows in a later PR, after the next SDK prerelease containing Add campaign A/B test and weighted variation types to the TypeScript SDK sdks#344 is published and passes staging acceptance. At that point the local types can be replaced with the SDK exports.Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.