FA-75931 / Chat ordering and read receipts / Open access
Summarize group delivery and read receipts for one message: status precedence · case 01
Fully read messages are shown with delivered ticks because the delivered test runs first.
ROOT CAUSE
The status precedence decision evaluates `elif len(got) == len(recipients): status = 'delivered' elif len(has_read) == len(recipients): status = 'read'` where the contract requires `elif len(has_read) == len(recipients): status = 'read' elif len(got) == len(recipients): status = 'delivered'`.
VERIFIED REPAIR
Use `elif len(has_read) == len(recipients): status = 'read' elif len(got) == len(recipients): status = 'delivered'` for the status precedence decision and keep every other rule of the model unchanged.
Unsuccessful approach: Declaring read as soon as one recipient reads overstates group progress. The attempted `elif len(has_read) >= 1: status = 'read' elif len(got) == len(recipients): status = 'delivered'` still disagrees with a fixture.
Case contract
Recipients are members other than the sender whose joined_at (first visible seq, default 0) is <= sent_seq. A recipient has read the message when read[u] (their read marker) >= sent_seq; reading implies delivery. Status is "sent" with no recipients, "read" when every recipient read, "delivered" when every recipient got it, else "sent". Result {status, read_by (sorted), recipients (count)}.
Why this case matters
Group tick marks summarise many receipts; wrong membership or thresholds show false "read" states.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(sender, members, joined_at, sent_seq, delivered, read):
recipients = [u for u in members if u != sender and joined_at.get(u, 0) <= sent_seq]
has_read = [u for u in recipients if read.get(u, -1) >= sent_seq]
got = [u for u in recipients if delivered.get(u) or u in has_read]
if not recipients:
status = 'sent'
elif len(got) == len(recipients):
status = 'delivered'
elif len(has_read) == len(recipients):
status = 'read'
else:
status = 'sent'
return {'status': status, 'read_by': sorted(has_read), 'recipients': len(recipients)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 21}, 11, {'bo': True}, {'bo': 16}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 10}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 5}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 1, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 5, {'bo': True}, {'cy': 5}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 2: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 22}, 12, {'bo': True}, {'bo': 17}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 11}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 6}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 2, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 6, {'bo': True}, {'cy': 6}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 3: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 23}, 13, {'bo': True}, {'bo': 18}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 7}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 3, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 7, {'bo': True}, {'cy': 7}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 4: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 24}, 14, {'bo': True}, {'bo': 19}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 13}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 8}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 4, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 8, {'bo': True}, {'cy': 8}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 5: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 25}, 15, {'bo': True}, {'bo': 20}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 14}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 9}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 5, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 9, {'bo': True}, {'cy': 9}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})]}
for _label, _args, _expected in _CASES[N]:
check(_label, solve(*_args), _expected)
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 |
|---|---|---|---|
| late joiner does not block read | {'read_by': ['bo'], 'recipients': 1, 'status': 'delivered'} | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | Failed |
| member joined exactly at the message | {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'} | {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'} | Passed |
| read marker beyond message | {'read_by': ['bo'], 'recipients': 1, 'status': 'delivered'} | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | Failed |
| read without delivery ack | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | Passed |
| everyone read | {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'delivered'} | {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'} | Failed |
| sender alone | {'read_by': [], 'recipients': 0, 'status': 'sent'} | {'read_by': [], 'recipients': 0, 'status': 'sent'} | Passed |
| read exactly without ack | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | Passed |
| partial delivery | {'read_by': [], 'recipients': 3, 'status': 'sent'} | {'read_by': [], 'recipients': 3, 'status': 'sent'} | Passed |
SHA-256 / 4ff2dabb7fb70714291051c68c32e47d89eecf7d76546f146ce191ba44af0394
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(sender, members, joined_at, sent_seq, delivered, read):
recipients = [u for u in members if u != sender and joined_at.get(u, 0) <= sent_seq]
has_read = [u for u in recipients if read.get(u, -1) >= sent_seq]
got = [u for u in recipients if delivered.get(u) or u in has_read]
if not recipients:
status = 'sent'
elif len(has_read) >= 1:
status = 'read'
elif len(got) == len(recipients):
status = 'delivered'
else:
status = 'sent'
return {'status': status, 'read_by': sorted(has_read), 'recipients': len(recipients)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 21}, 11, {'bo': True}, {'bo': 16}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 10}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 5}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 1, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 5, {'bo': True}, {'cy': 5}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 2: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 22}, 12, {'bo': True}, {'bo': 17}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 11}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 6}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 2, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 6, {'bo': True}, {'cy': 6}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 3: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 23}, 13, {'bo': True}, {'bo': 18}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 7}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 3, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 7, {'bo': True}, {'cy': 7}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 4: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 24}, 14, {'bo': True}, {'bo': 19}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 13}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 8}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 4, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 8, {'bo': True}, {'cy': 8}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 5: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 25}, 15, {'bo': True}, {'bo': 20}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 14}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 9}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 5, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 9, {'bo': True}, {'cy': 9}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})]}
for _label, _args, _expected in _CASES[N]:
check(_label, solve(*_args), _expected)
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 |
|---|---|---|---|
| late joiner does not block read | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | Passed |
| member joined exactly at the message | {'read_by': ['bo'], 'recipients': 2, 'status': 'read'} | {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'} | Failed |
| read marker beyond message | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | Passed |
| read without delivery ack | {'read_by': ['cy'], 'recipients': 2, 'status': 'read'} | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | Failed |
| everyone read | {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'} | {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'} | Passed |
| sender alone | {'read_by': [], 'recipients': 0, 'status': 'sent'} | {'read_by': [], 'recipients': 0, 'status': 'sent'} | Passed |
| read exactly without ack | {'read_by': ['cy'], 'recipients': 2, 'status': 'read'} | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | Failed |
| partial delivery | {'read_by': [], 'recipients': 3, 'status': 'sent'} | {'read_by': [], 'recipients': 3, 'status': 'sent'} | Passed |
SHA-256 / 30da85efc767ef233394b483a0b948eb4539773dfcecdd5ff49054f421a500b2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(sender, members, joined_at, sent_seq, delivered, read):
recipients = [u for u in members if u != sender and joined_at.get(u, 0) <= sent_seq]
has_read = [u for u in recipients if read.get(u, -1) >= sent_seq]
got = [u for u in recipients if delivered.get(u) or u in has_read]
if not recipients:
status = 'sent'
elif len(has_read) == len(recipients):
status = 'read'
elif len(got) == len(recipients):
status = 'delivered'
else:
status = 'sent'
return {'status': status, 'read_by': sorted(has_read), 'recipients': len(recipients)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 21}, 11, {'bo': True}, {'bo': 16}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 10}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 5}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 1, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 5, {'bo': True}, {'cy': 5}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 2: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 22}, 12, {'bo': True}, {'bo': 17}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 11}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 6}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 2, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 6, {'bo': True}, {'cy': 6}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 3: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 23}, 13, {'bo': True}, {'bo': 18}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 7}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 3, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 7, {'bo': True}, {'cy': 7}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 4: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 24}, 14, {'bo': True}, {'bo': 19}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 13}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 8}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 4, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 8, {'bo': True}, {'cy': 8}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})], 5: [('late joiner does not block read', ('al', ['al', 'bo', 'cy'], {'cy': 25}, 15, {'bo': True}, {'bo': 20}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('member joined exactly at the message', ('al', ['al', 'bo', 'cy'], {'cy': 12}, 12, {'bo': True, 'cy': True}, {'bo': 12}), {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'}), ('read marker beyond message', ('al', ['al', 'bo'], {}, 7, {}, {'bo': 14}), {'read_by': ['bo'], 'recipients': 1, 'status': 'read'}), ('read without delivery ack', ('al', ['al', 'bo', 'cy'], {}, 4, {'bo': True}, {'cy': 9}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('everyone read', ('al', ['al', 'bo', 'cy'], {}, 3, {'bo': True, 'cy': True}, {'bo': 3, 'cy': 5}), {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'}), ('sender alone', ('al', ['al'], {}, 5, {}, {}), {'read_by': [], 'recipients': 0, 'status': 'sent'}), ('read exactly without ack', ('al', ['al', 'bo', 'cy'], {}, 9, {'bo': True}, {'cy': 9}), {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'}), ('partial delivery', ('al', ['al', 'bo', 'cy', 'di'], {}, 2, {'bo': True, 'cy': True}, {'bo': 1}), {'read_by': [], 'recipients': 3, 'status': 'sent'})]}
for _label, _args, _expected in _CASES[N]:
check(_label, solve(*_args), _expected)
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 |
|---|---|---|---|
| late joiner does not block read | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | Passed |
| member joined exactly at the message | {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'} | {'read_by': ['bo'], 'recipients': 2, 'status': 'delivered'} | Passed |
| read marker beyond message | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | {'read_by': ['bo'], 'recipients': 1, 'status': 'read'} | Passed |
| read without delivery ack | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | Passed |
| everyone read | {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'} | {'read_by': ['bo', 'cy'], 'recipients': 2, 'status': 'read'} | Passed |
| sender alone | {'read_by': [], 'recipients': 0, 'status': 'sent'} | {'read_by': [], 'recipients': 0, 'status': 'sent'} | Passed |
| read exactly without ack | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | {'read_by': ['cy'], 'recipients': 2, 'status': 'delivered'} | Passed |
| partial delivery | {'read_by': [], 'recipients': 3, 'status': 'sent'} | {'read_by': [], 'recipients': 3, 'status': 'sent'} | Passed |
SHA-256 / aeaa22a0b07474d2a6583ab95130f52f4b30e34fd4251e0ecfc3c01b301740eb
Verification & scope
Stipulated offline chat model; not a complete messaging protocol, client or server implementation. 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:49:11.534164+00:00.
Case digest / 8e57027d6bffb97cd25ae2009c5e35d290e2c99144796ae4582c5ae0f5247c11