Release control center
#1471Muneerali199/draftdeckai

refactor: payment webhook retry + coupon stacking + proration + orders_meta migration

Muneerali199rakshak/demo-block-riskymain1 commits13d agoopen on GitHub

92

risk score

Release decision

Block release

Do not deploy. Escalate to the on-call engineer and file a Jira blocker for the touched surface before any merge.

Risk score 92/100 is at incident level (recurring incidents on high-incident surface).

Escalating to incident queue; deployment is blocked immediately.

A blocker will be filed in Jira and an incident note posted to Notion.

Incident memory

How this change scores against your production history — 8 past incident(s) on the touched surface.

Subscriptions & Billing

21 changed lines in this PR

2 incidentscritical

Checkout Flow

24 changed lines in this PR

2 incidentscritical

Data Migrations

9 changed lines in this PR

1 incidenthigh

Payments Gateway

18 changed lines in this PR

3 incidentscritical

High-incident surface: 8 past incidents mapped to the touched modules.

Files touched by past incidents: Change edits 3 file(s) implicated in INC-288, INC-248, INC-231 — high regression risk in the exact failure surface.

How Rakshak understands this change

AI reasoning layer · confidence HIGH · model Qwen/Qwen3-Next-80B-A3B-Thinking

This PR introduces multiple changes to billing and payment systems, including relaxing Stripe webhook signature checks, enabling coupon stacking without usage-cap validation, altering proration logic, and performing a large-scale data migration. These modifications directly impact critical systems like subscriptions, checkout, and payments, with risks of duplicate charges, incorrect billing, checkout failures, and database performance issues due to the untested 18M-row migration. The changes specifically target areas previously associated with high-severity incidents, such as proration errors, coupon race conditions, and webhook retry failures, while introducing new risks through untested migration logic and relaxed security checks.

Subscriptions & BillingCheckout FlowData MigrationsPayments Gateway

Failure hypotheses

Relaxed Stripe signature check in src/payments/webhooks/stripe.ts could allow unauthorized requests to trigger duplicate charges (as in INC-231), affecting payment processing for 90% of checkout sessions.

Coupon stacking logic in src/checkout/coupons/apply.ts removes usage-cap validation, risking negative totals or coupon abuse similar to INC-248's race condition during checkout.

Proration changes in src/billing/proration/calculate.ts may miscalculate billing periods, causing double-billing incidents like INC-288 for users changing subscription plans.

18M-row orders_meta migration in src/db/migrations/0014_add_orders_meta.sql without tests risks database locks or timeouts, disrupting all services using order data.

Release risk score

Weighted from 9 evidence categories

92/ 100 release risk
criticalguardedclear

Blast radius

What this change can reach

Modules affected

4

Subscriptions & Billing, Checkout Flow, Data Migrations, Payments Gateway

Services reached

6

billing, web, core, payments, worker, api

Estimated users exposed

90%

90% of checkout sessions

Changed files

5

72 lines of diff

Blast radius map

Severity-weighted dependency graph · 90% of checkout sessions

lowmediumhighcritical
apibillingcorepaymentswebworkerchange5 filesSubscriptions & Billingcritical29%Checkout Flowcritical33%Data Migrationshigh13%Payments Gatewaycritical25%4 modules · 6 services · reaches 90% of checkout sessions

Risk factors

Every point of the score is traceable to an observation

·

Traceability · No linked issue

low

No Jira issue is referenced from the PR description.

Scope · Focused change set

low

5 files changed — contained diff.

Test coverage · Tests included

low

1 test file(s) included in the change.

Signal · High-risk intent keyword

high

Description contains "migration" — treat as elevated risk.

Blast radius · Wide service fan-out

high

Reaches 6 services: billing, web, core, payments, worker, api.

Incident history · Files touched by past incidents

high

Change edits 3 file(s) implicated in INC-288, INC-248, INC-231 — high regression risk in the exact failure surface.

Test coverage · Low-coverage modules changed

high

Subscriptions & Billing below 60% coverage.

Blast radius · Critical modules touched

high

Touches Subscriptions & Billing, Checkout Flow, Data Migrations, Payments Gateway — 90% of checkout sessions.

Incident history · High-incident surface

critical

8 past incidents mapped to the touched modules.

Schema · Database migration present

critical

Schema migration detected — irreversible once applied; requires phased rollout.

Affected modules

Coverage, incident history and change load per module

ModuleServiceFilesΔ linesCoverageIncidentsSeverity

Subscriptions & Billing

billing

billing121
58%
2 priorcritical

Checkout Flow

checkout

web224
71%
2 priorcritical

Payments Gateway

payments

