signal-bot/tests
Krzysztof kuhy Rudnicki 8df2646377 feat: weekly, monthly and year-in-review posts, keyed off the day reported
A Sunday closes a week, a month's last day closes the month, and
31 December closes the year. Keyed off the day being *reported* rather
than off today, which is the only reading that stays right when the bot
has been offline: catching up on a week-old Sunday now also posts that
week's summary, and there is a test asserting the five messages a
three-day outage produces.

One scheduler, a date predicate. Three background tasks firing at the
same wall-clock time into the same group is three independent ways for
an evening to go wrong, for no gain over an if-statement. A failed
period summary is deliberately best-effort and runs after the day has
been marked, so it cannot make the bot re-post the daily one tomorrow.

Also: the quote frame arrived while this was being written, and it
carries a trap. `quote` has its own nested `attachments` array holding
the *quoted* message's media -- so a text reply to somebody's photo has
attachments in the payload that belong to somebody else. Reading them
would credit the replier with a photo they did not post, in a group
where people reply to photos constantly, inflating one number without
ever looking wrong.

The parser already read the top level only and is correct. It is now
pinned by a test built from the exact captured frame, and written up in
DOCS-signal-envelopes.md, because "it happens to be right" and "it
cannot silently stop being right" are different things. This is the same
wrong-nesting-level mistake that once made the bot ignore its own
stickers.

test_bot.py went past the 250-line cap on the way, so the report and
catch-up tests move into files named for what they cover.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d48t4qsQLBJnDwDeo2Nom
2026-08-30 19:56:25 +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 feat: survive an outage, and keep the counts that predate the event log 2026-08-30 19:23:53 +02:00
test_stats_commands.py feat: nine commands for asking the statistics questions 2026-08-30 19:49:41 +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 feat: survive an outage, and keep the counts that predate the event log 2026-08-30 19:23:53 +02:00
test_stats_render_period.py feat: nine commands for asking the statistics questions 2026-08-30 19:49:41 +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