thrivePCISite v0.43.62+20261122T201000Z

SCOTT REVIEW · PLATFORM AND DELIVERY

A clear path to protected learning.

An evidence-based review of authenticated enrollment and paid access, with a phased implementation plan and explicit acceptance gates.

340focused automated checks passed
24live boundary checks passed
45acceptance scenarios tracked
10implementation gaps recorded

Automated fixtures, anonymous boundary checks and a completed customer journey are different kinds of evidence. Forty matrix rows still require execution; the five recorded rows include configuration, schema, local tests and two live boundary scenarios.

Review and execution files

The CSV distinguishes observed results from work not yet run. No secrets, account identifiers, personal database rows or payment credentials are included.

What must be connected and proven

  1. G01 · Provider activation absent

    Dedicated Stripe sandbox, Twilio Verify/email setup, hosted secrets, allowlist and explicit pilot enablement are missing.

    P0 · Phase 1 · Scott / integration owner

  2. G02 · Fresh-login proof boundary unproven

    Step-up cookie is bound to account, not an exposed native login session; direct sign-out does not explicitly revoke it.

    P0 · Phase 1 · Engineering / platform capability review

  3. G03 · Authenticated checkout HTTP/UI missing

    Internal test order/consent/session helpers have no learner-facing authenticated checkout route or approved immutable document registry.

    P0 · Phase 2 · Engineering / Scott

  4. G04 · Payment-to-enrollment fulfillment missing

    Test receiver and ledger deliberately grant no live access. Add atomic production-capable grant processing and durable recovery.

    P0 · Phase 3 · Engineering

  5. G05 · Purchase-time policy unapproved

    Current test-event timestamp is not an approved exact live purchase/capture policy; duration and price remain proposals.

    P0 · Phases 0 and 3 · Scott / engineering

  6. G06 · Private media routes missing

    Public review/GitHub assets cannot become confidential retroactively. New paid media needs private storage and server authorization.

    P0 · Phases 0 and 4 · Content owner / engineering

  7. G07 · Two-account hosted acceptance absent

    Local fixtures do not prove native login, actual verification delivery, provider callbacks or cross-account media isolation.

    P0 · Phases 1–5 · QA / consenting participants

  8. G08 · Commercial and participant procedures pending

    Approve offer, terms, refund/dispute handling, data retention and recovery before collecting pilot participant data or accepting charges.

    P0 · Phase 0 · Scott

  9. G09 · Owner administration and support incomplete

    Authorized revoke/extend/recover/reinstate workflows and human support/reconciliation need implementation and rehearsal.

    P1 · Phase 5 · Operations / engineering

  10. G10 · Production outage and rollback evidence absent

    Rehearse key rotation, failed writes, webhook recovery, backup/migration and paid-but-unfulfilled handling.

    P1 · Phase 5 · Engineering / operations

Version 0.1.0+20261122T201000Z · November 22, 2026 · Reviewer: Scott

Readiness: implementation foundation; the paid journey is not operational or verified end to end. This plan covers one standalone course in a controlled pilot. It preserves native ChatGPT sign-in, the existing email/SMS verification design, public preparation resources, and the hold on newsletter thirty-four and marketing expansion. It does not enable providers, send messages, create charges or grant course access.

What the inspection establishes

The production runtime inspection found revision 3 with only ASSET_DELIVERY_WRITE_MODE=disabled. Stripe credentials, Twilio credentials, their enable flags and the verification pilot allowlist are absent. D1 exposes fourteen application tables; table names establish deployed schema, not enrollment contents or successful transactions. No personal rows were read for this plan.

The focused local suite passes 340 checks across nine member, verification, authorization and payment test files. SQLite migrations execute, but provider transports use intercepted fixtures. Those results support domain behavior; they do not establish actual delivery, native sign-in continuity, provider configuration or hosted two-account isolation. Twenty-four production HTTP checks passed across the custom and platform origins: anonymous member APIs and forged identity headers were denied, identity-dependent responses were no-store, and the disabled test receiver rejected an unsigned event. The native sign-in entry was observed reaching OpenAI login; no signed-in lifecycle was completed. Scott confirmed that neither Stripe sandbox nor Twilio Verify is configured. These findings are recorded separately and do not prove the paid journey.

