FAILURE MAP
← Case archive

FA-1246 / Workflow orchestration / Open access

Replay durable workflow history: Replay silently skips a missing history event · case 01

The workflow replay operation is admitted even though replay silently skips a missing history event.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The admission path omits the history contiguous invariant while validating the other operation preconditions.

VERIFIED REPAIR

Require r['history_contiguous'] == list(range(len(r['history_contiguous']))) together with every other stated precondition before accepting the operation.

Unsuccessful approach: Adding the history contiguous check repairs the reported defect, but replacing the adjacent command type check loses that independent invariant.

Case contract

Return a Boolean admission decision for replay durable workflow history. The record r must satisfy all of: r['command_type'][0] == r['command_type'][1]; r['command_order'][0] == r['command_order'][1]; r['version_marker'][0] in r['version_marker'][1]; r['random_recorded'] is True; r['history_contiguous'] == list(range(len(r['history_contiguous']))). Extra tracing fields are ignored; validation does not mutate the record.

Why this case matters

A deterministic local contract for workflow orchestration. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (r['command_type'][0] == r['command_type'][1]) and (r['command_order'][0] == r['command_order'][1]) and (r['version_marker'][0] in r['version_marker'][1]) and (r['random_recorded'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'command_type': ['timer', 'timer'], 'command_order': [['a', 'b'], ['a', 'b']], 'version_marker': [2, [1, 2]], 'random_recorded': True, 'history_contiguous': [0, 1, 2]}
check('valid operation', solve(r), True)
check('Replayed code emits a different command kind than history', solve(dict(r, **{'command_type': ['activity', 'timer']})), False)
check('Replayed commands reverse the recorded causal order', solve(dict(r, **{'command_order': [['b', 'a'], ['a', 'b']]})), False)
check('Code executes a branch not selected by the recorded marker', solve(dict(r, **{'version_marker': [3, [1, 2]]})), False)
check('Replay consumes an unrecorded nondeterministic random value', solve(dict(r, **{'random_recorded': False})), False)
check('Replay silently skips a missing history event', solve(dict(r, **{'history_contiguous': [0, 2, 3]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'command_type': ['activity', 'timer'], 'command_order': [['b', 'a'], ['a', 'b']], 'version_marker': [3, [1, 2]], 'random_recorded': False, 'history_contiguous': [0, 2, 3]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
valid operationTrueTruePassed
Replayed code emits a different command kind than historyFalseFalsePassed
Replayed commands reverse the recorded causal orderFalseFalsePassed
Code executes a branch not selected by the recorded markerFalseFalsePassed
Replay consumes an unrecorded nondeterministic random valueFalseFalsePassed
Replay silently skips a missing history eventTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / b13c8d88331ab45165d9d6c9f7e96375f4c7f1e30de0cae3466d1d71612c2d95

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (r['command_order'][0] == r['command_order'][1]) and (r['version_marker'][0] in r['version_marker'][1]) and (r['random_recorded'] is True) and (r['history_contiguous'] == list(range(len(r['history_contiguous']))))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'command_type': ['timer', 'timer'], 'command_order': [['a', 'b'], ['a', 'b']], 'version_marker': [2, [1, 2]], 'random_recorded': True, 'history_contiguous': [0, 1, 2]}
check('valid operation', solve(r), True)
check('Replayed code emits a different command kind than history', solve(dict(r, **{'command_type': ['activity', 'timer']})), False)
check('Replayed commands reverse the recorded causal order', solve(dict(r, **{'command_order': [['b', 'a'], ['a', 'b']]})), False)
check('Code executes a branch not selected by the recorded marker', solve(dict(r, **{'version_marker': [3, [1, 2]]})), False)
check('Replay consumes an unrecorded nondeterministic random value', solve(dict(r, **{'random_recorded': False})), False)
check('Replay silently skips a missing history event', solve(dict(r, **{'history_contiguous': [0, 2, 3]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'command_type': ['activity', 'timer'], 'command_order': [['b', 'a'], ['a', 'b']], 'version_marker': [3, [1, 2]], 'random_recorded': False, 'history_contiguous': [0, 2, 3]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
valid operationTrueTruePassed
Replayed code emits a different command kind than historyTrueFalseFailed
Replayed commands reverse the recorded causal orderFalseFalsePassed
Code executes a branch not selected by the recorded markerFalseFalsePassed
Replay consumes an unrecorded nondeterministic random valueFalseFalsePassed
Replay silently skips a missing history eventFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / e7098b5d28652546a4ba258dc1d4173bad1c4c904401b228c0b30872fe07f1d8

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (r['command_type'][0] == r['command_type'][1]) and (r['command_order'][0] == r['command_order'][1]) and (r['version_marker'][0] in r['version_marker'][1]) and (r['random_recorded'] is True) and (r['history_contiguous'] == list(range(len(r['history_contiguous']))))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'command_type': ['timer', 'timer'], 'command_order': [['a', 'b'], ['a', 'b']], 'version_marker': [2, [1, 2]], 'random_recorded': True, 'history_contiguous': [0, 1, 2]}
check('valid operation', solve(r), True)
check('Replayed code emits a different command kind than history', solve(dict(r, **{'command_type': ['activity', 'timer']})), False)
check('Replayed commands reverse the recorded causal order', solve(dict(r, **{'command_order': [['b', 'a'], ['a', 'b']]})), False)
check('Code executes a branch not selected by the recorded marker', solve(dict(r, **{'version_marker': [3, [1, 2]]})), False)
check('Replay consumes an unrecorded nondeterministic random value', solve(dict(r, **{'random_recorded': False})), False)
check('Replay silently skips a missing history event', solve(dict(r, **{'history_contiguous': [0, 2, 3]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'command_type': ['activity', 'timer'], 'command_order': [['b', 'a'], ['a', 'b']], 'version_marker': [3, [1, 2]], 'random_recorded': False, 'history_contiguous': [0, 2, 3]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
valid operationTrueTruePassed
Replayed code emits a different command kind than historyFalseFalsePassed
Replayed commands reverse the recorded causal orderFalseFalsePassed
Code executes a branch not selected by the recorded markerFalseFalsePassed
Replay consumes an unrecorded nondeterministic random valueFalseFalsePassed
Replay silently skips a missing history eventFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / a4af76672b3655f0e41c6196a5b9d72d57e3863cecf4e51a457754e1c9ec4467

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:00.099691+00:00.

Case digest / a970cb9822e317fb8e1f2765d9eacb3c3f048af60a41d9191aacc3567e8ee691