Repository navigation
test(site): validate fragments and report repository documentation drift - #94
Conversation
src/verify.ts checked that a linked file existed but dropped the fragment, so a link to a section that no longer exists passed. Same-page, relative, cross-page and absolute same-origin links are now resolved in the source page's URL context and checked against the generated HTML's element ids, across the twelve pages, their Markdown mirrors, llms.txt and each page section of llms-full.txt, with percent and entity decoding. Measured: a planted href="#planted-missing-anchor" in a private copy of /docs/core/ fails by source page and target (exit 1); repaired, exit 0; a generated-artifact mutant on both HTML and Markdown refuses even after a refreshed valid manifest. Targeted 38 pass; full suite 67 pass / 548 assertions; build 12 pages + 8 redirects; verify 0. Deterministic checks use no network. bun run check:external is a separate, bounded live report for rig-c repository documentation links (40 requests, 2 redirect hops, 1 MiB per body, 5 s per request, 45 s total; no retries, no credentials): only HTTP 404/410 count as missing; auth, rate limit, server error, timeout and network failures keep their own statuses. One run: 89 link entries, 0 missing, 63 success, 5 body-limit, 21 unvisited by budget, 26 anchors present / 19 unknown / 44 not requested — a bounded report, not an all-links pass. README documents both. Rejected: crawling arbitrary domains; recursing into copied demo bundles; guessing GitHub heading slugs; broad retries; any workflow or permission change. Closes #88 Co-Authored-By: Naru <342599188+fj-naru[bot]@users.noreply.github.com> Co-Authored-By: Roa <342598975+fj-roa[bot]@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5af06d4136
ℹ️ 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 (existsSync(join(root, html))) documents.push({ source: html, route: page.route, html: read(html) }); | ||
| if (existsSync(join(root, md))) documents.push(markdownDocument(md, `/${md}`, read(md))); | ||
| } | ||
| if (existsSync(join(root, 'llms.txt'))) documents.push(markdownDocument('llms.txt', '/llms.txt', read('llms.txt'))); |
There was a problem hiding this comment.
Reject missing output before reporting a successful link check
When check:links runs before a build or receives a nonexistent --out directory, every input is silently skipped, so it reports Internal links: 0 error(s) and exits 0 without checking anything. I reproduced this with bun src/links.ts --out /tmp/rig-c-review-nonexistent-output-0a59771. Although verify separately checks required files, the newly documented standalone command does not. Validate that the output directory and expected source documents exist before returning a successful standalone check.
Useful? React with 👍 / 👎.
…missing Review of #94 (P2): check:links run before a build, or with a nonexistent --out, skipped every input and reported "Internal links: 0 error(s)" with exit 0 — a check that measured nothing printing green. siteDocuments now preflights the output directory and every regular HTML, Markdown and LLM source file; the CLI refuses by name, exit 1, naming what is missing, for the standalone command and the shared reader alike. Measured: before the fix, a nonexistent output and a deleted Markdown input both exited 0 (kept as the red control); after, the nonexistent output and each of the 26 required documents deleted one at a time refuse by name, a directory replacement refuses, and the restored fixture exits 0 with the original stdout/stderr. Targeted 21 pass / 232 assertions; full suite 68 pass / 634 assertions; build 12 pages + 8 redirects; verify 0. README states the build-first requirement. Rejected: creating missing documents silently; removing the standalone command; a wider refactor. Co-Authored-By: Naru <342599188+fj-naru[bot]@users.noreply.github.com> Co-Authored-By: Roa <342598975+fj-roa[bot]@users.noreply.github.com>
|
Review P2 adopted: |
Closes #88.
verifydropped fragments, so a link to a vanished section passed. Links are now resolved in the source page's URL context and checked against generated element ids across the twelve pages, Markdown mirrors,llms.txtand each section ofllms-full.txt(percent/entity decoding included).check:externalis a separate, bounded live report for rig-c repository documentation links (40 requests, 2 hops, 1 MiB/body, 5 s/request, 45 s total, no retries, no credentials); only 404/410 are "missing".#planted-missing-anchorin a private copy of/docs/core/Rejected: arbitrary domains, recursing into demo bundles, guessed heading slugs, retries, any workflow/permission change.
@codex review
🤖 Generated with Claude Code