BoundaryExisting implementationRemaining acceptance
Account identityapp/chatgpt-auth.ts; native sign-in and protected API identityHosted sign-in, reload, sign-out and two-account observation
Verificationmember-step-up.mjs; managed email/SMS adapter, bound destinations, quotas, short proof and client UIReal delivery, recovery, retention and fresh-login binding
CheckoutImmutable test orders, consent references, retry-safe session helperReviewed document registry and authenticated HTTP/UI integration
PaymentSigned test inbox, fresh Stripe reconciliation, separate test access/hold ledgerLive-capable fulfillment, approved purchase clock and atomic grant
EnrollmentRead-only summaries; pure purchase and authorization policiesPersisted authorized transitions and production route integration
MediaPublic review/download deliveryPrivate course media, authorized playback and operational verification

handleEnrollmentRequest explicitly returns playbackAvailable:false. The test receiver returns fulfillment:false; verified test receipts remain verified_no_grant. Existing helpers must not be presented as an operational paywall.

Target journey and scope

Native Site identity → email/SMS proof → approved order and terms acceptance → Stripe-hosted Checkout → durable verified payment event → atomic course grant → server entitlement checks → private media delivery → expiry, revocation and support.

Native identity remains the base account boundary. It does not itself satisfy the designed email/SMS proof. Keep platform sign-in as a top-level navigation; do not build a second OAuth stack. Anonymous browsing remains available. The learner sees the course, amount, currency, access period, purchase-start rule, download policy, terms and support route before accepting an order.

The initial release is a one-time, one-course purchase. Subscriptions, teams, seats, automatic renewals and grace periods are outside this pilot. The proposed $495 and 90 days remain unapproved commercial proposals. Neither tests nor this plan approve them.

Phase 0 — freeze the pilot contract

Scott selects the pilot course, reviewed recording and captions, two consenting pilot accounts, and the applicable commercial documents. Record the approved price, currency, duration, purchase-time definition, refund/dispute policy, downloads, support and recovery procedure in versioned records. A real learner's consent must reference immutable document bytes, not a mutable URL alone.

Separate public teasers and review materials from future paid payloads. Current /review PPTX/PDF downloads are public, and release artifacts are in public GitHub. A future login page cannot protect those existing copies or recall downloads. Put paid originals and recordings outside public directories, source repositories, public R2 delivery catalogs, archives and downloadable backups. Decide explicitly which existing materials remain public.

Exit: approved pilot configuration and data-handling procedures; private asset list; no ambiguous offer presented for payment.

Phase 1 — prove identity and close the session gap

Exercise native sign-in, save/reload/delete of a fictional generic plan, sign-out, and independent account B. Ownership must come from platform identity, never a body, query, payment metadata or user-supplied header. Verify the platform strips forged identity headers, private responses cannot cross caches, and mutations enforce same-origin requests.

Configure a dedicated Twilio Verify service, email delivery configuration, intended SMS destinations/geographies, provider fraud controls, spending alerts and pilot allowlist. Store credentials and a high-entropy binding secret through hosted secret settings. Enable verification only after the provider and participant checks; sending still needs the user's explicit acknowledgment. Test wrong/expired codes, quotas, interrupted delivery, resumed flows, cancellation and approved recovery. Do not log codes or raw session secrets.

P0 session gap: readMemberStepUp currently binds proof to user ID, flow cookie and destination hashes, not an exposed native login-session ID. Existing sign-out links do not explicitly revoke that proof. Same-account re-login inside its lifetime may reuse it. The requirement for fresh verification on a new login is therefore not demonstrated.

Implement a server-owned training-session record with finite lifetime, proof binding, revocation and accountable events. The application's sign-out must revoke training proof/session and clear its cookie before platform sign-out. Confirm whether the platform supplies a supported native-session binding or lifecycle signal. Direct platform logout and re-login must be tested too. If the required lifecycle cannot be observed reliably, resolve that capability or explicitly review the requirement before paid release; a short TTL alone does not prove new-login freshness. Do not invent a platform callback or infer a login from a page visit.

Exit: two real accounts pass isolation, factor binding and sign-out/re-login tests; fresh-login semantics are explicit and satisfied.

Phase 2 — connect authenticated sandbox checkout

