FA-76171 / Chat ordering and read receipts / Open access
Decide which messages start a new visual group: previous pointer · case 01
System notices are skipped when tracking the previous message, so the next user message is grouped across the notice.
ROOT CAUSE
The previous pointer decision evaluates `prev = m if m['kind'] != 'system' else prev` where the contract requires `prev = m`.
VERIFIED REPAIR
Use `prev = m` for the previous pointer decision and keep every other rule of the model unchanged.
Unsuccessful approach: Tracking only user messages also skips notices from bots. The attempted `prev = m if m['kind'] == 'user' else prev` still disagrees with a fixture.
Case contract
messages are ascending {author, ts, kind}. A message shows a header (starts a group) when it is the first message, when it or the previous message is a system message, when the author changes, when more than 300 seconds passed since the previous message, or when the UTC day changes. Result: one boolean per message.
Why this case matters
Compact chat layouts hide repeated avatars; wrong grouping attributes messages to the wrong person or time.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(messages):
out = []
prev = None
for m in messages:
if prev is None or m['kind'] == 'system' or prev['kind'] == 'system':
head = True
elif m['author'] != prev['author']:
head = True
elif m['ts'] - prev['ts'] > 300:
head = True
else:
head = m['ts'] // 86400 != prev['ts'] // 86400
out.append(head)
prev = m if m['kind'] != 'system' else prev
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1401, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 13, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259211, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}],), [True, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 2: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1402, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 2000, 'kind': 'user'}, {'author': 'bo', 'ts': 2300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 14, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259212, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}],), [True, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 3: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1403, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 3000, 'kind': 'user'}, {'author': 'bo', 'ts': 3300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 15, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259213, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}],), [True, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 4: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1404, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 4000, 'kind': 'user'}, {'author': 'bo', 'ts': 4300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 16, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259214, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}, {'author': 'bo', 'ts': 460, 'kind': 'user'}],), [True, False, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 5: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1405, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 5000, 'kind': 'user'}, {'author': 'bo', 'ts': 5300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 17, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259215, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}, {'author': 'bo', 'ts': 460, 'kind': 'user'}, {'author': 'bo', 'ts': 520, 'kind': 'user'}],), [True, False, False, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])]}
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 |
|---|---|---|---|
| long pause | [True, True] | [True, True] | Passed |
| exact five minutes | [True, False] | [True, False] | Passed |
| after a system message | [True, True, False] | [True, True, True] | Failed |
| midnight crossing | [True, True] | [True, True] | Passed |
| burst | [True, False, False, False] | [True, False, False, False] | Passed |
| author change | [True, True] | [True, True] | Passed |
| bot notice between | [True, True, True] | [True, True, True] | Passed |
SHA-256 / 5465115ecc2d08277072b5be5e07f52e95fa90bd2712ddd81a9b3eee6ce1b288
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(messages):
out = []
prev = None
for m in messages:
if prev is None or m['kind'] == 'system' or prev['kind'] == 'system':
head = True
elif m['author'] != prev['author']:
head = True
elif m['ts'] - prev['ts'] > 300:
head = True
else:
head = m['ts'] // 86400 != prev['ts'] // 86400
out.append(head)
prev = m if m['kind'] == 'user' else prev
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1401, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 13, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259211, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}],), [True, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 2: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1402, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 2000, 'kind': 'user'}, {'author': 'bo', 'ts': 2300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 14, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259212, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}],), [True, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 3: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1403, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 3000, 'kind': 'user'}, {'author': 'bo', 'ts': 3300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 15, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259213, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}],), [True, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 4: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1404, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 4000, 'kind': 'user'}, {'author': 'bo', 'ts': 4300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 16, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259214, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}, {'author': 'bo', 'ts': 460, 'kind': 'user'}],), [True, False, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 5: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1405, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 5000, 'kind': 'user'}, {'author': 'bo', 'ts': 5300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 17, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259215, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}, {'author': 'bo', 'ts': 460, 'kind': 'user'}, {'author': 'bo', 'ts': 520, 'kind': 'user'}],), [True, False, False, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])]}
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 |
|---|---|---|---|
| long pause | [True, True] | [True, True] | Passed |
| exact five minutes | [True, False] | [True, False] | Passed |
| after a system message | [True, True, False] | [True, True, True] | Failed |
| midnight crossing | [True, True] | [True, True] | Passed |
| burst | [True, False, False, False] | [True, False, False, False] | Passed |
| author change | [True, True] | [True, True] | Passed |
| bot notice between | [True, True, False] | [True, True, True] | Failed |
SHA-256 / db3315301b78d815ed9f0a2d5c56de9cae8ec968145c905e83bc3feeb7160f92
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(messages):
out = []
prev = None
for m in messages:
if prev is None or m['kind'] == 'system' or prev['kind'] == 'system':
head = True
elif m['author'] != prev['author']:
head = True
elif m['ts'] - prev['ts'] > 300:
head = True
else:
head = m['ts'] // 86400 != prev['ts'] // 86400
out.append(head)
prev = m
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1401, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 13, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259211, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}],), [True, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 2: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1402, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 2000, 'kind': 'user'}, {'author': 'bo', 'ts': 2300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 14, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259212, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}],), [True, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 3: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1403, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 3000, 'kind': 'user'}, {'author': 'bo', 'ts': 3300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 15, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259213, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}],), [True, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 4: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1404, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 4000, 'kind': 'user'}, {'author': 'bo', 'ts': 4300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 16, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259214, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}, {'author': 'bo', 'ts': 460, 'kind': 'user'}],), [True, False, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])], 5: [('long pause', ([{'author': 'bo', 'ts': 1000, 'kind': 'user'}, {'author': 'bo', 'ts': 1405, 'kind': 'user'}],), [True, True]), ('exact five minutes', ([{'author': 'bo', 'ts': 5000, 'kind': 'user'}, {'author': 'bo', 'ts': 5300, 'kind': 'user'}],), [True, False]), ('after a system message', ([{'author': 'bo', 'ts': 10, 'kind': 'user'}, {'author': 'bo', 'ts': 11, 'kind': 'system'}, {'author': 'bo', 'ts': 17, 'kind': 'user'}],), [True, True, True]), ('midnight crossing', ([{'author': 'bo', 'ts': 259170, 'kind': 'user'}, {'author': 'bo', 'ts': 259215, 'kind': 'user'}],), [True, True]), ('burst', ([{'author': 'bo', 'ts': 100, 'kind': 'user'}, {'author': 'bo', 'ts': 160, 'kind': 'user'}, {'author': 'bo', 'ts': 220, 'kind': 'user'}, {'author': 'bo', 'ts': 280, 'kind': 'user'}, {'author': 'bo', 'ts': 340, 'kind': 'user'}, {'author': 'bo', 'ts': 400, 'kind': 'user'}, {'author': 'bo', 'ts': 460, 'kind': 'user'}, {'author': 'bo', 'ts': 520, 'kind': 'user'}],), [True, False, False, False, False, False, False, False]), ('author change', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'cy', 'ts': 6, 'kind': 'user'}],), [True, True]), ('bot notice between', ([{'author': 'bo', 'ts': 5, 'kind': 'user'}, {'author': 'bot', 'ts': 6, 'kind': 'notice'}, {'author': 'bo', 'ts': 7, 'kind': 'user'}],), [True, True, True])]}
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 |
|---|---|---|---|
| long pause | [True, True] | [True, True] | Passed |
| exact five minutes | [True, False] | [True, False] | Passed |
| after a system message | [True, True, True] | [True, True, True] | Passed |
| midnight crossing | [True, True] | [True, True] | Passed |
| burst | [True, False, False, False] | [True, False, False, False] | Passed |
| author change | [True, True] | [True, True] | Passed |
| bot notice between | [True, True, True] | [True, True, True] | Passed |
SHA-256 / a967f3c9ab3b4d8b437bf78b8479af86feac54ab64d5dbe9b798dff27d8eea35
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:13.889071+00:00.
Case digest / bb5de51dd4f03355a94644b674983300155fdf8bbd2cf8e4bcc697c78b879047