FA-776 / Queues / Open access
Settle a queue delivery acknowledgement: A receipt from an older delivery deletes the current message · case 01
The queue acknowledge operation is admitted even though a receipt from an older delivery deletes the current message.
ROOT CAUSE
The admission path omits the receipt handle invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['receipt_handle'][0] == r['receipt_handle'][1] together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the receipt handle check repairs the reported defect, but replacing the adjacent lease live 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['lease_live'][0] < r['lease_live'][1]) and (r['channel_scope'][0] == r['channel_scope'][1]) and (r['settlement_once'] is False) 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A receipt from an older delivery deletes the current message | True | False | Failed |
| An acknowledgement settles an already expired reservation | False | False | Passed |
| A delivery tag from another channel is settled | False | False | Passed |
| A second settlement credits the consumer twice | False | False | Passed |
| Cumulative acknowledgement jumps over an unprocessed delivery | 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 / 77874a193bd345a57d8bc6044bd1b75bd69244dd14c47b666773991e26cd1f67
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['channel_scope'][0] == r['channel_scope'][1]) and (r['settlement_once'] is False) 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A receipt from an older delivery deletes the current message | False | False | Passed |
| An acknowledgement settles an already expired reservation | True | False | Failed |
| A delivery tag from another channel is settled | False | False | Passed |
| A second settlement credits the consumer twice | False | False | Passed |
| Cumulative acknowledgement jumps over an unprocessed delivery | 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 / 7a51e38f3f3cde483564dd7ae9aab926f75a8e65d525292ef52d4a3d47061465
3 / The verified repair
Exit 0"""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) 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A receipt from an older delivery deletes the current message | False | False | Passed |
| An acknowledgement settles an already expired reservation | False | False | Passed |
| A delivery tag from another channel is settled | False | False | Passed |
| A second settlement credits the consumer twice | False | False | Passed |
| Cumulative acknowledgement jumps over an unprocessed delivery | 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 / 81c12c323a149fb7e710ab7f3bdc6eca3d9e07adc199fb81244c4a0887a7daeb
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.033090+00:00.
Case digest / b0cc08b14aac87b7af27eaa6401a223c6e628f54dc668ca575c1c61e8ea069de