Feat/summary readiness gate - #1
Merged
Merged
Conversation
Daily/weekly/monthly summaries were posted the moment the period closed, before the explorer finished indexing/enriching/deriving it — yielding "0 winning tickets / 0 ETH" rollups that were then permanently watermarked and never corrected. Gate each post behind, in order: 1. Settlement floor — never post before period_close + settle_<cadence>. 2. Enrichment — usd_rows_priced >= ticket_count. 3. Local cross-check — rollup ticket_count must be >= the WinningTicketRedeemed events the bot already ingested for the window. 4. Stability — figures unchanged since the previous poll (summary_snapshots). The watermark is written only on a ready (or backstop) post. Past SUMMARY_MAX_DEFER_SECS a period posts anyway with an "incomplete" footer rather than being skipped silently. New settle/defer env vars are optional and default to 6h/12h/24h/48h. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI's clippy step (run with -D warnings) has been red on main, unrelated to the summary readiness work: - orchestrator.rs: move period_window above the #[cfg(test)] mod tests block (items_after_test_module) - tests/embeds.rs: allow too_many_arguments on the stored_event_fixture_at test helper Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…scribe Subscriptions were silently DELETED after DM_FAILURE_AUTO_UNSUB consecutive DM 403s (Discord "Cannot send messages to this user" — DMs disabled, no mutual guild, or blocked bot). Users lost subscriptions days later with no notice and no way to tell why. Now the row is retained and a dm_blocked flag is raised instead: - migration 0005 adds subscriptions.dm_blocked - repo: set_dm_blocked(), clear_dm_failure() also clears the flag, all SELECTs hydrate dm_blocked via a shared row mapper - reward_poller / subscriber_digest_poster: flag instead of delete, and log the Discord JSON error code (50007 = privacy/no-mutual-guild) - discord_bot: DmError::DmsClosed now carries the error code - /subscriptions surfaces "⚠️ DM-blocked" with a fix-your-settings hint - /subscribe warns up front that notifications are DMs and require server-member DMs enabled Delivery and the flag clear automatically on the next successful DM. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.