Skip to content

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

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

bketelsen merged 1 commit 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, anchors and symlinks are unchanged.

scripts/test-check-docs.mjs gets every link-integrity case of core's tests: the must-fail cases (each must report -> missing.md does not resolve) and the must-pass cases.

Checks

  • make test-docs-check: all assertions pass (the CI docs job runs it)
  • No Go code changes; CI runs make ci
  • New behavior has focused tests, including failure paths

Risk tier

  • Tier 2: Moderate

Rationale:

  • A change to a quality gate and its self-test. No path in .github/risk-paths.json matches.

Verification

  • node scripts/check-docs.mjs green: checked: 29 docs, 553 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.

  • c5a0876: Ready. Blocking: none. The 4 functions match core's verbatim; all 25 core link-integrity fixtures are in the self-test with identical strings; no other gate behavior changes.

@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 8a0c9b1 Nov 6, 2026
23 checks passed
@bketelsen
bketelsen deleted the lucilla/check-docs-code-spans branch November 6, 2026 19:21
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants