FA-1156 / Workflow orchestration / Open access
Fire a durable workflow timer: A cancelled timer resumes workflow execution · case 01
The workflow timer operation is admitted even though a cancelled timer resumes workflow execution.
ROOT CAUSE
The admission path omits the timer not cancelled invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['timer_not_cancelled'] is False together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the timer not cancelled check repairs the reported defect, but replacing the adjacent timer generation check loses that independent invariant.
Case contract
Return a Boolean admission decision for fire a durable workflow timer. The record r must satisfy all of: r['fire_time'][0] >= r['fire_time'][1]; r['timer_not_cancelled'] is False; r['timer_generation'][0] == r['timer_generation'][1]; r['workflow_not_terminal'] not in ['completed','failed','cancelled']; r['fire_once'] is False. 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['fire_time'][0] >= r['fire_time'][1]) and (r['timer_generation'][0] == r['timer_generation'][1]) and (r['workflow_not_terminal'] not in ['completed','failed','cancelled']) and (r['fire_once'] is False)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'fire_time': [20, 20], 'timer_not_cancelled': False, 'timer_generation': [2, 2], 'workflow_not_terminal': 'waiting', 'fire_once': False}
check('valid operation', solve(r), True)
check('A timer fires before its scheduled timestamp', solve(dict(r, **{'fire_time': [19, 20]})), False)
check('A cancelled timer resumes workflow execution', solve(dict(r, **{'timer_not_cancelled': True})), False)
check('A stale timer wakeup fires a replacement timer', solve(dict(r, **{'timer_generation': [1, 2]})), False)
check('A timer reactivates a completed workflow', solve(dict(r, **{'workflow_not_terminal': 'completed'})), False)
check('A retried timer delivery produces another history event', solve(dict(r, **{'fire_once': True})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'fire_time': [19, 20], 'timer_not_cancelled': True, 'timer_generation': [1, 2], 'workflow_not_terminal': 'completed', 'fire_once': True}
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 |
| A timer fires before its scheduled timestamp | False | False | Passed |
| A cancelled timer resumes workflow execution | True | False | Failed |
| A stale timer wakeup fires a replacement timer | False | False | Passed |
| A timer reactivates a completed workflow | False | False | Passed |
| A retried timer delivery produces another 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 / ce12b3f034bc687ccb98c61a827f39e639e0fe094e9ac559b90ea3264a072350
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['fire_time'][0] >= r['fire_time'][1]) and (r['timer_not_cancelled'] is False) and (r['workflow_not_terminal'] not in ['completed','failed','cancelled']) and (r['fire_once'] is False)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'fire_time': [20, 20], 'timer_not_cancelled': False, 'timer_generation': [2, 2], 'workflow_not_terminal': 'waiting', 'fire_once': False}
check('valid operation', solve(r), True)
check('A timer fires before its scheduled timestamp', solve(dict(r, **{'fire_time': [19, 20]})), False)
check('A cancelled timer resumes workflow execution', solve(dict(r, **{'timer_not_cancelled': True})), False)
check('A stale timer wakeup fires a replacement timer', solve(dict(r, **{'timer_generation': [1, 2]})), False)
check('A timer reactivates a completed workflow', solve(dict(r, **{'workflow_not_terminal': 'completed'})), False)
check('A retried timer delivery produces another history event', solve(dict(r, **{'fire_once': True})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'fire_time': [19, 20], 'timer_not_cancelled': True, 'timer_generation': [1, 2], 'workflow_not_terminal': 'completed', 'fire_once': True}
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 |
| A timer fires before its scheduled timestamp | False | False | Passed |
| A cancelled timer resumes workflow execution | False | False | Passed |
| A stale timer wakeup fires a replacement timer | True | False | Failed |
| A timer reactivates a completed workflow | False | False | Passed |
| A retried timer delivery produces another 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 / 991d0f1bfd4465b4d20e0d12132d2e5284c41e7e253d83fb73b3e6a000382283
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['fire_time'][0] >= r['fire_time'][1]) and (r['timer_not_cancelled'] is False) and (r['timer_generation'][0] == r['timer_generation'][1]) and (r['workflow_not_terminal'] not in ['completed','failed','cancelled']) and (r['fire_once'] is False)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'fire_time': [20, 20], 'timer_not_cancelled': False, 'timer_generation': [2, 2], 'workflow_not_terminal': 'waiting', 'fire_once': False}
check('valid operation', solve(r), True)
check('A timer fires before its scheduled timestamp', solve(dict(r, **{'fire_time': [19, 20]})), False)
check('A cancelled timer resumes workflow execution', solve(dict(r, **{'timer_not_cancelled': True})), False)
check('A stale timer wakeup fires a replacement timer', solve(dict(r, **{'timer_generation': [1, 2]})), False)
check('A timer reactivates a completed workflow', solve(dict(r, **{'workflow_not_terminal': 'completed'})), False)
check('A retried timer delivery produces another history event', solve(dict(r, **{'fire_once': True})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'fire_time': [19, 20], 'timer_not_cancelled': True, 'timer_generation': [1, 2], 'workflow_not_terminal': 'completed', 'fire_once': True}
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 |
| A timer fires before its scheduled timestamp | False | False | Passed |
| A cancelled timer resumes workflow execution | False | False | Passed |
| A stale timer wakeup fires a replacement timer | False | False | Passed |
| A timer reactivates a completed workflow | False | False | Passed |
| A retried timer delivery produces another 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 / bb178148be19374f525c9e1703e1426f295a0767738acd9edd1e1ad8ead1b1b7
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:36:59.263545+00:00.
Case digest / 4df3bbaf37d6a8469237fb1ef5db9310323f1b354277641cb8a0915fc3af0d55