FA-76156 / Chat ordering and read receipts / Open access
Decide which messages start a new visual group: gap threshold · case 01
Messages exactly five minutes apart are split, or long pauses are not split at all.
ROOT CAUSE
The gap threshold decision evaluates `m['ts'] - prev['ts'] >= 300` where the contract requires `m['ts'] - prev['ts'] > 300`.
VERIFIED REPAIR
Use `m['ts'] - prev['ts'] > 300` for the gap threshold decision and keep every other rule of the model unchanged.
Unsuccessful approach: Comparing against milliseconds never splits groups for second-based timestamps. The attempted `m['ts'] - prev['ts'] > 300000` 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
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, True] | [True, False] | Failed |
| 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 / 1d3f1604c05b5f20ce969dfd400e8356583c7ccb9a38b0aba64de012292259f9
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'] > 300000:
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, False] | [True, True] | Failed |
| 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 / 100c07a1b5e8c6b800a48cd09fda0cd7dd0c31cf35becb855789f5be1f2559e6
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.573339+00:00.
Case digest / 1c1025f44ff549978be963d46da595f404f0e5e32ab9f8195a34dca2f50587bf