Skip to content

feat(digest): add weekly summary generator and Discord dispatcher (fixes #29) - #50

Closed
evandroribeiro94 wants to merge 1 commit into
devodii:mainfrom
evandroribeiro94:feat/issue-29-discord-digest
Closed

evandroribeiro94 wants to merge 1 commit into
devodii:mainfrom
evandroribeiro94:feat/issue-29-discord-digest

Conversation

@evandroribeiro94

Copy link
Copy Markdown

Summary

Adds the hackproof digest CLI command to generate weekly markdown summaries comparing ecosystem progression, with optional automated posting to a Discord webhook (fixes #29).

What has been built

  • CLI Subcommand: Added digest subcommand in apps/api/src/hackproof/cli.py accepting --fixture (for deterministic run snapshot inputs) and --webhook (or DISCORD_WEBHOOK_URL / HACKPROOF_DISCORD_WEBHOOK_URL in settings).
  • Weekly Run Differ & Renderer:
    • Compares previous vs. current snapshots across Projects, Verified Contracts, Builders, and Failed Transactions.
    • Optionally renders Top Survival Movers, Graduations, and Stellar Community Fund (SCF) Highlights if the underlying tables or run metrics exist, cleanly skipping any unpopulated sections.
  • Discord Webhook Client: Sends the markdown payload via httpx.AsyncClient when configured, or prints cleanly to stdout with safe encoding fallback.
  • Deterministic Fixtures: Added apps/api/tests/fixtures/weekly_runs.json with sample multi-run metrics.

Acceptance Criteria & Testing

  • Unit tests added in apps/api/tests/test_digest.py:
    • test_generate_digest_from_fixture: Validates deterministic markdown generation from fixture.
    • test_generate_digest_skips_missing_tables: Ensures absent sections are cleanly omitted.
    • test_post_to_discord: Tests Discord webhook posting.
    • test_run_digest_job: End-to-end execution.
    • Test suite passes with 100% green (4 passed in 0.54s).
    • Code passes all formatting and lint checks (ruff check & ruff format 0 errors).

@vercel

vercel Bot commented Oct 31, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Payroutes OSS Team on Vercel.

A member of the Team first needs to authorize it.

@devodii devodii closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weekly digest to Discord

2 participants