Skip to content

ci: three-minute PR check and two previews per PR - #95

Merged
Programcode merged 6 commits into
mainfrom
t3code/fix-preview-auth-and-faster-ci
Oct 3, 2026
Merged

Programcode merged 6 commits into
mainfrom
t3code/fix-preview-auth-and-faster-ci

Conversation

@Programcode

@Programcode Programcode commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Pull request checks now take about 3 minutes instead of about 26, and each PR gets a production preview and a staging preview that both update on every push.

Why

  • One PR push used about 62 Actions minutes (run 36903797758): quality 5, browser-tests 21, database-tests 19.5, and Live provider E2E 17, which also spent OpenRouter and Exa credit on every push.
  • Signing in on a Vercel preview landed on the live site. Production's Auth redirect allowlist has no vercel.app host, so Supabase fell back to the Site URL. Edge Function CORS also rejected preview origins, so demo-code sign-in and every AI call failed on previews.

What changes

CI:

  • Quality runs lint, types, unit, collaboration, Edge Function and build checks. On PRs a parallel browser-smoke job runs 31 Playwright tests tagged @smoke on desktop Chromium.
  • New browser-nightly.yml runs the full desktop and mobile suite nightly and on demand.
  • New database.yml holds the database gate. It runs only when backend, store, AI or gate paths change, plus weekly.
  • Live provider E2E runs on PRs only when AI or research code changes, plus nightly.
  • New docs.yml: docs-only PRs run docs:check alone.
  • Playwright browsers are cached and npm ci uses the npm cache.

Unit tests:

  • 112 files cut to 24 (274 tests). The kept files cover:
    • security boundaries and Current Debate isolation
    • project selection and stream parsing
    • source import, plus the Crossfire and Sparring rules
    • the voice logic and the voice page tests that the verify-debatelab skill relies on
    • the save-queue ordering and the section-regeneration fix
    • the docs checker, backend:status and the db-gate script
  • The coverage gate is removed, at Adam's request.

Previews:

  • VITE_SUPABASE_ENV=production|staging pins a build to one project, through the same pinned path that feat(dev): staging-pinned tailnet previews #92 added for tailnet previews. Any other value fails the build.
  • isAllowedOrigin() in _shared/cors.ts accepts the debate-navigator and debatelab-staging preview hosts under this team's Vercel scope. Edge Function CORS and the demo-code sign-in redirect both use it.

npm run verify uses the smoke set (about 2 minutes); npm run verify:full adds the full suite.

Outside the repo

