signal-bot/tests
Krzysztof kuhy Rudnicki 40538b89a1 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 Ala and for Jan Nowak, 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 --
Ala 19:00, Jan Nowak 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: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
conftest.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
stats_seed.py feat: periods, records and the crown 2026-08-30 19:38:54 +02:00
test_allowlist.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
test_animals.py fix: !gekon really is random (iNaturalist ignores order_by=random) 2026-08-29 23:35:53 +02:00
test_announce.py feat: name every release after a pope, and tell the group when one lands 2026-08-29 22:51:20 +02:00
test_app.py fix: a signal-api that is not up yet no longer kills the bot at boot 2026-08-30 15:23:42 +02:00
test_bot_catchup.py feat: weekly, monthly and year-in-review posts, keyed off the day reported 2026-08-30 19:56:25 +02:00
test_bot_report.py feat: weekly, monthly and year-in-review posts, keyed off the day reported 2026-08-30 19:56:25 +02:00
test_bot.py feat: weekly, monthly and year-in-review posts, keyed off the day reported 2026-08-30 19:56:25 +02:00
test_changelog.py feat: name every release after a pope, and tell the group when one lands 2026-08-29 22:51:20 +02:00
test_cli.py feat: discover groups from the account, so adding the bot is the whole setup 2026-08-29 15:30:08 +02:00
test_config.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_counting.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_decorators.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_discovery.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_dispatcher.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_envelope_shape.py feat: the bot can describe an envelope without quoting anybody 2026-08-30 19:29:06 +02:00
test_fake_account.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
test_fake_groups.py feat: discover groups from the account, so adding the bot is the whole setup 2026-08-29 15:30:08 +02:00
test_fake_server.py release: 0.0.7 «Telesfor» — !papież, and the bot can test itself 2026-08-30 17:06:25 +02:00
test_folding.py fix: commands resolve when typed on another alphabet's keyboard 2026-08-30 14:22:43 +02:00
test_healthz.py fix: a signal-api that is not up yet no longer kills the bot at boot 2026-08-30 15:23:42 +02:00
test_http_client.py feat: !gekon posts a research-grade gecko photo 2026-08-29 23:26:40 +02:00
test_liveness.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
test_logging_setup.py feat: the bot can describe an envelope without quoting anybody 2026-08-30 19:29:06 +02:00
test_main.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_membership.py feat: discover groups from the account, so adding the bot is the whole setup 2026-08-29 15:30:08 +02:00
test_models.py feat: weekly, monthly and year-in-review posts, keyed off the day reported 2026-08-30 19:56:25 +02:00
test_popes_command.py release: 0.0.7 «Telesfor» — !papież, and the bot can test itself 2026-08-30 17:06:25 +02:00
test_portcheck.py feat: make the bot actually reply on Signal, and gate every way it went silent 2026-08-29 14:37:27 +02:00
test_portraits.py release: 0.0.7 «Telesfor» — !papież, and the bot can test itself 2026-08-30 17:06:25 +02:00
test_quoting.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
test_registry.py release: 0.0.7 «Telesfor» — !papież, and the bot can test itself 2026-08-30 17:06:25 +02:00
test_scenario.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
test_scheduler.py feat: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
test_selftest.py release: 0.0.7 «Telesfor» — !papież, and the bot can test itself 2026-08-30 17:06:25 +02:00
test_startup.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_stats_backfill.py fix: !ja told everybody their favourite hour was noon 2026-08-30 20:15:20 +02:00
test_stats_commands.py fix: !ja told everybody their favourite hour was noon 2026-08-30 20:15:20 +02:00
test_stats_curiosities.py feat: the nightly post notices things 2026-08-30 19:43:55 +02:00
test_stats_events.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_stats_nightly.py feat: weekly, monthly and year-in-review posts, keyed off the day reported 2026-08-30 19:56:25 +02:00
test_stats_periods.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_stats_queries_period.py feat: periods, records and the crown 2026-08-30 19:38:54 +02:00
test_stats_records.py feat: the nightly post notices things 2026-08-30 19:43:55 +02:00
test_stats_render_day.py release: 0.1.1 «Pius I» — commands that explain themselves 2026-08-30 20:09:14 +02:00
test_stats_render_period.py release: 0.1.1 «Pius I» — commands that explain themselves 2026-08-30 20:09:14 +02:00
test_stats_streaks.py feat: periods, records and the crown 2026-08-30 19:38:54 +02:00
test_stats_text.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_store.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_transport_base.py feat: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
test_transport_fake.py feat: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
test_transport_rest.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
test_trust.py feat: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +02:00
test_versioning.py release: 0.0.7 «Telesfor» — !papież, and the bot can test itself 2026-08-30 17:06:25 +02:00