chore(referrals): retire the KiloClaw referral program - #5393
Open
jobrietbergen wants to merge 1 commit into
Open
chore(referrals): retire the KiloClaw referral program#5393jobrietbergen wants to merge 1 commit into
jobrietbergen wants to merge 1 commit into
Conversation
Fresh KiloClaw provisioning is closed, so no account can make a first paid KiloClaw subscription payment and no KiloClaw referral can ever be earned. Remove the KiloClaw Advocate referral program and keep Kilo Pass as the only live referral program. - Stop creating KiloClaw referral touches, participants, conversions, reward decisions, and rewards; KiloClaw Advocate config no longer resolves and the Advocate token endpoint rejects `product=kiloclaw`. - Split the shared referral machinery out of `kiloclaw-referrals.ts` into `referral-attribution.ts` and `referral-delivery.ts` for Kilo Pass. - Report KiloClaw affiliate SALEs directly for renewals of existing subscriptions instead of routing them through referral attribution, in both the web Stripe/credit paths and the billing lifecycle worker. - Drop the KiloClaw refer page, sidebar entry, and referral reward UI; rename the admin investigation surface to Impact referrals with KiloClaw retained read-only for support history. - Migration 0221 cancels unapplied KiloClaw rewards and terminates their queued Advocate redemptions. Applied free months and historical records stand.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the KiloClaw referral retirement across conversion, billing, migration, and UI paths at HEAD Files Reviewed (57 files)
Reviewed by grok-4.6 · Input: 368.5K · Output: 30.7K · Cached: 1.4M Review guidance: REVIEW.md from base branch |
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.
Why
Fresh KiloClaw instance provisioning is closed, so no account can make a first paid KiloClaw subscription payment. No KiloClaw referral can ever be earned again, and the program's attribution logic was still suppressing affiliate SALE reporting on KiloClaw renewals. This retires the KiloClaw Advocate referral program and leaves Kilo Pass as the only live referral program.
What changed
getImpactAdvocateConfigonly resolves the Kilo Pass program, and/api/impact-advocate/tokenrejectsproduct=kiloclawinstead of silently serving a Kilo Pass token. The retired program ID51699and its widget path are still rejected if a Kilo Pass misconfiguration points at them.lib/impact/kiloclaw-referrals.tsis replaced bylib/impact/referral-attribution.ts(winning-touch resolution) andlib/impact/referral-delivery.ts(conversion reports, Advocate redemption queue, reward-bearing config checks) used by Kilo Pass.kiloclaw-billinglifecycle worker (process_paid_conversionside effect replaced byenqueue_affiliate_event). Affiliate touch parsing keeps the KiloClaw product scope; referral touch parsing now returnsnullwhen a URL targets no live program./claw/refer, the "Refer & Earn" sidebar entry,ReferralRewardsSummary/ReferralRewardStatusCard, and thereferralRewardsbilling payload are gone. The admin surface moved from/admin/kiloclaw-referralsto/admin/impact-referrals, defaults to Kilo Pass, and keeps a "KiloClaw (retired)" option so support can still read retained history.0221_retire_kiloclaw_referral_rewardscancelspending/earnedKiloClaw free-month rewards withreview_reason = 'kiloclaw_referral_program_retired'and fails their queued Advocate redemptions so the shared sweep stops retrying forever. Already-applied free months are not reversed and historical rows are retained.IMPACT_ADVOCATE_KILOCLAW_PROGRAM_ID/IMPACT_ADVOCATE_KILOCLAW_WIDGET_IDremoved;ENVIRONMENT.mdupdated. Referral seed topics and helpers removed..specs/impact-referrals.mdgains a KiloClaw retirement section (69a–69g) and changelog entry; the old KiloClaw rules are retained as history.Verification
pnpm --filter web typecheck,scripts/typecheck-all.sh --changes-only,pnpm lint,pnpm format:check— passpnpm --filter web test --testPathPatterns="(impact|referral|kiloclaw|billing-side-effects|dispatch-affiliate-events|billing-types|stripe)"— 73 suites, 1286 tests passpnpm --filter kiloclaw-billing test— 186 tests pass (lifecycle stubs/assertions updated for the side-effect rename)pnpm --filter @kilocode/db test,pnpm test:dev-local,pnpm test:web-env— passpnpm test:dbNot run: the full
pnpm testand full-repo typecheck.