Add same-origin, bounded JSON checkout and consent routes, for example app/api/training/checkout/route.ts, plus a purchase page and owned order-status endpoint. These are proposed routes, not existing capabilities. Reuse purchase-order-ledger.mjs, purchase-checkout-intents.mjs and stripe-test-checkout.mjs where their test-only boundaries fit. Keep server offers authoritative: the browser selects a course, not its price, duration or owner.

Persist order and affirmative terms acceptance before provider session creation. Preserve the existing durable idempotency key and fixed session parameters across ambiguous retries. Return only the validated Stripe-hosted URL after session binding succeeds. A cancelled or abandoned checkout produces no entitlement. Returning to the success page is a status check, never proof of payment. Offer a clear pending state if processing is incomplete.

Use a dedicated sandbox, matched account and test prices first. Keep sandbox and eventual live credentials, signing secrets, event receipts and grants distinguishable. Never promote a test_purchase_access row into a live enrollment merely by enabling a flag.

Exit: the exact owned order survives browser interruption and retry, without duplicate sessions or grants; no live charge is possible.

Phase 3 — implement durable fulfillment and enrollment

Retain bounded raw-body signature verification, expected account checks and fresh provider reads from stripe-test-inbox.mjs and stripe-test-reconciliation.mjs. Add a deliberate production-capable fulfillment path rather than silently changing test receipts to grant access. Validate the saved learner/order/session/price/amount/currency/course relationship before granting.

The current test policy uses the original payment_intent.succeeded event creation time. That is event evidence, not an approved exact capture/settlement timestamp. Select and document the authoritative successful-purchase field/event for the supported payment method and configuration. Persist its provenance; derive starts_at and expires_at once. Delivery, first viewing and re-login cannot restart the duration. Deferred payment support needs its own successful-payment handling or must remain outside the pilot.

Use additive migrations, preserving applied SQL history. Proposed records include a versioned commercial-document registry, a durable fulfillment event state/attempt record, a purchase-to-course grant keyed uniquely by provider/account/purchase/course, enrollment transition events, training sessions and a private course-asset registry. Existing training_enrollments has only order uniqueness and status/start/expiry; reconcile that schema with the richer purchase-domain model before connecting it. Specify foreign keys or equivalent validated references and indexes for owner/course, event identity, expiry and revocation lookups.

A D1 transaction/batch must make grant uniqueness and its durable processing result consistent. A separately committed inbox is acceptable only when retries or a durable worker resume unfinished work. Never acknowledge an event as fulfilled between payment verification and a lost grant write. Handle duplicate, concurrent, out-of-order, delayed and interrupted processing. Store only required identifiers and audit facts, with sanitized errors and recovery visibility.

Exit: a successful sandbox purchase creates exactly one correct enrollment; denial/hold states survive later success retries; purchase dates never move.

Phase 4 — deliver private learning

Add a server-only playback authorization route and private media handler, for example app/api/training/[courseId]/playback/route.ts and app/api/training/media/[assetId]/route.ts. Resolve asset keys from a trusted course registry. Read native identity, the current training session/proof, course enrollment, expiry and holds for each authorization; never accept these facts from browser JSON.

Reuse authorizePlayback after building records from trusted reads, with explicit adapters for its state fields versus database status fields. A signed short-lived token should bind learner, course, asset/version, session and expiry. Bound its expiry by proof, session and entitlement limits. The media handler must enforce identity/session binding and current revocation as well as token signature; a copied URL must not authorize another learner.

Store the reviewed MP4 in private Sites R2 with no public object URL. Test HEAD, valid ranges, seeking, invalid/unsatisfiable ranges, disconnects and renewal, including revocation or expiry between requests. Use private/no-store responses and avoid shared caching of authenticated content. Test captions/transcripts/downloads under the same visibility policy. Do not promise DRM or recall of already buffered/downloaded bytes. Measure startup, mobile playback, file size and delivery cost before choosing whether a streaming provider is necessary.

Exit: account A can watch only its valid course; B, anonymous, unverified, unpaid, expired and revoked cases cannot obtain protected bytes.

Phase 5 — close refund, recovery and operations

