Commit Graph

2 Commits

Author SHA1 Message Date
Tom Boucher
d77170a25d perf(#312): index argv once in parseNamedArgs (#392)
parseNamedArgs re-scanned argv with indexOf/includes once per flag —
O(flags * argv) — on the command-dispatch hot path (24 call sites across
gsd-tools + init/state/validate routers). Build a first-index Map of argv
tokens in a single pass and use it for the flag lookups, dropping it to
O(argv + flags). Semantics are identical: firstIndex.get(t)??-1 === indexOf(t),
firstIndex.has(t) === includes(t); first-occurrence-wins and the value-token
rejection are preserved. Adds the first behavior-lock tests for the module.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 20:21:36 -04:00
Tom Boucher
43eafea3d5 fix(#303): deepen command routing seams and alias parity guard (#304) 2026-05-26 11:23:53 -04:00