From a39e02fb1306eb301f5af755196d91419b556f3f Mon Sep 17 00:00:00 2001 From: Jake Strawn Date: Thu, 26 Mar 2026 20:39:37 -0400 Subject: [PATCH] feat: allow enterprises to customize health scoring weights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- README.md | 67 +++ packages/core/src/config.ts | 86 +++ packages/core/src/handlers/dimensions.ts | 23 + packages/core/src/handlers/health.ts | 37 +- .../configurable-health-scoring.test.ts | 497 ++++++++++++++++++ 5 files changed, 707 insertions(+), 3 deletions(-) create mode 100644 tests/handlers/configurable-health-scoring.test.ts diff --git a/README.md b/README.md index 6feb3c9..4043c0c 100644 --- a/README.md +++ b/README.md @@ -455,6 +455,7 @@ Place this file at the root of your component library project (or wherever `MCP_ | `tokensPath` | `string \| null` | `null` | Path to a design tokens JSON file. Set to `null` to disable token tools. | | `cdnBase` | `string \| null` | `null` | Base URL prepended to component paths when generating CDN `