A posterior may be updated as new batches arrive, but the update ledger must keep outcomes mature, unique and ordered.
Sequential posterior monitoring with mature outcomes
Define a batch boundary
A seven-day escalation label is unknown on the day a case closes. Batches should include only cases whose outcome window has matured by the monitoring cutoff. Suppose batch A contains 19 cases with three escalations and batch B contains 34 cases with eight. Together they give 11 of 53, but only after both windows close. A partially mature batch undercounts later escalations. Censoring offers another analysis path when time-to-escalation is itself important.
Prevent duplicate evidence
Store a stable batch ID, case IDs, cohort rule, close date, outcome-maturity date and source snapshot. Before updating, verify that no case appears in an earlier batch and that 0 ≤ events ≤ cases. An ingestion retry must not add the same 19 cases twice. Conjugate updating is arithmetically simple; identity control is the failure-prone part.
Record probabilities before decisions
At each checkpoint, save the posterior, the probability of crossing the service threshold and the action rule before the next labels arrive. A Bayesian posterior can be recomputed after every mature batch, but the operating policy may have costs, capacity limits and repeated interventions. Assess its long-run false-action and missed-action behavior by simulating realistic sequences, rather than assuming that any posterior threshold automatically has a desired error rate.
Handle changing regimes
If the support process changed between batches, the common-rate likelihood may no longer apply. Report batch-level rates and case mix, inspect predictive misfit, and consider a time-varying model or a reset with an explicit rationale. Do not carry a strong posterior from an obsolete period into a new queue as if it were fresh evidence. Sensitivity checks show whether the carried prior drives the decision.
Keep the audit trail replayable
Rebuild the current posterior from the immutable batch ledger and compare it with the stored state. A corrected label requires a new ledger revision and a replay, not a silent subtraction from a dashboard card. Record who approved the correction and which downstream staffing decisions used the earlier state. The project combines this ledger with held-out scoring.
Implementation
def replay_mature_batches(prior_alpha, prior_beta, batches):
if prior_alpha <= 0 or prior_beta <= 0:
raise ValueError("prior shapes must be positive")
seen = set()
alpha, beta = prior_alpha, prior_beta
for batch in batches:
if batch["id"] in seen or not batch["mature"]:
raise ValueError("duplicate or immature batch")
events, cases = batch["escalations"], batch["cases"]
if not 0 <= events <= cases:
raise ValueError("invalid batch counts")
seen.add(batch["id"])
alpha += events
beta += cases - events
return alpha, beta
ledger = [{"id": "west-sep", "mature": True, "escalations": 3, "cases": 19},
{"id": "east-sep", "mature": True, "escalations": 8, "cases": 34}]
assert replay_mature_batches(4, 36, ledger) == (15, 78)Performance and operating cost
Replaying B batches is O(B) expected time and O(B) space for the batch-ID set. Exact case-level deduplication requires additional identity storage or reconciliation and may dominate the job. Do not infer statistical validity from a ledger that only checks arithmetic.
Common Mistakes
- Do not count a case before its outcome window matures.
- Do not accept a retry as fresh evidence.
- Do not assume a posterior threshold has a known long-run false-action rate without evaluating the full policy.
