Skip to content

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

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

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>
ar7casper added a commit that referenced this pull request Jun 22, 2026
These PRs predated #69's llm-provider refactor and were never rebased, so their tests referenced removed APIs (AnthropicClient, ContextEnhancer(client=)) and #69's new registry credential probe. Updated test construction/mocking to the post-#69 API only; no assertions changed, no production code touched. Full suite: 729 passed, 0 failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gadievron

Copy link
Copy Markdown
Collaborator Author

Closing as already resolved on current master. This fix's behavior shipped via the parser-fix-stack release (#133/#134); confirmed by independent reproduction — the original bug (reconstructed from its bug-pipeline investigation) no longer manifests on master, not merely by line-presence. Part of a full validated sweep of the open-PR corpus.

@gadievron gadievron closed this Jul 10, 2026
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