FAILURE MAP
← Case archive

FA-1201 / Workflow orchestration / Open access

Run a saga compensation action: Compensation reverses a forward action that never committed · case 01

The saga compensation operation is admitted even though compensation reverses a forward action that never committed.

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

ROOT CAUSE

The admission path omits the forward committed invariant while validating the other operation preconditions.

VERIFIED REPAIR

Require r['forward_committed'] is True together with every other stated precondition before accepting the operation.

Unsuccessful approach: Adding the forward committed check repairs the reported defect, but replacing the adjacent reverse dependency check loses that independent invariant.

Case contract

Return a Boolean admission decision for run a saga compensation action. The record r must satisfy all of: r['forward_committed'] is True; all(r['reverse_dependency']); r['compensation_identity'][0] not in r['compensation_identity'][1]; r['resource_version'][0] == r['resource_version'][1]; r['compensation_registered'] is not None. 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 (all(r['reverse_dependency'])) and (r['compensation_identity'][0] not in r['compensation_identity'][1]) and (r['resource_version'][0] == r['resource_version'][1]) and (r['compensation_registered'] is not None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'forward_committed': True, 'reverse_dependency': [True, True], 'compensation_identity': ['c2', ['c1']], 'resource_version': [7, 7], 'compensation_registered': 'release'}
check('valid operation', solve(r), True)
check('Compensation reverses a forward action that never committed', solve(dict(r, **{'forward_committed': False})), False)
check('An upstream step is compensated while dependents remain active', solve(dict(r, **{'reverse_dependency': [True, False]})), False)
check('Retried compensation refunds the same side effect twice', solve(dict(r, **{'compensation_identity': ['c1', ['c1']]})), False)
check('Compensation overwrites a resource changed by another workflow', solve(dict(r, **{'resource_version': [6, 7]})), False)
check('A committed step has no recorded inverse operation', solve(dict(r, **{'compensation_registered': None})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'forward_committed': False, 'reverse_dependency': [True, False], 'compensation_identity': ['c1', ['c1']], 'resource_version': [6, 7], 'compensation_registered': None}
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
Compensation reverses a forward action that never committedTrueFalseFailed
An upstream step is compensated while dependents remain activeFalseFalsePassed
Retried compensation refunds the same side effect twiceFalseFalsePassed
Compensation overwrites a resource changed by another workflowFalseFalsePassed
A committed step has no recorded inverse operationFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / cdb8d99b98aee5c38ccf54c367b63a0791be4d2a75c8dacfd974295f413c87af

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(r):
    return (r['forward_committed'] is True) and (r['compensation_identity'][0] not in r['compensation_identity'][1]) and (r['resource_version'][0] == r['resource_version'][1]) and (r['compensation_registered'] is not None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'forward_committed': True, 'reverse_dependency': [True, True], 'compensation_identity': ['c2', ['c1']], 'resource_version': [7, 7], 'compensation_registered': 'release'}
check('valid operation', solve(r), True)
check('Compensation reverses a forward action that never committed', solve(dict(r, **{'forward_committed': False})), False)
check('An upstream step is compensated while dependents remain active', solve(dict(r, **{'reverse_dependency': [True, False]})), False)
check('Retried compensation refunds the same side effect twice', solve(dict(r, **{'compensation_identity': ['c1', ['c1']]})), False)
check('Compensation overwrites a resource changed by another workflow', solve(dict(r, **{'resource_version': [6, 7]})), False)
check('A committed step has no recorded inverse operation', solve(dict(r, **{'compensation_registered': None})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'forward_committed': False, 'reverse_dependency': [True, False], 'compensation_identity': ['c1', ['c1']], 'resource_version': [6, 7], 'compensation_registered': None}
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
Compensation reverses a forward action that never committedFalseFalsePassed
An upstream step is compensated while dependents remain activeTrueFalseFailed
Retried compensation refunds the same side effect twiceFalseFalsePassed
Compensation overwrites a resource changed by another workflowFalseFalsePassed
A committed step has no recorded inverse operationFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 7dc80be298b82e8ad441efff510eecbdf3654879aa0e671c35660b57eb1e134d

3 / The verified repair

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

N = 1
observations = []
def solve(r):
    return (r['forward_committed'] is True) and (all(r['reverse_dependency'])) and (r['compensation_identity'][0] not in r['compensation_identity'][1]) and (r['resource_version'][0] == r['resource_version'][1]) and (r['compensation_registered'] is not None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'forward_committed': True, 'reverse_dependency': [True, True], 'compensation_identity': ['c2', ['c1']], 'resource_version': [7, 7], 'compensation_registered': 'release'}
check('valid operation', solve(r), True)
check('Compensation reverses a forward action that never committed', solve(dict(r, **{'forward_committed': False})), False)
check('An upstream step is compensated while dependents remain active', solve(dict(r, **{'reverse_dependency': [True, False]})), False)
check('Retried compensation refunds the same side effect twice', solve(dict(r, **{'compensation_identity': ['c1', ['c1']]})), False)
check('Compensation overwrites a resource changed by another workflow', solve(dict(r, **{'resource_version': [6, 7]})), False)
check('A committed step has no recorded inverse operation', solve(dict(r, **{'compensation_registered': None})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'forward_committed': False, 'reverse_dependency': [True, False], 'compensation_identity': ['c1', ['c1']], 'resource_version': [6, 7], 'compensation_registered': None}
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
Compensation reverses a forward action that never committedFalseFalsePassed
An upstream step is compensated while dependents remain activeFalseFalsePassed
Retried compensation refunds the same side effect twiceFalseFalsePassed
Compensation overwrites a resource changed by another workflowFalseFalsePassed
A committed step has no recorded inverse operationFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 1aca91ff3c565a918f953356c22641b5a095b7e1d16ebe54e4b963edf4ab1429

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.879581+00:00.

Case digest / 4dfe23a9edebce4736f8fab859538be2e84a8c4a503612e7b27df58f4e5ada3f