fix(heldout): declare sequential-drift horizon and record censored delays - #1095
Conversation
CUSUM delay KPIs must fail closed without replications, horizon, change-point, and coverage, and must keep no-alarm replications as horizon-censored missed detections.
…lays Remove the abort-on-no-alarm and the baked-in 500/250/100 CUSUM screen. Wilson coverage comes from the declared interval and is stored as false_alarm_rate_upper_bound.
ADR 0046 is Proposed. Production route/conduct defaults stay locked.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
|
Integration finding at exact head 74c27e7: _evaluate_sequential_drift_threshold appends horizon-change_after into detection_delays for a no-alarm replication, then reports ordinary detection_delay_p50/p95 from that combined list. A horizon-censored non-detection is not an observed detection at that boundary; retaining censored_replications alone does not make those percentile labels accurate. Also _validate_sequential_drift still calls min(eligible_candidates) without an empty-candidate path, and all pre-change alarms cause a ValueError that loses the otherwise valid false-alarm summary. Parent #1067 now preserves these outcomes at fb12256 (current parent84a60523): explicit non-detection denominator, detected-only delay population with null empty quantiles, no eligible candidate -> null candidate/false acceptance and retained calibration results. Please preserve that effective delta while retaining this PR’s required horizon/coverage declarations during normal stack integration. No close, force push, or replacement of this PR’s declaration delta is requested. This is source review evidence, not a new executed test or current-head approval. |
Signed-off-by: Seongho Bae <me@seonghobae.me>
|
Repair df31500 preserves required horizon/coverage declarations and the parent non-detection semantics. RED: one no-alarm regression failed (median10.0 despite zero detections). GREEN: 20 boundary tests passed in17.22s. Separate full-size seeded screen (500/250/100, coverage0.95) retains threshold6.6, false-alarm rate0.024, detected-only p95=20 and zero censored candidate replications. No-alarm and all-premature-alarm outcomes now preserve counts/null quantiles, no eligible candidate returns null/false plus full calibration results. ADR0046, doctoring sequence and gap baseline corrected; Proposed status stays. This replaces the older body claim that censoring boundaries enter the observed delay distribution. No protected merge, release or buyer KPI improvement is claimed. |
Signed-off-by: Seongho Bae <me@seonghobae.me>
Stack
Draft successor of #1093 (
d40a4981). Parents #1092, #1091, #1090, #1074, and psychometric KPI owner #1067 stay open. This PR does not close #1093.Exact head:
318370e84aa4a2a2d280493057a6b19b23484a7e.Static-analysis follow-up: eight inherited findings were reproduced on predecessor
74c27e7e, then corrected without moving the runtime guard after numerical imports. The two changed files pass Ruff and 20 boundary tests pass in 7.84s on this source. Earlier seeded-screen results below apply todf31500a, not a fresh run of this head.Problem
The held-out CUSUM screen hid a 500-replication, 250-observation, change-at-100 horizon, aborted when a replication never alarmed, and stored a 95% Wilson bound as
false_alarm_rate_upper_95. Missed detections could not enter the delay KPI.Change
replications,horizon_observations,change_after_observations, andconfidence_level. Missing, non-positive,change_after >= horizon, or non-exclusive-unit-interval coverage fail closed.horizon - change_afterseparately as the observation limit, never as an observed detection. Quantiles describe post-change detections only and are null when empty. Preserve failure denominators and all calibration results; no eligible candidate returns null and false acceptance.false_alarm_rate_upper_boundusing the declared coverage.Verification
Current repair: 20 boundary tests passed in 17.22s, after reproducing the false horizon-valued median. A separate full-size seeded screen preserves threshold 6.6, false-alarm rate 0.024, and detected-only p95 20. These are local unit/screen results, not buyer outcomes.
Historical tests on predecessor
74c27e7e(not transferred to the current head):tests/test_psychometric_routing.py,tests/test_psychometric_benchmark_boundaries.py,tests/test_planning_adr_identifiers.py)This is declaration-and-censoring-contract evidence, not buyer-held-out accuracy, p95 latency, or protected merge.
Remaining no-heuristics work
Other harness sample sizes remain later slices. No production policy or release is authorized. Parent #1067 still needs independent review.