signal-bot/signal_bot/stats
Krzysztof kuhy Rudnicki 8354d9bcde fix: !ja told everybody their favourite hour was noon
Reported from the group: the same "Najczęściej piszesz między 12:00 a
13:00" line came back for Mithra and for Michał Faron, which is too much
of a coincidence to be a statistic.

It was the backfill. The 342 messages carried over from the pre-0.1.0
counter have no timestamps, so the seeded rows got a placeholder hour of
12 -- and favourite_hour was the one query that never excluded the
backfilled day. For every person those synthetic noons outnumbered every
real message they had sent since, so all seven got the same answer. The
genuine hours are 19-21: this group talks in the evening.

The comment above that placeholder said "the day is marked anyway, so
nothing that cares about hours will read these", which is exactly the
kind of reasoning that stops being true the moment somebody adds a
query. So the fix is not another `exclude` argument to remember: the
absent hour is now -1, which no real hour can be, and hour queries
filter `local_hour >= 0`. Forgetting the exclusion can no longer invent
an answer, and night_owl gets the same guard even though its 0..2 window
happened to miss the old placeholder.

Live database migrated with the service stopped and a backup taken: 342
rows moved from noon to unknown. Verified afterwards on the real data --
Mithra 19:00, Michał Faron 19:00, kuhy 20:00, and the two people whose
only messages are backfilled correctly get no hour line at all.

Not released. Sitting at 0.1.1 until kuhy says otherwise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d48t4qsQLBJnDwDeo2Nom
2026-08-30 20:15:20 +02:00
..
__init__.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
backfill.py fix: !ja told everybody their favourite hour was noon 2026-08-30 20:15:20 +02:00
commands.py release: 0.1.1 «Pius I» — commands that explain themselves 2026-08-30 20:09:14 +02:00
curiosities.py fix: !ja told everybody their favourite hour was noon 2026-08-30 20:15:20 +02:00
events.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
facts.py feat: the nightly post notices things 2026-08-30 19:43:55 +02:00
highlights.py feat: nine commands for asking the statistics questions 2026-08-30 19:49:41 +02:00
nightly.py feat: weekly, monthly and year-in-review posts, keyed off the day reported 2026-08-30 19:56:25 +02:00
periods.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
queries_day.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
queries_period.py feat: periods, records and the crown 2026-08-30 19:38:54 +02:00
recorder.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
records.py feat: the nightly post notices things 2026-08-30 19:43:55 +02:00
render_day.py release: 0.1.1 «Pius I» — commands that explain themselves 2026-08-30 20:09:14 +02:00
render_extra.py fix: !ja told everybody their favourite hour was noon 2026-08-30 20:15:20 +02:00
render_period.py feat: nine commands for asking the statistics questions 2026-08-30 19:49:41 +02:00
streaks.py feat: periods, records and the crown 2026-08-30 19:38:54 +02:00
text.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00