FA-786 / Queues / Open access
Settle a queue delivery acknowledgement: A delivery tag from another channel is settled · case 01
The queue acknowledge operation is admitted even though a delivery tag from another channel is settled.
ROOT CAUSE
The admission path omits the channel scope invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['channel_scope'][0] == r['channel_scope'][1] together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the channel scope check repairs the reported defect, but replacing the adjacent settlement once 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['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 | True | False | Failed |
| 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 / 4ec5da2414002475aa215f219dde981cf3ef31abb96885cd618f6d7931fa6efe
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 (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 | True | False | Failed |
| 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 / 12b490f36452b9625e530da9846e3b18d69c32e326c12b8d7ff00fa82507e146
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.031819+00:00.
Case digest / ee162db8ba3f536aba75764b22f05d2beda6ddd0bc44d09ed96e2d820e36c660