Evidence CLI silently ignores unknown Thor options like --path instead of erroring #484

Closed
opened 2026-08-22 22:43:08 +00:00 by jared · 1 comment
Owner

Context

During a code-probe run on ticket #473 in cc-os, an agent passed --path <dir> to the evidence CLI (os-sdlc/lib/os_sdlc/evidence/cli.rb) expecting it to scope the search. The CLI only declares a --root option (cli.rb:10-13); Thor silently accepted --path as an unrecognized switch and ignored it, so options[:root] stayed at its default "." for every call. Every "scoped" evidence-collect call therefore ran ast-grep over the entire repo (resolver.rb:33-35,174-179; probe.rb:46-49,61-66), including noise under graphify-out/cache/ast/. Multi-token calls took 9+ minutes; one hit a timeout with an IOError from a killed subprocess.

Tasks

  • Make Thor raise/error on an unrecognized option instead of silently ignoring it, or add --path as a real alias for --root.
  • Consider excluding graphify-out/ from the default ast-grep search root.

Acceptance criteria

  • Passing an unknown option to evidence collect produces a clear error, not silent fallback to defaults.

Origin

  • Trigger: os-sdlc:code-probe agent run on ticket #473, 2026-08-22.
  • Improvised this session: none -- agent completed via narrower file-scoped calls instead.
  • Chain: 9+ minute hang / timeout ← full-repo ast-grep scan ← --root silently defaulted to "." ← DESIGN (cli.rb:10-13 declares no --path option, Thor doesn't error on unknown options).
  • Root candidate: this ticket.

VERDICT: CREATE — Reproducible validation gap (silent fallback masking a real option typo, causing 9+ minute misscoped scans) with concrete file/line evidence and a stated fix; falls under the validation hard floor.

## Context During a code-probe run on ticket #473 in cc-os, an agent passed `--path <dir>` to the evidence CLI (`os-sdlc/lib/os_sdlc/evidence/cli.rb`) expecting it to scope the search. The CLI only declares a `--root` option (cli.rb:10-13); Thor silently accepted `--path` as an unrecognized switch and ignored it, so `options[:root]` stayed at its default `"."` for every call. Every "scoped" evidence-collect call therefore ran `ast-grep` over the entire repo (resolver.rb:33-35,174-179; probe.rb:46-49,61-66), including noise under `graphify-out/cache/ast/`. Multi-token calls took 9+ minutes; one hit a timeout with an IOError from a killed subprocess. ## Tasks - [ ] Make Thor raise/error on an unrecognized option instead of silently ignoring it, or add `--path` as a real alias for `--root`. - [ ] Consider excluding `graphify-out/` from the default ast-grep search root. ## Acceptance criteria - Passing an unknown option to `evidence collect` produces a clear error, not silent fallback to defaults. ## Origin - Trigger: os-sdlc:code-probe agent run on ticket #473, 2026-08-22. - Improvised this session: none -- agent completed via narrower file-scoped calls instead. - Chain: 9+ minute hang / timeout ← full-repo ast-grep scan ← --root silently defaulted to "." ← DESIGN (cli.rb:10-13 declares no --path option, Thor doesn't error on unknown options). - Root candidate: this ticket. VERDICT: CREATE — Reproducible validation gap (silent fallback masking a real option typo, causing 9+ minute misscoped scans) with concrete file/line evidence and a stated fix; falls under the validation hard floor.
Author
Owner

Resolution

Done: Both tasks resolved. (1) Evidence CLI now rejects unknown Thor options: check_unknown_options! added at lib/os_sdlc/evidence/cli.rb:9 in commit 8fcbd2a, so --path errors hard instead of silently scanning the full repo. (2) graphify-out/ exclusion handled via .gitignore rather than per-invocation --globs: root .gitignore line 13 ignores graphify-out/, and os-vault:onboard-project Step 4 enforces the entry on every onboarded project. ast-grep honors .gitignore by default (it has no ignore field in sgconfig.yml and no built-in dir list), so root-scoped evidence scans skip graphify-out/.

Evidence: Verified 2026-08-23: ast-grep run --lang ruby -p 'def $M' . --json=compact from repo root returns zero result paths under graphify-out/ (11.8MB of cache present); explicit-path invocation still reads it, confirming gitignore-based skipping on root scans. cli.rb:9 contains check_unknown_options!.

Follow-ups: none

## Resolution **Done:** Both tasks resolved. (1) Evidence CLI now rejects unknown Thor options: check_unknown_options! added at lib/os_sdlc/evidence/cli.rb:9 in commit 8fcbd2a, so --path errors hard instead of silently scanning the full repo. (2) graphify-out/ exclusion handled via .gitignore rather than per-invocation --globs: root .gitignore line 13 ignores graphify-out/, and os-vault:onboard-project Step 4 enforces the entry on every onboarded project. ast-grep honors .gitignore by default (it has no ignore field in sgconfig.yml and no built-in dir list), so root-scoped evidence scans skip graphify-out/. **Evidence:** Verified 2026-08-23: ast-grep run --lang ruby -p 'def $M' . --json=compact from repo root returns zero result paths under graphify-out/ (11.8MB of cache present); explicit-path invocation still reads it, confirming gitignore-based skipping on root scans. cli.rb:9 contains check_unknown_options!. **Follow-ups:** none
jared closed this issue 2026-08-23 16:22:34 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#484
No description provided.