Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

TRP-83 feat(economics): render the daily digest as a Discord embed

3 months ago

d22742f
Authored
grim7/26/2026, 1:06:11 AM
Replaces the plain-text daily digest with a structured embed: a 2x3 field
grid (runs, billed, OpenRouter+drift / credits, Railway, review model), a
green border on a calm day and a red border with an Alerts field on any
breach. The fields state the numbers; the color and the Alerts field judge.

- buildDigestEmbed(totals, thresholds): pure, returns the embed object, so
  it stays unit-tested against fixtures like the text renderer it replaces.
- REVIEW_MODEL constant (x-ai/grok-4.5, $2/M in, $6/M out) surfaced as a
  field. Cost math never reads it — metered cost is provider-reported per
  call — so a stale price only misprints a label, never the drift.
- post() now sends a { content?, embeds? } payload; the monthly report
  stays plain markdown content. dry-run prints the full JSON payload.
- embed carries an optional thumbnail slot for a generated chart (follow-up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Parentb08860e

4 files changed
  • apps/worker/src/economics-trigger.ts+6−2
  • apps/worker/src/jobs/economics-digest.test.ts+45−17
  • apps/worker/src/jobs/economics-digest.ts+105−39
  • packages/contracts/src/economics.ts+14−0