FA-76006 / Chat ordering and read receipts / Open access
Insert local day separators into a message list: offset units · case 01
A viewer several hours east of UTC sees evening messages under the wrong day.
ROOT CAUSE
The offset units decision evaluates `offset_min` where the contract requires `offset_min * 60`.
VERIFIED REPAIR
Use `offset_min * 60` for the offset units decision and keep every other rule of the model unchanged.
Unsuccessful approach: Treating the offset as an hhmm number still misplaces fractional-hour zones and whole-hour zones alike. The attempted `offset_min * 100` 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) // 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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-08']] | [[0, '1970-01-08']] | Passed |
| empty | [] | [] | Passed |
SHA-256 / 91caab3a1e64e666a08354c97debcaaba806039f2287975ab5b9221243a86eb7
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 + offset_min * 100) // 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| east of UTC late evening | [[0, '1970-04-12']] | [[0, '1970-04-12']] | Passed |
| west of UTC early morning | [[0, '1970-07-19']] | [[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 / 2b6e2b30662b9239757f92793fdca697141542700910883e1b36ceb194b63987
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.200308+00:00.
Case digest / e2e83baf861abc533cde23643680eed4d69362d6a997edc6641401f22b96e6c0