Skip to content

chore(ci): import-cycle ratchet + mobile viewport regression suite - #808

Merged
njrini99-code merged 8 commits into
mainfrom
chore/ci-guardrails-cycles-mobile
Jul 15, 2026
Merged

chore(ci): import-cycle ratchet + mobile viewport regression suite#808
njrini99-code merged 8 commits into
mainfrom
chore/ci-guardrails-cycles-mobile

Conversation

@njrini99-code

Copy link
Copy Markdown
Owner

Summary

First PR from the UI-audit remediation Nick approved — the two Stage-1 guardrails, each targeting a defect class that has repeatedly shipped to production:

1. Import-cycle ratchet (scripts/check-cycles.mjs, .cycles-baseline.json, .madgerc, new import-cycles CI job wired into the all hard gate). Value-level import cycles typecheck and build cleanly but crash at cold runtime with "Cannot access X before initialization" — the exact class behind the #803 golf CoachHelm and #804 baseball roster prod crashes. madge is configured to skip import type edges (erased at compile time, TDZ-safe); the 33 pre-existing runtime cycles are baselined so only NEW cycles fail, mirroring the existing lint-ratchet pattern. npm run check:cycles -- --update locks in reductions.

2. Mobile viewport regression suite (e2e/mobile-viewports.spec.ts, three mobile-* Playwright projects, blocking step in playwright.yml). Functional assertions at 320/390/430px on public routes plus CI-seeded baseball coach/player routes:

Plain viewports rather than isMobile device emulation — mobile emulation zooms out on overflow, growing innerWidth with the content, which silently defeats the pan/clip geometry checks (found while validating the helpers).

Verification

  • Synthetic two-file runtime cycle is detected by the ratchet (exit 1, names the cycle); baseline run green; synthetic cycle removed.
  • Assertion helpers validated against known-good and known-bad fixture pages: clean page passes all three checks; bad page trips all three (pan, 2 clipped controls, FAB×nav 64×36px overlap).
  • npm run typecheck clean.

Type of change

  • Bug fix
  • Feature / new behavior
  • Security / RLS / auth
  • Database migration
  • CI / tooling / chore
  • Docs only

Area

shared · CI · mobile

Risk level

  • Low — additive checks; the cycle ratchet baselines all existing cycles, and the mobile suite runs as its own projects/step without touching existing suites

Git Activity Timeline note

Adds CI guardrails that block new runtime import cycles and phone-width layout regressions — the two bug classes behind several recent production fixes.

Checklist

  • npm run typecheck passes
  • npm run check:cycles green on baseline; detection verified with a synthetic cycle
  • Mobile assertion helpers validated against good/bad fixtures
  • No migrations, no RLS changes, no secrets

🤖 Generated with Claude Code

https://claude.ai/code/session_019WJ1Gzjj9MT3UsxhMoMzSV


Generated by Claude Code

Two guardrails from the UI audit's Stage-1 'protect trust and stop
regressions' list, each targeting a bug class that has repeatedly
reached production:

1. Import-cycle ratchet (scripts/check-cycles.mjs + .cycles-baseline.json
   + CI job in the 'all' hard gate). Value-level import cycles typecheck
   and build cleanly but crash at cold runtime with TDZ errors — the
   #803/#804 prod-crash class. madge (config in .madgerc) skips
   'import type' edges since those are erased at compile time; the 33
   pre-existing runtime cycles are baselined and only NEW cycles fail,
   mirroring the lint-ratchet pattern. Verified: synthetic two-file
   cycle is detected, baseline run is green.

