Repository navigation
Description
What happened
ai/review/pipeline.py has 15 except Exception handlers at b170358, and 19 sites that the swallowed-failures ratchet counts (BLE001, S110, S112). Eight of the handlers hide a failure that changes what the review checks, and the review does not say so:
| Line | Function | What the user does not see |
|---|---|---|
| 274 | _try_reuse_cached_analysis_meta |
a cache entry that failed to validate (logged at debug level) |
| 404 | _collect_scanner_commit_files |
list_repo_files failed, so the secret scan gets fewer files (pass) |
| 558 | _file_content |
a file that failed to read is read as absent |
| 887 | _analyze_path |
the pre-analysis of a file failed, so the file has no metadata |
| 922 | _collect_paths_to_analyze |
a path that failed to prepare is dropped (debug log) |
| 2082 | __init__ |
find_repo_root failed, so the path classes load without the repository's configuration (pass) |
| 2563 | _fetch_threat_intel |
the network references of a file were not extracted (debug log) |
| 2640 | _read_content |
a second copy of _file_content, with the same behaviour |
A test that only covers these handlers would lock the swallow in. The fix is to handle or report each cause (AGENTS.md rule 11).
What should happen
Each of the eight handlers catches only the errors that its call raises. A failure that changes the scope of the review reaches the report as a coverage gap with its reason, as errored_files already does at line 2780 for a payload that fails. A failure that changes nothing the user relies on, such as a cache miss, is not caught as Exception. The two copies of the file read become one.
Evidence
At b170358:
src/devops_cli/ai/review/pipeline.py: the lines in the table.uv run ruff check --select BLE001,S110,S112 src/devops_cli/ai/review/pipeline.py: 19 sites.tests/fixtures/swallowed_failures_ceilings.jsonholds 19 for the file.:2780-2784records the error of a file inerrored_filesand warns. That handler reports its cause, so it stays.
Out of scope, because open issues own them:
:1809and:1862(a failed base-file read) and:2437(the static-scanner stage): fix(review): a failed base-file read counts as an absent file, and an empty pull request diff raises is no diff #1907.:852and:863(a failed threat-intel lookup reads as a clean record): fix(security): cloudflare radar lookups use the documented radar api with the configured token, and a failed lookup is reported as unavailable, never as verified #1429.:200(_resolve_ollama_urlsand its default URL): fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165.
Acceptance criteria
- Tests first: a review where
list_repo_filesfails, where a file read fails, where the pre-analysis of a file fails, and wherefind_repo_rootfails. Each test checks that the report or the session names the gap and its reason. The tests fail on today's code. - None of the eight handlers catches
Exception._file_contentand_read_contentare one function. - The swallowed-failures ceiling of
ai/review/pipeline.pygoes down by the sites this change removes (uv run python -m tests.test_swallowed_failures_ratchet --lower). - The tests run over the model, tool-executor and process fakes, and patch no
devops_cliname (docs/TESTING.md). -
uv run devops cipasses.
Related: #1328 (the ai/review tests move onto fakes), #1907, #1429, #1165.
Source: #1907
regression of #423
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate fixes a bug in the review pipeline's exception handling.The fix addresses hidden failures that change the scope of reviews.The change improves correctness and transparency of the review process.Requires modifying multiple exception handlers and adding tests.fix(review): the review pipeline reports the eight failures it now sw…
chore(main): release 0.4.3 (#2198)