Seam flag inputs not validated: bad --attempt / --reqs / scalar config degrade with a misleading error #45
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence#45
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?
Severity: low · Area: planning-seam / config · surfaced in the post-v1.2.0 cross-model review sweep (bundled: three instances of one root — unvalidated flag/input types produce a misleading error rather than a clean usage error). Related to #42 (the medium
cursor set --totalcase in the same family).Each degrades within contract (nothing is misdirected), but each misreports a usage error as something else, which wastes debugging time.
1.
phase-done --reqsas a bare flag throws "internal"cadence-core/bin/planning.mjs:224-225:const ids = opts.reqs ? opts.reqs.split(',')... : .... Passing--reqsimmediately before another flag parses it as booleantrue;true.splitthrows and is caught as{ok:false, reason:"internal"}— a usage error mislabelled internal.2.
resolve --attempt abcreports "unresolved" instead of a bad argumentcadence-core/bin/route.mjs:157:o.attempt = parseInt(a[++i], 10)yieldsNaNforabc. Inautomode the NaN flows through the escalation math and indexes the profile order withNaN, so the resolver answers{ok:false, reason:"unresolved"}(caller safely falls back to the base model) rather than flagging the bad--attempt.3.
config validatepasses a non-object configcadence-core/bin/config.mjs:100-108:flatten(cfg, '', {})over a scalar yields zero leaves, so a file whose entire content is42validates clean ({ok:true, checked:0}).mergeLayersthen returns42as the whole config while reportingsource:"repo"(see also #39). The "no invalid value is written" gate has a hole for non-object JSON.Fix direction
Validate flag/input types before use: reject a non-numeric
--attemptand a valueless--reqswith ausage/bad-argsresult, and require the validated config to be a top-level object. A small shared seam-flag validator could cover these and #42 together.