FAILURE MAP
← Case archive

FA-791 / Queues / Open access

Settle a queue delivery acknowledgement: A second settlement credits the consumer twice · case 01

The queue acknowledge operation is admitted even though a second settlement credits the consumer twice.

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

ROOT CAUSE

The admission path omits the settlement once invariant while validating the other operation preconditions.

THE FAILURE

The admission path omits the settlement once invariant while validating the other operation preconditions.

Unsuccessful approach: Adding the settlement once check repairs the reported defect, but replacing the adjacent batch prefix check loses that independent invariant.

Case contract

Return a Boolean admission decision for settle a queue delivery acknowledgement. The record r must satisfy all of: r['receipt_handle'][0] == r['receipt_handle'][1]; r['lease_live'][0] < r['lease_live'][1]; r['channel_scope'][0] == r['channel_scope'][1]; r['settlement_once'] is False; all(r['batch_prefix']). 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['receipt_handle'][0] == r['receipt_handle'][1]) and (r['lease_live'][0] < r['lease_live'][1]) and (r['channel_scope'][0] == r['channel_scope'][1]) and (all(r['batch_prefix']))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'receipt_handle': ['h2', 'h2'], 'lease_live': [8, 9], 'channel_scope': ['c2', 'c2'], 'settlement_once': False, 'batch_prefix': [True, True, True]}
check('valid operation', solve(r), True)
check('A receipt from an older delivery deletes the current message', solve(dict(r, **{'receipt_handle': ['h1', 'h2']})), False)
check('An acknowledgement settles an already expired reservation', solve(dict(r, **{'lease_live': [9, 9]})), False)
check('A delivery tag from another channel is settled', solve(dict(r, **{'channel_scope': ['c1', 'c2']})), False)
check('A second settlement credits the consumer twice', solve(dict(r, **{'settlement_once': True})), False)
check('Cumulative acknowledgement jumps over an unprocessed delivery', solve(dict(r, **{'batch_prefix': [True, False, True]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'receipt_handle': ['h1', 'h2'], 'lease_live': [9, 9], 'channel_scope': ['c1', 'c2'], 'settlement_once': True, 'batch_prefix': [True, False, True]}
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 receipt from an older delivery deletes the current messageFalseFalsePassed
An acknowledgement settles an already expired reservationFalseFalsePassed
A delivery tag from another channel is settledFalseFalsePassed
A second settlement credits the consumer twiceTrueFalseFailed
Cumulative acknowledgement jumps over an unprocessed deliveryFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 12b490f36452b9625e530da9846e3b18d69c32e326c12b8d7ff00fa82507e146

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(r):
    return (r['receipt_handle'][0] == r['receipt_handle'][1]) and (r['lease_live'][0] < r['lease_live'][1]) and (r['channel_scope'][0] == r['channel_scope'][1]) and (r['settlement_once'] is False)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'receipt_handle': ['h2', 'h2'], 'lease_live': [8, 9], 'channel_scope': ['c2', 'c2'], 'settlement_once': False, 'batch_prefix': [True, True, True]}
check('valid operation', solve(r), True)
check('A receipt from an older delivery deletes the current message', solve(dict(r, **{'receipt_handle': ['h1', 'h2']})), False)
check('An acknowledgement settles an already expired reservation', solve(dict(r, **{'lease_live': [9, 9]})), False)
check('A delivery tag from another channel is settled', solve(dict(r, **{'channel_scope': ['c1', 'c2']})), False)
check('A second settlement credits the consumer twice', solve(dict(r, **{'settlement_once': True})), False)
check('Cumulative acknowledgement jumps over an unprocessed delivery', solve(dict(r, **{'batch_prefix': [True, False, True]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'receipt_handle': ['h1', 'h2'], 'lease_live': [9, 9], 'channel_scope': ['c1', 'c2'], 'settlement_once': True, 'batch_prefix': [True, False, True]}
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 receipt from an older delivery deletes the current messageFalseFalsePassed
An acknowledgement settles an already expired reservationFalseFalsePassed
A delivery tag from another channel is settledFalseFalsePassed
A second settlement credits the consumer twiceFalseFalsePassed
Cumulative acknowledgement jumps over an unprocessed deliveryTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / b98b42fb097e4b5e8af099a931238639ec3a84c04cced979c4e5980040fa7597

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

Case digest / 3dfd9b5138d8a4316feaaf6e95e08e8ef6b7ad68233519ddd501ea8b4e8d0cc0