Skip to content

fix(risk): say when line coverage is stored without a per-test map, and flag stale measured tests - #4339

Merged
swati510 merged 1 commit into
mainfrom
fix/get-risk-coverage-honesty
Oct 21, 2026
Merged

swati510 merged 1 commit into
mainfrom
fix/get-risk-coverage-honesty

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

On a repository with stored line coverage but no per-test map, get_risk said coverage was unavailable and test gaps were withheld.

  • Aggregate coverage is reported. get_risk says no per-test map exists and that aggregate line coverage is available (coverage.reason: no_per_test_map_aggregate_available). It gives coverage.aggregate with the file count, measured commit and freshness.
  • Match granularity is labelled. Measured test recommendations say they match the changed file rather than its lines (evidence[].match: "file"), since get_risk only receives paths.
  • Stale tests are flagged. A measured-only row whose test file git shows deleted or edited since the coverage was measured carries stale: true and a stale_reason. A row the graph also backs is never marked stale.
  • Shapes. The REST blast-radius schema and the TS types carry the same fields. MCP default responses do not grow: false and empty values are dropped.

Stacked on #4334.

On this repository: coverage.aggregate = {file_count: 2223, ingested_commit: 7c3fbfe…, freshness: stale} with the new reason, where before it said "coverage unavailable".

Verification

  • Unit tests for the fold, a real-git test for the stale flags, a DB test for the aggregate read, and wording tests for the directive summary.
  • tests/unit/{analysis,persistence,server}: 11,542 passed.
  • Generated HTTP types in sync; tsc --noEmit clean in types, ui and web; ruff check clean.

@repowise-bot

repowise-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🔍 1 thing to check

  1. This PR introduces 5 new findings across 2 files: 3× complex method, 1× complex conditional, 1× error handling (see all)

➖ Health of changed files: 8.30 → 8.29 (-0.01; structure -0.02)
Average full file score (structure and history) of 9 changed code files, weighted by size before this PR; not the repository score.

Check Result
Coverage Waiting for this PR's CI to upload a report (last report from this repo 1 hour ago)
Tests 2 of 4 changed code files reached by a test · 2 reached by no test · which tests
Security No new findings on changed lines
Doc drift No drift in docs this PR edits
🧾 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 4 changed files reached by a test; 4 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: 5 introduced, 0 worsened, 0 resolved
AI provenance unknown · not known Provenance: unknown, known for 0 of 1 commit; AI share withheld: coverage 0% is below 30%
Diff size rank ok · measured Larger than 67.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 08:57 UTC
Silence one PR with [skip repowise] in the title · Bot settings
⭐ Star Repowise · 📥 Install on another repo

@RaghavChamadiya
RaghavChamadiya force-pushed the fix/tests-tab-one-reach branch from 45baed2 to df51363 Compare October 20, 2026 22:52
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/get-risk-coverage-honesty branch from d482c5d to 629c672 Compare October 20, 2026 22:52
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/tests-tab-one-reach branch from df51363 to 6b716d6 Compare October 21, 2026 04:36
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/get-risk-coverage-honesty branch 2 times, most recently from 2211f50 to 7dcedf5 Compare October 21, 2026 04:49
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/tests-tab-one-reach branch from 6b716d6 to 038ffa9 Compare October 21, 2026 04:49
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/get-risk-coverage-honesty branch from 7dcedf5 to f2f79c6 Compare October 21, 2026 05:37
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/tests-tab-one-reach branch 2 times, most recently from d4147fc to 7db4673 Compare October 21, 2026 05:40
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/get-risk-coverage-honesty branch from f2f79c6 to 241bbea Compare October 21, 2026 05:40
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/tests-tab-one-reach branch from 7db4673 to d2ef818 Compare October 21, 2026 07:26
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/get-risk-coverage-honesty branch from 241bbea to 95d5636 Compare October 21, 2026 07:26
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/tests-tab-one-reach branch from d2ef818 to aef9870 Compare October 21, 2026 07:33
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/get-risk-coverage-honesty branch from 95d5636 to 56163eb Compare October 21, 2026 07:33
Base automatically changed from fix/tests-tab-one-reach to main October 21, 2026 08:50
…nd flag stale measured tests

get_risk read "coverage unavailable" and "test gaps withheld" on a repository
with stored line coverage, because only the per-test map counted. The test
impact now names that case (no_per_test_map_aggregate_available, with the
stored file count and freshness). Measured recommendations say they match a
changed file rather than its lines, and a measured-only row whose test file
git shows deleted or edited since the measured commit carries stale and
stale_reason.
@RaghavChamadiya
RaghavChamadiya force-pushed the fix/get-risk-coverage-honesty branch from 56163eb to 26d1fd2 Compare October 21, 2026 08:56
@swati510
swati510 merged commit 9179fc6 into main Oct 21, 2026
10 checks passed
@swati510
swati510 deleted the fix/get-risk-coverage-honesty branch October 21, 2026 08:57
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.

2 participants