FAILURE MAP
← Case archive

FA-1126 / Workflow orchestration / Open access

Accept a durable activity completion: A completion from a previous workflow run is accepted · case 01

The activity completion operation is admitted even though a completion from a previous workflow run is accepted.

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

ROOT CAUSE

The admission path omits the run identity invariant while validating the other operation preconditions.

THE FAILURE

The admission path omits the run identity invariant while validating the other operation preconditions.

Unsuccessful approach: Adding the run identity check repairs the reported defect, but replacing the adjacent activity attempt 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['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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A completion from a previous workflow run is acceptedTrueFalseFailed
A timed-out activity attempt overwrites its successorFalseFalsePassed
An unsolicited completion invents an unscheduled activityFalseFalsePassed
An incompatible activity result enters durable historyFalseFalsePassed
A duplicate activity completion schedules downstream work twiceFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 8464a8becff3db8695f66b366163d6b63aa0309ce0944b8be7d914eb24ba64e3

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_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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A completion from a previous workflow run is acceptedFalseFalsePassed
A timed-out activity attempt overwrites its successorTrueFalseFailed
An unsolicited completion invents an unscheduled activityFalseFalsePassed
An incompatible activity result enters durable historyFalseFalsePassed
A duplicate activity completion schedules downstream work twiceFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / a776de2c2f97f0270903aae2327702f151c269da121e0cbe8d0c16ccd2629283

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 9 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / d19c65c5c0e86fd2f9d162de1a0c52ad91694a70154360d0bac5f9136fc54d75