signal-bot/tests
Krzysztof kuhy Rudnicki 0e0c9ba619 feat: the nightly post notices things
Around twenty things could be said about a day. Saying all of them is a
wall nobody reads; saying whichever three are computed first is
arbitrary. So each candidate declares a priority and a magnitude and the
picker takes the top few, with two rules that make the result readable:
one line per family, so "set a record", "had 60% of the day" and "kept
the crown" do not become three sentences about the same person; and
fully deterministic ordering, so a day renders identically twice.

Nine candidates so far: personal records with what they beat, the
group's busiest day ever, a photo record, crown streaks (naming everyone
when it is shared), a silence broken, a monologue, one person dominating
the day, an unusual showing for that weekday, and a night owl.

Every candidate is (DayFacts) -> Highlight | None with the same
signature. On day one of this release almost all of them return None,
and a shape where "not yet" is the ordinary case is much easier to get
right than one where every guard is bespoke.

Two off-by-ones fixed by writing the sentence out and checking it:

- "odezwał się po 3 dniach ciszy" was counting four. The day somebody
  last spoke is not silent, and neither is the day they came back on, so
  the gap excludes both ends. The function is now named for that.
- A personal record on somebody's first ever day was being announced as
  a record. It is, trivially, and saying so every time is noise.

Verified against the live database, read-only on a copy: the real group
renders correctly at 324 messages, claims no average length for the
backfilled day, and fires no highlights at all -- which is right, since
there is one day of history for them to stand against.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d48t4qsQLBJnDwDeo2Nom
2026-08-30 19:43:55 +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.py feat: survive an outage, and keep the counts that predate the event log 2026-08-30 19:23:53 +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: the message event log, and the nightly report built on it 2026-08-30 19:14:43 +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 feat: survive an outage, and keep the counts that predate the event log 2026-08-30 19:23:53 +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: survive an outage, and keep the counts that predate the event log 2026-08-30 19:23:53 +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 feat: survive an outage, and keep the counts that predate the event log 2026-08-30 19:23:53 +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