FAILURE MAP
← Case archive

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

Choose which queued sends to dispatch now: due inclusive · case 01

A retry scheduled for exactly now waits an extra tick.

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

ROOT CAUSE

The due inclusive decision evaluates `if m['next_try'] < now:` where the contract requires `if m['next_try'] <= now:`.

VERIFIED REPAIR

Use `if m['next_try'] <= now:` for the due inclusive decision and keep every other rule of the model unchanged.

Unsuccessful approach: A one-tick grace dispatches retries before their scheduled time. The attempted `if m['next_try'] <= now + 1:` still disagrees with a fixture.

Case contract

outbox items {nonce, conv, order, next_try}. Per conversation, messages are sent strictly in numeric `order`: the head is the lowest-order message that is neither acknowledged nor dead (failed attempts >= 5). Dead messages are skipped without blocking. The head is dispatched when next_try <= now; later messages always wait for it. Result: nonces to dispatch, by conversation id then order.

Why this case matters

Outboxes must preserve per-conversation order across retries without letting a dead message block the queue.

1 / The failure

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

N = 1
observations = []
def solve(outbox, acked, failed, now):
    done = set(acked)
    out = []
    by_conv = {}
    for m in outbox:
        by_conv.setdefault(m['conv'], []).append(m)
    for conv in sorted(by_conv):
        for m in sorted(by_conv[conv], key=lambda m: m['order']):
            if m['nonce'] in done:
                continue
            if failed.get(m['nonce'], 0) >= 5:
                continue
            if m['next_try'] < now:
                out.append(m['nonce'])
            break
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 101}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 41}], [], {}, 41), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 1), ['p', 'q'])], 2: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 102}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 5}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 42}], [], {}, 42), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 2), ['p', 'q'])], 3: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 103}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 43}], [], {}, 43), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 3), ['p', 'q'])], 4: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 104}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 5}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 44}], [], {}, 44), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 4), ['p', 'q'])], 5: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 105}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 45}], [], {}, 45), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 5), ['p', 'q'])]}
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
head not yet due[][]Passed
dead head skipped['d2']['d2']Passed
due exactly now[]['e1']Failed
one tick early[][]Passed
acked head['g2']['g2']Passed
numeric order beyond nine['h9']['h9']Passed
two conversations['p', 'q']['p', 'q']Passed

SHA-256 / 64189f972f36315d7831c6ee8ce1ead20aa059e2a261b37a41118126f096bb3e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(outbox, acked, failed, now):
    done = set(acked)
    out = []
    by_conv = {}
    for m in outbox:
        by_conv.setdefault(m['conv'], []).append(m)
    for conv in sorted(by_conv):
        for m in sorted(by_conv[conv], key=lambda m: m['order']):
            if m['nonce'] in done:
                continue
            if failed.get(m['nonce'], 0) >= 5:
                continue
            if m['next_try'] <= now + 1:
                out.append(m['nonce'])
            break
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 101}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 41}], [], {}, 41), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 1), ['p', 'q'])], 2: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 102}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 5}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 42}], [], {}, 42), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 2), ['p', 'q'])], 3: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 103}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 43}], [], {}, 43), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 3), ['p', 'q'])], 4: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 104}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 5}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 44}], [], {}, 44), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 4), ['p', 'q'])], 5: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 105}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 45}], [], {}, 45), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 5), ['p', 'q'])]}
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
head not yet due[][]Passed
dead head skipped['d2']['d2']Passed
due exactly now['e1']['e1']Passed
one tick early['f1'][]Failed
acked head['g2']['g2']Passed
numeric order beyond nine['h9']['h9']Passed
two conversations['p', 'q']['p', 'q']Passed

SHA-256 / 4d9219d3c1703ececfeb3b7c59aa94834a45703685d838918831202a322b5cf9

3 / The verified repair

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

N = 1
observations = []
def solve(outbox, acked, failed, now):
    done = set(acked)
    out = []
    by_conv = {}
    for m in outbox:
        by_conv.setdefault(m['conv'], []).append(m)
    for conv in sorted(by_conv):
        for m in sorted(by_conv[conv], key=lambda m: m['order']):
            if m['nonce'] in done:
                continue
            if failed.get(m['nonce'], 0) >= 5:
                continue
            if m['next_try'] <= now:
                out.append(m['nonce'])
            break
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 101}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 41}], [], {}, 41), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 1), ['p', 'q'])], 2: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 102}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 5}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 42}], [], {}, 42), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 2), ['p', 'q'])], 3: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 103}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 43}], [], {}, 43), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 3), ['p', 'q'])], 4: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 104}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 5}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 44}], [], {}, 44), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 4), ['p', 'q'])], 5: [('head not yet due', ([{'nonce': 'a1', 'conv': 'c', 'order': 1, 'next_try': 105}, {'nonce': 'a2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {}, 50), []), ('dead head skipped', ([{'nonce': 'd1', 'conv': 'c', 'order': 1, 'next_try': 999}, {'nonce': 'd2', 'conv': 'c', 'order': 2, 'next_try': 0}], [], {'d1': 6}, 10), ['d2']), ('due exactly now', ([{'nonce': 'e1', 'conv': 'k', 'order': 3, 'next_try': 45}], [], {}, 45), ['e1']), ('one tick early', ([{'nonce': 'f1', 'conv': 'k', 'order': 1, 'next_try': 41}], [], {}, 40), []), ('acked head', ([{'nonce': 'g1', 'conv': 'c', 'order': 2, 'next_try': 0}, {'nonce': 'g2', 'conv': 'c', 'order': 3, 'next_try': 0}], ['g1'], {}, 5), ['g2']), ('numeric order beyond nine', ([{'nonce': 'h10', 'conv': 'z', 'order': 10, 'next_try': 0}, {'nonce': 'h9', 'conv': 'z', 'order': 9, 'next_try': 0}], [], {}, 1), ['h9']), ('two conversations', ([{'nonce': 'q', 'conv': 'b', 'order': 1, 'next_try': 0}, {'nonce': 'p', 'conv': 'a', 'order': 1, 'next_try': 0}, {'nonce': 'r', 'conv': 'a', 'order': 2, 'next_try': 0}], [], {}, 5), ['p', 'q'])]}
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
head not yet due[][]Passed
dead head skipped['d2']['d2']Passed
due exactly now['e1']['e1']Passed
one tick early[][]Passed
acked head['g2']['g2']Passed
numeric order beyond nine['h9']['h9']Passed
two conversations['p', 'q']['p', 'q']Passed

SHA-256 / d123b5c364725e4f0952ac0d793a0b1723cd8f4bda4d6193450a2ae1a19acc8b

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

Case digest / 310a7d475ca7653fe6a9e824dd2bcaa4ff44d002d43bb54eefa2ee9cded78e51