fix(cli): reject excess positionals - #1433
Conversation
|
Reviewed exact head The exhaustive test only proves declared schemas are enforced; it does not prove each schema admits the existing command grammar, so it misses this regression. Other reviewed routes and all exact-head checks are clean; keep |
|
Re-reviewed exact head The follow-up fixes the prior Trace confirms normal CLI parsing reaches the guard before daemon execution; legacy batch applies it before projection. This aligns with #1406/#1412 and ADR 0008’s command-family CLI-schema ownership. Exact-head focused suites passed 57/57. GitHub reports the PR clean/mergeable with 18 checks passing; Bundle Size is intentionally skipped. No labels changed. |
Summary
Bounded CLI commands now fail closed when a plan supplies extra positionals. For example,
open app url closepreviously swallowedclose; it now returnsINVALID_ARGSbefore command execution.CommandSchemaand enforce it in normal parsing, deprecated legacy batch steps, and help-conformance validationconnectprovider andswipeduration inputs accuratelyThis production-contract slice changes 8 files and stays within the CLI schema/parser, legacy batch, and deterministic validator family. It does not modify guidance or SkillGym while the active harness split moves command-planning coverage out of the oversized suite; that coverage remains follow-up work.
Validation
The focused parser, interaction, session, batch, and help-conformance suites pass (133 tests). Formatting, typechecking, linting, layering, Fallow, build, and generated MCP metadata checks are green locally.
The native-Windows full unit sweep reached 4,249 passing and 8 skipped tests, with 257 existing environment-sensitive failures involving platform paths, unavailable host tools, symlinks, and fixture checksums. All changed-path suites pass in isolation; CI remains the cross-platform authority. This is parser-only behavior, so no device session was opened.
Related: #1406, #1411