fix(scanner): isolate optional-stage failures and disambiguate skip causes#88
Open
gadievron wants to merge 1 commit into
Open
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).