Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
Command-surface inconsistencies found by a QA sweep of every command across 12 example projects, 11 operand spellings, and the error-handling matrix on semaprax 0.3.0 (main 5c6e7a4b). Each item is small and independent; together they make the CLI unpredictable for scripts and agents. Data-loss items, the path-component rejection, the patch argument laxity and context on while are filed separately.
Exit codes and diagnostics
test <nonexistent>exits 2 (usage) withtest requires a Project v1 semaprax.toml manifest, whilecheck/run/lockon the same operand exit 1 withSPX-I001/SPX-J102. A missing path is not a grammar error.src/cli/execution.rs~96-104.check --jsonprints nothing on success (human form printsverified …). Automation cannot distinguish success from silence; emit{"status":"verified","revision":…}or the same line as the human form. Same for projectcheck --json.lockandresolveusage errors print thehint:line twice: theusage()helpers insrc/cli/project_lock.rs~241 andsrc/cli/resolve.rs~345 embed a hint andhelp::finishappends the generic one.fmtrejects flag-first order:fmt --check semaprax.toml→unknown fmt option --check, whilecheck --json semaprax.tomlis accepted; barefmt --checkreports the missing operand as an unknown option.src/cli/fmt.rs~30-40.--max-stepsbounds are three different error classes:0→ exit 2 usage,100000001→SPX-F101exit 1,-1→ "requires a value". Pick one.native-callable -o <bare-name>fails withSPX-I107: cannot canonicalize native-callable output parent : No such file or directory(empty parent), while-o ./bareworks:Path::new("bare").parent()isSome(""), so theunwrap_or_else(|| Path::new("."))fallback never fires.src/codegen/native_callable_bundle.rs~288.- Missing-
maindiagnostic always says "entry module" (even for the test module), carries"path":null, andSPX-G172is reused for cycles, unknown identities, duplicate@id, missing module, missingmain, permit mismatches and profile exclusions. Split the code or at least make each message name its cause; the permit-list mismatch currently reads "module is outside the pure scalar linker profile". - Project test counts are inconsistent: failure says
1 of 4 in <module>(countsmain), success sayspassed (3 named cases). fmt --checknames no line for a drifting file (… is not canonically formatted), while the manifest checker prints the first differing line; andfmtjoins a five-linematchinto one 230-character line (canonical, but worth a documented rule).- Wording:
patch <file>with a missing patch operand saysmissing file path;help all extra→unknown command help;resolve --target bogusis never validated (reportsSPX-J126about[dependencies]instead);new .→ "final component is not UTF-8" (it is UTF-8; the name simply cannot be derived).
Build command
build --target boguson a project listsrust(then refused as unavailable in the standalone package) and omitsnative-callable, contradictinghelp build; derive the list from the catalog for the capability class.src/cli/build.rs~409-414.--target wasmis byte-identical to--target weband both printbuilt … web package;-o dist/app.wasmtherefore creates a directory namedapp.wasm. Either document the alias or makewasmemit onlyapp.wasm.buildwithout--targetsilently builds web; without-oit writes<name>-web/<name>-out/<name>-npminto the project root, or<stem>.outbeside a single source file. No help or doc mentions the defaults. Document[-o path] (default …)or require-o.--outputis an undocumented alias of-o(src/cli/build.rs~323).- Profile projects report
SPX-W120 cannot create fresh npm package destinationfor--target web; parametrise message and code by target (src/project/npm). build --jsonis rejected (exit 2) althoughcheck --jsonandtest --jsonexist.- Two concurrent project native builds into the same
-oboth exit 0 (last writer wins) while web/npm close the window withSPX-I307/SPX-W120; documented as a non-claim, but the asymmetry is surprising.
Patch, run, context
patchapplies a no-op rename (rename math.add to addwhen it is alreadyadd) with exit 0 on the single-file route, contradictingdocs/SEMANTIC-PATCH-V2.md(SPX-G106covers no-op edits); the workspace route rejects withSPX-G153. Apply the check fromsrc/patch.rs(~1320 / ~2823) on the single-file route.patchrewrites a0444read-only source via stage+rename and keeps the mode;fmton the same file correctly refuses. Probe writability first and report anSPX-I205-class error.run <file> --jsonis rejected ("legacy single-file run accepts exactlysemaprax run <file>") whilecheck <file> --jsonworks.runon a command-profile project runsmain, not the command, and prints nothing about it; print a note naming the command function and the adapters that exercise it.context --max-bytesadmits 1024 but every value below ~1300 failsSPX-G004 … cannot contain the canonical envelope; the admitted range message should start at the smallest value that can succeed, or the envelope should truncate.fmtaccepts symlinked sources, manifests and project directories that every other project command rejects (SPX-J102) and writes through the link. Documented, butfmt .rewrites whatcheck .refuses to read.
Verification
Each item has a one-command reproducer above. Add regression cases in the harness that owns each command (tests/cli_help_surface_v1.rs tree for grammar, tests/project.rs tree for project commands) and update docs/CLI-GUIDE.md, docs/CLI-HELP-V4.md (if the grammar text changes) and CHANGELOG.md.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
fix(cli): align check and usage surfaces
fix(cli): normalize test failure contracts
Align remaining CLI diagnostics
fix(cli): align build and command runtime surface
fix: align patch context and fmt CLI contracts
Clarify project linker diagnostics
fix(cli): reject extra help operands