After #143, mex check still reports MISSING_PATH errors for things that are not
drift. Measured across five scaffolds with real .mex/ directories, one of them
loses ~90 points to notations that were never paths.
Grouped because they share src/drift/claims.ts and
src/drift/checkers/path.ts. Happy to split further. A seventh defect in the
same area — version-shaped references such as release/2.1.0 — is filed
separately as a starter task in #201.
A. Tokens that were never file paths
| # |
Flagged |
Document actually says |
Cause |
| 1 |
src/auth/login.validateToken ×3 |
"the qualified_name string (e.g. …)" |
symbol notation read as a path |
| 2 |
.d.ts ×2 |
"the SDK's CJS .d.ts" |
EXTENSION_ONLY is /^\.[A-Za-z0-9]+$/ — matches .ts, misses the compound form |
| 3 |
./x, x.ts, x/index.ts |
"(./x may be x.ts or x/index.ts); at most one really exists" |
hypothetical examples |
| 4 |
tests/grounding|traversal|edges|store.test.ts |
"The existing unit tests in …" |
alternation shorthand |
B. Things that exist but are reported missing
5. Scoped packages with a strict exports map. pathExists probes
${pkgName}/package.json, which modern packages do not expose:
@scope/pkg/package.json -> FAILS: ERR_PACKAGE_PATH_NOT_EXPORTED
@scope/pkg -> RESOLVES
Observed on a package that is installed, in dependencies, and importable.
Resolving the bare specifier would fix it.
6. The gitignore exemption is inert for directory-only rules. Trailing-slash
patterns match directories only, and git cannot classify a path that does not
exist. mex writes exactly such a rule into every scaffold —
src/setup/ignore.ts has ["graph.db*", "wiki.db*", "local/"]. In a clean repo
with those rules:
# .mex/local absent — the only case MISSING_PATH can fire
$ printf '.mex/local\n.mex/graph.db\n' | git check-ignore --stdin
.mex/graph.db <- .mex/local NOT exempt
# .mex/local present — already skipped by existsSync
.mex/local
.mex/graph.db
So the exemption fires only when it is not needed. graph.db* escapes because it
is a glob with no trailing slash. A bare filename under an ignored directory is
never matched either.
Expected behavior
None of these are drift. Per the reasoning settled in #143, a token that is
confidently not a path should be dropped before it becomes a claim rather than
demoted, and a deliberately ignored path should be exempt whether or not it
currently exists.
Additional context
src/drift had no tests across 19 source files until #143's fix added the first
file, which is plausibly why these accumulated. That file covers the cases which
already pass and can be extended in place.
After #143,
mex checkstill reports MISSING_PATH errors for things that are notdrift. Measured across five scaffolds with real
.mex/directories, one of themloses ~90 points to notations that were never paths.
Grouped because they share
src/drift/claims.tsandsrc/drift/checkers/path.ts. Happy to split further. A seventh defect in thesame area — version-shaped references such as
release/2.1.0— is filedseparately as a starter task in #201.
A. Tokens that were never file paths
src/auth/login.validateToken×3qualified_namestring (e.g. …)".d.ts×2.d.ts"EXTENSION_ONLYis/^\.[A-Za-z0-9]+$/— matches.ts, misses the compound form./x,x.ts,x/index.ts./xmay bex.tsorx/index.ts); at most one really exists"tests/grounding|traversal|edges|store.test.tsB. Things that exist but are reported missing
5. Scoped packages with a strict
exportsmap.pathExistsprobes${pkgName}/package.json, which modern packages do not expose:Observed on a package that is installed, in
dependencies, and importable.Resolving the bare specifier would fix it.
6. The gitignore exemption is inert for directory-only rules. Trailing-slash
patterns match directories only, and git cannot classify a path that does not
exist. mex writes exactly such a rule into every scaffold —
src/setup/ignore.tshas["graph.db*", "wiki.db*", "local/"]. In a clean repowith those rules:
So the exemption fires only when it is not needed.
graph.db*escapes because itis a glob with no trailing slash. A bare filename under an ignored directory is
never matched either.
Expected behavior
None of these are drift. Per the reasoning settled in #143, a token that is
confidently not a path should be dropped before it becomes a claim rather than
demoted, and a deliberately ignored path should be exempt whether or not it
currently exists.
Additional context
src/drifthad no tests across 19 source files until #143's fix added the firstfile, which is plausibly why these accumulated. That file covers the cases which
already pass and can be extended in place.