FAILURE MAP
← Case archive

FA-76166 / Chat ordering and read receipts / Open access

Decide which messages start a new visual group: day break · case 01

Messages sent seconds apart across midnight are grouped under the previous day's header.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The day break decision evaluates `head = False` where the contract requires `head = m['ts'] // 86400 != prev['ts'] // 86400`.

VERIFIED REPAIR

Use `head = m['ts'] // 86400 != prev['ts'] // 86400` for the day break decision and keep every other rule of the model unchanged.

Unsuccessful approach: Requiring a full day of elapsed time never splits at midnight. The attempted `head = m['ts'] - prev['ts'] >= 86400` 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 = False
        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 fixtureActualExpectedOutcome
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, False][True, True]Failed
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 / df718674230af0d3134a8982c9ec07f6c6f16e1e5076098720b9dfa7db418a16

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'] - 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 fixtureActualExpectedOutcome
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, False][True, True]Failed
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 / 495c27d95be40f36972a5250feda4ffa953c3fc5aef147cc2ba0033e4645a888

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 fixtureActualExpectedOutcome
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.879297+00:00.

Case digest / 38377021c9dde83c0dba0bd455229d3f909c000b109a2110d6065d699989d4d4