payments118
62%
3 priorcritical

Data Migrations

data-migrations

core191 priorhigh

Evidence chain

How Rakshak AI reached its decision

  1. SWYTCHCODE_VERIFYSwytchcode CLI queried 3 open PR(s)

    `swytchcode exec github.pull.get` returned 3 recent open PRs for Muneerali199/draftdeckai

    Aug 9, 08:14 AM
  2. GITHUB_INGESTPR #1471 ingested

    5 files, 72 lines changed by Muneerali199 → main

    Aug 9, 08:14 AM
  3. JIRA_LINKNo linked issues

    PR description references no Jira issue — traceability is weak.

    Aug 9, 08:14 AM
  4. NOTION_KNOWLEDGEProject knowledge loaded

    0 architecture notes · 1 incident records · 12 prior release reports consulted.

    Aug 9, 08:14 AM
  5. IMPACT_MAPBlast radius mapped

    Subscriptions & Billing (critical) · Checkout Flow (critical) · Data Migrations (high) · Payments Gateway (critical) — reaches 90% of checkout sessions.

    Aug 9, 08:14 AM
  6. AI_REASONAI layer: how Rakshak understands the change

    This PR introduces multiple changes to billing and payment systems, including relaxing Stripe webhook signature checks, enabling coupon stacking without usage-cap validation, altering proration logic, and performing a large-scale data migration. These modifications directly impact critical systems like subscriptions, checkout, and payments, with risks of duplicate charges, incorrect billing, checkout failures, and database performance issues due to the untested 18M-row migration. The changes specifically target areas previously associated with high-severity incidents, such as proration errors, coupon race conditions, and webhook retry failures, while introducing new risks through untested migration logic and relaxed security checks. • INC-231 was directly caused by idempotency key handling issues during webhook retries; relaxing signature checks increases risk of malicious or duplicate requests. • INC-248 resulted from coupon engine race conditions; removing usage-cap validation could reintroduce similar issues during concurrent coupon applications. • INC-288 occurred due to proration window calculation errors; new period boundary logic may have off-by-one errors if not validated. • Backfilling 18M rows in a single transaction without tests is known to cause database performance issues, as large untested migrations often lead to locks or timeouts.

    Aug 9, 08:14 AM
  7. RISK_SCORERisk scored 92/100 — critical

    Focused change set · 5 files changed — contained diff. — Critical modules touched · Touches Subscriptions & Billing, Checkout Flow, Data Migrations, Payments Gateway — 90% of checkout sessions. — Wide service fan-out · Reaches 6 services: billing, web, core, payments, worker, api. — High-incident surface · 8 past incidents mapped to the touched modules. — Files touched by past incidents · Change edits 3 file(s) implicated in INC-288, INC-248, INC-231 — high regression risk in the exact failure surface. — Low-coverage modules changed · Subscriptions & Billing below 60% coverage. — Tests included · 1 test file(s) included in the change. — Database migration present · Schema migration detected — irreversible once applied; requires phased rollout. — High-risk intent keyword · Description contains "migration" — treat as elevated risk.

    Aug 9, 08:14 AM
  8. DECISIONDecision: BLOCK

    Risk score 92/100 is at incident level (recurring incidents on high-incident surface). Escalating to incident queue; deployment is blocked immediately. A blocker will be filed in Jira and an incident note posted to Notion.

    Aug 9, 08:14 AM

Change surface

5 files in the diff

src/billing/proration/calculate.ts+21-0
src/checkout/coupons/apply.test.ts+7-0
src/checkout/coupons/apply.ts+17-0
src/db/migrations/0014_add_orders_meta.sql+9-0
src/payments/webhooks/stripe.ts+18-0

Failure points

Where this change is most likely to break

Subscriptions & Billing: 21 changed lines, 2 prior incident(s)

Checkout Flow: 24 changed lines, 2 prior incident(s)

Data Migrations: 9 changed lines, 1 prior incident(s)

Payments Gateway: 18 changed lines, 3 prior incident(s)

Migration lock / irreversible DDL on large tables

Dependency security

CVE lookup on changed dependencies via osv.dev

No known advisories on changed dependencies

Missing coverage

Modules below the 60% test bar

Subscriptions & Billing (58% coverage)

Agent trace

Swytchcode orchestration run

rakshak pipeline · run #9

01okgithub.github.fetch_pr

02okjira.jira.search

03oknotion.notion.knowledge

04okswytchcode.blast-radius

05okswytchcode.osv.scan

06okswytchcode.llm.reason

07okswytchcode.risk-engine

08okswytchcode.decision-engine

decided block

Analyzed Aug 9, 08:14 AM · updated 13d ago