The existing test ledger conservatively holds access for partial/full refunds and disputes, including closed/won disputes. Approve the actual customer policy separately. Implement verified provider events as monotonic denial states; a paid retry must not reactivate them. Any reinstatement, extension or manual grant requires an authorized human, reason, original record linkage and an audit event. A manual grant is not a fabricated payment.

Provide owner-authorized revoke/extend/recovery workflows, least-privilege administration, retained support records and a staffed route. Factor changes must verify identity through the approved recovery procedure rather than accepting a new phone. Define retention/deletion for pseudonymous verification, payment and audit records, and provider retention separately. Test key rotation, session invalidation, provider outage and database failure without exposing secrets.

Back up the schema and approved configuration references, rehearse additive migrations in a separate test environment, then deploy with new checkout/media/grant flags off. Rollback disables new entry and access issuance, preserves receipts and enrollment history, and reconciles any paid-but-unfulfilled order with human support. It must not delete payment history or reset access clocks. Assess the impact before applying a destructive schema rollback.

Acceptance, rollout and ownership

The accompanying matrix is the execution contract. Each row needs an environment, observed result and sanitized evidence; a fixture pass cannot close a hosted/provider row. Scott reviews commercial, participant and release decisions. Engineering owns integration and evidence; operations owns support, reconciliation and recovery.

Run in order: local contract tests → isolated sandbox integration → two-account hosted pilot → reviewed private media pilot → refund/expiry/outage rehearsal → limited release. Release requires zero unresolved access-control failures, actual provider delivery, correct immutable grants, two-account/two-course denial tests, private media protection, approved terms, recovery/support, monitoring and rollback. Keep subscriptions and live sales disabled until their own gates pass. The next concrete implementation step is Phase 1's two-account identity/session pilot, alongside Scott's Phase 0 selections.

Provider setup runbook

Scott confirmed that neither provider is configured. Start in isolated test services, with live sales disabled. Account creation, sender/domain verification, participant consent and spending limits are prerequisites; this release performs none of those external actions.

PurposeExisting runtime namesActivation condition
Stripe sandboxSTRIPE_TEST_SECRET_KEY, STRIPE_TEST_ACCOUNT_ID, STRIPE_TEST_WEBHOOK_SECRETCorrect sandbox, price, destination and compatible events verified
Stripe pilot gatesSTRIPE_TEST_RECEIVER_ENABLED, STRIPE_TEST_PROCESSOR_ENABLED, STRIPE_TEST_ACCESS_POLICYEnable in the controlled sandbox sequence; test policy is not a live grant
Managed verificationTWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_VERIFY_SERVICE_SID, MEMBER_BINDING_SECRETEmail/SMS delivery setup, secret handling and binding design reviewed
Verification gateMEMBER_VERIFICATION_ENABLED, MEMBER_VERIFICATION_PILOT_IDSTwo consenting accounts, explicit delivery and session-lifecycle acceptance ready

Redeploy after a deliberate runtime change, record the resulting configuration revision without secret values, and execute the applicable matrix rows. Keep ASSET_DELIVERY_WRITE_MODE=disabled; public marketing-download maintenance is unrelated to protected training delivery. Enable no live payment capability until the separate fulfillment, private-media and release gates pass.

Sources and evidence boundaries

Repository references are relative to thrivepci/source: app/chatgpt-auth.ts, app/api/member/*, app/api/payments/stripe/test-events/route.ts, src/server/member-service.mjs, member-step-up.mjs, training-access.mjs, purchase-enrollment.mjs, the purchase/Stripe modules listed above, and additive migrations drizzle/0000 through 0007. Existing specifications: TRAINING_ACCESS_SPEC.md, docs/MEMBER_AREA.md, docs/STRIPE_LOGIN_PILOT_v0.2.0.md. Runtime inspection and current test results are supplied by the release audit; real provider/browser evidence remains separately recorded.

Stripe fulfillment (opens in a new tab) supports server-side, retry-safe fulfillment and handling of delayed successful payments. Stripe webhooks (opens in a new tab) informs signature verification and durable processing. Twilio email verification (opens in a new tab) and rate limits (opens in a new tab) inform service setup and delivery limits. The proposed architecture, phases and acceptance conditions are thrivePCI implementation decisions, not provider certifications or a PCI compliance conclusion.