Repository navigation
Description
Problem
scripts/check-docs.mjs strips fenced code blocks, but not inline code spans, before it finds Markdown links. A Go generic call in inline code, such as errors.AsType[T](err) or reflect.TypeAssert[T](v), matches the link pattern \[[^\]]*\]\(([^)\s]+)\) and fails the gate as a broken link.
core#200 (vendored Go skills) worked around 3 such calls in .agents/skills/golang-error-handling/SKILL.md, .agents/skills/golang-safety/SKILL.md and .agents/skills/golang-modernize/references/versions.md. Each call is split into the code span X[T] and a code span for the argument list, and each carries a marked <!-- Frostyard override --> comment (see docs/design/shared-skills.md, "Vendored Go skills"). A gate that understands code spans can remove these overrides.
Attempt in core#200 and why it was dropped
core#200 tried a code-span stripper in check-docs.mjs. The cross-review (openai/gpt-6.1-sol) found 10 points over 5 rounds. 5 were in the stripper (1 per round), and each time a real broken link could be hidden from the gate. Brian chose to drop the parser from #200 (T928b). The stripper findings, split into 6 test cases, are the test corpus for a later PR:
- A regex
`[^`\n]*`removes a real link between escaped backticks:\` [x](missing.md) \`. - Delimiter runs must match by length (CommonMark):
a[x](missing.md) `` `` is 1 span, and `` `` [x](missing.md)`` is an unclosed run, so the link is checked. - Spans must not pair across blocks: adjacent headings
# First `/# [x](missing.md) `. - A span that wraps over lines:
`code/continued` [x](missing.md) `tail`. If the closer of the wrapped span is read as a new opener, the link is hidden. - A GFM table cell boundary splits inline contexts:
| ` | [x](missing.md) ` |. - Raw HTML and autolinks can hold a literal backtick:
<span title="`">[x](missing.md)`</span>and the email autolink<1`@example.com> [x](missing.md) `.
Of the other 5 findings, 4 were in scripts/sync-skills.sh and its tests (config shape, 1 JSON document, empty skill list, a push assertion that could not fail) and 1 was a description count in the design doc. #200 fixed them and keeps them.
Proposed direction
- A conservative rule that never hides a real link: strip a code span only where no line in its blank-line-separated run has an unpaired backtick run, a
|, or a<(case 6 shows that a narrower<rule is not enough). Otherwise check every link in the run. - Alternative: parse with a CommonMark/GFM library (for example
markdown-it) and collect link nodes. This adds a dependency and changes how links are found (reference links, autolinks), so it needs its own decision. - Each of the 6 cases above becomes a test in
test/docs-integrity.test.mjs, and each must make the gate fail onmissing.md. Add 1 positive test: a fully pairedX[T](v)code span passes. - After the merge, remove the 3 overrides from the vendored Go skills.
Risk: check-docs.mjs is a quality gate; the PR needs a cross-review.
Activity