FAILURE MAP
← Case archive

FA-1141 / Workflow orchestration / Open access

Accept a durable activity completion: An incompatible activity result enters durable history · case 01

The activity completion operation is admitted even though an incompatible activity result enters durable history.

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

ROOT CAUSE

The admission path omits the result schema invariant while validating the other operation preconditions.

THE FAILURE

The admission path omits the result schema invariant while validating the other operation preconditions.

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

SHA-256 / b8a86ab02d505bf327e3079cd385ba5ae44bddb5d0355d23722ada9b56c55ca7

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 (set(r['result_schema'][0]) <= set(r['result_schema'][1]))
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 successorFalseFalsePassed
An unsolicited completion invents an unscheduled activityFalseFalsePassed
An incompatible activity result enters durable historyFalseFalsePassed
A duplicate activity completion schedules downstream work twiceTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 7fe30ff76222eeb11727f94a1c519773bc158af18f096200eb0269db38a3b65b

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 / 1c3e328700f6fbcb25d644f8f493899f9d65cb412366e0ac7e1b985d775d48f0