feat(billing): add auditable Checkout reconciliation operations - #516
feat(billing): add auditable Checkout reconciliation operations#516seonghobae wants to merge 21 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
Buyer and operability impact
This bounded stacked #488 slice removes the direct-database-intervention dead end left by
reconciliation_requiredCheckout attempts. It gives an authorized operator adapter a tenant-scoped, credential-safe inspection boundary, an alertable backlog count, and an atomic audited resolution primitive that unblocks Checkout only after authoritative provider evidence has been verified.Exact current stack and scope
feat/stripe-checkout-attempt-ledger-488@2743a58c9ac65ab125c3898ec94370a7dc91f095.985747c4ed3dc369ee85df48f4923f5050c11209.403c493ac914ab6a397d9504541978c037d6a733and exact current parent2743a58c9ac65ab125c3898ec94370a7dc91f095.docs/doctoring/stripe-checkout-reconciliation-operations.md;package.json;server/billing_checkout_attempt.mjs;tests/unit/billing-checkout-attempt.test.mjs;tests/unit/billing-checkout-reconciliation-authority.test.mjs;tests/unit/billing-checkout-reconciliation.test.mjs;tests/unit/billing-checkout-review-regressions.test.mjs;tests/unit/coverage-script-contract.test.mjs.No auth/session, Clearfolio, attachment, workflow, dependency lockfile, scanner suppression, or branch-protection artifact is changed by the effective child diff.
Implemented reconciliation contract
billing_checkout_reconciliation_eventsaudit state linked to the held attempt and resolving user without copying idempotency keys, secrets, tokens, or credential hashes;countReconciliationRequiredfor internal alert/health adapters;resolveReconciliationfor authoritativeprovider_succeededorprovider_failedoutcomes with bounded evidence references;Security and authority boundary
This persistence port does not decide who is an operator and does not treat caller assertions as provider truth. HTTP/service adapters must enforce owner/admin authorization and verify evidence against authoritative Stripe or signed-webhook state before invoking resolution. No self-service or unverified release route is introduced.
Stack repair evidence
The previous child was based on predecessor parent
0b0a9373870860a18ba5fc5f36d660f72354a34band had diverged after #511 moved. The current repair starts from the exact parent tree, overlays only the eight child-owned paths, and semantically mergespackage.json. The resulting exact parent→child comparison is zero-behind with no unintended deletion of current parent test, coverage, auth, attachment, Clearfolio, orchestrator, provider, or operability behavior.Current exact-head evidence
Fresh repository-native workflows for exact child head
985747c4ed3dc369ee85df48f4923f5050c11209are queued and therefore non-passing:32268962547;32268962558; and32268963156.The predecessor-head Server Tests, Dependency Review, and OSV successes are diagnostic history only. No formal reviews or inline review threads currently exist on this PR, and no qualifying independent current-head approval exists. Queued, pending, cancelled, skipped-required, neutral, absent, stale, predecessor, status-only, synthetic-only, author-only, or model-only evidence is non-passing.
This PR remains Draft and must not integrate independently of #511, #507, and #505.
Scope boundary
This PR does not yet wire the operator HTTP adapter, expose the backlog count on
/api/metrics, verify Stripe webhook signatures, or implement subscription entitlement reconciliation. Those remain bounded #488 follow-on work.Merge gate
After the prerequisite stack reaches protected
develop, reconcile this exact bounded semantic diff onto the resulting live head and rerun every then-applicable CI, browser E2E, coverage/docstring, SAST, security, dependency, supply-chain, package/provenance, migration/recovery, resolved-thread, and qualifying independent-approval gate actually required by live policy. No predecessor-head, author-only, skipped, neutral, status-only, synthetic, or model-only evidence transfers.Refs #488