Skip to content

fix(actions): name a fragile file's lead to simplify only when it is worth breaking up - #4361

Open
RaghavChamadiya wants to merge 2 commits into
mainfrom
fix/fragile-row-lead
Open

RaghavChamadiya wants to merge 2 commits into
mainfrom
fix/fragile-row-lead

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

What

A Do next fragile-file row could read "Simplify X: it is tested, and fixes keep landing" while its lead finding was a coverage marker (coverage_gradient, "7% of lines uncovered") or a weak target such as a constructor at CCN 9 or 10. The title, its claim and its evidence disagreed.

How

  • The actions loader reads each lead finding's details_json and line_end, so the shared break-up rule that already ranks the file's lead (health.models, the rule Fix first uses for "Break up") can measure the function. Without them it could never apply.
  • lead_and_worth returns that lead and whether its function is worth breaking up first; primary_finding wraps it, so every surface keeps the same lead.
  • A fragile row says "Simplify fn" only when the lead is worth breaking up. Otherwise it says "Review why fixes keep landing in X: it is tested" (or "tests reach it") and shows no finding. Raise-coverage and add-tests rows are unchanged. The folder row's first step follows.
  • Docs: docs/layers/CODE_HEALTH.md Do next.

Verification

Bar, set before measuring: list every fragile row before and after on a copy of this repository's index and on one held-out corpus (umami, freshly indexed). Every changed row, before and after text, is judged blind with opaque ids, shuffled, as true or false on whether its title, claims and lead agree with its facts. To pass, no after row may be judged false, and no file whose before row was judged true may lose its row.

rows before rows after changed before judged false after judged false true rows lost
this repository 65 65 55 29 0 0
umami 4 4 1 0 0 0

The before rows judged false were all Simplify rows. Their leads were coverage or error-handling markers, constructors at CCN 9 to 10, 4-level nesting, or a single long condition. Other corpora on hand had too little recent history to produce fragile rows.

Tests: tests/unit/analysis/test_actions_rules.py, tests/unit/persistence/test_actions_loader.py and the related health, snapshot and parity suites pass. Ruff is clean on the touched files.

@repowise-bot

repowise-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🔍 2 things to check

  1. This PR introduces 2 new findings across 1 file: 2× complex method (see all)
  2. 2 files that usually change with this PR's files are not in it: packages/core/src/repowise/core/persistence/models.py changed in 16 of the 26 commits that touched packages/core/src/repowise/core/analysis/health/models.py; packages/core/src/repowise/core/analysis/health/engine.py changed in 15 of the 26 commits that touched packages/core/src/repowise/core/analysis/health/models.py

✅ Health of changed files: 6.7 (unchanged)
Average full file score (structure and history) of 7 changed code files, weighted by size before this PR; not the repository score.

Check Result
Coverage 100% of 32 changed lines covered
Tests 5 of 5 changed code files reached by a test · which tests
Security No new findings on changed lines
Doc drift No drift in docs this PR edits
Coverage

Patch coverage 100.0% (32 of 32 changed executable lines covered)

943ab03 · cobertura · 5 of 8 changed files measured, 3 out of scope

Report from this run for 943ab03.

🧾 Evidence: 1 to look at, 6 not known
Item Status Evidence
Components touched ok · inferred 3 components: docs, packages, tests
Declared owners ok · declared @RaghavChamadiya, @swati510
Suggested reviewers unknown · not known Not known: not gathered on a pull request
Tests reaching the change unknown · not known 0 of 5 changed files reached by a test; 5 not known
Contracts touched ok · measured No workspace contract touched; no breaking signature change
Consumers in other repos unknown · not known Not known: not gathered on a pull request
Decisions crossed unknown · not known Not known: decision records are read only for an AI review
Health delta look · measured Findings: 2 introduced, 0 worsened, 0 resolved
AI provenance unknown · not known Provenance: unknown, known for 0 of 2 commits; AI share withheld: coverage 0% is below 30%
Diff size rank ok · measured Larger than 32.0% of recent commits
Outcomes since merge unknown · not known Not known: a pull request is not a merged change

AI review is paused: this repository reached its monthly spending limit. Bot settings


📊 See the full report for this PR
Blast radius, every caller of the contracts it changes, and health before and after. No sign-in.
Plain markdown for agents

Settings and updates

Updated 2026-10-21 18:57 UTC, since the last push: 1 new finding, 1 finding gone
Silence one PR with [skip repowise] in the title · Bot settings
⭐ Star Repowise · 📥 Install on another repo

This branch has not been deployed

No deployments
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