Skip to content

fix(public): guard the live contact page against the heading-hierarchy finding (closes 2026-08-09 dogfood item) - #78

Closed
nish3451 wants to merge 1 commit into
mainfrom
fix/lane1-contact-heading-hierarchy-live-guard
Closed

fix(public): guard the live contact page against the heading-hierarchy finding (closes 2026-08-09 dogfood item)#78
nish3451 wants to merge 1 commit into
mainfrom
fix/lane1-contact-heading-hierarchy-live-guard

Conversation

@nish3451

Copy link
Copy Markdown
Collaborator

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.mjs guards 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.
  • Wired into npm test and npm run ci.
  • Network-tolerant: skips when the site is unreachable; fails loudly when the deployment serves stale pages.

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 failures
  • node 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 failures
  • npm test → only the guard's stale-live failures; all other suites pass
  • find scripts -name '*.mjs' -print0 | xargs -0 -n1 node --check → clean
  • git diff --check → clean

@greptile-apps greptile-apps 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.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@nish3451, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

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).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5007b9f7-c88d-4a37-a1a8-6e3dfdcc39fe

📥 Commits

Reviewing files that changed from the base of the PR and between b2a58e0 and 496a3ee.

📒 Files selected for processing (3)
  • .github/workflows/live-site-check.yml
  • package.json
  • scripts/test-public-live-heading-hierarchy.mjs

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

@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: 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".

Comment on lines +48 to +50
if (!res.ok) {
console.log(` ok skipped: ${url} answered ${res.status}, deployment not reachable - no assertions run for it`)
return null

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

Comment on lines +42 to +43
const infoCardTitleCount = (html) =>
(html.match(/<article class="info-card[^"]*"[^>]*>[\s\S]*?<h2\b/gi) || []).length

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 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>
@nish3451
nish3451 force-pushed the fix/lane1-contact-heading-hierarchy-live-guard branch from 4a016ec to 496a3ee Compare August 11, 2026 12:59

@greptile-apps greptile-apps 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.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@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: 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

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

@nish3451

Copy link
Copy Markdown
Collaborator Author

Superseded by #119 (same intent, rebased on fresh origin/main without the conflicting live-site-check.yml rewrite). Closing this in favor of #119 keeps the /contact heading-hierarchy live guard mergeable.

@nish3451

Copy link
Copy Markdown
Collaborator Author

Superseded by #118 — same test-public-live-heading-hierarchy.mjs guard and same workflow, extended to cover the deploy checker. Closing in favour of #118.

@nish3451 nish3451 closed this Aug 19, 2026
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