Every code snippet in the docs carries a source link pinned to a full commit hash (see CLAUDE.md). Nothing verifies these links stay resolvable, so drift is only caught by hand. Recent examples of that manual work: #108 and #111 (stale staging URLs), #109/#110 (wrong deploy claim). If a pinned file/commit disappears or a repo is force-pushed, the 404 ships silently.
There are currently 45 unique pinned github.com/.../blob/<hash>/<path> source links across docs/, and all resolve today — so a checker would start green.
Proposed check
A small script (e.g. scripts/check-source-links.mjs) that:
- Greps
docs/ for https://github.com/<owner>/<repo>/blob/<hash>/<path> links.
- Verifies each returns HTTP 200 (via the GitHub contents API with
ref=<hash>, which handles private repos when a token is present).
- Exits non-zero listing any that 404.
Wire it in as npm run check:links plus a CI job.
Note on scope
This is an HTTP 200 existence check only. It does not catch content drift where a file still exists but the referenced line range no longer matches the snippet (the postguard-examples consolidation gotcha in CLAUDE.md). That deeper check is out of scope here.
Filing for human review because the CI wiring lives in .github/workflows/, which the Dobby App cannot push to — a maintainer needs to add the workflow step (the script + npm script themselves are within reach of a normal PR).
Every code snippet in the docs carries a source link pinned to a full commit hash (see
CLAUDE.md). Nothing verifies these links stay resolvable, so drift is only caught by hand. Recent examples of that manual work: #108 and #111 (stale staging URLs), #109/#110 (wrong deploy claim). If a pinned file/commit disappears or a repo is force-pushed, the 404 ships silently.There are currently 45 unique pinned
github.com/.../blob/<hash>/<path>source links acrossdocs/, and all resolve today — so a checker would start green.Proposed check
A small script (e.g.
scripts/check-source-links.mjs) that:docs/forhttps://github.com/<owner>/<repo>/blob/<hash>/<path>links.ref=<hash>, which handles private repos when a token is present).Wire it in as
npm run check:linksplus a CI job.Note on scope
This is an
HTTP 200existence check only. It does not catch content drift where a file still exists but the referenced line range no longer matches the snippet (thepostguard-examplesconsolidation gotcha inCLAUDE.md). That deeper check is out of scope here.Filing for human review because the CI wiring lives in
.github/workflows/, which the Dobby App cannot push to — a maintainer needs to add the workflow step (the script + npm script themselves are within reach of a normal PR).