Skip to content

fix(scanner): isolate optional-stage failures and disambiguate skip causes#88

Open
gadievron wants to merge 1 commit into
masterfrom
fix/scanner-isolate-optional-stage-failures-and-disambiguate-skip
Open

fix(scanner): isolate optional-stage failures and disambiguate skip causes#88
gadievron wants to merge 1 commit into
masterfrom
fix/scanner-isolate-optional-stage-failures-and-disambiguate-skip

Conversation

@gadievron

Copy link
Copy Markdown
Collaborator

Three bugs in core/scanner.py, fixed together as they share the
optional-stage skip/error machinery.

Error-handling: the optional enhance, verify and dynamic-test stages ran
inside step_context but had no inner try/except, unlike app-context and
llm-reachability. step_context re-raises (core/step_report.py:57), so an
optional-stage error escaped scan_repository to cli.py's blanket except and
discarded the completed parse/analyze work. Each optional stage now warns and
continues on failure, matching the existing app-context pattern. Required
stages (parse, analyze, build-output) still propagate their errors.

Skip-cause conflation: skipped_steps recorded one bare string for distinct
causes (verify auto-skip vs opt-out both -> 'verify'; dynamic-test collapsed
several causes -> 'dynamic-test'). Fixed additively: a new
skipped_step_reasons dict on ScanResult (emitted as steps_skipped_reasons in
scan.report.json) records the disambiguated cause per skipped step. The bare
skipped_steps / steps_skipped strings are unchanged so existing telemetry
consumers keep working.

New tests/test_scanner.py (7 tests; LLM/Docker stages monkeypatched so the
orchestration runs offline). Full suite 183 passed, 63 skipped, 0 failed.
ruff clean.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Coordination

Touches a file also modified by in-flight PR #25/#27/#69 (region-disjoint; textual merge only).

…auses

Three bugs in core/scanner.py, fixed together as they share the
optional-stage skip/error machinery.

Error-handling: the optional enhance, verify and dynamic-test stages ran
inside step_context but had no inner try/except, unlike app-context and
llm-reachability. step_context re-raises (core/step_report.py:57), so an
optional-stage error escaped scan_repository to cli.py's blanket except and
discarded the completed parse/analyze work. Each optional stage now warns and
continues on failure, matching the existing app-context pattern. Required
stages (parse, analyze, build-output) still propagate their errors.

Skip-cause conflation: skipped_steps recorded one bare string for distinct
causes (verify auto-skip vs opt-out both -> 'verify'; dynamic-test collapsed
several causes -> 'dynamic-test'). Fixed additively: a new
skipped_step_reasons dict on ScanResult (emitted as steps_skipped_reasons in
scan.report.json) records the disambiguated cause per skipped step. The bare
skipped_steps / steps_skipped strings are unchanged so existing telemetry
consumers keep working.

New tests/test_scanner.py (7 tests; LLM/Docker stages monkeypatched so the
orchestration runs offline). Full suite 183 passed, 63 skipped, 0 failed.
ruff clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant