Repository navigation
PAY-002B2C3A — Freeze the closed Stripe reconciliation decision contract #184
Description
Officer impact: None. This child adds an unused server-only policy and tests. It changes no current checkout, payment, refund, or officer procedure.
Officer documentation: None — no public page, officer duty, provider account, deployment, or production behavior changes.
Deployment evidence: Source/tests only. Closure must explicitly say whether website, runmprc.com, Firebase, Stripe/provider configuration, and production behavior were changed; no green workflow proves those surfaces live.
Problem
PAY-002B2C2/#182 safely stops automatic POST retries when the original attempt is old or ambiguous. The next boundary must not turn a timeout, connection loss, Stripe 5xx, pruned idempotency key, missing reference, 404, or partial/empty search into permission for attempt 2.
A persistence or runtime API would be premature until the allowed evidence matrix is closed and exhaustively tested. Current C2 source also does not record a complete dispatch/response history.
Atomic outcome
Add one pure CommonJS classifier for attempt-1 reconciliation evidence. It returns only fixed frozen classifications:
existing_attempt_found— exact verified attempt-1 provider evidence exists; do not advance.new_attempt_candidate— evidence is structurally sufficient for a later persistence/authorization review, but this result is not permission to send.reconciliation_required— outcome remains unsafe or unknown; do not advance.
The first version may produce new_attempt_candidate only for:
- a complete trusted dispatch history proving endpoint execution never began, with exact plan binding and an explicitly eligible same logical operation; or
- an exact verified attempt-1 Checkout Session that is terminal
expired,unpaid, bound to the exact plan, supported by verified expiry evidence, and paired with an explicitly eligible new logical generation.
An exact open attempt, or exact completed paid/no-payment-required attempt with verified success evidence, may produce only existing_attempt_found.
Every other valid evidence combination produces reconciliation_required. Invalid/schema-hostile input fails with one fixed non-identifying error.
Non-negotiable exclusions
- No Firestore read/write or reconciliation record.
- No Stripe/network/provider call or SDK dependency.
- No provider-object ID, idempotency key, account, metadata, amount, member, order, or registration value in input/output.
- No runtime/index import.
- No send/execute/advance authorization, attempt-2 plan/key/document, response replay, or business transition.
- No caller-selected free text, URLs, status codes, timestamps, reason strings, or booleans that can bypass the closed enum matrix.
- No package/lock/workflow/Rules source/provider configuration/production data/officer procedure change.
Exact owned paths
- new
functions/commerceProviderReconciliation.js - new
functions/commerceProviderReconciliation.test.js STRIPE_COMMERCE_DESIGN.mdSYSTEM_DESIGN.mdSECURITY.mdIMPLEMENTATION_PLAN.mdGITHUB_ISSUES.mdGITHUB_ISSUE_SLICES.md
All other paths are excluded, especially functions/commerceCommandJournal.js, checkout creators, webhook runtime, index, Rules, package/lock/workflows, account/email/profile code, and officer docs.
Acceptance
- Exact root fields, schema version, provider
stripe, and attempt1only. - Closed enum matrix covers complete dispatch-never-began, exact open/success/expired provider evidence, and every unsafe/contradictory combination.
- Timeout, connection loss, 409/424/429/5xx, old/pruned key, missing reference, 404 without an exact known object, empty/partial search, unknown/open/complete-processing/conflicting Session evidence never produces a candidate.
- Results and error text are fixed/frozen and contain no input.
- Extra/missing/inherited/symbol fields, accessors, proxies, custom prototypes, invalid Unicode, unknown/future enums, and mutation attempts fail closed without invoking traps.
- Static tests prove no Firebase, Stripe, network, logger, environment, clock, random, filesystem, dynamic import, or runtime/index adoption.
- Focused and full Node 20 Functions suites, frontend suite/build, Rules suite, and workflow/artifact guards pass.
- Security, test/coverage, and documentation reviews approve the exact diff.
Dependencies and follow-ups
Dependencies complete: PAY-002B2C2/#182 merged as 95be260d08377b7e931dd3526da91b59c5fbf755; PAY-003A/#101 evidence vocabulary is merged.
This child does not complete PAY-002B2C3. Follow-ups remain:
- C3B: persist immutable paired reconciliation evidence only after a trusted verifier can produce it.
- C3C: authorize/version a later provider attempt only after persisted proof plus business transition and a fresh lease.
- PAY-001B/C, PAY-002C/D, PAY-003B, RACE/MERCH capacity/inventory, runtime adoption, protected deployment, and live verification.
Activity
daliu commentedon Jul 13, 2026
CLAIMED by Codex agent
/rootat 2026-07-13T21:47:40Z.Branch:
codex/issue-184-pay-002b2c3a-policyIsolated worktree:
/Users/daveliu/Code/Run-MPRC.issue-184Exact base:
95be260d08377b7e931dd3526da91b59c5fbf755Owned paths are exactly the eight listed in the issue body: two new pure policy/test files plus six narrow root design/status documents. All journal persistence, checkout/webhook/runtime/index, Rules, package/lock/workflow, provider, production-data, account/email/profile, and officer paths are excluded.
Invariant: classification is not authorization. This child cannot send, execute, advance, persist, or prove provider truth. C3B/C3C remain required.
daliu commentedon Jul 13, 2026
EXTRACTION FINISHED by Codex agent
/rootat 2026-07-13T22:01:25Z.Exact staged scope is the eight claimed paths only: the new pure classifier/test plus the six named root design/status documents.
git diff --cached --checkis clean.Verification on Node 20 / Java 17:
Three independent read-only reviews approved the exact corrected diff: security/correctness, adversarial tests, and documentation/dependency truth.
Officer impact: None. No current checkout, payment, refund, page, or officer procedure changes.
Officer documentation: None — this module is unused and has no officer-visible behavior.
Deployment evidence: source/tests only. No runtime/index import, Firebase deployment, Stripe/provider call or configuration, website publication, runmprc.com verification, production data access, or live behavior. C3B evidence persistence and C3C later-attempt authorization/versioning remain open.
feat: freeze Stripe reconciliation policy (#184) (#185)
daliu commentedon Jul 13, 2026
COMPLETE / CLAIM RELEASED at 2026-07-13T22:06:30Z.
PR #185 admin-squash merged exact reviewed head
f43237c2952e7ab334f1c2ad4d4b0ed6eb09cd69as main5c7d2d160237465b367c4dcc799cefcfab1e4e9b.Post-merge exact-main CI run 29288647739 passed all five jobs:
PR Netlify preview completed successfully. It is preview evidence only, not production publication.
Three independent reviews approved the final eight-path diff after fixes. The source contract has exactly two candidate tuples, exact open/success existing-attempt tuples, and one fixed fail-closed reconciliation result for every other valid combination. Hostile input remains fixed-error/redacted.
Officer impact: None.
Officer documentation: None — no officer-visible behavior changed.
Deployment evidence: Source/tests/merge only. No runtime/index adoption, Firebase deployment, Stripe/provider call or configuration, production data action, website production publication,
runmprc.comrevision verification, or live behavior. C3B and C3C remain open.The #184 path claim is released.