Skip to content

fix(public): enforce trust/support JSON-LD on the live site and deploy bundle - #83

Closed
nish3451 wants to merge 9 commits into
mainfrom
fix/lane1-trust-support-jsonld-live-guard
Closed

fix(public): enforce trust/support JSON-LD on the live site and deploy bundle#83
nish3451 wants to merge 9 commits into
mainfrom
fix/lane1-trust-support-jsonld-live-guard

Conversation

@nish3451

Copy link
Copy Markdown
Collaborator

The item

[unreviewed-by-grok] Six trust/support pages carry no JSON-LD structured data while the other six public pages do

Root cause

The finding describes the live site (tinystudio.in), which has served the stale 2026-06-20 bundle (07acd07) since June 20. Live JSON-LD coverage today: only /, /support/, /promptly/, /drishti/ (4 of 12 pages); /contact/, /privacy/, /privacy-choices/, /terms/, /promptly/support/, /promptly/privacy/, /drishti/support/, /drishti/privacy/ carry zero JSON-LD.

The repo fix is already merged on main: PR #26 added JSON-LD to every public page and test-public-structured-data.mjs asserts all 12 pages (127 checks, 0 failures). The release lane (#81) exists to publish main, but fail-closes without a Cloudflare Pages API token (one-time provisioning documented in publish-public-site.mjs).

What this PR closes: the detector blind spots

The instance was fixed in #26, but the release lane only proved JSON-LD on /contact/ - the exact finding could recur silently. This PR makes the acceptance enforced end-to-end:

  1. scripts/check-public-live-deploy.mjs - new section E asserts every one of the 12 public paths returns 200 and carries exactly one application/ld+json block (mirrors the PR fix(public): add JSON-LD structured data to trust and support pages #26 repo-side invariant). Run against the live site today it fails on exactly the pages the Grok review flagged.
  2. scripts/prepare-public-deploy-bundle.mjs - NEUTRAL_PROOFS now asserts JSON-LD survival for every remaining public page, so the filtered deploy bundle fails closed before publish if any page loses its structured data (test-public-deploy-bundle.mjs: 62 -> 72 checks).

Verification

  • npm test - all green (structured-data 127 checks, deploy-bundle 72 checks, 0 failures)
  • node scripts/check-public-live-deploy.mjs - now reports the 8 live pages missing JSON-LD (detector catches the original finding; passes only after the release lane publishes main)
  • git diff --check clean

Note

The actual publish to production remains blocked on the documented one-time provisioning of a Cloudflare Pages-scoped token (gh secret set CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID=f670a698e17bf160c8e4679823e68916) - no repo secret or local wrangler auth exists.

…y bundle

The Grok review finding ("six trust/support pages carry no JSON-LD while
the other six do") describes the live tinystudio.in, which has served the
2026-06-20 bundle (07acd07) since June 20. The repo fix itself is already
merged on main (PR #26 adds JSON-LD to every public page; the structured
data test asserts all 12 pages), but the release lane's detectors only
proved JSON-LD on /contact/, so the finding could recur silently.

Close the detector blind spots so the acceptance is enforced end-to-end
once the release lane publishes:

- scripts/check-public-live-deploy.mjs: new section E asserts every one
  of the 12 public paths returns 200 and carries exactly one
  application/ld+json block, mirroring the repo-side invariant from PR #26
  (currently fails live: 8 pages on the stale bundle have zero JSON-LD).
- scripts/prepare-public-deploy-bundle.mjs: NEUTRAL_PROOFS now asserts
  JSON-LD survival for every remaining public page, so the filtered
  deploy bundle fails closed if any page loses its structured data
  (test-public-deploy-bundle.mjs: 62 -> 72 checks).

verify: npm test (all green); node scripts/test-public-deploy-bundle.mjs
(72 checks, 0 failures); node scripts/check-public-live-deploy.mjs now
reports the 8 live pages missing JSON-LD, proving the detector catches
the original finding; git diff --check
@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: 39 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: Free

Run ID: 5034964c-c9e0-489e-8ea3-79903bc14e78

📥 Commits

Reviewing files that changed from the base of the PR and between 8b69101 and 9782547.

📒 Files selected for processing (2)
  • scripts/check-public-live-deploy.mjs
  • scripts/prepare-public-deploy-bundle.mjs

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 Pro by visiting https://app.coderabbit.ai/login.

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

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

ℹ️ 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".

{
label: "support page JSON-LD (07acd07 baseline)",
file: "support/index.html",
test: (html) => html.includes("application/ld+json"),

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 Validate an actual JSON-LD block in bundle proofs

When a page loses its JSON-LD <script> but retains the text application/ld+json elsewhere—for example, in an HTML comment—this proof still passes, so preparePublicDeployBundle() can produce a publishable bundle without structured data despite the stated fail-closed invariant. This affects every newly added proof because they all use the same substring check; count complete JSON-LD script blocks (and require exactly one) instead.

Useful? React with 👍 / 👎.

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

ℹ️ 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".

for (const path of PUBLIC_PATHS) {
const { status, body } = await get(path)
ok(status === 200, `${path} returns 200 (got ${status})`)
const blocks = (body.match(/<script\s+type="application\/ld\+json"[^>]*>/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 Require complete, parseable JSON-LD blocks

When a live response contains this opening-tag text inside an HTML comment, or contains one unterminated or syntactically invalid JSON-LD script, blocks is still 1, so section E reports success even though consumers have no usable structured data. This live acceptance check should extract complete opening/closing script blocks and parse their contents as JSON before counting them as valid.

Useful? React with 👍 / 👎.

]

// Every public page on the live site must carry structured data (PR #26).
const PUBLIC_PATHS = [

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 Derive live paths from the public-page inventory

When a new public/**/index.html page is added, the bundle copies and publishes it but this manually maintained array does not automatically include it, so the claimed site-wide live invariant silently stops at the original 12 routes. This is especially problematic for detecting another stale deployment: the new route can be absent or lack JSON-LD while post-deploy verification succeeds. Derive this inventory from the deploy bundle or another canonical route manifest, or add a synchronization check against the public pages.

Useful? React with 👍 / 👎.

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

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

ℹ️ 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 +116 to +117
const blocks = (body.match(/<script\s+type="application\/ld\+json"[^>]*>/gi) || []).length
ok(blocks === 1, `${path} carries exactly one application/ld+json block (got ${blocks})`)

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 Verify that each response matches its requested route

When a listed route is misconfigured to return another page with status 200—for example, /drishti/privacy/ serving the homepage—this check passes because the homepage also contains exactly one JSON-LD opening tag. The unknown-URL test does not detect a rewrite or duplicated artifact affecting only a known route, so the release lane can approve a deployment where the requested page and its route-specific structured data are absent; compare the response canonical or parsed JSON-LD URL with path before accepting it.

Useful? React with 👍 / 👎.

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

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

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

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

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@nish3451

Copy link
Copy Markdown
Collaborator Author

Superseded by #127 — same trust/support JSON-LD live guard, 98% of this PR's changes are contained in it. Closing in favour of #127.

@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