feat(health): lead with two figures and mark history as something to watch - #2161
Merged
Conversation
…watch The Code Health page led with one number that half comes from git history, so it fell through a week of good refactoring and never said why. It now leads with two: Code health, footed by "Structure 8.4. History pulls it to 7.0.", and Maintainability, which is code shape only and the number a refactor moves. Neither changes value when the map lens changes; the lens highlights one. History findings are watch items, not work. In the drawer they wear a neutral chip with an explainer instead of the pillar's orange, and in both AI prompts they move out of the fix list into the file's behaviour-over-time section with an explicit instruction not to try to fix them. The drawer's leading cause now passes over a history lead for the strongest code-shape finding, and says so when a file's whole deduction is history. Only the three canonical bands are named. The lede and the file drawer had a five-band vocabulary of their own, so a 6.9 read "Good" in green beside marks calling it "Warning" in amber; the map's four colour steps borrowed band words for ranges that did not match, and invented a "Fair" band the product never returns, so they name their score ranges instead. The map lens, the coverage and test table headers and the file page follow the headline to "Code health". A production/all-code toggle in the page header narrows the overview, map, trend, files, findings and work queue. Scope rides in the cache key as well as the query, so a narrowed population cannot render under the previous label. The trend gains a maintainability line and a shaded band for what history costs, both drawn only across the snapshots that recorded them. Server changes are the ones the screens could not be built without: the two halves on the overview summary, a maintainability column on health_snapshots with the three figures exposed per trend point, and scope on the findings route. The trend route's response model dropped the new per-point fields after serialization, which reached the browser as nulls with every unit test green, so two route-level tests now cover the model itself. Removes HealthKpiCards, the dashboard barrel and the legacy /health redirect, none of which had a caller in either repository, and moves HealthScoreRing beside its only consumer.
|
🔍 3 things to check
✅ Health of changed files: 4.8 (unchanged) ✅ Health gate: passed 📊 See the full report for this PR |
… test Both are CI failures from the change that renamed the code-health headline. The import block lost its order when a symbol was added to it, and the VS Code webview test still looked for "Defect risk" on a lede that now says "Code health" — and the new label collides with the page title, so the assertion names the figure's own label rather than the first match.
swati510
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Code Health page led with one number, roughly half of which comes from git
history. It fell through a week of good refactoring and never said why.
It now leads with two figures. Code health, footed by "Structure 8.4.
History pulls it to 7.0.", and Maintainability, which is code shape only
and the number a refactor actually moves. Neither changes value when the map
lens changes; the lens highlights one of them.
History findings are watch items, not work. In the file drawer they wear a
neutral chip with an explainer instead of the pillar's orange, and in both AI
prompts they move out of the fix list into the file's behaviour-over-time
section with an explicit instruction not to try to fix them. The drawer's
leading cause now passes over a history lead for the strongest code-shape
finding, and says so plainly when a file's whole deduction is history.
Only the three canonical bands are named anywhere. The lede and the file drawer
carried a five-band vocabulary of their own, so a 6.9 read "Good" in green
beside marks calling it "Warning" in amber. The map's four colour steps had
borrowed band words for ranges that did not match, and invented a "Fair" band
the product never returns; they name their score ranges instead. The map lens,
the coverage and test table headers and the file page follow the headline to
"Code health".
A production / all-code toggle in the page header narrows the overview, map,
trend, files, findings and work queue. Scope rides in the cache key as well as
the query, so a narrowed population cannot render under the previous label.
The trend chart gains a maintainability line and a shaded band for what history
costs, both drawn only across the snapshots that recorded them rather than
backfilled.
Server changes are held to what the screens could not be built without: the two
halves on the overview summary, a maintainability column on
health_snapshotswith the three figures exposed per trend point, and
scopeon the findingsroute.
Removes
HealthKpiCards, thedashboardbarrel and the legacy/healthredirect, none of which had a caller, and moves
HealthScoreRingbeside itsonly consumer.
Verification
packages/ui1,660 passed / 192 files;packages/web84 passed / 16 files.npm run type-checkgreen across every workspace.response_model, which dropped the new per-pointfields after serialization — they reached the browser as
nullwith everyunit test green. Two route-level tests now cover the model itself.
lens, the production scope, the drawer, the prompt modal and the trend.
they hold at 7.0 / 8.0 and only the label colour changes.