FA-1241 / Workflow orchestration / Open access
Replay durable workflow history: Replay consumes an unrecorded nondeterministic random value · case 01
The workflow replay operation is admitted even though replay consumes an unrecorded nondeterministic random value.
ROOT CAUSE
The admission path omits the random recorded invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['random_recorded'] is True together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the random recorded check repairs the reported defect, but replacing the adjacent history contiguous 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['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| Replayed code emits a different command kind than history | False | False | Passed |
| Replayed commands reverse the recorded causal order | False | False | Passed |
| Code executes a branch not selected by the recorded marker | False | False | Passed |
| Replay consumes an unrecorded nondeterministic random value | True | False | Failed |
| Replay silently skips a missing history event | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 6d9fa8810f1a60a32b4166e7931053144a2ea300bcf82d03788124a786e90615
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_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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| Replayed code emits a different command kind than history | False | False | Passed |
| Replayed commands reverse the recorded causal order | False | False | Passed |
| Code executes a branch not selected by the recorded marker | False | False | Passed |
| Replay consumes an unrecorded nondeterministic random value | False | False | Passed |
| Replay silently skips a missing history event | True | False | Failed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / b13c8d88331ab45165d9d6c9f7e96375f4c7f1e30de0cae3466d1d71612c2d95
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| Replayed code emits a different command kind than history | False | False | Passed |
| Replayed commands reverse the recorded causal order | False | False | Passed |
| Code executes a branch not selected by the recorded marker | False | False | Passed |
| Replay consumes an unrecorded nondeterministic random value | False | False | Passed |
| Replay silently skips a missing history event | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
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.091821+00:00.
Case digest / 46f1c0c481eaf3943dc5da8343ef49efe54f8d020785e35a2a0e46076ae83d63