Skip to content

chore(audit-2026-05-28): next-cycle prep — clean dead refs + tame noisy gate - #199

Merged
ejay-dev merged 3 commits into
mainfrom
chore/audit-2026-05-28-next-cycle-prep
May 28, 2026
Merged

chore(audit-2026-05-28): next-cycle prep — clean dead refs + tame noisy gate#199
ejay-dev merged 3 commits into
mainfrom
chore/audit-2026-05-28-next-cycle-prep

Conversation

@ejay-dev

@ejay-dev ejay-dev commented May 28, 2026

Copy link
Copy Markdown
Owner

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.orgs refs + missing file_hash in 5 sibling e2e specs

Same 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 — adds file_hash (NOT NULL since 7fd40ffa) + removes the orgs.delete mirror at teardown.
  • e2e/trial-provisioning-guarantee.spec.tsmirrorLegacyOrg() becomes a no-op stub.
  • e2e/auth-invariant.spec.ts — removes orgs.delete at 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 — removes orgs.upsert mirror, simplifies teardown comment.

2. Demote Deployment Quality Gates production-config check to advisory

That GitHub Actions workflow has been red on every main push for ≥5 commits. Root cause: check-env.js --strict --profile=production runs against process.env in 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 015a0959 to 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: true to 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-recency

When the gate is in time-bomb mode (an initial restore_test_runs row 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

Gate Result
npm run type-check exit 0
npx jest __tests__/ --testPathIgnorePatterns='integration/rls' 359 suites / 5248 tests / 0 failures
node --check scripts/check-restore-test-recency.mjs syntax OK

Test plan

  • CI passes on this PR (the same gates that protected PR feat(audit-2026-05-27): NDIS Phase 3 UI + unified health dashboard + CAPA auto-create + /verify #192)
  • After merge: verify next main commit doesn't have a red Deployment Quality Gates failure surface (it should be advisory now)
  • Spot-check that 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.ts no longer fail on the dead public.orgs references when run

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Updated end-to-end tests to reflect database schema consolidation and removal of legacy mirror table.
  • Chores

    • Modified deployment validation step to run as advisory rather than a critical blocker.
    • Enhanced CI restore-test recency gate to display next scheduled drill date in logs.

Review Change Stack

ejay-dev and others added 3 commits May 28, 2026 14:41
…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>
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
forma-os Ready Ready Preview, Comment May 28, 2026 5:20am

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 79e644b5-9b48-410b-bb07-1fdce8ee6a8e

📥 Commits

Reviewing files that changed from the base of the PR and between fbe62fd and c2efb7d.

📒 Files selected for processing (7)
  • .github/workflows/deployment-gates.yml
  • e2e/auth-invariant.spec.ts
  • e2e/auth/mfa-enforcement.spec.ts
  • e2e/onboarding-flow.spec.ts
  • e2e/product-walkthrough.spec.ts
  • e2e/trial-provisioning-guarantee.spec.ts
  • scripts/check-restore-test-recency.mjs

📝 Walkthrough

Walkthrough

This PR removes legacy public.orgs mirror table references from five E2E test files following a schema migration, adds SHA-256 file hashing to evidence uploads in the onboarding flow, makes the production config validation check advisory in CI, and enhances restore-test recency logging with due-date output.

Changes

Schema migration cleanup and CI enhancements

Layer / File(s) Summary
Production config validation advisory mode
.github/workflows/deployment-gates.yml
The "Production configuration validation" step is changed to advisory by adding continue-on-error: true, allowing pipeline failures in npm run check:production-config to be non-blocking.
Legacy orgs table removal from E2E tests
e2e/auth-invariant.spec.ts, e2e/auth/mfa-enforcement.spec.ts, e2e/product-walkthrough.spec.ts, e2e/trial-provisioning-guarantee.spec.ts
E2E test cleanup and provisioning paths remove upserting/deleting from the legacy public.orgs mirror table and replace those operations with comments documenting the schema migration that dropped the table; mirrorLegacyOrg helper becomes a no-op.
Evidence file hashing in onboarding flow
e2e/onboarding-flow.spec.ts
Test imports createHash and computes a SHA-256 hash for evidence content, including the file_hash value in org_evidence inserts; cleanup removes legacy orgs deletion references.
Restore test recency due-date logging and documentation
scripts/check-restore-test-recency.mjs
Expanded comments clarify the transition from warn-only to blocking behavior; success path now computes and logs the next restore-test due date derived from performed_at plus the 35-day window.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A migration swept away the mirror's gleam,
E2E tests now wake from their dream,
No more the orgs dance, yet evidence hashes shine,
CI gates relax while restore-drills align—
Hoppy hops forward through schema's refine! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: removing dead references to the legacy public.orgs table and demoting a noisy CI gate, which are the central themes of the changeset across the workflow and E2E specs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/audit-2026-05-28-next-cycle-prep

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@github-actions

Copy link
Copy Markdown

♿ Accessibility Test Results

PASSED - No critical accessibility issues found

Tests Performed:

  • WCAG 2.1 AA compliance validation
  • Cross-browser accessibility testing
  • Keyboard navigation testing
  • Screen reader compatibility
  • Color contrast validation

Artifacts: Download the accessibility reports from the "Artifacts" section for detailed results.

@ejay-dev
ejay-dev merged commit e3d5385 into main May 28, 2026
30 checks passed
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.

1 participant