Parent
#105
What to build
Extend the Priority 7 distribution shape routing in _strategy_router.py with two new Scope 16 signals. Both apply only to non-BoundedDiscrete columns (BoundedDiscrete routing is handled inside its own Priority 3 gate).
TailAsymmetryTag severity upgrade
Before evaluating the Priority 7 distribution shape condition, compute an effective SkewSeverity:
- When
NumericStats.tail_asymmetry_tag is TailAsymmetryTag.RightHeavy or TailAsymmetryTag.LeftHeavy, upgrade the effective SkewSeverity by one level (e.g. Moderate → High, High → Severe). Severe stays Severe.
- The stored
NumericStats.skewness_severity is not modified — the upgrade is ephemeral, used only within this routing call.
- When
tail_asymmetry_tag is Symmetric or None, effective severity equals stored severity.
NumericFlag.HighOutlierDensity as independent KNN trigger
Add NumericFlag.HighOutlierDensity as an independent escalation condition in the Priority 7 Minor/Moderate distribution shape gate, alongside KurtosisTag.Leptokurtic and SkewSeverity.Severe. A column at Minor or Moderate severity that has HighOutlierDensity set escalates to KNN (subject to size guards → Median fallback), regardless of its kurtosis tag or skewness.
Signal recording
When either signal triggers a routing change, append a diagnostic string to ColumnImputationRecord.signals:
- Tail asymmetry upgrade:
"tail_asymmetry_right_heavy: effective_skew_severity upgraded from {stored} to {effective}" or the left_heavy variant
- Outlier density escalation:
"high_outlier_density: escalated to KNN"
Acceptance criteria
Blocked by
Parent
#105
What to build
Extend the Priority 7 distribution shape routing in
_strategy_router.pywith two new Scope 16 signals. Both apply only to non-BoundedDiscretecolumns (BoundedDiscrete routing is handled inside its own Priority 3 gate).TailAsymmetryTag severity upgrade
Before evaluating the Priority 7 distribution shape condition, compute an effective
SkewSeverity:NumericStats.tail_asymmetry_tagisTailAsymmetryTag.RightHeavyorTailAsymmetryTag.LeftHeavy, upgrade the effectiveSkewSeverityby one level (e.g.Moderate → High,High → Severe).SeverestaysSevere.NumericStats.skewness_severityis not modified — the upgrade is ephemeral, used only within this routing call.tail_asymmetry_tagisSymmetricorNone, effective severity equals stored severity.NumericFlag.HighOutlierDensity as independent KNN trigger
Add
NumericFlag.HighOutlierDensityas an independent escalation condition in the Priority 7 Minor/Moderate distribution shape gate, alongsideKurtosisTag.LeptokurticandSkewSeverity.Severe. A column atMinororModerateseverity that hasHighOutlierDensityset escalates to KNN (subject to size guards → Median fallback), regardless of its kurtosis tag or skewness.Signal recording
When either signal triggers a routing change, append a diagnostic string to
ColumnImputationRecord.signals:"tail_asymmetry_right_heavy: effective_skew_severity upgraded from {stored} to {effective}"or theleft_heavyvariant"high_outlier_density: escalated to KNN"Acceptance criteria
SkewSeverity.ModerateandTailAsymmetryTag.RightHeavyroutes to KNN (same asSevere) —ColumnImputationRecord.strategy == ImputationStrategy.KNNSkewSeverity.NormalandTailAsymmetryTag.RightHeavyroutes to KNN (upgraded from Normal to Moderate triggers distribution shape escalation path for Moderate+tail)NumericStats.skewness_severityis unchanged after routing — stored severity is not mutatedNumericFlag.HighOutlierDensityatMinorMCAR severity escalates to KNN, not Mean or MedianMesokurticcolumn withHighOutlierDensityescalates to KNN (flag fires independently of kurtosis)ColumnImputationRecord.signalsrecords the triggering signal for both mechanismsTailAsymmetryTag.Symmetricand noHighOutlierDensityfollows existing routing unchanged (regression test)Blocked by
TailAsymmetryTag,NumericFlag.HighOutlierDensitymust exist inNumericStats)NumericStats.tail_asymmetry_tagmust be populated by the profiler)NumericStats.outlier_densityandNumericFlag.HighOutlierDensitymust be populated by the profiler)