Skip to content

test(site): validate fragments and report repository documentation drift - #94

Merged
firejune merged 2 commits into
mainfrom
naru/88-anchors-and-link-drift
Oct 27, 2026
Merged

firejune merged 2 commits into
mainfrom
naru/88-anchors-and-link-drift

Conversation

@firejune

Copy link
Copy Markdown
Contributor

Closes #88.

verify dropped 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.txt and each section of llms-full.txt (percent/entity decoding included). check:external is 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".

Check Result
planted #planted-missing-anchor in a private copy of /docs/core/ fails by source page + target (exit 1); repaired → exit 0
artifact mutant (HTML + Markdown) refused even after a refreshed manifest
targeted / full / build / verify 38 pass / 67 pass (548 assertions) / 12 pages + 8 redirects / 0
one live external report 89 entries, 0 missing, 63 success, 5 body-limit, 21 unvisited (budget) — a bounded report, not an all-links pass

Rejected: arbitrary domains, recursing into demo bundles, guessed heading slugs, retries, any workflow/permission change.

@codex review

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T03:01:35.598044Z 5af06d4 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Comment thread src/links.ts Outdated
Comment on lines +42 to +45
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')));

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

Copy link
Copy Markdown
Contributor Author

Review P2 adopted: check:links now refuses by name when the output directory or any of the 26 required source documents is missing (before: exit 0 with "0 error(s)" — kept as the red control). 26 single-deletion cases + nonexistent output + directory replacement refuse; restored fixture exits 0 unchanged. Full suite 68 pass. No re-review requested.

@firejune
firejune merged commit 012abd4 into main Oct 27, 2026
3 checks passed
@firejune
firejune deleted the naru/88-anchors-and-link-drift branch October 27, 2026 03:17
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.

test(site): validate internal anchors and report external documentation link drift

1 participant