-
Notifications
You must be signed in to change notification settings - Fork 0
fix(public): guard live llms.txt coverage in both live-site checkers #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d53862
fix(public): check live llms.txt lists all 12 public pages in both li…
nish3451 9a6f51a
Merge branch 'main' into fix/live-llms-txt-coverage-check
nish3451 d409a22
Merge branch 'main' into fix/live-llms-txt-coverage-check
nish3451 48e6ad1
Merge branch 'main' into fix/live-llms-txt-coverage-check
nish3451 27cb33c
Merge branch 'main' into fix/live-llms-txt-coverage-check
nish3451 0dcacac
Merge branch 'main' into fix/live-llms-txt-coverage-check
nish3451 897b3d0
Merge branch 'main' into fix/live-llms-txt-coverage-check
nish3451 5a9e1af
Merge remote-tracking branch 'origin/main' into fix/live-llms-txt-cov…
nish3451 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // Single source of truth for the tinystudio.in public page set. | ||
| // | ||
| // Every consumer that needs to know "what are all the public pages" must | ||
| // import from here instead of hard-coding its own list: | ||
| // - scripts/prepare-static-site-bundle.mjs (bundle generator + its | ||
| // llms.txt coverage assertion) | ||
| // - scripts/check-public-live-deploy.mjs (release-lane live verifier) | ||
| // - scripts/check-public-live-soft-404.mjs (nightly stale-bundle net) | ||
| // | ||
| // Drift between these lists is how the live llms.txt ended up listing only | ||
| // 7 of the 12 public URLs (the five per-app support/privacy trust pages | ||
| // were missing from the June-20 bundle). Keep the lists in sync here only. | ||
|
|
||
| export const PUBLIC_HTML_FILES = [ | ||
| "index.html", | ||
| "404.html", | ||
| "support/index.html", | ||
| "contact/index.html", | ||
| "privacy/index.html", | ||
| "privacy-choices/index.html", | ||
| "terms/index.html", | ||
| "promptly/index.html", | ||
| "promptly/support/index.html", | ||
| "promptly/privacy/index.html", | ||
| "drishti/index.html", | ||
| "drishti/support/index.html", | ||
| "drishti/privacy/index.html", | ||
| ] | ||
|
|
||
| export const pageUrlFor = (relativeFile) => | ||
| relativeFile === "index.html" | ||
| ? "https://tinystudio.in/" | ||
| : `https://tinystudio.in/${relativeFile.split("/").slice(0, -1).join("/")}/` | ||
|
|
||
| // The 12 canonical public URLs (every page except the 404 catch-all). | ||
| export const PUBLIC_PAGE_URLS = PUBLIC_HTML_FILES.filter( | ||
| (relativeFile) => relativeFile !== "404.html" | ||
| ).map(pageUrlFor) | ||
|
|
||
| // Assert that llms.txt content lists every public page; returns the | ||
| // missing URLs (empty array when coverage is complete). | ||
| export const missingFromLlmsTxt = (content) => | ||
| PUBLIC_PAGE_URLS.filter((url) => !content.includes(url)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
body.includes(url)treats parent URLs as present whenever a child URL is listed: for example,https://tinystudio.in/promptly/support/satisfies checks for both the homepage and/promptly/. Consequently, both live-site guards can pass even if the Home, Promptly, or Drishti entries are absent, defeating the coverage check this commit adds. Parse the file into complete URL tokens or lines and compare exact entries instead.Useful? React with 👍 / 👎.