You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(score): directory-tree code blocks in README produce broken-reference false positives #293
charter score on a Vite/TypeScript app reports 118 broken path references, dragging Grounding to 11/20. Nearly all of them are bare filenames listed inside a fenced directory tree block in the README, and every one of those files exists in the repo at its real path.
This is a different class from #164 (URLs, env vars, HTTP routes; closed) and #163 (monorepo/absolute paths). #164's fix keeps any token with a file extension, which is exactly what a directory tree is full of. The tokens are real filenames; only the prefix is missing, because a tree diagram expresses the prefix structurally through indentation rather than inline.
Impact
118 false positives against ~0 real ones here, so the number carries no signal.
Grounding is the one category a well-documented repo can't win: the more thorough the README's structure section, the worse the score.
It pushes authors toward deleting useful documentation, or rewriting trees as fully-qualified path lists, to satisfy the metric.
Suggested fix
Any of these would resolve it:
Skip fenced blocks that look like directory trees — a block whose lines are dominated by indentation plus ├ └ │ / or dir/ headers is a diagram, not a reference list.
Resolve by basename before declaring a reference broken — if exactly one file in the repo matches the basename, count it as resolved. Ambiguous matches could stay unresolved or warn once.
Only validate tokens that look like paths relative to the repo — i.e. containing a / and resolving from root, and treat bare name.ext tokens in prose as prose.
Option 2 also helps #163, since it doesn't depend on the reference being written relative to the repo root.
Repro
Any repo with a README directory-tree section. Observed with @stackbilt/[email protected], charter score, Node 22.14, WSL2.
Activity
fix(score): require trailing-segment agreement for basename resolution (
docs: correct the adf tidy note and document score, telemetry, stamp-…