Skip to content

ci: verify pinned source links resolve #120

Description

@dobby-coder

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:

  1. Greps docs/ for https://github.com/<owner>/<repo>/blob/<hash>/<path> links.
  2. Verifies each returns HTTP 200 (via the GitHub contents API with ref=<hash>, which handles private repos when a token is present).
  3. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions