Rendered from docs/verifications/0002-a-fixture-tree-of-document-paths-symlinks-and-identifiers-proves-the-document-path-finding.md in the Headwater
corpus. Every document on this half of the site is typed by the taxonomy
the descriptor names: corpus.json.
A fixture tree of document paths, symlinks and identifiers proves the document path finding
Approach
The fixture tree at engine/crates/check/fixtures/document-path-target/ holds one note for each case of HW-AC-0003. engine/crates/check/fixtures/document-path-target.taxonomy.yml declares the kinds and relations the notes use. NOTE-FIX-b in notes/b.md is the target document that every path case names.
The cases, and the file that carries each one:
- The decisive case.
notes/a.mdwrites the path ofNOTE-FIX-bundertraces_to. - Spelling.
notes/a2.mdwrites the path with./and a..segment.notes/k.mdwrites it in two spellings in one entry. - Symlinks.
src/alias.mdis a symlink ontonotes/b.md, andlinked/is a symlink ontonotes/.notes/l.mdandnotes/l2.mdwrite a path through each one. - Path and identifier together.
notes/m.mdwrites the path and thenNOTE-FIX-b. - The identifier form.
notes/c.mdwritesNOTE-FIX-b. - Paths that name no document.
notes/d.mdtraces tosrc/lib.rs, andnotes/n.mdtraces tosrc/lib-link.rs, a symlink onto it.notes/e.mdwrites a wildcard,notes/g.mdnames a file with no identifier, andnotes/j.mdnames a file with no kind.notes/h.mdwrites the path undercites, whose resolver is a fixture snapshot outside the tree.notes/f.mdwrites the path undergoverns.
engine/crates/check/tests/document_path_target.rs builds the census, the graph and one check run over the tree, with a pinned clock. Each of its seven tests reads the findings of relation.target.unresolved on one or more notes, and the graph's target for each entry.
cargo test -p headwater-check --test document_path_target --manifest-path engine/Cargo.toml --locked
The two source files under src/ hold no code that the engine runs. They exist so that a path to a source file, and a symlink onto one, resolve to a real entry on the tree.
What this does not cover
The tree proves the rule over one taxonomy, and that taxonomy declares two relations that admit a document and an anchor. It does not prove every relation of every package.
The test does not run headwater check from the command line. It calls the check library, so the CLI's output format for the finding is outside this test.
This document governs the test file and the fixture tree. A change to either one is a change to the test design, and a reader then checks this document against the change. The comment that cites HW-VER-0002 in the test file binds the cited_in edge.