Done alongside this PR, not by the merge (backups in ~/backups/supabase-auth/ on the VPS):

  • Created the debatelab-staging Vercel project (same repo, VITE_SUPABASE_ENV=staging for Production and Preview, production URL https://debatelab-staging.vercel.app). debate-navigator leaves VITE_SUPABASE_ENV unset, so it stays on production.
  • Added https://debate-navigator-*-adam-gaborjanis-projects.vercel.app/** to production's Auth redirect allowlist.
  • Added the debatelab-staging preview and production hosts to staging's allowlist, and set staging's Site URL to https://debatelab-staging.vercel.app (it was http://localhost:8080).
  • After merge: redeploy the 13 functions that import _shared/cors.ts to staging, then production. Both projects currently run exactly main's source for all 13 (downloaded and compared on 2026-10-03), so the deploy ships only this PR's CORS and redirect change.

Verification

GitHub Actions, at 4b2ada4 (before the last two commits):

  • Quality: quality 139 s and browser-smoke 136 s, side by side (run 37062718290). This is the new PR check, about 2.3 minutes against 26 before.
  • Database 1,017 s (37062718249), Live provider E2E 566 s (37062718399), Docs 10 s (37062718385): all passed.
  • Model matrix failed (37062718240): every case waited on the "Start a debate with this motion?" dialog. That bug is on main too and is fixed by test(e2e): wait for the welcome tour to settle before clicking it #94.

9a2a520 carries #94's commit 7c73df7 unchanged. The two spec files are byte-identical to #94's, which passed model-matrix in run 37045216055. It also fixes the same dialog in the production canary.

GitHub did not start any job at 9a2a520 or later: "recent account payments have failed or your spending limit needs to be increased". So the final head has local results only, and a local pass is not a CI pass.

Local, at 5f26ebc (final head):

  • npm run verify: lint, typecheck, docs, unit, collaboration, Edge Function and build pass. Smoke: 30 passed, 1 flaky (crossfire.spec.ts "Question the AI completes a grounded Crossfire debrief" timed out waiting for the first field on a cold dev-server route and passed on retry).
  • ./.superset/db-gate.sh: pgTAP 451 tests in 19 files pass; full-stack and collaboration browser specs 71 passed, 1 skipped (workspace-collaboration.spec.ts "survive a teammate reload" on mobile, a skip written into the spec). 18 minutes.
  • Codex review (gpt-6.1-sol, high) of the full diff: no actionable findings.

Driven by hand (2026-10-02):

  • A VITE_SUPABASE_ENV=staging build in Chromium shows the staging strip with no switch button, ignores a saved production toggle, and sends Google sign-in to the staging project.
  • The real demo-code-login function was run over HTTP against a fake Supabase:
    • Preview origins get their own origin back on preflight. chorely-*, .vercel.app.evil.com and http: lookalikes do not.
    • A preview redirectTo reaches generate_link, and a foreign one is dropped.

Plan: plans/2026-10-01-ci-and-preview-verification.md.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added automated documentation checks and browser smoke tests for pull requests, alongside scheduled full browser and database checks.
    • Added support for preview and staging environments to use the appropriate Supabase project and sign-in redirects.
  • Changes

    • Updated verification guidance to distinguish quick smoke checks from the full desktop and mobile browser suite.
    • Reduced the unit-test checks run in the standard verification flow; coverage thresholds are no longer enforced.

Programcode and others added 2 commits October 2, 2026 18:16
Pull requests now run lint, types, unit, Edge Function and build checks
beside a 31-test desktop browser smoke set. The full browser suite runs
nightly. The database gate and live provider journeys run only when their
paths change, so most pushes no longer start Supabase or spend provider
credit. Docs-only PRs run the docs check alone.

The unit suite keeps 15 files that guard security boundaries, Current
Debate isolation, project selection, stream parsing, source import and
the Crossfire and Sparring rules. The coverage gate is removed.

VITE_SUPABASE_ENV pins a build to one project, for a second Vercel
project that builds staging previews. Edge Function CORS and the
demo-code redirect accept both projects' preview hosts, which previews
could not call before.

db-gate.test.ts stubs docker, so the unit suite no longer removes the
fake provider container another worktree's gate is using.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…th-and-faster-ci

# Conflicts:
#	plans/README.md
#	src/components/StagingBanner.tsx
#	src/components/features/settings/EnvironmentSwitcher.tsx
#	src/lib/supabase/env.ts
#	src/lib/supabase/switch-env.ts
#	src/test/ai/crossfire-client.test.ts
#	src/test/ai/sparring.test.ts
#	src/test/components/EnvironmentSwitcher.test.tsx
#	src/test/components/SparringSetup.test.tsx
#	src/test/crossfire/storage.test.ts
#	src/test/pages/CrossfirePage.test.tsx
#	src/test/pages/GeneratePage.test.tsx
#	src/test/pages/SettingsAdminNavigation.test.tsx
#	src/test/stores/sparring-store.test.ts
Copilot AI balanced review requested due to automatic review settings October 2, 2026 18:20
@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Oct 3, 2026 5:49am UTC
debatelab-staging Ready Ready Preview Oct 3, 2026 5:49am UTC

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Free
  • Run ID: fdb12631-bdb6-4b79-8434-66d910a90fda
📥 Commits

Reviewing files that changed from the base of the PR and between 4b2ada4 and 5f26ebc.

📒 Files selected for processing (3)
  • e2e/model-matrix/generate.spec.ts
  • e2e/production/canary.spec.ts
  • plans/2026-10-01-ci-and-preview-verification.md
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0cc615e9-88b6-417e-b45e-b250f8381a0e

📥 Commits

Reviewing files that changed from the base of the PR and between 34d1573 and 4b2ada4.

📒 Files selected for processing (126)
  • .github/workflows/browser-nightly.yml
  • .github/workflows/database.yml
  • .github/workflows/deploy.yml
  • .github/workflows/docs.yml
  • .github/workflows/live-e2e.yml
  • AGENTS.md
  • README.md
  • docs/operations.md
  • docs/testing.md
  • e2e/admin-announcements.spec.ts
  • e2e/authed-pages.spec.ts
  • e2e/crossfire.spec.ts
  • e2e/first-run.spec.ts
  • e2e/login.spec.ts
  • e2e/public-pages.spec.ts
  • e2e/sparring.spec.ts
  • e2e/startup-shell.spec.ts
  • package.json
  • plans/2026-10-01-ci-and-preview-verification.md
  • plans/README.md
  • src/lib/supabase/env.ts
  • src/test/ai/client-analytics.test.ts
  • src/test/ai/client-branches.test.ts
  • src/test/ai/client.test.ts
  • src/test/ai/control-payload-matrix.test.ts
  • src/test/ai/crossfire-client.test.ts
  • src/test/ai/error-display.test.ts
  • src/test/ai/request-dispatch.test.ts
  • src/test/ai/sparring.test.ts
  • src/test/ai/streaming-integration.test.ts
  • src/test/announcements.test.ts
  • src/test/app-route-analytics-error-boundary.test.tsx
  • src/test/auth/AccountQueryCache.test.tsx
  • src/test/auth/AuthFlow.test.tsx
  • src/test/auth/LoginPage.test.tsx
  • src/test/components/AdminAnnouncements.test.tsx
  • src/test/components/AnimatedSection.test.tsx
  • src/test/components/AnnouncementBanner.test.tsx
  • src/test/components/AppLayout.test.tsx
  • src/test/components/AskChat.test.tsx
  • src/test/components/AttackForm.test.tsx
  • src/test/components/AttackResults.test.tsx
  • src/test/components/AutoSavedSourcesUndo.test.tsx
  • src/test/components/ExportToolbar.test.tsx
  • src/test/components/FactoidsResults.test.tsx
  • src/test/components/GenerateFormHonesty.test.tsx
  • src/test/components/GenerateResultsRegenerate.test.tsx
  • src/test/components/LanguageSwitcher.test.tsx
  • src/test/components/LimitReachedModal.test.tsx
  • src/test/components/Markdown.test.tsx
  • src/test/components/ModelSelector.test.tsx
  • src/test/components/SourceQualityList.test.tsx
  • src/test/components/SparringSetup.test.tsx
  • src/test/components/StreamingIndicator.test.tsx
  • src/test/components/ui.test.tsx
  • src/test/crossfire/prefill.test.ts
  • src/test/crossfire/schemas.test.ts
  • src/test/crossfire/storage.test.ts
  • src/test/date-format.test.ts
  • src/test/debate/motion.test.ts
  • src/test/export-google-docs.test.ts
  • src/test/export-telemetry.test.ts
  • src/test/export-utils-extended.test.ts
  • src/test/export-utils.test.ts
  • src/test/helpers/downloads.ts
  • src/test/hooks/use-subscription-error.test.ts
  • src/test/hooks/use-subscription.test.ts
  • src/test/hooks/use-toast.test.ts
  • src/test/i18n.test.ts
  • src/test/jam-loader.test.ts
  • src/test/jam-metadata.test.ts
  • src/test/native-app-url-listener.test.ts
  • src/test/native-runtime.test.ts
  • src/test/native.test.ts
  • src/test/observability.test.ts
  • src/test/pages/AdminPage.test.tsx
  • src/test/pages/AttackPage.test.tsx
  • src/test/pages/ConversationPages.test.tsx
  • src/test/pages/CrossfirePage.test.tsx
  • src/test/pages/FlowchartPage.test.tsx
  • src/test/pages/HistoryPage.test.tsx
  • src/test/pages/LibraryPage.test.tsx
  • src/test/pages/SettingsAdminNavigation.test.tsx
  • src/test/pages/SettingsPage.test.tsx
  • src/test/pages/SourcesPage.test.tsx
  • src/test/pages/SparringPage.test.tsx
  • src/test/pages/TimerPage.test.tsx
  • src/test/pages/pages.test.tsx
  • src/test/pdf-export-utils.test.ts
  • src/test/providers.test.ts
  • src/test/register-service-worker.test.ts
  • src/test/route-modules.test.ts
  • src/test/route-skeleton.test.tsx
  • src/test/runtime-contracts.test.ts
  • src/test/schemas.test.ts
  • src/test/scripts/smoke-jev.test.ts
  • src/test/sentry-event-filter.test.ts
  • src/test/source-file-import.test.ts
  • src/test/sparring-ai.test.ts
  • src/test/sparring/exports.test.ts
  • src/test/stores/session-store.test.ts
  • src/test/stores/settings-store.test.ts
  • src/test/stores/sparring-store.test.ts
  • src/test/stripe.test.ts
  • src/test/supabase/pinned-env.test.ts
  • src/test/supabase/prompt-builder.test.ts
  • src/test/use-route-prefetch.test.tsx
  • src/test/use-speech-to-text.test.tsx
  • src/test/validation.test.ts
  • src/test/webhook-event-lifecycle.test.ts
  • src/test/workspace/collaboration.test.ts
  • src/test/workspace/document-conversion.test.ts
  • src/test/workspace/durable-ack.test.ts
  • src/test/workspace/fixtures/structured-speech.ts
  • src/test/workspace/member-removal.test.ts
  • src/test/workspace/navigation.test.tsx
  • src/test/workspace/review-panel.test.tsx
  • src/test/workspace/review.test.ts
  • src/test/workspace/tool-context.test.ts
  • src/vite-env.d.ts
  • supabase/functions/_shared/cors.test.ts
  • supabase/functions/_shared/cors.ts
  • supabase/functions/demo-code-login/index.ts
  • supabase/functions/demo-code-login/index_test.ts
  • vite.config.ts
  • vitest.config.ts
💤 Files with no reviewable changes (98)
  • src/test/components/LanguageSwitcher.test.tsx
  • src/test/components/ExportToolbar.test.tsx
  • src/test/sparring-ai.test.ts
  • src/test/components/Markdown.test.tsx
  • src/test/use-speech-to-text.test.tsx
  • src/test/workspace/review-panel.test.tsx
  • src/test/native.test.ts
  • src/test/pages/SettingsAdminNavigation.test.tsx
  • src/test/hooks/use-subscription-error.test.ts
  • src/test/components/ModelSelector.test.tsx
  • src/test/components/AskChat.test.tsx
  • src/test/auth/AuthFlow.test.tsx
  • src/test/runtime-contracts.test.ts
  • src/test/stores/settings-store.test.ts
  • src/test/components/ui.test.tsx
  • src/test/pages/FlowchartPage.test.tsx
  • src/test/pages/HistoryPage.test.tsx
  • src/test/components/SourceQualityList.test.tsx
  • src/test/hooks/use-toast.test.ts
  • src/test/auth/AccountQueryCache.test.tsx
  • src/test/pages/SettingsPage.test.tsx
  • src/test/route-modules.test.ts
  • src/test/components/GenerateFormHonesty.test.tsx
  • src/test/components/LimitReachedModal.test.tsx
  • src/test/native-runtime.test.ts
  • src/test/sentry-event-filter.test.ts
  • src/test/scripts/smoke-jev.test.ts
  • src/test/components/AttackResults.test.tsx
  • src/test/crossfire/prefill.test.ts
  • src/test/stores/session-store.test.ts
  • src/test/pages/SourcesPage.test.tsx
  • src/test/pdf-export-utils.test.ts
  • src/test/app-route-analytics-error-boundary.test.tsx
  • src/test/observability.test.ts
  • src/test/components/StreamingIndicator.test.tsx
  • src/test/crossfire/storage.test.ts
  • src/test/sparring/exports.test.ts
  • src/test/pages/TimerPage.test.tsx
  • src/test/workspace/member-removal.test.ts
  • src/test/validation.test.ts
  • src/test/ai/control-payload-matrix.test.ts
  • src/test/ai/error-display.test.ts
  • src/test/components/AdminAnnouncements.test.tsx
  • src/test/route-skeleton.test.tsx
  • src/test/pages/SparringPage.test.tsx
  • src/test/pages/AttackPage.test.tsx
  • src/test/source-file-import.test.ts
  • src/test/stripe.test.ts
  • src/test/hooks/use-subscription.test.ts
  • src/test/workspace/review.test.ts
  • src/test/native-app-url-listener.test.ts
  • src/test/components/FactoidsResults.test.tsx
  • src/test/export-utils-extended.test.ts
  • src/test/ai/sparring.test.ts
  • src/test/auth/LoginPage.test.tsx
  • src/test/ai/streaming-integration.test.ts
  • src/test/ai/client.test.ts
  • src/test/pages/ConversationPages.test.tsx
  • src/test/components/AppLayout.test.tsx
  • src/test/schemas.test.ts
  • src/test/announcements.test.ts
  • src/test/workspace/navigation.test.tsx
  • src/test/crossfire/schemas.test.ts
  • src/test/components/SparringSetup.test.tsx
  • src/test/use-route-prefetch.test.tsx
  • src/test/ai/client-analytics.test.ts
  • src/test/workspace/durable-ack.test.ts
  • src/test/components/AnnouncementBanner.test.tsx
  • src/test/pages/AdminPage.test.tsx
  • src/test/helpers/downloads.ts
  • src/test/date-format.test.ts
  • src/test/workspace/collaboration.test.ts
  • src/test/components/AutoSavedSourcesUndo.test.tsx
  • src/test/components/AnimatedSection.test.tsx
  • src/test/i18n.test.ts
  • src/test/export-utils.test.ts
  • src/test/jam-metadata.test.ts
  • src/test/pages/pages.test.tsx
  • src/test/pages/CrossfirePage.test.tsx
  • src/test/supabase/prompt-builder.test.ts
  • src/test/components/AttackForm.test.tsx
  • src/test/debate/motion.test.ts
  • src/test/workspace/tool-context.test.ts
  • src/test/register-service-worker.test.ts
  • src/test/export-telemetry.test.ts
  • src/test/stores/sparring-store.test.ts
  • src/test/webhook-event-lifecycle.test.ts
  • src/test/ai/client-branches.test.ts
  • src/test/export-google-docs.test.ts
  • src/test/components/GenerateResultsRegenerate.test.tsx
  • src/test/jam-loader.test.ts
  • src/test/ai/request-dispatch.test.ts
  • src/test/pages/LibraryPage.test.tsx
  • vitest.config.ts
  • src/test/workspace/fixtures/structured-speech.ts
  • src/test/workspace/document-conversion.test.ts
  • src/test/ai/crossfire-client.test.ts
  • src/test/providers.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request changes CI workflows and verification commands, removes many Vitest test suites, and adds build-time Supabase environment pinning. It also expands Edge Function origin checks for staging and Vercel preview hosts.

Changes

CI and test verification

Layer / File(s) Summary
Workflow triggers and jobs
.github/workflows/browser-nightly.yml, .github/workflows/database.yml, .github/workflows/deploy.yml, .github/workflows/docs.yml, .github/workflows/live-e2e.yml
Adds scheduled browser and database workflows, a docs-check workflow, and a pull-request browser smoke job. Updates path filters and replaces the deploy workflow’s database and full-browser jobs.
Smoke tests and verification commands
package.json, e2e/*.spec.ts, vitest.config.ts
Adds a desktop Chromium smoke command and verify:full, tags selected E2E tests with @smoke, and removes Vitest coverage configuration.
CI documentation and plan
AGENTS.md, README.md, docs/operations.md, docs/testing.md, plans/2026-10-01-ci-and-preview-verification.md, plans/README.md
Updates verification instructions and documents workflow triggers, test scopes, local checks, preview arrangements, and CI status.
Removed AI and domain test suites
src/test/ai/*, src/test/crossfire/*, src/test/debate/*, src/test/schemas.test.ts, src/test/sparring-ai.test.ts, src/test/sparring/*, src/test/providers.test.ts, src/test/supabase/prompt-builder.test.ts
Removes test suites for AI clients, Crossfire, sparring, schemas, prompts, and provider configuration.
Removed authentication, component, and page tests
src/test/auth/*, src/test/components/*, src/test/pages/*
Removes authentication, component, and page test files.
Removed utility and platform test suites
src/test/announcements.test.ts, src/test/app-route-analytics-error-boundary.test.tsx, src/test/date-format.test.ts, src/test/export-*, src/test/helpers/downloads.ts, src/test/hooks/*, src/test/i18n.test.ts, src/test/jam-*.test.ts, src/test/native*.test.ts, src/test/observability.test.ts, src/test/pdf-export-utils.test.ts, src/test/register-service-worker.test.ts, src/test/route-*.test.*, src/test/runtime-contracts.test.ts, src/test/scripts/smoke-jev.test.ts, src/test/sentry-event-filter.test.ts, src/test/source-file-import.test.ts, src/test/use-*.test.ts*, src/test/validation.test.ts, src/test/webhook-event-lifecycle.test.ts
Removes utility and platform tests covering exports, hooks, localization, routing, native behavior, observability, validation, and other areas.
Removed store and workspace test suites
src/test/stores/*, src/test/stripe.test.ts, src/test/workspace/*
Removes store, Stripe, and workspace test files, including a structured-document fixture.

Pinned preview environments

Layer / File(s) Summary
Build-time and runtime project pinning
src/vite-env.d.ts, vite.config.ts, src/lib/supabase/env.ts, src/test/supabase/pinned-env.test.ts
Declares and validates VITE_SUPABASE_ENV. The resolver selects pinned production or staging configuration, and tests cover pins and fallback behavior.
Preview origins and demo-code redirects
supabase/functions/_shared/cors.ts, supabase/functions/_shared/cors.test.ts, supabase/functions/demo-code-login/index.ts, supabase/functions/demo-code-login/index_test.ts
Adds shared origin validation for configured, staging, and matching Vercel preview origins. CORS handling and demo-code login redirect validation use the helper.
Preview environment documentation
docs/operations.md, plans/2026-10-01-ci-and-preview-verification.md
Documents the production and staging preview setup, pinned build behavior, and related configuration requirements and caveats.

Estimated code review effort: 4 (Complex) | ~60 minutes

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 4b2ad

Approved preview builds can now handle production authentication responses while running unmerged code. Strict hostname checks and separate environment sessions reduce accidental exposure, but they do not establish that preview code is trusted. Production and staging deployment settings remain unverified.

Retained concerns

  • High · security · inferred: The shared allowlist trusts both production and staging PR-preview host families without binding them to the serving Supabase project or an approved code revision. Once deployed to production, this permits preview-controlled JavaScript to read production demo-session handoffs when a valid code is submitted. A contributor able to publish a malicious approved preview could capture those handoffs or sessions established there. Build-time staging pinning controls ordinary routing, not malicious frontend requests. This expands browser-client trust; it does not expose the service-role credential or bypass demo-code validation.
Security review details

Security Blast Radius

  • inferred — The expanded trust reaches approved previews of both projects and, when the shared policy is deployed there, production and staging function responses. Account exposure is bounded by users authenticating on a malicious preview or supplying valid demo codes, and by each resulting account's authorization. Repeated preview visits can expose multiple accounts; no direct service-role credential disclosure or universal database access is established.

Security Findings and Attack Paths

  • inferred — An attacker needs the ability to publish code to an approved preview, then induce authentication or valid demo-code submission there. Preview JavaScript can read the newly permitted production handoff and redeem it as the demo user. Origin-specific storage does not protect credentials delivered directly to that preview. This is an inferred attack path, not a verified deployed exploit; preview publication and access protections are unknown.

Trust Boundaries and Controls

  • observed — Preview matching is HTTPS-only, anchored to two project prefixes and one team suffix; negative tests cover foreign projects, another team, lookalikes, and HTTP. Demo login also validates code state, account ownership, and role, and maps requested admin roles to ordinary users. These controls limit arbitrary-origin and privilege-escalation paths but do not distinguish reviewed code from unmerged code on an approved host.

Resilience and Maintainability Implications

  • observed — The inspected changed verification jobs use read-only repository permissions and disabled checkout credential persistence. Their local smoke, browser, and database checks do not establish deployed preview authentication or backend-version parity. Operations guidance requires explicit target confirmation, baseline capture, staging verification, and separate production deployment.

Hardening Proposals

  • proposed — Use staging for arbitrary PR builds and require explicit trusted-revision approval before enabling a preview to receive production authentication or function responses. Bind each backend's origin policy to its intended environment rather than trusting both preview families everywhere.
  • proposed — Make staging deployments fail closed when the staging pin is missing, and verify build selection, Auth redirect settings, and deployed function versions together before enabling previews and after rollback.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

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

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Pull request base or head changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Programcode and others added 2 commits October 2, 2026 20:42
They are the only coverage of the voice-unavailable state, and they check
that a late microphone permission does not open the next turn and that
words do not carry between rounds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…th-and-faster-ci

# Conflicts:
#	docs/operations.md
#	docs/testing.md
#	package.json
#	src/test/docs/check-docs.test.ts
#	src/test/scripts/backend-status.test.ts
Generate now asks "Start a debate with this motion?" before it sends the
request. Neither spec answered it, so every model-matrix case and the
canary's "generates a case" test waited out their response timeouts with
the dialog open and no request sent.

Both now choose "use it once": model-matrix through the existing
chooseForMotion helper, the canary inline because it does not load the
full-stack helpers. Using it once also keeps the production canary
account from accumulating debates.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyWuBiDEMvVnjmguH9CwCZ
@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode
Programcode merged commit 604194d into main Oct 3, 2026
6 of 12 checks passed
@Programcode
Programcode deleted the t3code/fix-preview-auth-and-faster-ci branch October 3, 2026 06:40
Programcode added a commit that referenced this pull request Oct 3, 2026
…nning browser jobs

- Deploy dates only say when a function was deployed. The sync now downloads
  what staging runs and compares it byte for byte with the commit, so an older
  checkout deployed after a merge no longer passes as current. Proven against
  a checkout from before #95: dates said nothing was pending, and the content
  check flagged the 13 functions that run the newer cors.ts.
- run.sh holds a sync only while a browser job is running. A queued or gated
  run isn't using staging, and the job timeout doesn't cover queue time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

4 active (2 outdated) deployments
Preview – debate-navigator — 5f26ebcc Deployed Oct 3, 2026 by vercel[bot]
Preview – debatelab-staging — 5f26ebcc Deployed Oct 3, 2026 by vercel[bot]
Production – debatelab-staging — 4b2ada4c Deployed Oct 2, 2026 by vercel[bot]
Preview — 4b2ada4c Deployed Oct 2, 2026 by vercel[bot]
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.

2 participants