FAILURE MAP
← Case archive

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

Place the "new messages" divider in a loaded window: no divider sentinel · case 01

When nothing is unread the divider is drawn at the end of the list instead of being omitted.

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

ROOT CAUSE

The no divider sentinel decision evaluates `index = len(messages)` where the contract requires `index = None`.

THE FAILURE

The no divider sentinel decision evaluates `index = len(messages)` where the contract requires `index = None`.

Unsuccessful approach: Using -1 as the sentinel is interpreted by the list as the last row. The attempted `index = -1` still disagrees with a fixture.

Case contract

messages are ascending [seq, author] pairs of the loaded window that starts at window_start. Sending a message implies having read everything before it, so the effective marker is the larger of marker and the highest seq authored by me. The divider goes before the first loaded message after the effective marker not written by me (index, or None). older_unread is true when some unread seq lies before the loaded window (effective marker < window_start - 1).

Why this case matters

The divider tells users where to resume reading; misplacing it hides or repeats unread history.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(messages, me, marker, window_start):
    eff = marker
    for seq, author in messages:
        if author == me and seq > eff:
            eff = seq
    index = len(messages)
    for i, (seq, author) in enumerate(messages):
        if seq > eff and author != me:
            index = i
            break
    return {'index': index, 'older_unread': eff < window_start - 1}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('interleaved own replies', ([[11, 'bo'], [12, 'me'], [13, 'bo'], [14, 'me'], [15, 'cy']], 'me', 10, 11), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [22, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 7, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 2: [('interleaved own replies', ([[12, 'bo'], [13, 'me'], [14, 'bo'], [15, 'me'], [16, 'cy']], 'me', 11, 12), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [23, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 8, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 3: [('interleaved own replies', ([[13, 'bo'], [14, 'me'], [15, 'bo'], [16, 'me'], [17, 'cy']], 'me', 12, 13), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [24, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 9, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 4: [('interleaved own replies', ([[14, 'bo'], [15, 'me'], [16, 'bo'], [17, 'me'], [18, 'cy']], 'me', 13, 14), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [25, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 10, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 5: [('interleaved own replies', ([[15, 'bo'], [16, 'me'], [17, 'bo'], [18, 'me'], [19, 'cy']], 'me', 14, 15), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [26, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 11, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})]}
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
interleaved own replies{'index': 4, 'older_unread': False}{'index': 4, 'older_unread': False}Passed
window starts right after marker{'index': 0, 'older_unread': False}{'index': 0, 'older_unread': False}Passed
one unloaded unread{'index': 0, 'older_unread': True}{'index': 0, 'older_unread': True}Passed
all read{'index': 2, 'older_unread': False}{'index': None, 'older_unread': False}Failed
only own messages after marker{'index': 2, 'older_unread': False}{'index': None, 'older_unread': False}Failed
first unread foreign{'index': 1, 'older_unread': False}{'index': 1, 'older_unread': False}Passed

SHA-256 / 532aa380c9836f2022156356abe2b80fa6e87832fa6f0819ea38af33c8ed146a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(messages, me, marker, window_start):
    eff = marker
    for seq, author in messages:
        if author == me and seq > eff:
            eff = seq
    index = -1
    for i, (seq, author) in enumerate(messages):
        if seq > eff and author != me:
            index = i
            break
    return {'index': index, 'older_unread': eff < window_start - 1}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('interleaved own replies', ([[11, 'bo'], [12, 'me'], [13, 'bo'], [14, 'me'], [15, 'cy']], 'me', 10, 11), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [22, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 7, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 2: [('interleaved own replies', ([[12, 'bo'], [13, 'me'], [14, 'bo'], [15, 'me'], [16, 'cy']], 'me', 11, 12), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [23, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 8, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 3: [('interleaved own replies', ([[13, 'bo'], [14, 'me'], [15, 'bo'], [16, 'me'], [17, 'cy']], 'me', 12, 13), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [24, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 9, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 4: [('interleaved own replies', ([[14, 'bo'], [15, 'me'], [16, 'bo'], [17, 'me'], [18, 'cy']], 'me', 13, 14), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [25, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 10, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})], 5: [('interleaved own replies', ([[15, 'bo'], [16, 'me'], [17, 'bo'], [18, 'me'], [19, 'cy']], 'me', 14, 15), {'index': 4, 'older_unread': False}), ('window starts right after marker', ([[20, 'bo'], [21, 'bo']], 'me', 19, 20), {'index': 0, 'older_unread': False}), ('one unloaded unread', ([[20, 'bo'], [26, 'bo']], 'me', 18, 20), {'index': 0, 'older_unread': True}), ('all read', ([[5, 'bo'], [6, 'cy']], 'me', 11, 5), {'index': None, 'older_unread': False}), ('only own messages after marker', ([[1, 'bo'], [2, 'me']], 'me', 1, 1), {'index': None, 'older_unread': False}), ('first unread foreign', ([[3, 'bo'], [4, 'cy'], [5, 'dd']], 'me', 3, 3), {'index': 1, 'older_unread': False})]}
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
interleaved own replies{'index': 4, 'older_unread': False}{'index': 4, 'older_unread': False}Passed
window starts right after marker{'index': 0, 'older_unread': False}{'index': 0, 'older_unread': False}Passed
one unloaded unread{'index': 0, 'older_unread': True}{'index': 0, 'older_unread': True}Passed
all read{'index': -1, 'older_unread': False}{'index': None, 'older_unread': False}Failed
only own messages after marker{'index': -1, 'older_unread': False}{'index': None, 'older_unread': False}Failed
first unread foreign{'index': 1, 'older_unread': False}{'index': 1, 'older_unread': False}Passed

SHA-256 / 0a4f04a19b801719145cd4d7e88221bc077420a7bf904edf601d308b7898451a

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 7731685c08326b9bada11bdb679b0a7b613a53272f872673929833b6107b89ec