Skip to content

Collapse the nested evidence conditionals ruff flags (SIM102) - #12

Open
docxology wants to merge 1 commit into
mainfrom
refactor/sim102-claim-support
Open

docxology wants to merge 1 commit into
mainfrom
refactor/sim102-claim-support

Conversation

@docxology

Copy link
Copy Markdown
Collaborator

Prediction

At head bd99405, the check-set should read exactly two rows, both pass:

  • gates — pass (ruff check, ruff format, mypy, artifact build + provenance gates, pytest --cov=src --cov-fail-under=90)
  • gnn conformance (pinned) — pass (pinned-parser extract + conformance tests)

No other workflow-owned rows are expected; this repository has a single workflow (gates.yml). If GitHub Actions is still billing-locked, both rows will fail in 1-2 s with steps: 0 and the annotation "The job was not started because your account is locked due to a billing issue" — instrument outage, not a verdict on this change.

Change

ruff check is red on main: SIM102 (collapsible nested if) fires twice in _audit_evidence in src/manuscript/claim_support.py — once for the delivery claim type, once for the visual claim type. This collapses the two nested conditionals into their elif guards:

elif row.claim_type == "delivery" and not row.validators:
elif row.claim_type == "visual" and not row.figures:

Each branch appends the same issue message the nested form appended, and no else exists on either inner if, so the fix is behavior-preserving.

Local verification (the repo's own gates, run before opening)

  • uvx ruff check src scripts tests — 0 diagnostics (was 1 on main)
  • uvx ruff format --check src scripts tests — 280 files already formatted
  • uv run mypy src — Success: no issues found in 142 source files
  • uv run pytest --cov=src --cov-fail-under=90 -q — 982 passed, coverage 90.99% (floor 90%)
  • GNN_ROOT=... uv run python scripts/validate_gnn_spec.py — exit 0, receipt checks 6/6 at the pinned commit 8f293d9b
  • tests/test_claim_support.py — 39/39 passed, including test_delivery_row_needs_validators and test_visual_row_missing_figure, which assert the message text and audit outcome of both touched branches

The regenerated output/ artifacts (PNG byte noise from matplotlib version drift) are left uncommitted.

The gate battery is green at this commit: ruff check/format, mypy src,
pytest 982 passed at 90.99% coverage, and the pinned GNN conformance gate
with GNN_ROOT set. The claim_support audit output is byte-identical
(behavior-preserving).
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