Skip to content

PAY-002A1: add canonical commerce state reducers - #162

Merged
daliu merged 1 commit into
mainfrom
codex/issue-161-commerce-state-reducers
Jul 13, 2026
Merged

daliu merged 1 commit into
mainfrom
codex/issue-161-commerce-state-reducers

Conversation

@daliu

@daliu daliu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Closes #161

Outcome

Adds the source-only version-1 commerce state contract that later race, shop, webhook, cancellation, and refund work can share. No current endpoint imports it, no record is changed, and no payment behavior becomes available.

  • separates payment, registration, fulfillment, confirmed-refund, and per-dispute state
  • treats same-state as unchanged, never as proof of Event/command replay
  • validates disputes separately so an order/registration cannot collapse multiple disputes into one field
  • rejects impossible cross-dimension combinations with fixed results
  • classifies all current legacy status shapes conservatively without emitting a write patch
  • quarantines provider references, mismatched refunds, malformed timestamps, and operational status that lacks compatible payment evidence
  • emits only fixed aggregate counts/reasons in its synthetic dry-run report

Security and compatibility boundary

The module is dependency-free CommonJS and makes no Firebase, Stripe, network, filesystem, environment, logger, clock, or random call. Inputs and outputs are non-mutating/frozen; hostile accessors, proxies, prototypes, nested timestamp values, opaque IDs, and canary data are covered.

This PR does not add command identity, webhook adoption, a migration, a compatibility writer, capacity/inventory, refund commands, provider configuration, or production testing. PAY-002B-D, PAY-003B, PAY-005, #113, and PAY-002A2 retain those boundaries.

Verification

Node 20 on exact commit 1db6fe3:

  • commerce-state focused suite: 110/110 passed
  • full Functions suite: 12 suites, 567 passed, 1 intentional skip
  • npm --prefix functions run lint: passed
  • frontend Jest: 132/132 passed
  • SPA navigation: 10/10 passed
  • diagnostic production build: passed
  • Firestore Rules on demo-rules-test with Java 17: 305/305 passed
  • diff, relative-link, sensitive-pattern, scope, and runtime-import checks: passed
  • two independent exact-file reviews: approved

State and deployment truth

  • Source changed: yes
  • Tests passed: yes
  • Code merged: no, at PR creation
  • Website published: no
  • runmprc.com verified: no
  • Firebase deployed: no
  • Stripe/provider configured: no
  • Production behavior verified: no

Officer impact: No current officer screen, payment flow, or procedure changes. Commerce remains NOT AVAILABLE YET.

Officer documentation: None — the library is not imported by a runtime endpoint and gives officers no usable action.

Deployment evidence: Source/tests and local isolated verification only. Website, Firebase, Stripe/provider, migration, and live behavior are intentionally unmodified/unverified at PR creation.

@netlify

netlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for luminous-fox-7c393f ready!

Name Link
🔨 Latest commit 1db6fe3
🔍 Latest deploy log https://app.netlify.com/projects/luminous-fox-7c393f/deploys/6a5505f1d8f6c7000817dba0
😎 Deploy Preview https://deploy-preview-162--luminous-fox-7c393f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@daliu
daliu merged commit 68dbcae into main Jul 13, 2026
7 checks passed
@daliu
daliu deleted the codex/issue-161-commerce-state-reducers branch July 13, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PAY-002A1 — Add pure canonical commerce-state reducers and a safe legacy classifier

1 participant