FA-1136 / Workflow orchestration / Open access
Accept a durable activity completion: An unsolicited completion invents an unscheduled activity · case 01
The activity completion operation is admitted even though an unsolicited completion invents an unscheduled activity.
ROOT CAUSE
The admission path omits the activity scheduled invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['activity_scheduled'][0] in r['activity_scheduled'][1] together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the activity scheduled check repairs the reported defect, but replacing the adjacent result schema check loses that independent invariant.
Case contract
Return a Boolean admission decision for accept a durable activity completion. The record r must satisfy all of: r['run_identity'][0] == r['run_identity'][1]; r['activity_attempt'][0] == r['activity_attempt'][1]; r['activity_scheduled'][0] in r['activity_scheduled'][1]; set(r['result_schema'][0]) <= set(r['result_schema'][1]); r['completion_pending'] == 'pending'. 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['run_identity'][0] == r['run_identity'][1]) and (r['activity_attempt'][0] == r['activity_attempt'][1]) and (set(r['result_schema'][0]) <= set(r['result_schema'][1])) and (r['completion_pending'] == 'pending')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'run_identity': ['r2', 'r2'], 'activity_attempt': [3, 3], 'activity_scheduled': ['a', ['a', 'b']], 'result_schema': [['receipt'], ['receipt']], 'completion_pending': 'pending'}
check('valid operation', solve(r), True)
check('A completion from a previous workflow run is accepted', solve(dict(r, **{'run_identity': ['r1', 'r2']})), False)
check('A timed-out activity attempt overwrites its successor', solve(dict(r, **{'activity_attempt': [2, 3]})), False)
check('An unsolicited completion invents an unscheduled activity', solve(dict(r, **{'activity_scheduled': ['c', ['a', 'b']]})), False)
check('An incompatible activity result enters durable history', solve(dict(r, **{'result_schema': [['receipt'], ['error']]})), False)
check('A duplicate activity completion schedules downstream work twice', solve(dict(r, **{'completion_pending': 'completed'})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'run_identity': ['r1', 'r2'], 'activity_attempt': [2, 3], 'activity_scheduled': ['c', ['a', 'b']], 'result_schema': [['receipt'], ['error']], 'completion_pending': 'completed'}
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 completion from a previous workflow run is accepted | False | False | Passed |
| A timed-out activity attempt overwrites its successor | False | False | Passed |
| An unsolicited completion invents an unscheduled activity | True | False | Failed |
| An incompatible activity result enters durable history | False | False | Passed |
| A duplicate activity completion schedules downstream work twice | 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 / 483cf1bff214e0e7927c046522946770908d01819bad9db3df75c7ea04db7baa
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['run_identity'][0] == r['run_identity'][1]) and (r['activity_attempt'][0] == r['activity_attempt'][1]) and (r['activity_scheduled'][0] in r['activity_scheduled'][1]) and (r['completion_pending'] == 'pending')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'run_identity': ['r2', 'r2'], 'activity_attempt': [3, 3], 'activity_scheduled': ['a', ['a', 'b']], 'result_schema': [['receipt'], ['receipt']], 'completion_pending': 'pending'}
check('valid operation', solve(r), True)
check('A completion from a previous workflow run is accepted', solve(dict(r, **{'run_identity': ['r1', 'r2']})), False)
check('A timed-out activity attempt overwrites its successor', solve(dict(r, **{'activity_attempt': [2, 3]})), False)
check('An unsolicited completion invents an unscheduled activity', solve(dict(r, **{'activity_scheduled': ['c', ['a', 'b']]})), False)
check('An incompatible activity result enters durable history', solve(dict(r, **{'result_schema': [['receipt'], ['error']]})), False)
check('A duplicate activity completion schedules downstream work twice', solve(dict(r, **{'completion_pending': 'completed'})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'run_identity': ['r1', 'r2'], 'activity_attempt': [2, 3], 'activity_scheduled': ['c', ['a', 'b']], 'result_schema': [['receipt'], ['error']], 'completion_pending': 'completed'}
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 completion from a previous workflow run is accepted | False | False | Passed |
| A timed-out activity attempt overwrites its successor | False | False | Passed |
| An unsolicited completion invents an unscheduled activity | False | False | Passed |
| An incompatible activity result enters durable history | True | False | Failed |
| A duplicate activity completion schedules downstream work twice | 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 / b8a86ab02d505bf327e3079cd385ba5ae44bddb5d0355d23722ada9b56c55ca7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['run_identity'][0] == r['run_identity'][1]) and (r['activity_attempt'][0] == r['activity_attempt'][1]) and (r['activity_scheduled'][0] in r['activity_scheduled'][1]) and (set(r['result_schema'][0]) <= set(r['result_schema'][1])) and (r['completion_pending'] == 'pending')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'run_identity': ['r2', 'r2'], 'activity_attempt': [3, 3], 'activity_scheduled': ['a', ['a', 'b']], 'result_schema': [['receipt'], ['receipt']], 'completion_pending': 'pending'}
check('valid operation', solve(r), True)
check('A completion from a previous workflow run is accepted', solve(dict(r, **{'run_identity': ['r1', 'r2']})), False)
check('A timed-out activity attempt overwrites its successor', solve(dict(r, **{'activity_attempt': [2, 3]})), False)
check('An unsolicited completion invents an unscheduled activity', solve(dict(r, **{'activity_scheduled': ['c', ['a', 'b']]})), False)
check('An incompatible activity result enters durable history', solve(dict(r, **{'result_schema': [['receipt'], ['error']]})), False)
check('A duplicate activity completion schedules downstream work twice', solve(dict(r, **{'completion_pending': 'completed'})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'run_identity': ['r1', 'r2'], 'activity_attempt': [2, 3], 'activity_scheduled': ['c', ['a', 'b']], 'result_schema': [['receipt'], ['error']], 'completion_pending': 'completed'}
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 completion from a previous workflow run is accepted | False | False | Passed |
| A timed-out activity attempt overwrites its successor | False | False | Passed |
| An unsolicited completion invents an unscheduled activity | False | False | Passed |
| An incompatible activity result enters durable history | False | False | Passed |
| A duplicate activity completion schedules downstream work twice | 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 / c39ba7de8344a2e46d65b9212399f6a99908626f6f026316dea695596c517697
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.227460+00:00.
Case digest / 337287e331bda68d1f50fc02fff9aaec9fb0a79884d53bc3bad6712c1c0df39f