|
| 1 | +# CuraFrame Weighted Multi-Constraint Scoring Engine (v3.0.0) |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +The Weighted Multi-Constraint Scoring Engine is a subsystem added in v3.0.0 that sits above the existing constraint bundles. It takes the output (signals, falsifications, and narrative summaries) from all bundles and distills them into a unified, modular, and configurable **Composite Stability Score**. |
| 6 | + |
| 7 | +This system does not alter or modify the underlying deterministic bundle evaluation logic. Instead, it aggregates results and applies domain-specific weighting, penalties, and bonuses to produce a nuanced report of therapeutic candidate viability. |
| 8 | + |
| 9 | +## Architecture |
| 10 | + |
| 11 | +1. **WeightProfile (`scoring/WeightProfile.hpp`)**: An interface (with default implementations) that defines the weights, penalties, multipliers, and scaling factors for different domains and specific signals. |
| 12 | +2. **WeightedScoringEngine (`scoring/WeightedScoringEngine.hpp/.cpp`)**: The core engine that ingests the outputs from all bundles (`EvaluationReport`), applies the provided `WeightProfile`, computes the final score, and generates a structured summary. |
| 13 | +3. **ScoringPipeline (`scoring/ScoringPipeline.hpp/.cpp`)**: A wrapper pipeline managing the execution of the scoring engine with a specified weight profile. |
| 14 | +4. **ScoringReport (`scoring/ScoringReport.hpp`)**: The structured output structure, detailing penalty breakdowns, bonus breakdowns, falsification impacts, and a narrative summary. |
| 15 | + |
| 16 | +## Composite Stability Score |
| 17 | + |
| 18 | +The Composite Stability Score is a numerical representation of candidate stability scaled between 0 and 100: |
| 19 | +- **100**: Perfect theoretical safety baseline, zero constraint violations or penalized signals. |
| 20 | +- **< 100**: Progressive deterioration of the score based on domain-weighted penalties, amplified by specific severity levels, or falsification flags. |
| 21 | +- **Falsification impact**: Candidate falsification triggers massive penalty deductions (configurable per weight profile), severely lowering the final score. |
| 22 | + |
| 23 | +Higher scores indicate more stable candidates, and lower scores indicate more risk-burdened candidates. |
| 24 | + |
| 25 | +## Example Report Execution |
| 26 | + |
| 27 | +```cpp |
| 28 | +MultiBundleEvaluator evaluator; |
| 29 | +EvaluationReport eval_report = evaluator.evaluate(candidate); |
| 30 | + |
| 31 | +// Generate standard composite scoring |
| 32 | +ScoringReport score = evaluator.score(eval_report); |
| 33 | + |
| 34 | +// Generate with an aggressive safety profile |
| 35 | +ScoringReport safety_score = evaluator.score_with_profile(eval_report, std::make_shared<HighSafetyProfile>()); |
| 36 | +``` |
0 commit comments