FAILURE MAP
← Case archive

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

Insert local day separators into a message list: offset sign · case 01

Viewers west of UTC see evening messages under the following day.

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

ROOT CAUSE

The offset sign decision evaluates `(t - offset_min * 60)` where the contract requires `(t + offset_min * 60)`.

VERIFIED REPAIR

Use `(t + offset_min * 60)` for the offset sign decision and keep every other rule of the model unchanged.

Unsuccessful approach: Using the absolute offset still shifts western zones in the wrong direction. The attempted `(t + abs(offset_min) * 60)` still disagrees with a fixture.

Case contract

stamps are ascending unix seconds; offset_min is the viewer's UTC offset in minutes. A separator [index, label] precedes the first message of each local calendar day: "Today" for the local day containing now, "Yesterday" for the one before, otherwise the ISO local date.

Why this case matters

Day headers anchor chat history in time; zone mistakes split or merge days around midnight.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from datetime import date, timedelta
N = 1
observations = []
def solve(stamps, offset_min, now):
    def local_day(t):
        return (t - offset_min * 60) // 86400
    today = local_day(now)
    out = []
    prev = None
    for i, t in enumerate(stamps):
        d = local_day(t)
        if d != prev:
            if d == today:
                label = 'Today'
            elif d == today - 1:
                label = 'Yesterday'
            else:
                label = str(date(1970, 1, 1) + timedelta(days=d))
            out.append([i, label])
            prev = d
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('east of UTC late evening', ([8712000, 8722800], 330, 9072001), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144060), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449601), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355001), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055201), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592201), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 1), [])], 2: [('east of UTC late evening', ([8712000, 8722800], 330, 9072002), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144120), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449602), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355002), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055202), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592202), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 2), [])], 3: [('east of UTC late evening', ([8712000, 8722800], 330, 9072003), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144180), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449603), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355003), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055203), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592203), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 3), [])], 4: [('east of UTC late evening', ([8712000, 8722800], 330, 9072004), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144240), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449604), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355004), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055204), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592204), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100, 605160], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 4), [])], 5: [('east of UTC late evening', ([8712000, 8722800], 330, 9072005), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144300), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449605), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355005), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055205), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592205), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100, 605160, 605220], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 5), [])]}
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
east of UTC late evening[[0, '1970-04-11']][[0, '1970-04-12']]Failed
west of UTC early morning[[0, '1970-07-20']][[0, '1970-07-19'], [1, '1970-07-20']]Failed
today and yesterday[[0, 'Yesterday'], [1, 'Today']][[0, 'Yesterday'], [1, 'Today']]Passed
east of UTC after local midnight[[0, 'Today']][[0, 'Today']]Passed
west of UTC before local midnight[[0, 'Today']][[0, 'Today']]Passed
skewed future message[[0, 'Today'], [1, '1970-02-01']][[0, 'Today'], [1, '1970-02-01']]Passed
many messages one day[[0, '1970-01-07']][[0, '1970-01-08']]Failed
empty[][]Passed

SHA-256 / a5732e970b0e32f2832c7b5f50dfe88bd2608ece29343dd73c0930c40624f6fb

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from datetime import date, timedelta
N = 1
observations = []
def solve(stamps, offset_min, now):
    def local_day(t):
        return (t + abs(offset_min) * 60) // 86400
    today = local_day(now)
    out = []
    prev = None
    for i, t in enumerate(stamps):
        d = local_day(t)
        if d != prev:
            if d == today:
                label = 'Today'
            elif d == today - 1:
                label = 'Yesterday'
            else:
                label = str(date(1970, 1, 1) + timedelta(days=d))
            out.append([i, label])
            prev = d
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('east of UTC late evening', ([8712000, 8722800], 330, 9072001), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144060), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449601), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355001), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055201), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592201), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 1), [])], 2: [('east of UTC late evening', ([8712000, 8722800], 330, 9072002), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144120), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449602), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355002), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055202), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592202), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 2), [])], 3: [('east of UTC late evening', ([8712000, 8722800], 330, 9072003), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144180), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449603), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355003), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055203), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592203), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 3), [])], 4: [('east of UTC late evening', ([8712000, 8722800], 330, 9072004), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144240), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449604), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355004), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055204), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592204), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100, 605160], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 4), [])], 5: [('east of UTC late evening', ([8712000, 8722800], 330, 9072005), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144300), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449605), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355005), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055205), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592205), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100, 605160, 605220], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 5), [])]}
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
east of UTC late evening[[0, '1970-04-12']][[0, '1970-04-12']]Passed
west of UTC early morning[[0, '1970-07-20']][[0, '1970-07-19'], [1, '1970-07-20']]Failed
today and yesterday[[0, 'Yesterday'], [1, 'Today']][[0, 'Yesterday'], [1, 'Today']]Passed
east of UTC after local midnight[[0, 'Today']][[0, 'Today']]Passed
west of UTC before local midnight[[0, 'Today']][[0, 'Today']]Passed
skewed future message[[0, 'Today'], [1, '1970-02-01']][[0, 'Today'], [1, '1970-02-01']]Passed
many messages one day[[0, '1970-01-08']][[0, '1970-01-08']]Passed
empty[][]Passed

