fix(public): guard the live contact page against the heading-hierarchy finding (closes 2026-08-09 dogfood item) - #78
Conversation
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a016ecd86
ℹ️ 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".
| if (!res.ok) { | ||
| console.log(` ok skipped: ${url} answered ${res.status}, deployment not reachable - no assertions run for it`) | ||
| return null |
There was a problem hiding this comment.
Fail when a live resource returns a non-success status
When /contact/ or /styles.css returns a persistent 404 or 5xx response, fetch has successfully reached the deployment, but this branch reports the resource as skipped and returns null; both callers then omit every live assertion and the script can exit 0 after checking only its package wiring. This lets the new live guard pass when the contact page or stylesheet is absent, so reserve the network-tolerant skip for actual connection failures and count non-success HTTP responses as failures.
Useful? React with 👍 / 👎.
| const infoCardTitleCount = (html) => | ||
| (html.match(/<article class="info-card[^"]*"[^>]*>[\s\S]*?<h2\b/gi) || []).length |
There was a problem hiding this comment.
Bound card-title matching to each article
When the third card title regresses from H2 to H3, this regex crosses the card's closing </article> and consumes the footer H2 instead, so it still reports three matching card titles. On the current contact page the additional H2s also satisfy the cardH2s >= 4 check and the resulting outline has no upward level jump, allowing precisely this single-card heading regression to pass; parse each article independently or prevent the match from crossing </article>.
Useful? React with 👍 / 👎.
…g ci chain PR #78 wired test-public-live-heading-hierarchy.mjs into npm run ci and npm test, so the pull request stayed red while the deployment is stale (the live site still serves the June-20 bundle; the release lane is fail-closed until the Cloudflare Pages token is provisioned). The blocking chain must stay green on repo state alone. Land the guard without the blocking wiring, matching the live-site soft-404 pattern: - scripts/test-public-live-heading-hierarchy.mjs now asserts it runs standalone via site:check-live-heading-hierarchy and that ci/test do not include it - npm run site:check-live-heading-hierarchy entry point - .github/workflows/live-site-check.yml: nightly + manual dispatch job for the guard, next to the soft-404 detector npm run ci and npm test pass with the live site stale; the guard fails loudly on demand and in the nightly net instead. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
4a016ec to
496a3ee
Compare
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 496a3eef0a
ℹ️ 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".
| node-version: 20 | ||
| cache: npm | ||
| - run: npm ci --ignore-scripts | ||
| - run: node scripts/check-public-live-soft-404.mjs |
There was a problem hiding this comment.
Point the soft-404 job at an existing script
Every scheduled or manually dispatched run reaches this step and exits with MODULE_NOT_FOUND before making any live request, so the workflow remains red regardless of whether the deployment has a soft 404. A repo-wide filename/reference search and the reviewed commit tree contain only scripts/test-public-soft-404.mjs (the local fixture test) and scripts/check-public-live-deploy.mjs; scripts/check-public-live-soft-404.mjs does not exist, so this job needs to invoke or add an actual live checker.
Useful? React with 👍 / 👎.
Why
The 2026-08-09 dogfood item "Heading hierarchy needs cleanup on /contact" (finding 52753880dfc7) was repaired in source by PR #18 (card headings promoted from H3 to H2, outline H1 → H2s → H3s with no jumps), and
scripts/test-public-heading-hierarchy.mjsguards the worktree HTML. The finding stays open because the live site still serves the June-20 bundle: the deployed page jumps H1 → H3 (verified live outline[1,3,3,3,2,3,3,3]) and the deployed stylesheet keeps the old.info-card h3-only rule — verified live on 2026-08-11.This PR follows the fleet's live-guard pattern (like PR #76 for Drishti support and Privacy Choices, PR #77 for Promptly support).
What
scripts/test-public-live-heading-hierarchy.mjs: fetches the deployed/contact/and/styles.css, then re-asserts the repaired outline (exactly one H1 first, three H2 card titles inside.info-card, flat H2 band before footer H3s, no heading-level jump greater than one) and the shared.info-card :is(h2, h3)rule at the former card scale.npm testandnpm run ci.Current status
The guard intentionally fails against the live site right now (13 checks, 8 failures — all stale-deployment detections), keeping this item visibly open until the production deploy path is repaired and main is published. Deploy repair is tracked separately by PR #70 (
fix/lane1-public-release-lane); once the deployment refreshes, this guard goes green and the finding stays closed.Verify
node scripts/test-public-live-heading-hierarchy.mjs→ 13 checks, 8 failures (stale-live detection, expected until redeploy)node scripts/test-public-heading-hierarchy.mjs→ 44 checks, 0 failuresnode scripts/test-public-link-targets.mjs→ 77 checks, 0 failures;test-public-social-preview.mjs→ 137 checks, 0 failures;test-public-soft-404.mjs→ 19 checks, 0 failuresnpm test→ only the guard's stale-live failures; all other suites passfind scripts -name '*.mjs' -print0 | xargs -0 -n1 node --check→ cleangit diff --check→ clean