MC
acme/payments-api · Code migration · npm

stripe

17.7.018.5.0Verified API changeReady for reviewMajor versionpackage.json
Requires human review.
  • Major version: stripe 17 → 18 pins API version 2025-03-31.basil for every request this service makes.

Evidence trail

Every step Darwin took, from the records it keeps

  1. Found behind latest

    stripe 17.7.0 is declared in package.json; the registry's latest is 18.5.0.

  2. Compared the release's API

    Stripe's 2025-03-31.basil API version, pinned by stripe 18, removes Invoice.subscription; it now lives under Invoice.parent.subscription_details.subscription. Verified against the SDK's own declarations and its changelog.

    CandidateResultReason
    18.5.0VerifiedIndependently verified
  3. Stripe: Invoice.subscription moves under parent

    API version 2025-03-31.basil removes Invoice.subscription; read Invoice.parent.subscription_details.subscription.

    − invoice.subscription
    + invoice.parent?.subscription_details?.subscription

    Evidence: SDK types at 18.5.0 (types/Invoices.d.ts) · Changelog (CHANGELOG.md · 18.0.0 "⚠️ Breaking changes")

  4. Rewrote 3 call sites

    src/billing/invoices.ts:39
    − invoice.subscription
    + invoice.parent?.subscription_details?.subscription
    src/billing/invoices.ts:40
    − return invoice.subscription;
    + return subscription;
    src/webhooks/invoicePaid.ts:18
    − invoice.subscription as string
    + invoice.parent?.subscription_details?.subscription as string
  5. Validated with 1,212 tests

    Each check ran on the unmodified repository first; only checks that pass there judge the change.

    CheckFromUnmodifiedWith changeTests
    npm run typecheckci.yml · typecheckPassedPassed—
    npm testci.yml · test (22.x)PassedPassed1,212
  6. Review gate approved the patch

    The patch replaces every read of Invoice.subscription with the basil location and keeps the null handling. No unrelated edits; tests cover both paths.

    DeepSeek V4.1 Flash · Jev shadow review

  7. Opened #184 as a draft

    Migrate Stripe invoices to API version 2025-03-31.basil (stripe 18.5.0). Your repository's own CI judged it: CI passed

    CheckWorkflowVerdictNote
    test (22.x)ci.ymlPassed5 min
    typecheckci.ymlPassed1 min
    lintci.ymlPassed1 min
  8. Waiting for a person to merge

    Migrated 3 call sites in 2 files; typecheck and 1,212 tests passed; review approved.

Patch

Exactly what the review approved and the PR contains

package.json
@@ -21,7 +21,7 @@
"openai": "^4.104.0",
- "stripe": "^17.7.0",
+ "stripe": "^18.5.0",
"zod": "^3.25.76"
src/billing/invoices.ts
@@ -38,9 +38,10 @@ export async function subscriptionForInvoice(invoiceId: string) {
const invoice = await stripe.invoices.retrieve(invoiceId);
- if (typeof invoice.subscription !== "string") return null;
- return invoice.subscription;
+ const subscription = invoice.parent?.subscription_details?.subscription;
+ if (typeof subscription !== "string") return null;
+ return subscription;
}
src/webhooks/invoicePaid.ts
@@ -17,7 +17,7 @@ export async function onInvoicePaid(event: Stripe.InvoicePaidEvent) {
const invoice = event.data.object;
- await markPaid(invoice.subscription as string, invoice.amount_paid);
+ await markPaid(invoice.parent?.subscription_details?.subscription as string, invoice.amount_paid);
}

Summary

Repository
acme/payments-api
Present
17.7.0
Latest
18.5.0
Proposed
18.5.0
Kind
Code migration
Checked
Oct 27, 02:06 UTC
Pull request
Ready for review#184
Reviewers
maya, sam

Provenance

From the run's validation receipt

Base commit
9f3c2e1
Darwin version
942146c
Patch SHA-256
4be1…7c90
Attempt
6f1d0c2e

For agents

The same record, over MCP

dovel_get_update({
  id: "payments-api--stripe"
})