Problem
Two argument-handling defects from the 2026-06-10 re-audit:
runCliTool takes args[cmd_args_start] blindly as the positional, so codedb callers --max-results 3 indexFile reports "1 call sites for '--max-results'" — a silently wrong answer instead of a usage error. Affects every bridge command that takes a leading /.
codedb_symbol with name: "" returns no results for: (trailing colon, blank name) instead of a usage error — codedb_callers already rejects empty names; symbol should mirror it.
Failing Test
test "issue-573: cli bridge must not bind a leading flag as the positional name" in src/test_mcp.zig (branch fix/issue-573-arg-ux): callers with argv [--max-results, 3, indexFile] must not report call sites for '--max-results' and must fall through to the callers <name> usage line; codedb_symbol name:"" must emit error: empty name. Verified failing on release/0.2.5825: 107/108.
Fix
runCliTool: a leading --prefixed arg is not bound as the positional — pos stays null and the command's existing usage error fires
handleSymbol: explicit empty-name guard mirroring callers
Also folded in: handleCallers count/print double-loop collapsed to a single filter pass (same predicates were duplicated; a future edit to one loop would silently desync the header count — flagged as a maintenance trap in the same audit). Behavior unchanged, guarded by issue-391/425/426/562 tests.
Problem
Two argument-handling defects from the 2026-06-10 re-audit:
runCliTooltakesargs[cmd_args_start]blindly as the positional, socodedb callers --max-results 3 indexFilereports "1 call sites for '--max-results'" — a silently wrong answer instead of a usage error. Affects every bridge command that takes a leading /.codedb_symbolwithname: ""returnsno results for:(trailing colon, blank name) instead of a usage error —codedb_callersalready rejects empty names; symbol should mirror it.Failing Test
test "issue-573: cli bridge must not bind a leading flag as the positional name"insrc/test_mcp.zig(branchfix/issue-573-arg-ux): callers with argv[--max-results, 3, indexFile]must not report call sites for '--max-results' and must fall through to thecallers <name>usage line;codedb_symbol name:""must emiterror: empty name. Verified failing on release/0.2.5825: 107/108.Fix
runCliTool: a leading--prefixed arg is not bound as the positional — pos stays null and the command's existing usage error fireshandleSymbol: explicit empty-name guard mirroring callersAlso folded in:
handleCallerscount/print double-loop collapsed to a single filter pass (same predicates were duplicated; a future edit to one loop would silently desync the header count — flagged as a maintenance trap in the same audit). Behavior unchanged, guarded by issue-391/425/426/562 tests.