Skip to content

feat(alerts): launch domain-isolated governance alerts worker v2 - #101

Merged
0xPickles merged 10 commits into
yearn:masterfrom
0xPickles:agent/data
Aug 31, 2026
Merged

feat(alerts): launch domain-isolated governance alerts worker v2#101
0xPickles merged 10 commits into
yearn:masterfrom
0xPickles:agent/data

Conversation

@0xPickles

Copy link
Copy Markdown
Collaborator

Closes dao-operations/triage#35

Summary

Replace the combined governance alerts bot with governance-alerts-bot-v2, a simpler Worker that independently monitors and delivers stYFI, veYFI, and yETH alerts.

The v2 Worker uses one Durable Object and one Telegram destination per domain:

  • stYFI → t.me/styfi_alerts
  • veYFI → t.me/veyfi_alerts
  • yETH → t.me/yeth_alerts

The existing governance-alerts-bot remains a separate Worker and can continue serving the legacy combined channel during the transition.

Changes

  • Split alert processing into three independently enabled Durable Objects with separate cursors, receipts, backoff state, and Telegram destinations.
  • Replay each domain from its canonical start block using the same scanners, rendering, and delivery path used for live alerts.
  • Add the approved message catalogue covering all supported stYFI, veYFI, and yETH actions.
  • Add exact event-block account context to user alerts.
  • Attribute supported direct and canonical Safe transactions without guessing through unsupported transaction wrappers.
  • Support historical stYFI, veYFI, LLYFI, and yETH event shapes found during production replay.
  • Evaluate yETH protocol changes at fixed daily checkpoints and emit alerts only for material changes.
  • Set the yETH daily materiality threshold to 0.5 ETH.
  • Remove the daily impact digest and the previous migration, warning, rollback-generation, lease, and general subrequest-governor machinery.
  • Add a redacted authenticated /status endpoint and structured failure diagnostics.
  • Retain simple resource bounds appropriate for the paid Cloudflare Workers plan:
    • 10,000-block log ranges
    • six ranges per domain run
    • RPC batches of 25 calls
    • five ordered Telegram messages per domain run
    • persisted Telegram retry_after handling
  • Reserve disabled registry seams for teams, YBC, and DAO alerts.
  • Add an exhaustive catalogue printer for reviewing canonical message output.
  • Update the operator runbook, Worker documentation, message catalogue, replay procedure, and cutover instructions.

Architecture

governance-alerts-bot-v2 remains one Worker deployment, while domain state and failures are isolated across three Durable Object instances:

  • alerts:styfi:v1
  • alerts:veyfi:v1
  • alerts:yeth:v1

A failure in one domain does not advance its cursor or prevent the other domains from running. Event receipts provide replay-safe delivery, subject to the documented at-least-once duplicate window if Telegram accepts a message before its receipt is persisted.

There is deliberately no automated health-monitor or operational-warning subsystem in this release. Failures remain visible through structured Cloudflare logs and the authenticated status endpoint.

Rollout and compatibility

  • Introduces the permanent governance-alerts-bot-v2 Worker identity.
  • Does not rename, overwrite, or adopt state from the existing governance-alerts-bot.
  • Does not migrate the legacy singleton cursor or Telegram history.
  • Preserves existing v2 Durable Object state and delivery receipts across redeployments.
  • Keeps secrets in Cloudflare rather than source control.
  • Commits all three production domain flags as enabled following successful replay testing.
  • Allows the old combined channel to remain active during a deprecation period before the original Worker is disabled.

Verification

Completed successfully:

  • TypeScript type checking
  • ESLint
  • Dependency-policy validation
  • Full Vitest suite
  • Focused scanner, transaction-attribution, accounting, RPC, and runtime tests
  • Golden catalogue rendering
  • Wrangler deployment dry run
  • Exact production regression coverage for previously blocking stYFI, veYFI, and yETH transactions
  • Public-RPC replay of veYFI from its previously blocked cursor through the confirmed head
  • Full yETH replay from genesis through the confirmed head

The final replay fix passed 121 test files and 959 tests. No secrets are included in this change.

- route stYFI, veYFI, and yETH through independent Durable Object instances and chats
- retain canonical scanners, exact-block account context, yETH accounting, and approved rendering
- replace migration, warning, lease, and subrequest-governor machinery with one cursor record and event receipts
- evaluate yETH protocol changes at deterministic daily checkpoints and remove the impact digest
- keep every domain disabled by default for a bounded private-chat replay
- preserve deterministic scanner and yETH accounting coverage without implementation-coupled runtime proofs
- pin all 24 approved action templates and three channel introductions
- test exact event-block account positions, three-object fan-out, cursor reorg handling, and Telegram backoff
- prove daily yETH checkpoint delivery resumes from receipts when the per-run message cap is reached
- add a catalogue printer that keeps golden assertions active
- document the three final chats, three object names, and canonical replay boundaries
- retain the approved public message catalogue while removing operational warning copy
- explain paid-plan range and Telegram limits without a general subrequest governor
- define the daily yETH threshold review using structured checkpoint records
- provide a disabled-first rollout, replay rejection, pause, and duplicate-recovery procedure
- Assign governance-alerts-bot-v2 as the permanent replacement Worker identity.
- Document inert deployment, secret provisioning, staged replay, and authenticated cutover commands.
- Preserve the live singleton throughout private replay and define bounded rollback behavior.
- Run private replay and live observation from the isolated agent/data branch.
- Defer the fast-forward to master until all three domain histories are approved.
- Redeploy the accepted v2 commit before performing the old-Worker cutover.
- Align the deployed and fallback checkpoint threshold at 0.5 ETH.
- Pin decimal parsing and replay behavior in focused runtime tests.
- Document non-accumulating checkpoint semantics and private replay calibration.
- Record the precise runtime stage for failed domain runs
- Preserve safe RPC and Telegram status metadata without payloads
- Cover redaction, persistence, and typed delivery failures
- Attribute direct and canonical Safe protocol calls to the correct account.
- Derive yETH claims from canonical event and Recovery Vault companion evidence.
- Track Vault V3 report mints and vault-owned profit-lock burns without user alerts.
- Add exact production regressions and document the supported evidence paths.
@0xPickles
0xPickles merged commit 75de1bc into yearn:master Aug 31, 2026
3 checks passed
@0xPickles
0xPickles deleted the agent/data branch August 31, 2026 17:20
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.

Split alerts out

1 participant