SHA-256 / 12cf03fbb69c2a240df2b4f453a9da943e4c5df13c7e9efcc0b5d1b12e2b3bb6

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from datetime import date, timedelta
N = 1
observations = []
def solve(stamps, offset_min, now):
    def local_day(t):
        return (t + offset_min * 60) // 86400
    today = local_day(now)
    out = []
    prev = None
    for i, t in enumerate(stamps):
        d = local_day(t)
        if d != prev:
            if d == today:
                label = 'Today'
            elif d == today - 1:
                label = 'Yesterday'
            else:
                label = str(date(1970, 1, 1) + timedelta(days=d))
            out.append([i, label])
            prev = d
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('east of UTC late evening', ([8712000, 8722800], 330, 9072001), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144060), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449601), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355001), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055201), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592201), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 1), [])], 2: [('east of UTC late evening', ([8712000, 8722800], 330, 9072002), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144120), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449602), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355002), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055202), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592202), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 2), [])], 3: [('east of UTC late evening', ([8712000, 8722800], 330, 9072003), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144180), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449603), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355003), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055203), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592203), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 3), [])], 4: [('east of UTC late evening', ([8712000, 8722800], 330, 9072004), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144240), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449604), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355004), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055204), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592204), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100, 605160], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 4), [])], 5: [('east of UTC late evening', ([8712000, 8722800], 330, 9072005), [[0, '1970-04-12']]), ('west of UTC early morning', ([17287200, 17301600], -300, 18144300), [[0, '1970-07-19'], [1, '1970-07-20']]), ('today and yesterday', ([4402800, 4442400, 4446000], 0, 4449605), [[0, 'Yesterday'], [1, 'Today']]), ('east of UTC after local midnight', ([5350200], 120, 5355005), [[0, 'Today']]), ('west of UTC before local midnight', ([6051600], -300, 6055205), [[0, 'Today']]), ('skewed future message', ([2592100, 2678500], 0, 2592205), [[0, 'Today'], [1, '1970-02-01']]), ('many messages one day', ([604800, 604860, 604920, 604980, 605040, 605100, 605160, 605220], 60, 777600), [[0, '1970-01-08']]), ('empty', ([], 0, 5), [])]}
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
east of UTC late evening[[0, '1970-04-12']][[0, '1970-04-12']]Passed
west of UTC early morning[[0, '1970-07-19'], [1, '1970-07-20']][[0, '1970-07-19'], [1, '1970-07-20']]Passed
today and yesterday[[0, 'Yesterday'], [1, 'Today']][[0, 'Yesterday'], [1, 'Today']]Passed
east of UTC after local midnight[[0, 'Today']][[0, 'Today']]Passed
west of UTC before local midnight[[0, 'Today']][[0, 'Today']]Passed
skewed future message[[0, 'Today'], [1, '1970-02-01']][[0, 'Today'], [1, '1970-02-01']]Passed
many messages one day[[0, '1970-01-08']][[0, '1970-01-08']]Passed
empty[][]Passed

SHA-256 / 2d1bba23be0cda4bfe97be3269edb778eb4cd20321bb17d200d1221ddc34c65a

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

Case digest / 1eeafc2538093e900b0905b661464dd87dfdc73ba8aa4ed0a198d3ab086edfc6