Skip to content

TEST-001A1: add fail-closed Functions test safety harness - #176

Merged
daliu merged 1 commit into
mainfrom
codex/issue-175-test-safety-harness
Jul 13, 2026
Merged

daliu merged 1 commit into
mainfrom
codex/issue-175-test-safety-harness

Conversation

@daliu

@daliu daliu commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

Adds the TEST-001A1 Functions test-safety foundation tracked by #175.

  • Installs one process-wide Jest safety setup for the Functions suite.
  • Adds deterministic, deeply frozen synthetic contact, member, order, and completed Checkout Event fixtures that use reserved test data.
  • Adds one bounded synthetic Stripe raw-payload signer and migrates the existing webhook suite to it.
  • Rejects supplied production-like project/origin/emulator configuration, cloud authority variables, and live-shaped Stripe configuration with fixed redacted errors.
  • Blocks supported Node outbound transports unless the exact loopback endpoint is declared as an emulator.
  • Keeps TEST-001A2 separate for emitted-artifact scanning and named CI/release wiring.

Safety invariants

  • No production secrets or customer/member data are accepted, copied, or logged.
  • Only exact declared localhost, 127.0.0.1, or ::1 emulator endpoints may be reached.
  • Unsafe values fail with fixed messages that do not echo the supplied value.
  • The guard is a Jest test-process boundary, not a complete OS/runtime sandbox.
  • Native/add-on transports, separately spawned emulated Function processes, provider configuration, emitted artifacts, deployment, and live behavior remain outside this issue.

Exact scope

  • functions/testSupport/testSafety.js
  • functions/testSupport/jestSafetySetup.js
  • functions/testSupport/testSafety.test.js
  • functions/package.json
  • functions/stripeWebhook.test.js
  • SECURITY.md
  • GITHUB_ISSUES.md
  • GITHUB_ISSUE_SLICES.md

Staged diff SHA-256 before commit: 2eec0b8e5ea423a78395f9c4bb74db7bc88365fcd3e265271ef2c0bfc4838564.

Verification

Node 20:

  • npm --prefix functions run lint — passed.
  • Focused safety + webhook suite — 223/223 passed.
  • Full Functions unit suite — 931 passed, 26 skipped.
  • Full Auth + Firestore emulator suite — 932 passed, 25 skipped.
  • Commerce command-journal Firestore emulator suite — 25/25 passed.
  • git diff --check — passed.
  • Secret-shaped literal scan — passed.
  • Two independent exact-snapshot reviews — approved with no remaining findings.

Exact PR commit 71c5874b4c0d603bd239dcd674b0e89f3ade679b:

  • Hosted CI run 29279800649 passed Frontend, Cloud Functions, Firestore Rules, and the commerce command-journal emulator jobs.
  • Netlify deploy-preview 6a5540c54a65f20008c6cdef is ready. Its Pages and header checks were neutral/skipped because those surfaces did not change; its redirect check passed.
  • The preview is review evidence only. It is not a production website publication or runmprc.com verification.

Continuity

Officer impact: None — this changes developer test safeguards only and does not change the website or an officer task.

Officer documentation: None — no public content, navigation, admin duty, collected data, permission, deployment step, provider account, payment/refund operation, incident procedure, backup, or recovery behavior changes.

Deployment evidence: Source commit 71c5874b4c0d603bd239dcd674b0e89f3ade679b, local verification, hosted CI run 29279800649, and Netlify review preview 6a5540c54a65f20008c6cdef only. No production website was published or verified. Firebase was not deployed. Stripe and other outside providers were not configured or contacted. Production behavior is unchanged and unproven.

Closes #175

@netlify

netlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 71c5874
🔍 Latest deploy log https://app.netlify.com/projects/luminous-fox-7c393f/deploys/6a5540c54a65f20008c6cdef
😎 Deploy Preview https://deploy-preview-176--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 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

FINAL INDEPENDENT REVIEW — exact commit 71c5874b4c0d603bd239dcd674b0e89f3ade679b

Two independent reviewers approved the frozen source/test snapshot after adversarial probes. A final PR-level audit also approved all eight paths, the staged-diff hash, local and hosted test evidence, Netlify preview state, production/Firebase/provider distinctions, and neutral documentation wording. No remaining findings.

Hosted gate: CI run 29279800649 passed all four jobs; Netlify review preview 6a5540c54a65f20008c6cdef is ready. This is not production deployment evidence.

@daliu
daliu merged commit e6d8929 into main Jul 13, 2026
8 checks passed
@daliu
daliu deleted the codex/issue-175-test-safety-harness branch July 13, 2026 19:51
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.

TEST-001A1 — Add the fail-closed synthetic provider test harness

1 participant