Build an auditable release packet for a survival model that uses case-history updates and is evaluated on later arrivals with incomplete follow-up.
Project: validate a time-updated resolution model
Write the case contract
Define creation as time zero, recorded resolution as the target event, and cancellation as a separately documented terminal state. Record initial priority, each later priority update with effective and recorded times, and the last trustworthy status observation. Keep one case ID across all intervals. No feature may become visible before both its business event and its system record. The observation-clock rule is the first gate.
Generate the interval ledger
Convert each eligible case into contiguous start-stop rows. Only the final resolution row carries the event. Reconcile unique case counts before and after transformation, list cases with duplicate update times, and inspect a sample at every transition boundary. Record event-time risk-set counts. The interval lesson provides a small construction check; production fitting needs a time-varying survival implementation.
Freeze training and scoring periods
Choose arrival-date cutoffs and a nine-day target before comparing models. Train on earlier cases; hold later arrivals intact as the test cohort. Identify cases whose nine-day horizon has not elapsed by the extraction date, then distinguish them from cases that genuinely disappeared early. Preserve every frozen prediction for replay. Temporal validation defines the split.
Check the censoring route
Estimate the censoring survival curve on training data, record G at the nine-day horizon and refuse scoring where its support vanishes. If cases disappear according to severity or queue, a pooled censoring curve may be inadequate. Calculate the weighted Brier score with known outcomes and document the method used for tie handling and uncertainty. Compare it with a frozen baseline model, not only with zero. Support and scoring are separate checks.
Release only the supported claim
The final packet reports case counts, interval counts, update latency, event and censor counts, maturity, censoring support, calibration, Brier score and group coverage. Keep the fitted hazard association separate from claims about the effect of assigning priority. State any blocked result rather than silently removing difficult cases. The gate below catches basic data-contract failures; it does not certify the fitted model.
Implementation
def longitudinal_release_gate(case_rows, interval_rows, horizon_days,
censor_survival_at_horizon):
if horizon_days <= 0:
raise ValueError("invalid horizon")
case_ids = {case_id for case_id, _, _ in case_rows}
if len(case_ids) != len(case_rows):
raise ValueError("duplicate cases")
interval_ids = {case_id for case_id, start, stop, event in interval_rows
if 0 <= start < stop and event in (0, 1)}
if interval_ids != case_ids or len(interval_rows) < len(case_rows):
raise ValueError("missing or malformed intervals")
if not 0 < censor_survival_at_horizon <= 1:
raise ValueError("unsupported censoring horizon")
immature = sum(observed_days < horizon_days and not resolved
for _, observed_days, resolved in case_rows)
return {"cases": len(case_rows), "intervals": len(interval_rows),
"early_unknown_status": immature,
"simple_complete_case_score_ready": immature == 0}
cases = [("R701", 6, 1), ("R702", 11, 0), ("R703", 5, 0)]
intervals = [("R701", 0, 3, 0), ("R701", 3, 6, 1),
("R702", 0, 11, 0), ("R703", 0, 5, 0)]
review = longitudinal_release_gate(cases, intervals, 9, 0.64)
assert review["cases"] == 3 and review["intervals"] == 4
assert review["early_unknown_status"] == 1
assert not review["simple_complete_case_score_ready"]Performance and operating cost
The basic gate is O(N + I) expected time and O(N) space for N cases and I intervals. A production audit also validates each case’s ordered interval chain, fits the censoring model and computes uncertainty. Those costs are justified by the risk of a false performance claim.
Common Mistakes
- Do not infer priority at case creation from a later update.
- Do not treat an early-lost case as a known nine-day failure.
- Do not publish a causal priority claim from a predictive hazard coefficient.
Read next
- Time-updated case histories and the observation clock
- Counting-process intervals for a time-varying Cox model
- Censoring survival weights and horizon support
- IPCW Brier score for censored survival predictions
- Temporal validation of a support-resolution model
Continue the workflow: Project: review resolution predictions with competing exits.
