feat: configurable health scoring weights via mcpwc.config.json#231
Merged
feat: configurable health scoring weights via mcpwc.config.json#231
Conversation
Add optional scoring.weights config section to helixir.mcp.json that lets enterprise teams apply per-dimension weight multipliers to health scores. Accessibility-first teams can weight that dimension 3× while rapid-prototyping teams can downweight it 0.5×. - Add ScoringWeights and ScoringConfig interfaces to McpWcConfig - Parse and validate scoring.weights in loadConfig() (positive numbers only; warn and discard invalid values) - Export DIMENSION_WEIGHT_KEYS mapping from dimensions.ts - Apply multipliers via getEffectiveWeight() in scoreComponentMultiDimensional() - Default multiplier is 1.0 (fully backward-compatible) - Document all 14 dimension keys in README with examples Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR adds configurable per-dimension health scoring weights by introducing a new optional Changes
Sequence DiagramsequenceDiagram
participant App as Application
participant Loader as Config Loader
participant Parser as Scoring Parser
participant Scorer as Health Scorer
participant Registry as Dimension Registry
App->>Loader: loadConfig()
Loader->>Parser: parseScoringConfig(raw.scoring)
Parser->>Parser: validateScoringWeights()
Note over Parser: Filter non-positive values,<br/>warn on invalid entries
Parser-->>Loader: ScoringConfig object
Loader-->>App: McpWcConfig with scoring
App->>Scorer: scoreComponentMultiDimensional(component, config)
Scorer->>Registry: DIMENSION_REGISTRY entries
loop For each dimension
Scorer->>Scorer: getEffectiveWeight(baseWeight,<br/>dimensionName,<br/>config.scoring.weights)
Scorer->>Scorer: effectiveWeight = baseWeight × multiplier
end
Scorer-->>App: Scored dimensions with applied weights
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Allow Enterprises to Customize Health Scoring Weights
Currently health scoring uses hardcoded weights for each dimension (documentation, accessibility, naming, API consistency, etc.). Enterprise teams have different priorities — a design system team may weight accessibility at 3x while a rapid prototyping team may weight it at 0.5x.
Implementation
scoringsection tomcpwc.config.jsonschema:{ "scoring": { "weights": { "documentatio...Created automatically by Automaker
Summary by CodeRabbit
New Features
Documentation