mex check reports a MISSING_PATH error for references shaped
<word>/<version> — git branch names and pinned runtimes, not file paths:
✗ MISSING_PATH:123 Referenced path does not exist: release/2.1.0
src/drift/checkers/path.ts has a guard, isUnrootedReference, whose job is to
treat this kind of token as prose: if nothing by the name of the first segment
exists, it is not a real relative path. The guard never runs here, because it
returns early on anything that looks like it has a file extension:
if (/\.[A-Za-z0-9]+$/.test(trimmed)) return false;
A trailing version number matches that pattern — .1 in 2.1.0 reads as an
extension — so the value skips the prose check and is reported missing.
The inconsistency is visible within a single document. These differ only by a
trailing word:
release/2.1.0 FLAGGED release/2.1.0-rc ignored as prose
api/v1.2 FLAGGED api/v1 ignored as prose
python/3.11 FLAGGED
node/20.11 FLAGGED
release/2.1.0 is the git-flow standard branch name, so this affects any
project that documents a release branch, and python/3.11 or node/20.11 is
the ordinary way to write a pinned runtime in a stack document.
To Reproduce
main already carries a failing case for this, skipped:
src/drift/__tests__/path-false-positives.test.ts
it.skip("does not claim a version-shaped branch name", …)
Remove the .skip to reproduce.
Expected behavior
A trailing numeric segment is a version, not a file extension, so the value
should reach the existing prose guard and be dropped rather than reported.
One boundary worth knowing
Making the extension check require an alphabetic character is only half of it.
Once the value reaches isUnrootedReference, that guard clears it only if the
first path segment does not exist on disk. So api/v1.2 in a repository that
really has an api/ directory will still be reported. The skipped test covers
the common case; the narrower one can be left alone or handled separately.
mex checkreports a MISSING_PATH error for references shaped<word>/<version>— git branch names and pinned runtimes, not file paths:src/drift/checkers/path.tshas a guard,isUnrootedReference, whose job is totreat this kind of token as prose: if nothing by the name of the first segment
exists, it is not a real relative path. The guard never runs here, because it
returns early on anything that looks like it has a file extension:
A trailing version number matches that pattern —
.1in2.1.0reads as anextension — so the value skips the prose check and is reported missing.
The inconsistency is visible within a single document. These differ only by a
trailing word:
release/2.1.0is the git-flow standard branch name, so this affects anyproject that documents a release branch, and
python/3.11ornode/20.11isthe ordinary way to write a pinned runtime in a stack document.
To Reproduce
mainalready carries a failing case for this, skipped:Remove the
.skipto reproduce.Expected behavior
A trailing numeric segment is a version, not a file extension, so the value
should reach the existing prose guard and be dropped rather than reported.
One boundary worth knowing
Making the extension check require an alphabetic character is only half of it.
Once the value reaches
isUnrootedReference, that guard clears it only if thefirst path segment does not exist on disk. So
api/v1.2in a repository thatreally has an
api/directory will still be reported. The skipped test coversthe common case; the narrower one can be left alone or handled separately.