Recovery traces: bind the observed run to artifacts and fault oracles
Connect causal tracing with durable identities, reviewed artifacts, authoritative effect counts, and crash-window tests.
On this page
The question for today
What you’ll understand
- Distinguish sampled diagnostic traces from authoritative execution records.
- Bind step observations to exact inputs, tool versions, approvals, and artifacts.
- Evaluate recovery with independent effect and ownership oracles.
A run that returns success after a crash can still duplicate an external write, use an unapproved artifact, or abandon a child task. A recovery test therefore needs an oracle outside the runtime's own success flag. Bind observations to durable identities and exact artifacts, inject failures at meaningful boundaries, and compare the recovered world with the protocol's stated invariants.
A trace explains causality but is not automatically the journal
Record logical run, incarnation, step, attempt, provider operation identity, parent-child links, and the corresponding journal sequence. OpenTelemetry supplies concrete span and context APIs for diagnostic tracing, including parent relationships and links. Sampling, exporter failure, or retention can leave those diagnostics incomplete. A missing span is not proof that a tool never ran, and a success span is not an authoritative provider receipt. Keep the durable control record and effect evidence distinct from optional observability data.
Bind each decision to tool/schema version, canonical arguments, input artifact versions, model response artifact, approval identity, and relevant budget transitions. Record result and output artifact digests with controlled access to the actual content needed for recovery. A hash identifies bytes under its stated assumptions; it does not prove the artifact was approved, truthful, or available. Avoid relying on mutable file names or model aliases as the complete identity of an executed action. Record amendments as new evidence when reconciliation changes what is known.
Fault injection needs an independent outcome oracle
Inject crashes before dispatch, after provider commit but before acknowledgement, after result observation but before journal append, and during cleanup or compensation. Use an instrumented provider or controlled fixture that records authoritative logical effects independently of the worker. Test what happens when it honors keys, expires them, rejects payload reuse, or lacks idempotency support. A simulator can validate the proposed protocol under its assumptions; it cannot establish that an untested production provider has the same guarantees.
Compare effect counts, resource versions, accepted approvals, outstanding budget reservations, and ownership of every child or cleanup obligation. Replay the same accepted history with the intended compatible code and recorded nondeterministic inputs, then verify command identities and outputs. A model-quality evaluator answers another question: whether the chosen plan was useful. Runtime recovery tests should not pass merely because a final response sounds plausible or because a mocked tool returned a success-shaped JSON object.
Report the property and failure window, not only a pass rate
Name each fixture's initial state, logical intent, fault location, provider behavior, expected recovery, and final authoritative observations. Preserve minimized failing histories and compatible artifacts. Include duplicate and delayed messages, concurrent cancellation, changed approvals, schema evolution, and expired deduplication records. A single invariant violation matters even when most runs recover; aggregate availability can conceal a systematic commit-gap failure. Conversely, a test that explicitly expects an unresolved obligation can pass when the runtime safely refuses an unsafe retry.
The probability lab illustrates only the chance of missing a hypothetical independent defect. Reset, set p=0.05 and n=20, predict mean one defect and zero-defect probability about 0.3585, then Play or Step. Separately Reset, set p=0.05 and n=30, predict mean 1.5 and zero-defect probability about 0.2146, then Play or Step. It performs no fault injection and assumes identical independent trials. Real crash windows are structured cases, so deterministic boundary coverage and independent oracles remain necessary even after many apparently clean runs.
Work it through
Successful responses can hide a duplicate-effect failure
A fixture matrix tests four tool cases at three crash windows, giving twelve isolated recovery scenarios. All return a success response. Eleven scenarios have exactly one authoritative committed effect; one has two, although every scenario expected one.
The matrix contains 4×3=12 scenarios, with response-success rate 12/12=100%.
Authoritative effects total 11×1+1×2=13 instead of the expected twelve. One scenario has a duplicate-effect violation.
The effect-invariant pass rate is 11/12≈91.67%, but the promised at-most-one property has failed in the identified window. Preserve that trace and fix or narrow the protocol rather than describe the suite as fully successful.
Availability and effect correctness produce different verdicts. The independent provider record reveals the failure hidden by the runtime's success flags.
The living notebook
Explore the model
Interactive lab · probability
A clean sample can miss a structured defect
Reset, set p=0.05 and n=20, predict mean 1 and P(K=0)=0.95²⁰≈0.3585, then Play or Step. Separately Reset, set p=0.05 and n=30, predict mean 1.5 and P(K=0)=0.95³⁰≈0.2146, then Play or Step. The exact iid binomial does not execute crash scenarios or certify an effect protocol.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forUse explicit fault-window coverage and authoritative oracles alongside aggregate test counts.
Pause & reason
Check your understanding
Your turn
Try it yourself
Twenty isolated scenarios all return success. Eighteen have one committed effect, while two each have one extra duplicate. Find total effects and the at-most-one invariant pass rate.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Count authoritative effects independently of response flags.
Compare with the solution
Total effects are 18×1+2×2=22 rather than twenty. The invariant passes in 18/20=90% of scenarios, while response-success rate is 100%. The two failing identities and fault windows must remain visible; their failures cannot be averaged away into an exactly-once claim.
Keep the idea
Take it with you
- Diagnostic tracing and durable execution evidence serve different roles.
- Bind observations to exact artifact, approval, contract, and effect identities.
- Recovery needs independent effect and ownership oracles at explicit fault windows.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.