Repository navigation
feat(health): one band vocabulary, and counts for the CLI and MCP - #2180
Merged
Merged
Conversation
A score meant six different things depending on where you read it. The canonical three bands said a 6.9 was Warning; the workspace repo list called the same number Good on a five-step ladder of its own; the file-table pills ran a four-step ramp that agreed with neither; two 0-100 surfaces had a third and fourth set of cutoffs; and two scatter charts and five colour tables carried inline copies that had drifted apart. The same file could read amber on a treemap tile and green in the tooltip attached to it. There is now one scale, defined once per language and locked by a parity test: Excellent 8.5+, Good 7.0-8.5, Fair 5.5-7.0, Needs work 4.0-5.5, At risk below 4.0. Absolute rather than percentile, so a score means the same thing behind a firewall as against a public corpus. Excellent and Good share one green and are told apart by the word. 4.0 keeps its long-standing meaning, so no repo's most severe classification changes. No score moves. Only the word attached to it. The canvas surfaces cannot separate five bands by word, so the node ramp gains a fifth token and the zoom palette a fourth; without that a 6.0 file read gold in the detail panel and amber on the card behind it. HEALTHY_MIN was doing two jobs. It named a band, and it was the score a refactoring's leverage is measured against. It keeps the second job as TARGET_SCORE at the same value, deliberately not a band edge, asserted as such. Separately, `counts` now reaches `repowise health` and `get_health`, matching what `scope` already had. An agent asking whether a repository's code is getting better could only get the churn-contaminated number. A target the projection cannot read is reported as `not_measured` rather than `not_indexed`, which would have sent the caller to run an update that changes nothing.
…er surface Review of the band vocabulary change found the same defect in three places: a figure that had been projected, next to nothing saying so. `only=["kpis"], counts="code_shape"` returned the projected score with the reading stripped by the projection — the exact failure the echo was added to prevent. It survives now, but only once it is not the default, so an ordinary `only` call does not grow three empty keys. Trends and the two ranked queues are built from the calibrated score and cannot be projected at all; a code-shape response names them rather than letting a reader assume the headline projected everything beside it. A lookup by id answers about one stored row, so the five detail paths report the controls as inapplicable instead of silently returning a calibrated row under a flag that asked for the other reading. A misspelled control is named rather than quietly defaulted, and an explicit null is not a misspelling. The canvas surfaces had the same split brain the bands were meant to end. The SVG export painted Fair amber while the canvas it was exporting painted it gold; the coupling legend still read healthy/warning/alert in three rows over dots drawn on five bands, so a needs-work node had no entry at all; and the treemap gave Excellent and Good one green on tiles that carry no word. All three now share the one five-value ramp. A server predating the five bands made the distribution bar report 128 files with none in any band. That is a confident false statement, so it falls through to the unknown state. The CLI reported `unscored_files: 0` always, because it scores live and the split is never missing; a constant reading as "every file measured" is worse than no field. The share test passed under three different implementations, so it gets the row that discriminates. The exporter's new branch, the legacy-band guard, the CLI's distribution line and trend warning, badge hex coverage, and the range and colour tables all get the coverage they were shipped without. MCP_TOOLS.md told agents get_health reports under `unknown_only_keys` in a list shape while it emits a flat map under `ignored_arguments`, documented neither control, and `repo` had lost its docstring entry while the parameter remained.
swati510
approved these changes
Sep 10, 2026
This was referenced Sep 11, 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.
Summary
countsreachesrepowise healthandget_health, matching whatscopealready had. An agent asking whether a repository's code is getting better could previously only get the churn-contaminated number.Why
A score meant different things depending on where you read it. The canonical three bands called a 6.9 Warning; the workspace repo list called the same number Good on a five-step ladder of its own; the file-table pills ran a four-step ramp agreeing with neither; two 0-100 surfaces had a third and fourth set of cutoffs; and two scatter charts plus five colour tables carried inline copies that had drifted. The same file could read amber on a treemap tile and green in the tooltip attached to it.
Bands are absolute rather than percentile, so a score means the same thing behind a firewall as against a public corpus. Green starts at 7.0 because a 7 is not a warning. 4.0 keeps its long-standing meaning, so no repo's most severe classification changes.
HEALTHY_MINwas doing two jobs — naming a band, and being the score a refactoring's leverage is measured against. It keeps the second asTARGET_SCOREat the same value, deliberately not a band edge, asserted as such.Notable fixes found in review
only=["kpis"], counts="code_shape"returned the projected score with the reading stripped by the projection. It survives now, but only once it is not the default.counts_not_applied_to.finding_id/plan_id/opportunity_id) bypassed the controls entirely and answered about a calibrated row under a flag asking for the other reading.scope/countsfell back silently over MCP; now named inignored_arguments.Test Plan
packages/ui1678,packages/web84,packages/types142,packages/api-client63, vscode webview 45; Python server / CLI / health / generation scope green, with only the failures that are already red onmainruff check,npm run lint)npm run type-check)npm run build)Verified that no score changes for any repo — the band cutoffs are referenced only inside
band_for/bandForScore, andTARGET_SCOREis pinned at 8.0 with a test asserting it is not a band edge.Checklist