FAILURE MAP
← Case archive

FA-811 / Queues / Open access

Move a poison message to a dead-letter queue: The source is removed before the target copy is durable · case 01

The queue dead letter operation is admitted even though the source is removed before the target copy is durable.

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

ROOT CAUSE

The admission path omits the transfer persisted invariant while validating the other operation preconditions.

VERIFIED REPAIR

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

Unsuccessful approach: Adding the transfer persisted check repairs the reported defect, but replacing the adjacent cycle detection check loses that independent invariant.

Case contract

Return a Boolean admission decision for move a poison message to a dead-letter queue. The record r must satisfy all of: r['attempt_threshold'][0] >= r['attempt_threshold'][1]; r['destination_exists'] is True; r['transfer_persisted'] is True; r['cycle_detection'][0] not in r['cycle_detection'][1]; r['original_identity'][0] == r['original_identity'][1]. Extra tracing fields are ignored; validation does not mutate the record.

Why this case matters

A deterministic local contract for queues. 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['attempt_threshold'][0] >= r['attempt_threshold'][1]) and (r['destination_exists'] is True) and (r['cycle_detection'][0] not in r['cycle_detection'][1]) and (r['original_identity'][0] == r['original_identity'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'attempt_threshold': [5, 5], 'destination_exists': True, 'transfer_persisted': True, 'cycle_detection': ['q3', ['q1', 'q2']], 'original_identity': ['m1', 'm1']}
check('valid operation', solve(r), True)
check('A transient first failure is dead-lettered prematurely', solve(dict(r, **{'attempt_threshold': [4, 5]})), False)
check('The source is deleted without a dead-letter destination', solve(dict(r, **{'destination_exists': False})), False)
check('The source is removed before the target copy is durable', solve(dict(r, **{'transfer_persisted': False})), False)
check('Dead-letter forwarding revisits a queue in its own route', solve(dict(r, **{'cycle_detection': ['q1', ['q1', 'q2']]})), False)
check('Dead-letter transfer loses the original message identity', solve(dict(r, **{'original_identity': ['m2', 'm1']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'attempt_threshold': [4, 5], 'destination_exists': False, 'transfer_persisted': False, 'cycle_detection': ['q1', ['q1', 'q2']], 'original_identity': ['m2', 'm1']}
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 transient first failure is dead-lettered prematurelyFalseFalsePassed
The source is deleted without a dead-letter destinationFalseFalsePassed
The source is removed before the target copy is durableTrueFalseFailed
Dead-letter forwarding revisits a queue in its own routeFalseFalsePassed
Dead-letter transfer loses the original message identityFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 8fdb6eec0ce82a5af674821f1a387ac936c693638f35c531976db5b55813925b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(r):
    return (r['attempt_threshold'][0] >= r['attempt_threshold'][1]) and (r['destination_exists'] is True) and (r['transfer_persisted'] is True) and (r['original_identity'][0] == r['original_identity'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'attempt_threshold': [5, 5], 'destination_exists': True, 'transfer_persisted': True, 'cycle_detection': ['q3', ['q1', 'q2']], 'original_identity': ['m1', 'm1']}
check('valid operation', solve(r), True)
check('A transient first failure is dead-lettered prematurely', solve(dict(r, **{'attempt_threshold': [4, 5]})), False)
check('The source is deleted without a dead-letter destination', solve(dict(r, **{'destination_exists': False})), False)
check('The source is removed before the target copy is durable', solve(dict(r, **{'transfer_persisted': False})), False)
check('Dead-letter forwarding revisits a queue in its own route', solve(dict(r, **{'cycle_detection': ['q1', ['q1', 'q2']]})), False)
check('Dead-letter transfer loses the original message identity', solve(dict(r, **{'original_identity': ['m2', 'm1']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'attempt_threshold': [4, 5], 'destination_exists': False, 'transfer_persisted': False, 'cycle_detection': ['q1', ['q1', 'q2']], 'original_identity': ['m2', 'm1']}
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 transient first failure is dead-lettered prematurelyFalseFalsePassed
The source is deleted without a dead-letter destinationFalseFalsePassed
The source is removed before the target copy is durableFalseFalsePassed
Dead-letter forwarding revisits a queue in its own routeTrueFalseFailed
Dead-letter transfer loses the original message identityFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 3f2fcf0cb6cf0370aed956e1599d82f3371fb9c42578cea08ed8b311bbebae39

3 / The verified repair

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

N = 1
observations = []
def solve(r):
    return (r['attempt_threshold'][0] >= r['attempt_threshold'][1]) and (r['destination_exists'] is True) and (r['transfer_persisted'] is True) and (r['cycle_detection'][0] not in r['cycle_detection'][1]) and (r['original_identity'][0] == r['original_identity'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'attempt_threshold': [5, 5], 'destination_exists': True, 'transfer_persisted': True, 'cycle_detection': ['q3', ['q1', 'q2']], 'original_identity': ['m1', 'm1']}
check('valid operation', solve(r), True)
check('A transient first failure is dead-lettered prematurely', solve(dict(r, **{'attempt_threshold': [4, 5]})), False)
check('The source is deleted without a dead-letter destination', solve(dict(r, **{'destination_exists': False})), False)
check('The source is removed before the target copy is durable', solve(dict(r, **{'transfer_persisted': False})), False)
check('Dead-letter forwarding revisits a queue in its own route', solve(dict(r, **{'cycle_detection': ['q1', ['q1', 'q2']]})), False)
check('Dead-letter transfer loses the original message identity', solve(dict(r, **{'original_identity': ['m2', 'm1']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'attempt_threshold': [4, 5], 'destination_exists': False, 'transfer_persisted': False, 'cycle_detection': ['q1', ['q1', 'q2']], 'original_identity': ['m2', 'm1']}
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 transient first failure is dead-lettered prematurelyFalseFalsePassed
The source is deleted without a dead-letter destinationFalseFalsePassed
The source is removed before the target copy is durableFalseFalsePassed
Dead-letter forwarding revisits a queue in its own routeFalseFalsePassed
Dead-letter transfer loses the original message identityFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / c2684659d9b84001b786c64005d69215df25bc44d993344f3450509e0477c8bf

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

Case digest / 955e271d148fe681d628253ec4e2e5afa6920c586042d1dae8d44ec115026fe9