Skip to content

fix: CLI and verification docs match the code - #105

Merged
sonpiaz merged 1 commit into
mainfrom
fix/docs-stripe-onboarding-match-code
Oct 13, 2026
Merged

sonpiaz merged 1 commit into
mainfrom
fix/docs-stripe-onboarding-match-code

Conversation

@sonpiaz

@sonpiaz sonpiaz commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

What & why

Six claims in the Stripe/onboarding docs, checked against origin/main of affiliate-cms (87a36eab), Affitor/cli (ba97fd6, 0.4.2) and affiliate-dashboard (700cd90). This PR fixes the doc bugs. The CLI code bug is fixed in Affitor/cli#35.

# Claim Verdict Evidence Fix here
1 A Run verification button on Share Program, and Go Live unlocks when it passes; "same check as affitor test" DOC BUG Dashboard: no component calls the /api/tracking/run-verification proxy (only src/pages/api/tracking/run-verification/[programId].ts and utils/request.ts:2602). Settings/index.tsx:337-339,461-463: "Synthetic verification is the agent's path only; the human just clicks Go Live". CMS go-live lean gate = profile + economics (affiliate-program.ts:337-344). affitor test sends one event (cli/src/commands/test.ts:53-56); the chain is onboard / MCP affitor_run_verification (api-client.ts:168-191, mcp/src/index.ts:313-326) brand/tracking/testing-integration, quickstart-integration, quickstart/payouts, quickstart/define-commission
2 affitor setup stripe creates a webhook at <api-url>/webhooks/stripe/<program-id> CODE BUG (CLI) + DOC BUG No such CMS route; Stripe intake is POST /api/webhook-distributor/stripe (webhook-distributor/routes/custom-routes.ts:6); CLI save endpoint answers 410 (cli/controllers/cli.ts:368-382); token exchange needs Affitor's platform secret (cli stripe-oauth.ts:53-57) brand/cli/commands setup stripe section + error tables, brand/cli/quickstart, api-reference/agent-integration: connect Stripe in the dashboard
3 CLI subscribes invoice.paid, CMS handles invoice.payment_succeeded CODE BUG (CLI), no data loss True mismatch (cli types.ts:199-206 vs webhook-distributor.ts:787; no invoice.paid handler anywhere in CMS src/), but the CLI flow never completes (row 2), so no endpoint ever fed renewals. Dashboard-connected Stripe goes through the platform webhook, which handles invoice.payment_succeeded Removed the event list from docs. The invoice.paid mentions in the self-hosted guides (integrations/stripe, fastify) are about the brand's own handler and are correct
4 onboard and whoami --json report a negative outcome with exit 0 DOC BUG onboard.ts:129-131 sets exit 1 unless integration_verified; whoami.ts:16-19 exits 1 when logged out (CHANGELOG 0.4.2) brand/cli/commands: exit table, whoami line, onboard section
5 "Zero-code Stripe" vs required metadata Not a docs bug program_id is not required: resolveCustomerPartner takes it as optional and falls back to email_hash / stripe_customer_id / customer_key (webhook-distributor.ts:966-1130,1304-1333). Docs already call metadata "recommended" (integrations/stripe.mdx:105). See note below on dashboard /pricing none
6 API key prefix affitor_ DOC BUG New keys are aff_ (affiliate-program/services/affiliate-program.ts:13-19); affitor_ is legacy, still accepted (middlewares/agent-scope.ts:40-46) brand/cli/commands onboard example, brand/cli/quickstart JSON example

Note on 5 (dashboard copy, not changed here): /pricing says "nothing to wire into your checkout" / "zero-code". Without checkout metadata, a Connect sale is matched only via a stored identity. The usual one is the email hash. A browser signup() under the default lead_auth: server_required is provisional and writes no identity (affiliate-lead-event.ts:53-66; schema default server_required). So the email path needs a server-side lead. Flagged for a separate decision.

Verification

  • npm run build pass
  • node scripts/check-agent-surface.mjs PASS
  • No em-dashes added

🤖 Generated with Claude Code

No Run verification button exists; affitor setup stripe cannot connect Stripe
(dashboard only); onboard and whoami --json exit 1 on a negative outcome;
program keys start with aff_.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
affitor-docs Ready Ready Preview Oct 13, 2026 6:36am UTC

Request Review

@sonpiaz
sonpiaz merged commit 879e5bd into main Oct 13, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — ae5ffa2f Deployed Oct 13, 2026 by vercel[bot]
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