Skip to content

test(cli): swallowed failures may not grow: blind excepts, except-pass, except-continue and unread check=False are held at their ceilings #1347

Closed

Description

@dan-petty

Problem

Agents that cannot make an item work tend to make the failure quiet instead of reporting it. In v0.2.28, #1288 added except Exception: pass and kubectl ... check=False around Argo CD patches that could not work. Nothing in devops ci notices that kind of code:

  • Not selected in ruff: BLE001 (blind except Exception), S110 (try/except/pass) and S112 (try/except/continue) [code: pyproject.toml, [tool.ruff.lint] select].
  • Counts at the release head 61f9b67:

#423 enables BLE001 and triages every site. That is a large item and is not scheduled. This item stops the growth now, the way test_c901_suppressions_stay_under_the_ceiling does for complexity.

Acceptance criteria

  • A ratchet invariant counts, per file under src/:
    • BLE001, S110 and S112 sites, using ruff's own rules (ruff check --select ... --output-format json), not a hand-written parser;
    • calls passing check=False whose result is never read: no .returncode, .stdout or .stderr use, and the result is not returned. This one uses an AST check.
  • The ceilings are today's counts. A file over its ceiling fails with file:line and the rule. A file under its ceiling fails with the command that lowers it, so every fix also locks the gain in.
  • Tests cover a new blind except, a new except: pass, an unread check=False and a lowered ceiling.
  • changelog.d/<n>.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.

Strategic alignment

Activity

  1. added
    type/test
    scope/cli
    priority/p1-high
    on Oct 7, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. It stops code-quality regression from growing but does not fix a user-facing defect or security issue.
    • Value: Medium. It protects long-term maintainability by preventing silent failure-swallowing patterns from accumulating, but does not directly change user-facing behaviour.
    • Effort: Medium. Requires ruff JSON-output parsing, an AST check for unread check=False calls, per-file ceiling tracking, and tests that exercise the ratchet itself.
  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Linked: #1309 (same ceiling-table mechanism), #423 (lowers this item's BLE001 ceilings) and #849 (the sibling suppression ratchet). Found by the 2026-10-08 backlog review.

  4. added this to the v0.2.33 milestone on Oct 9, 2026
  5. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Admitted to v0.2.33: after v0.2.33 started, only a critical fix can join it. A person can place it in a planned release, and that placement stands. (devops roadmap reprioritize)

  6. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1521, merged into release/v0.2.33 as 5388ec5.

    Closes #1347

    5 file(s) changed.

    How it was verified

    Check runs at e68484a:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • Changed-Test Independence: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1347-swallowed-failures-ratchet.md:

    • A ratchet invariant counts, per file under src/:
      • BLE001, S110 and S112 sites, using ruff's own rules (ruff check --select ... --output-format json), not a hand-written parser;
      • calls passing check=False whose result is never read: no .returncode, .stdout or .stderr use, and the result is not returned. This one uses an AST check.
    • The ceilings are today's counts. A file over its ceiling fails with file:line and the rule. A file under its ceiling fails with the command that lowers it, so every fix also locks the gain in.
    • Tests cover a new blind except, a new except: pass, an unread check=False and a lowered ceiling.
    • changelog.d/<n>.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
    • uv run devops ci passes.
  7. added a commit that references this issue on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/clitype/test

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions