ND-007: npm run bench:ilike silently runs FTS mode — arg parser ignores --mode ilike (space form) #57
Labels
No labels
blocked:gate-fetch
blocked:gate-implement
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:needs-local-checkout
blocked:no-changes
bug
feature-request
in-progress
needs-decompose
needs-triage
ops-task
quickfix
security/high
security/low
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/nodedesk#57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The benchmark arg parser in
bench/search/benchmark.tsonly accepts--mode=ilike,--ilike, or the env varSEARCH_MODE=ilike. The documented/scripted invocation form--mode ilike(space-separated — used in the script header line 14 AND in package.jsonbench:ilike) is silently ignored, so the run falls through to the default FTS mode. Result:npm run bench:ilikewrites FTS numbers intobench/results/ilike-results.md, corrupting the ILIKE benchmark record.Found by post-deploy probe of issue #11 (ND-007). Kanban card:
t_edd9a649.Reproduction
Mark/nodedeskatmain:Reproduced: the
--mode ilike(space form) run wrotebench/results/fts-results.md— i.e. it executed the FTS path. Switching to the env-var toggle (SEARCH_MODE=ilike) produced genuine ILIKE results.Actual behavior
npm run bench:ilikesilently runs the FTS benchmark and overwrites/createsbench/results/ilike-results.mdwith FTS numbers, corrupting the benchmark record and any comparison docs derived from it.Expected behavior
npm run bench:ilike(and--mode ilike) runs the ILIKE benchmark and writes genuine ILIKE numbers. An unsupported/ambiguous mode argument should error out loudly rather than silently falling back to FTS.Root cause
Arg parser in
bench/search/benchmark.tsonly matches--mode=ilike,--ilike, or envSEARCH_MODE=ilike; the space-separated--mode ilikeform (used by package.jsonbench:ilikeand the script header docs) is not recognized and the code defaults to FTS mode instead of failing.Fixed by commit
d1b9a07(pushed to main 2026-08-10). The arg parser now accepts the space form--mode ilike(used by package.jsonbench:ilikeand the script header), plus the existing--mode=ilike/--ilike/--ftsand SEARCH_MODE env. Unsupported modes (--mode bogus) and missing values (bare--mode) now exit code 2 with a loud error instead of silently falling back to FTS. Verified:--mode boguserrors,--mode ilikepasses the parser. Also landedb2b68ab— a pure Prettier reformat of benchmark.ts so the pre-commit format gate stops failing on that file. Typecheck/lint/132 unit tests green on final tree.