2. Mobile viewport regression suite (e2e/mobile-viewports.spec.ts +
   mobile-* Playwright projects + blocking step in playwright.yml).
   Functional checks at 320/390/430px on public + seeded baseball
   coach/player routes: no horizontal page pan, no partially-clipped
   header/nav controls (the #806 'Today pill' class), no fixed-element/
   bottom-nav collisions (the #799 FAB class). Plain viewports rather
   than isMobile device emulation — mobile emulation zooms out on
   overflow, which defeats the geometry checks. Helpers validated
   against known-good and known-bad fixture pages (all three defect
   classes detected; clean page passes).

playwright.config.ts also skips webServer when PLAYWRIGHT_BASE_URL
points at an external deployment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WJ1Gzjj9MT3UsxhMoMzSV
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
helmv3 Ignored Ignored Preview Jul 15, 2026 6:47am

Request Review

@supabase

supabase Bot commented Jul 12, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project qmnssrrolpinvwjjnufo because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

The e2e job in playwright.yml (where the full mobile suite runs) only
executes on main pushes and manual dispatch — PRs get pr-smoke. Add the
public-route mobile project there as a blocking step so phone-width
layout regressions are caught before merge, not after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WJ1Gzjj9MT3UsxhMoMzSV
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR adds baseline-ratcheted Madge runtime import-cycle checks and makes them a required CI gate. It also adds Playwright mobile viewport regression coverage for public, coach, and player routes, with dedicated projects and shared dev-server handling in CI.

Changes

Quality gates

Layer / File(s) Summary
Import-cycle baseline enforcement
.madgerc, scripts/check-cycles.mjs, .cycles-baseline.json, package.json, .github/workflows/ci.yml
Adds Madge-based runtime cycle detection, canonical baseline comparison, update mode, skipped-file detection, and a required CI gate.
Mobile viewport regression suite
e2e/mobile-viewports.spec.ts
Adds public, coach, and player route checks for horizontal overflow, clipped controls, bottom-navigation collisions, and final route paths across phone-sized viewports.
Playwright project and CI wiring
playwright.config.ts, .github/workflows/playwright.yml, .github/workflows/pr-smoke.yml
Adds role-specific mobile projects, authentication-state dependencies, external deployment support, shared dev-server handling, and mobile checks in CI workflows.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant checkCycles as check-cycles.mjs
  participant Madge
  participant Baseline as cycles-baseline.json
  CI->>checkCycles: run check:cycles
  checkCycles->>Madge: analyze src imports
  Madge-->>checkCycles: return cycles and skipped files
  checkCycles->>Baseline: compare current results
  checkCycles-->>CI: pass or fail import-cycle gate
Loading
sequenceDiagram
  participant CI
  participant Playwright
  participant AuthState as setup storageState
  participant App
  CI->>Playwright: run mobile projects
  Playwright->>AuthState: load authenticated coach/player state
  Playwright->>App: navigate routes at mobile viewports
  App-->>Playwright: render page and final URL
  Playwright-->>CI: report layout and route assertions
Loading

Possibly related PRs

Suggested labels: ci

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Conventional Commits ❓ Inconclusive HEAD subject matches the regex, but the PR title isn’t available here to verify the second requirement. Provide the PR title or PR metadata so both the title and squash subject can be checked against the Conventional Commits regex.
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits, includes the required ci scope, and accurately summarizes the import-cycle and mobile regression changes.
Description check ✅ Passed The description is directly related to the CI guardrails and mobile viewport suite introduced by this changeset.
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.
No Service-Role In Client Bundles ✅ Passed PASS: the only changed file is e2e/mobile-viewports.spec.ts; its edits are DOM-fit assertions, with no SUPABASE_SERVICE_ROLE_KEY or service-role client usage.
Rls Coverage On New Tables ✅ Passed No changed files under migration paths in the merge-base diff, so the RLS-on-new-tables rule is not applicable.
Auth Check In Server Actions ✅ Passed No changed file matches src/app//actions//*.ts; the PR only touches e2e/mobile-viewports.spec.ts.
Sport-Prefixed Table Names ✅ Passed e2e/mobile-viewports.spec.ts:46-196 and playwright.config.ts:7-146 contain only Playwright routing/config; no Supabase queries or table literals were added.
No Destructive Writes ✅ Passed Changed files are CI/test/config only; the only write is baseline JSON in scripts/check-cycles.mjs:64-70, and there’s no DELETE/INSERT table logic in any changed file.
No Edits To Historical Migrations ✅ Passed Merge-base diff shows no supabase/migrations/ files changed; only e2e/mobile-viewports.spec.ts is touched.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ci-guardrails-cycles-mobile
  • 🛠️ helm safety pass
  • 🛠️ dashboard ux pass
  • 🛠️ rls test pass

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds CI guardrails for import cycles and mobile viewport regressions. The main changes are:

  • A madge-based import-cycle ratchet with a checked-in baseline.
  • A new CI job wired into the required all gate.
  • Mobile viewport Playwright projects for public, coach, and player routes.
  • Geometry checks for horizontal pan, clipped controls, and bottom-nav overlap.

Confidence Score: 4/5

This is close, but the PR smoke workflow should be fixed before merging.

  • The main Playwright workflow now avoids the separate mobile test process.
  • The PR smoke workflow adds a new standalone Playwright run that can restart the dev server on the same port.
  • The bottom-nav detector now matches the current app shell shape.

.github/workflows/pr-smoke.yml

Important Files Changed

Filename Overview
.github/workflows/playwright.yml Runs the authenticated mobile viewport projects inside the BaseballHelm smoke Playwright invocation.
.github/workflows/pr-smoke.yml Adds public mobile viewport checks as a separate Playwright invocation in the same job.
e2e/mobile-viewports.spec.ts Adds mobile fit assertions and authenticated bottom-nav presence checks.
scripts/check-cycles.mjs Adds a baseline-aware import-cycle check using madge.
playwright.config.ts Adds mobile Playwright projects and skips the local web server when an external base URL is provided.

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
.github/workflows/pr-smoke.yml:101-103
**Second Server Lifecycle**

This step starts another standalone Playwright run in the same job right after the accessibility run. In this workflow `PLAYWRIGHT_BASE_URL` is not set, so Playwright starts `npm run dev`; in CI, `reuseExistingServer` is false, so the first server is torn down and this step starts a new one on port 3000. If the port has not been released yet, the mobile viewport check can fail before it tests any layout behavior. Run this project in the existing Playwright invocation or point both steps at one prestarted server.

Reviews (2): Last reviewed commit: "fix(ci): madge API over CLI, skipped-fil..." | Re-trigger Greptile

Comment thread .github/workflows/playwright.yml Outdated
Comment thread e2e/mobile-viewports.spec.ts Outdated
…tom-nav detection

Two Greptile findings:

1. The standalone mobile step booted a second Playwright webServer in the
   same job, risking port-3000 contention with the smoke run's server.
   The mobile projects now ride the mandatory-smoke invocation (one
   process, one server). The 'public routes only' fallback step was dead
   code — the job hard-fails earlier when baseball secrets are missing.

2. The bottom-nav collision check silently passed when it couldn't
   identify the nav. Detection now also accepts tab-bar-SHAPED fixed
   elements (bottom-pinned, near-full-width, 2+ interactive children),
   and authenticated dashboard routes assert the bottom nav exists at
   phone widths per MOBILE_DOCTRINE — so a missed nav fails loud instead
   of skipping the check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019WJ1Gzjj9MT3UsxhMoMzSV
@coderabbitai coderabbitai Bot added the ci CI, Vercel, test, build, deploy label Jul 12, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/mobile-viewports.spec.ts`:
- Around line 68-73: Update expectNoClippedControls to reuse the bottom-nav
detector already used by expectNoBottomNavCollision, and include any detected
plain fixed bottom-nav wrapper when collecting controls alongside semantic
containers. Preserve the existing control de-duplication and clipping checks.
- Around line 178-181: Update the coach viewport tests around the “fits” cases
to assert immediately after navigation that the final pathname matches the
requested route, rather than only checking that it does not contain “/login”.
Apply the same route assertion to both affected test blocks, preserving any
explicitly documented redirect exceptions if the test suite defines them.

In `@scripts/check-cycles.mjs`:
- Around line 40-43: Update the Madge invocation in the cycle-check script to
run only the installed project binary, replacing the npx command with npm exec
--no -- madge or the equivalent local binary invocation. Preserve the existing
arguments and execution options so missing dependencies fail rather than being
downloaded.
- Around line 84-88: In the UPDATE branch of the baseline-writing flow, add an
“updating baseline” log immediately before writeFileSync mutates BASELINE_PATH.
Keep the existing success message after the write completes, and limit the
change to preserving intent-before-mutation ordering.
- Around line 40-52: Update the Madge execution and validation around
madgeOutput to detect any skipped or unresolved files using Madge warnings data
or a separate --warning pass. If skipped files are reported, print the relevant
error details and exit nonzero before cycle results are treated as resolved;
preserve the existing JSON parsing and failure handling for valid output without
skipped files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8c152fd4-d718-4ad4-a2f6-6d9a3eb2f3ad

📥 Commits

Reviewing files that changed from the base of the PR and between 3237633 and 32a9e72.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
📒 Files selected for processing (9)
  • .cycles-baseline.json
  • .github/workflows/ci.yml
  • .github/workflows/playwright.yml
  • .github/workflows/pr-smoke.yml
  • .madgerc
  • e2e/mobile-viewports.spec.ts
  • package.json
  • playwright.config.ts
  • scripts/check-cycles.mjs

Comment thread e2e/mobile-viewports.spec.ts Outdated
Comment thread e2e/mobile-viewports.spec.ts
Comment thread scripts/check-cycles.mjs Outdated
Comment thread scripts/check-cycles.mjs Outdated
Comment thread scripts/check-cycles.mjs
…detector

check-cycles.mjs now calls madge's Node API in-process instead of shelling
out to `npx madge` — no unpinned-package fetch is possible, and we get
res.warnings().skipped, which the CLI can never expose in --json mode (see
bin/cli.js: it only prints --warning output when NOT combined with --json).
Skipped files (e.g. this repo's permanent `server-only` bare-specifier,
aliased by Next.js at build time without ever being an installed package)
are now baseline-ratcheted the same way cycles are, so a genuinely new
unresolved import fails closed instead of silently hiding a cycle, without
permanently red-ing the gate on the known benign case. .cycles-baseline.json
moves from a flat cycle array to { skipped, cycles } (same 33 cycles,
verified byte-identical to the prior baseline). Baseline-file logging now
happens before the write, not after.

mobile-viewports.spec.ts: the bottom-nav detector (semantic nav/role OR
tab-bar-shaped fixed wrapper) is now computed once and reused by both the
clipped-controls scan and the collision scan, so a plain fixed bottom-nav
wrapper with no <nav>/role can no longer evade the clipped-controls check.
Coach/player route tests now assert the exact final pathname instead of
only rejecting /login, since a server route guard can redirect an
authed-but-unauthorized user to a different dashboard route and still pass
the old check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@njrini99-code
njrini99-code marked this pull request as ready for review July 15, 2026 01:08
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Comment thread .github/workflows/pr-smoke.yml
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026
Same class of bug already fixed in playwright.yml, in a workflow that
fix didn't touch: pr-smoke.yml ran the accessibility smoke and the public
mobile viewport check as two separate `npx playwright test` invocations
back to back, each managing its own webServer since neither set
PLAYWRIGHT_BASE_URL. In CI reuseExistingServer is false, so the mobile
step's server boot could race the accessibility step's server teardown
on port 3000.

Unlike playwright.yml's mandatory-smoke step, these two can't just be
merged into one `npx playwright test` invocation — the accessibility
step is intentionally advisory (continue-on-error, due to known
pre-existing WCAG-AA contrast debt) while the mobile step is intentionally
blocking, and merging would collapse that distinction into one exit code.
Instead: start the dev server once in its own step, wait for it to
respond, and point both test steps at it via PLAYWRIGHT_BASE_URL (which
playwright.config.ts's webServer block treats as "skip booting your own
server"). Stops the background server at the end regardless of outcome.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
njrini99-code added a commit that referenced this pull request Jul 15, 2026
…811)

Root cause of the intermittently-failing engine-run-helm-lifting test
(and a latent correctness gap that would eventually hit every rolling-
window metric the same way): loadLiftMetrics, loadReadinessMetrics,
loadPlayerMetrics' workload calc, and loadCatchingMetrics all computed
their cutoff from Date.now() — the real wall clock — instead of the
nowIso already threaded through runBaseballEngineCore for deterministic
runs. A test fixing "now" at a past date and seeding data just inside a
14-day window would pass only as long as real time hadn't yet carried
that window past the seeded date; it then fails with zero code changes
once it did (confirmed: passed on this exact branch 3 days before it
started failing, purely from the calendar advancing).

Threaded nowIso through the full call chain instead of just the one
function the failing test touches: mergeV10PlayerMetrics -> {
loadReadinessMetrics, loadLiftMetrics }, loadAllPlayerMetrics ->
loadPlayerMetrics, mergeEventPlayerMetrics -> loadCatchingMetrics, with
engine-run.ts's three call sites now passing its own nowIso through.
Each function's new nowIso param defaults to new Date().toISOString()
(matching the existing input.now ?? new Date() pattern in
effectiveness/engine.ts) so the three OTHER callers of loadPlayerMetrics
(practice-effectiveness.ts, action-baseline.ts, outcome-sweep.ts) keep
their current real-time behavior unchanged — only the deterministic
engine-run path needed fixing.

Left out of scope (same class, but a bigger architectural change and
not the cause of any current failure): generators/v10.ts's
importQualityGenerator also filters recent import runs via Date.now(),
but BaseballV10EngineInputs has no now/nowIso field for generators at
all today — adding one is a separate, larger PR.

Verified: full `npm run test:run` (unit project, 494 files/4921 tests)
and `npm run test:business` (business project, 505 files/4996 tests)
both pass clean — these are the exact commands CI's "Unit tests" and
"Business contracts" jobs run, and the ones that were failing on
PR #808 before this fix.

Co-authored-by: Fable Integrator <fable@helm.local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@njrini99-code
njrini99-code enabled auto-merge (squash) July 15, 2026 02:46
@njrini99-code

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr-smoke.yml:
- Around line 106-112: Update the startup polling loop in the workflow around
the curl readiness check to track the dev server process and verify it remains
alive on each iteration. If the process has exited, print or expose its startup
logs and fail immediately; otherwise preserve the existing readiness polling and
timeout behavior.
- Line 94: Add a kill -0 "$DEV_PID" process-aliveness check inside the
development server readiness loop, alongside the existing readiness polling, and
immediately fail with the appropriate error when the server process has exited.
Preserve the current timeout and successful readiness behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7dcd0315-2454-4384-9baa-f3c37555d9af

📥 Commits

Reviewing files that changed from the base of the PR and between 915c110 and f1aa62a.

📒 Files selected for processing (1)
  • .github/workflows/pr-smoke.yml

Comment thread .github/workflows/pr-smoke.yml
Comment thread .github/workflows/pr-smoke.yml
CodeRabbit round on #808: poll loop hung the full 120s when npm run dev
crashed immediately; now checks the pid each iteration and surfaces the
log at once. (Its second comment — missing permissions block — is stale:
pr-smoke.yml:15 already has one.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@njrini99-code

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 1 minute.

@njrini99-code

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/mobile-viewports.spec.ts`:
- Around line 199-202: Update the PUBLIC_ROUTES test using expectMobileFit to
also assert that navigation ends on the requested route pathname, matching the
existing coach and player route checks. Ensure redirects to login, error, or
fallback pages fail the test while preserving the viewport-fit assertion.
- Line 107: Update the clipping-detection selector in the viewport test loop to
include elements matching [role="tab"], alongside the existing link, button, and
button-role selectors. Keep the bottom-navigation handling and other clipping
checks unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2f3051eb-5173-4ef6-ad8e-6d1d5ae817c3

📥 Commits

Reviewing files that changed from the base of the PR and between dcaa59f and cd9494f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
📒 Files selected for processing (9)
  • .cycles-baseline.json
  • .github/workflows/ci.yml
  • .github/workflows/playwright.yml
  • .github/workflows/pr-smoke.yml
  • .madgerc
  • e2e/mobile-viewports.spec.ts
  • package.json
  • playwright.config.ts
  • scripts/check-cycles.mjs

Comment thread e2e/mobile-viewports.spec.ts Outdated
Comment thread e2e/mobile-viewports.spec.ts
…hname

CodeRabbit full-review round: [role=tab] counted for bottom-nav shape but
was invisible to clipping detection; public-route tests could measure a
redirect target and pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@njrini99-code

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@njrini99-code
njrini99-code merged commit 20d7b6f into main Jul 15, 2026
41 checks passed
@njrini99-code
njrini99-code deleted the chore/ci-guardrails-cycles-mobile branch July 15, 2026 06:56
njrini99-code pushed a commit that referenced this pull request Jul 15, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
njrini99-code added a commit that referenced this pull request Jul 15, 2026
…de changes) (#853)

Syncs 5 living docs + 1 memory file to actual tonight's reality on
batch/bbh-finish-0714 @ 0056bc0, independently re-verified (not copied
from PR claims) via grep/gh API/local test runs:

- PRODUCTION_READINESS_MISSION_2026-07-09.md: dated addendum (history kept
  intact) covering #792-#807 merged, discover-privacy P0 fixed+tested,
  29-surface Living-Annual migration done, tonight's batch merge state
  (#808 merged not "green-pending", #810 still open, #812-#841 + #851 on
  batch branch, #842-#850 still open), and the batch HEAD's 3 currently-red
  CI checks (Business contracts/Unit tests/Import-cycle ratchet).
- ui-migration-map.md + ui-migration-execution-plan.md: code-verified status
  headers — all 29 surfaces executed, Batch H (PR #820) done, zero
  isRedesignEnabled() forks remain under src/app/baseball or
  src/components/baseball.
- BASEBALLHELM_FEATURE_READINESS_MATRIX.md: ran
  check-readiness-matrix.ts (green before and after); upgraded Documents,
  Travel, Practice, Staff/Roles to ready and Practice Effectiveness to
  partial on real new test-coverage PRs (#822-#825); updated Player
  Today/Signals/Videos with tonight's #377 contract tests (#826) and #379
  Phase 4a progress (#851); rollup 10->14 ready. Re-ran the checker
  (route resolution + live owner-issue validation) clean after edits.
- BASEBALLHELM_PRODUCTION_VERDICT.md: reissued (old 2026-06-25 verdict kept
  as history below a new 2026-07-15 section) — honest "batch branch pending
  integration merge + CI" verdict, deferred-minors list, and the
  journey/pipeline vocabulary decision, #379 legacy-backfill scope,
  marketing-root (helm-website-ui/ vs src/app/page.tsx), and dual-wizard
  (ImportWizardClient vs EventImportWizard) open decisions, each grounded
  in a specific file/PR.
- memory/context/baseballhelm-features.md: corrected narrative lines now
  verifiably false (stale 2026-06-30 rollup counts, decision-room
  "unapplied migration"/#405-406 "open", pipeline "7 columns vs 5-stage
  enum", journey "UNVERIFIED source table", discover.ts profile_visibility
  omission, documents #393) — no AUTOGEN blocks in this file, none touched.

Gates: check:readiness-matrix exit 0 (route resolution + live GITHUB_TOKEN
owner-issue validation); readiness-matrix-routes.test.ts 204/204 passing;
no markdownlint config present in repo (skipped per task instructions).
Docs-only change; no product code touched.

Co-authored-by: Fable Integrator <fable@helm.local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
njrini99-code pushed a commit that referenced this pull request Jul 15, 2026
Adds a baseball-auth-smoke job to ci.yml that runs the already-built
e2e/baseball-smoke.spec.ts + e2e/baseball-onboarding-smoke.spec.ts (with
their existing fail-loud auth setup) as a required PR gate, folded into
the `all` aggregate — the same promotion mechanism used for Supabase RLS
tests (#517) and the import-cycle ratchet (#808). Previously this
authenticated coach/player smoke only ran post-merge via playwright.yml's
push/manual-only `e2e` job, which stayed untouched.

Skips (not fails) on fork/Dependabot PRs, which get no repo secrets;
same-repo pushes/PRs must have the required secrets or the job fails
loudly. Docs updated to reflect the new hard-gate status and its added
CI-minutes cost.

Also unmasks the `|| echo "Playwright suite has failures..."` exit-code
shim in playwright.yml's advisory "Playwright (chromium)" job so a real
failure there turns the job red instead of silently passing (reviewer-
flagged on #812 as blocking trust in the e2e gate). That job is advisory,
not a required check, so this cannot newly block a merge — it only makes
the status honest.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
njrini99-code added a commit that referenced this pull request Jul 15, 2026
)

* ci: promote BaseballHelm authed smoke to a required PR gate (#372)

Adds a baseball-auth-smoke job to ci.yml that runs the already-built
e2e/baseball-smoke.spec.ts + e2e/baseball-onboarding-smoke.spec.ts (with
their existing fail-loud auth setup) as a required PR gate, folded into
the `all` aggregate — the same promotion mechanism used for Supabase RLS
tests (#517) and the import-cycle ratchet (#808). Previously this
authenticated coach/player smoke only ran post-merge via playwright.yml's
push/manual-only `e2e` job, which stayed untouched.

Skips (not fails) on fork/Dependabot PRs, which get no repo secrets;
same-repo pushes/PRs must have the required secrets or the job fails
loudly. Docs updated to reflect the new hard-gate status and its added
CI-minutes cost.

Also unmasks the `|| echo "Playwright suite has failures..."` exit-code
shim in playwright.yml's advisory "Playwright (chromium)" job so a real
failure there turns the job red instead of silently passing (reviewer-
flagged on #812 as blocking trust in the e2e gate). That job is advisory,
not a required check, so this cannot newly block a merge — it only makes
the status honest.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(ci): skip baseball-auth-smoke on Dependabot PRs, not just forks

Dependabot PRs are opened against this repo (not a fork), so the existing
head.repo.full_name == github.repository check alone did not exclude them.
The job's own docs already claimed a Dependabot skip, but without secrets
it would hard-fail on the pull_request branch, blocking the required `all`
aggregate on every Dependabot PR. Add an explicit github.actor check and
sync the "skips on fork/Dependabot PRs" prose in the job comment,
branch-protection.md, and CI_RUNBOOK.md to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Fable Integrator <fable@helm.local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI, Vercel, test, build, deploy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants