Repository navigation
feat(billing): enforce recurring trial policy and safe workspace cancellation - #37
Conversation
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
@copilot Please review the latest billing changes, focusing on workspace isolation, direct-API trial eligibility/concurrent checkout, cancellation recovery, and the past-due grace timestamp. Do not change code or merge. |
|
@claude Please independently review the current billing PR for concrete correctness/security issues and fit with existing product semantics. Read-only review; do not edit, merge, release or deploy. Trace actual request paths and PostgreSQL behavior: recurring checkout serialization and retries, opt-in price policies, completed versus abandoned trials, webhook delay/replay, scheduled/immediate cancellation and preservation of manual grants, workspace archival versus permanent billing closure, billing-summary contracts and grace timestamps. Check migration numbering against current main (v0.5.0 now owns migration 00008), and tests that actually reproduce claimed behavior. Identify substantive defects with source references; avoid speculative redesign. Also inspect durable one-time credential notices and checkout-policy UI. All examples and discussion must remain generic. |
|
Claude finished @SirNarsh's task in 1m 13s —— View job Review of the recurring checkout and cancellation PRI read the code and traced the request paths. I did not run the Go tests or the PostgreSQL-backed tests. A shallow checkout meant Findings, most severe first
Checked and found fine
|
|
Independent review confirms substantive issues that need correction before merge: migration 00008 now collides with released main; the recurring guard can exhaust the database pool by holding one connection while requesting another; unresolved provider creation failures lack a safe retry/reconciliation path; unpaid subscriptions are omitted from duplicate prevention; and cancellation should normalize subscription/entitlement state rather than update status alone. Subject billing responses also need runtime schema tests and provider subscription identifiers. Permanent billing closure on immediate cancellation requires a product-semantics decision rather than being treated as ordinary cancellation. Credential notices should have explicit persistence rather than wording-dependent behavior. Claude review corroborates the concurrency, retry and coverage gaps. The branch being behind main is not itself evidence that its intended merge deletes resource authorization; rebase and regenerate while preserving the released feature. Existing checks are for the old base. No merge or release at this stage. |
|
@claude Please review the fixes at e4566a8 against current main. Read-only; do not edit, merge, release or deploy. Product decision: cancellation allows later resubscription; archival is separate. The PR now merges released main, preserves migrations 00001-00008 and adds 00009/00010. Review short atomic checkout reservation (no pooled connection held during provider I/O), saved provider forms/stable replay keys, definitive versus ambiguous provider errors, old-key/legacy reconciliation without assuming 25-hour expiry proves non-purchase, temporary cancellation records cleared on success, provider entitlement normalization and independent manual grants, archival rejection while billing is unsettled, signed-event grace timestamps/stale observation rejection, actual summary schema/provider identifiers, and explicit persistent credential notices. New real PostgreSQL HTTP regressions exercise concurrency with MaxConns=2, recovery, cancellation/resubscription, trial-only versus single-subscription policy, unpaid subscriptions, archive boundaries, expiration and generated summary schema. Focus on reproducible remaining defects and compatibility, not speculative features. |
|
Claude finished @SirNarsh's task in 1m 23s —— View job Review of e4566a8 (read-only)I traced the code paths against current What looks right
Remaining defects, most severe first
Checks that came out fine
Test coverage gap: I could not tell from reading whether the new regression tests cover items 1–3. The ones most worth adding are:
|
|
@claude Follow-up review requested on 2e60301 (plus typed SDK follow-up bb1a971). The abandoned-preparation cancellation now accepts terminal state after recovery; archival also blocks completed recurring checkout before its subscription is normalized. Empty provider lists deliberately do not automatically prove non-purchase: a new control-only resolve-not-created action requires explicit provider-investigation attestation/reason, a pending attempt older than 25 hours with no provider ID, Idempotency-Key, and atomic audit/state change. New PostgreSQL regressions cover this escape path, no unsafe old-key recreation, archive-before-subscription, and first-attempt cancellation of abandoned preparation. The generic HTTP idempotency middleware does use caller keys; durable cancellation operation IDs separately preserve provider keys across partial batch retries. Added invitation-token handling and corrected reconciliation error wording. Four server SDKs now expose typed summary fields and workspace cancellation, with runtime tests. Review remaining substantive security/correctness issues; do not edit, merge, release or deploy. |
|
Claude finished @SirNarsh's task in 38s —— View job Review of 2e60301 and bb1a971 (read-only)I read the code and did not run the Go or PostgreSQL tests. I read Earlier findings that now look fixed
Remaining issues, most severe first
Not verified
|
|
@claude Final focused follow-up on b48983a: cancellation now also reconciles completed recurring checkout awaiting subscription before reporting success (matching archive/eligibility predicates), with a PostgreSQL HTTP regression proving provider cancellation and subsequent archival. Customer-less provider-list recovery fails closed. Added negative tests for auditor access, recent/known/completed-session resolution rejection, forced audit failure rollback, and upgrade/down/up from released schema 8 preserving legacy unknown outcomes. Confirm the intentional 23–25 hour safety interval and privileged investigation/attestation contract, not automatic absence inference. HTTP idempotency records are scoped to application+actor+key and validate method/path/body hashes; durable subject operations intentionally allow authorized same-mode retries to join. Credential notices are separate from transient toast styling and covered across navigation. A single exact generated-schema byte string/path exception fixes a verified Gitleaks false positive; the payload was decoded as the public OpenAPI document and full-history scanning repeated. Please report only remaining substantive issues in these final changes. No edits, merge, release or deployment. |
|
Claude finished @SirNarsh's task in 39s —— View job Final review of b48983a (read-only)I found no substantive remaining defects in these changes. This is from reading the code. I did not run the Go, PostgreSQL, SDK or Playwright tests. I also did not read the new regression tests, the SDK diffs, the web UI or the idempotency middleware. Your statements about those, and about the Gitleaks decoding and history scan, are unchecked. Confirmed from source
Non-blocking notes
I did not confirm whether the new tests cover the 24-hour saved-form case with an empty list, or the legacy no-customer case in note 1. No edits, merge, release or deployment were made. |
|
Claude final review at b48983a reports no substantive remaining defects. Its optional points are intentional/documented: no automatic non-purchase inference from an empty list, a conservative 23–25 hour safety interval, and actor/application-scoped HTTP idempotency alongside durable subject-operation keys. Confirmed provider forms always contain a nonempty customer; list pagination errors fail rather than treating partial results as absence. Administrative resolution is a trusted, reasoned attestation with atomic audit, not automated proof of absence. Additional negative PostgreSQL tests reject auditors and ineligible states and prove audit failure rolls back resolution; schema-8 upgrade/down/up and completed-checkout-before-subscription cancellation regressions pass. Local browser suite: 76 passed, 4 optional skipped; current CI runs the real bootstrap flow separately. 7126a74 changes only the exact verified public-schema Gitleaks capture (not a source exclusion). Latest-head checks are pending. No merge/release/deployment. |
|
Final head 67e09ad passes all CI and Security checks, including browser flows, PostgreSQL/MinIO execution assertions, race tests, migration checks, SDK consumers, image and Helm smoke checks. Claude source review reports no substantive remaining defects; the automatic review also passes. Setup browser flows now explicitly dismiss credentials after reading them, while the separate navigation-persistence test remains. Cancellation allows later resubscription; archival is a separate operation requiring settled billing. Provider calls remain mocked in regression tests; live-provider acceptance is not claimed. This PR has not been merged, released or deployed. |
67e09ad to
60fbb7e
Compare
|
@claude Please review the rebased head 60fbb7e against current main (v0.7.1). Read-only review: do not edit, merge, release or deploy. The complete previous snapshot was consolidated before rebase because substantive fixes lived in an old merge commit. Released migrations 00001-00010 are unchanged; new migrations are 00011/00012, with upgrade/down/up tested from schema 10. Preserve the v0.7.1 typed Stripe acknowledgements, ignored-event classification, row-locked receipts and single-transaction normalizers; signed event created timestamps now reach the existing grace/stale guards through that receipt processor. Inspect interaction correctness, cross-application isolation, no nested pool use, cancellation/resubscription, durable recovery, current invitation credentials and persistent notices. Added a real PostgreSQL HTTP regression for signed timestamp, rollback/retry and stale subscription events with a one-connection pool. Prior reviewed product decisions are unchanged: cancellation permits resubscription; archival is separate; old unknown checkout outcomes are not inferred absent automatically. Report substantive defects with source references. Do not treat workflow success as test execution. |
|
Claude finished @SirNarsh's task in 1m 24s —— View job Review of rebased head 60fbb7e (read-only)I read the source and diffed against No substantive defects found in the interactions you asked about. Three non-blocking observations are below. Confirmed from source
Non-blocking observations
Not verified
No edits, merge, release or deployment were made. |
|
@claude Final delta review requested at 1f58d38. Your rebase review found no substantive interaction defects. Subsequent changes patch chi to 5.4.0, fast-uri to 3.1.9 and zod 4.x to 4.6.6; the exact generated OpenAPI finding was decoded as the public schema and narrowly allowlisted by value and path, with full-history scanning passing. Current main invitation responses use invitation_url, so both generic creation/action credential paths now retain that link in the existing persistent notice; a focused browser test verifies expiry does not hide it and explicit dismissal does. Three focused browser tests pass. Full PostgreSQL Go race suites and SDK/lint/contracts passed; exact-head CI remains required. Please confirm any remaining substantive blockers in these deltas, especially existing invitation/control workflows. No edits, merge, release or deployment. |
|
Claude finished @SirNarsh's task in 30s —— View job Final delta review of 1f58d38 (read-only)No substantive blockers found in these deltas. I read the diff What I checked
Non-blocking note
No edits, merge, release or deployment were made. |
Summary
Compatibility
Verification
No release, deployment, purchase, credential rotation or real-account changes are included.