Skip to content

fix(check-docs): ignore link-shaped text in inline code spans without hiding real links - #99

Merged
bketelsen merged 2 commits into
mainfrom
lucilla/check-docs-code-spans
Nov 6, 2026
Merged

bketelsen merged 2 commits into
mainfrom
lucilla/check-docs-code-spans

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

scripts/check-docs.mjs checks the links of every Markdown file, the skills that frostyard/core syncs into .agents/skills/ too. It read link-shaped text inside inline code as a link: a Go generic call in a code span, such as errors.AsType[T](err), failed the gate. Because of this, core splits 3 such calls in the synced Go skills (golang-error-handling, golang-safety, golang-modernize/references/versions.md) and cannot remove the split until every consumer gate reads code spans (frostyard/core#201).

This PR copies core's code-span rule (frostyard/core#216) verbatim: the functions codeSpanRanges, consumedBacktickMarkerEnd, isInCodeSpan and stripWithMap, and the same change to the link loop. A link-shaped match is skipped only when its whole original range is inside a code span of a safe run of non-blank lines. A run with a |, an escaped backtick, a < with a later >, a line with an unpaired backtick run, or a ](, ][, www., :// or $ outside every span with a later backtick keeps every link checked, so the rule never hides a real link. Fence stripping, the index check, the symlink, release-config and cross-arch checks are unchanged.

std had no self-test for its docs gate. scripts/test-check-docs.mjs (modeled on updex's) builds fixture repositories and runs 27 cases: a valid fixture passes, a plain dead link fails, and every link-integrity case of core's tests (each must-fail case must report -> missing.md does not resolve). The CI docs-gate job runs it before the gate. AGENTS.md names the new command.

Risk tier

  • Tier 1: Low
  • Tier 2: Moderate
  • Tier 3: High
  • Tier 4: Critical

Rationale: risk:high. Matched paths in .github/risk-paths.json, and why each change is safe:

  • scripts/** matches scripts/check-docs.mjs and the new scripts/test-check-docs.mjs. The gate change only skips a match that is fully inside a code span of a safe run; every other match is checked as before, and the real tree gives the same counts. The self-test is read-only: it writes fixtures under a temporary directory and deletes them.
  • .github/workflows/** matches .github/workflows/ci.yml. The change adds 1 run: step (node scripts/test-check-docs.mjs) to the existing docs-gate job. No new action, no permission change, no secret, no trigger change.

Checks

  • No Go or Rust change; CI runs make ci
  • go.mod unchanged
  • New behavior has focused tests, including failure paths

Docs housekeeping

  • AGENTS.md updated for the new self-test command

Protected boundaries

  • The .github/workflows/ci.yml change is called out above as high risk (no new action; permissions unchanged)

Verification

  • node scripts/test-check-docs.mjs: 27 cases pass
  • node scripts/check-docs.mjs green: checked: 9 docs, 369 links, 9 symlinks (same as before)
  • Manual proof: in a temporary copy with the 3 Go calls joined into 1 code span each, the new gate passes; the base gate fails on the links err, v and value
  • Revert test: with scripts/check-docs.mjs from the base and the new cases kept, 5 must-pass cases fail (Go generic calls, run-length span, < without >, CRLF, markers inside spans). The must-fail cases pass there, because the base gate checks every match.

Cross-review

Reviewer: openai/gpt-6.1-sol. Coder: github-copilot/mai-code-2-flash (the AGENTS.md lines by the author agent).

  • 88adb8a: Ready. Blocking: none. The 4 functions are byte-identical to core's; the link loop matches; the 25 code-span fixtures use core's exact strings; the workflow adds exactly 1 run: step (actions SHA-pinned; permissions, triggers and secrets unchanged); the risk:high paths were read first.

@github-actions github-actions Bot added the risk:high Touches a path in .github/risk-paths.json label Nov 6, 2026
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 6, 2026
@bketelsen
bketelsen added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 71ab6a3 Nov 6, 2026
11 checks passed
@bketelsen
bketelsen deleted the lucilla/check-docs-code-spans branch November 6, 2026 19:20
bketelsen pushed a commit to frostyard/core that referenced this pull request Nov 6, 2026
The docs gates of core, updex and std now ignore link-shaped text inside
an inline code span (#216, frostyard/updex#493, frostyard/std#99), so the
vendored Go skills no longer need the split `X[T]`(`v`) form. Restore
upstream's single code span in golang-error-handling, golang-safety and
golang-modernize/references/versions.md, drop the 3 marked override
comments, and drop the Code spans entry from the overrides list.

Closes #201.

Co-authored-by: frostyard-machines <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants