Check committed Markdown destinations

This commit is contained in:
2026-10-07 23:17:10 +00:00
parent b3b959ce77
commit 6397d41517
6 changed files with 440 additions and 11 deletions

View File

@@ -50,9 +50,19 @@ autolinks, images, titles, and their source use sites, and to build heading
anchors from visible AST text. It supports ATX and Setext headings, decodes
Markdown text through the parser, and assigns collision-free numeric suffixes
to repeated anchors. Link locations use one-based line and byte-column values.
A per-path cache retains the parsed records and anchors for each candidate
document. The parser remains internal; destination resolution and check selection
are tracked in the [implementation plan](../roadmap/implementation.md).
A per-path cache retains parsed records and anchors for candidate documents.
`checkMarkdownLinks` examines regular `.md` blobs from the captured tree. It
skips schemed and protocol-relative URIs, strips query components, and decodes
percent escapes once in local paths and fragments. It resolves destinations
through `CandidateTree.ResolveDestination`; decoded fragments are compared in
lowercase against anchors from the resolved regular Markdown document. Missing
paths, symlink cycles, and missing anchors produce `markdown-links` findings at
the source use site. Outside-checkout links produce out-of-scope observations by
default and findings when boundary enforcement is selected. Submodule-content
observations remain out of scope under either setting. Observations go to the
provided writer; a nil writer keeps library use quiet. Public selection remains
in the [implementation plan](../roadmap/implementation.md).
Committed-tree metadata and blob reads disable lazy fetching and Git transports
for those child commands. Missing local objects produce inspection errors;
@@ -126,6 +136,6 @@ symlink expansion detects cycles, and traversal honors cancellation. Absolute
destinations and symlink targets within the repository directory map back to
candidate-relative paths; existence still comes from committed entries.
The [implementation plan](../roadmap/implementation.md) owns Markdown
destination checking, diagnostics, and boundary policy. The committed-file and
destination-resolution primitives are available for that later integration.
The [implementation plan](../roadmap/implementation.md) records the remaining
public Markdown selection and integration work. The internal checker uses the
committed-file and destination-resolution primitives described here.