chore(audit-2026-05-28): next-cycle prep — clean dead refs + tame noisy gate - #199
Conversation
…5 e2e specs Follow-up to PR #192. The legacy public.orgs mirror calls inside e2e/helpers/test-auth.ts were removed in that PR's CI-unblock pass, but sibling specs that don't go through the helper still carried the same dead references. None of them are gated by Playwright Integrity Gate, so they didn't block #192 — but they would fail the moment any other workflow ran them (qa:deep, nightly sweep, ad-hoc local runs). Surgical cleanup: * e2e/onboarding-flow.spec.ts — adds file_hash to seeded org_evidence row (NOT NULL since commit 7fd40ff) AND removes the `from('orgs').delete()` mirror at teardown. * e2e/trial-provisioning-guarantee.spec.ts — mirrorLegacyOrg() becomes a no-op stub. Kept as a function so the 3 call sites compile without churn; safe to inline-delete in a future pass. * e2e/auth-invariant.spec.ts — removes `orgs.delete` at teardown and the legacy mirror upsert + error propagation at line 367. * e2e/product-walkthrough.spec.ts — 3 sites: teardown delete, setup upsert, second teardown delete. * e2e/auth/mfa-enforcement.spec.ts — removes the `orgs.upsert` mirror + simplifies the teardown comment (the mirror trigger referenced no longer exists either). Verified: npm run type-check exits 0. No spec semantics changed beyond removing impossible writes; every spec still creates + deletes an `organizations` row through the canonical path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…n deployment-gates The "Production configuration validation (critical)" step has been failing on every main push for months. Verified: last 5 main commits all have `Deployment Quality Gates: failure` status. Root cause: the step runs `check-env.js --strict --profile=production` against process.env, but production secrets (FOUNDER_EMAILS, STRIPE_*, RESEND_*, UPSTASH_*, CRON_SECRET, SENTRY_*) live only in Vercel — they were never mirrored to GitHub Actions repo secrets. Worse: this gate can't actually block production deploys. Vercel's git integration deploys main commits on its own schedule, independent of this workflow. We confirmed this with PR #192's merge — Vercel shipped 015a095 to https://www.formaos.com.au successfully while this workflow was red. A perpetually-red non-blocking gate is worse than no gate: it masks real failures (red checks become noise the reviewer ignores). Fix: demote `Production configuration validation` to advisory via `continue-on-error: true`. The summary still surfaces what's missing, so operators can choose to mirror the secrets without us re-promoting the gate ourselves. Re-promote to blocking once GH secrets mirror Vercel prod and the step runs clean for a week. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…cy check
When the gate IS in its time-bomb mode (an initial restore_test_runs
row exists and we're inside the 35-day window), the success log
previously said:
✓ Latest restore test: success (3 days ago, within 35-day window).
That tells the operator they're fine NOW. It doesn't tell them WHEN
the gate flips red. So a drill at day 0 looks identical to a drill at
day 34 — the only thing differentiating them is whether someone
remembers to count.
Now emits the computed deadline:
✓ Latest restore test: success (3 days ago, within 35-day window).
Next drill due by 2026-06-30 or this gate goes red.
Plus a fattened comment in the warn-only branch flagging the operator
heads-up so the time-bomb behaviour isn't a surprise the first time
the gate fires.
No semantic change to the gate's pass/warn/fail logic.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR removes legacy ChangesSchema migration cleanup and CI enhancements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2efb7d3af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # doesn't hide real failures from the rest of the pipeline. | ||
| # Re-promote to blocking once GitHub Actions secrets mirror | ||
| # Vercel prod and this step passes clean for a week. | ||
| continue-on-error: true |
There was a problem hiding this comment.
Make the env demotion cover the build step too
When GitHub Actions does not have FOUNDER_EMAILS mirrored (one of the secrets this new comment says lives only in Vercel), this step being advisory does not make the gate green: the same job still runs Build verification with npm run build later in .github/workflows/deployment-gates.yml:116-117, and package.json:20-21 defines a prebuild that runs CHECK_ENV_STRICT=1 npm run check-env. In the default non-Vercel profile, scripts/check-env.js:51-58 still treats FOUNDER_EMAILS as required, so the workflow remains failed for the stated environment instead of merely surfacing the production-config warning.
Useful? React with 👍 / 👎.
♿ Accessibility Test Results✅ PASSED - No critical accessibility issues found Tests Performed:
Artifacts: Download the accessibility reports from the "Artifacts" section for detailed results. |
Summary
Three small follow-ups to PR #192 so the next audit cycle starts on a truly clean baseline. Each one is independently surgical — no behaviour change beyond removing dead code paths and surfacing existing time-bombs earlier.
What lands
1. Dead
public.orgsrefs + missingfile_hashin 5 sibling e2e specsSame pattern PR #192 fixed in
e2e/helpers/test-auth.ts, but the sibling specs that don't go through the helper still had the references. None of these specs are gated by Playwright Integrity Gate, so they didn't block #192 — but they'd fail the moment any other workflow ran them (qa:deep, nightly sweep, ad-hoc local).e2e/onboarding-flow.spec.ts— addsfile_hash(NOT NULL since7fd40ffa) + removes theorgs.deletemirror at teardown.e2e/trial-provisioning-guarantee.spec.ts—mirrorLegacyOrg()becomes a no-op stub.e2e/auth-invariant.spec.ts— removesorgs.deleteat teardown + the legacy mirror upsert.e2e/product-walkthrough.spec.ts— 3 sites (teardown delete + setup upsert + second teardown delete).e2e/auth/mfa-enforcement.spec.ts— removesorgs.upsertmirror, simplifies teardown comment.2. Demote
Deployment Quality Gatesproduction-config check to advisoryThat GitHub Actions workflow has been red on every main push for ≥5 commits. Root cause:
check-env.js --strict --profile=productionruns againstprocess.envin CI, but production secrets (FOUNDER_EMAILS, STRIPE_, RESEND_, UPSTASH_, CRON_SECRET, SENTRY_) live only in Vercel — never mirrored to GitHub Actions repo secrets.The gate also can't actually block production deploys: Vercel's git integration deploys main commits on its own schedule. PR #192 confirmed this — Vercel shipped
015a0959to https://www.formaos.com.au while this workflow was red.A perpetually-red non-blocking gate is worse than no gate (becomes noise the reviewer ignores). Adding
continue-on-error: trueto the one failing step + a fat comment explaining the trade-off and the re-promote criteria.3. Surface the next-drill-due date in
check-restore-test-recencyWhen the gate is in time-bomb mode (an initial
restore_test_runsrow exists, we're inside the 35-day window), the success log used to say "✓ Latest restore test: success (3 days ago, within 35-day window)" — same message at day 3 and day 34. Operator has to do the arithmetic themselves.Now it computes the deadline and appends "Next drill due by YYYY-MM-DD or this gate goes red." Plus a fatter heads-up comment in the warn-only branch so the time-bomb behaviour isn't a surprise the first time it fires.
Verification
npm run type-checknpx jest __tests__/ --testPathIgnorePatterns='integration/rls'node --check scripts/check-restore-test-recency.mjsTest plan
Deployment Quality Gatesfailure surface (it should be advisory now)npx playwright test e2e/onboarding-flow.spec.ts/e2e/auth-invariant.spec.ts/e2e/auth/mfa-enforcement.spec.ts/e2e/product-walkthrough.spec.ts/e2e/trial-provisioning-guarantee.spec.tsno longer fail on the deadpublic.orgsreferences when run🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Chores