Skip to content

feat(runtime-guard): NOTIFY-04 B5 alert de-duplication (dry_run by default) - #410

Merged
Pigbibi merged 1 commit into
mainfrom
notify-04/b5-runtime-guard-dedupe
Oct 11, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
notify-04/b5-runtime-guard-dedupe

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

NOTIFY-04 B5 — runtime-guard alert de-duplication (dry-run by default)

Why. runtime-guard.yml runs every 30 min with a 180-min log lookback. One Cloud Run / Scheduler failure entry is re-reported by up to six consecutive runs, and the guard had no de-duplication.

What.

  • New scripts/runtime_guard_alert_dedupe.py (identical in Schwab / IBKR / LongBridge / Firstrade):
    • New failure log entries (Cloud Logging insertId, hashed) → always alert.
    • New issue type (issue text with numbers normalized) → always alert.
    • Same issues, no new entries → repeat; re-alert after RUNTIME_GUARD_ALERT_DEDUPE_REMINDER_HOURS (default 6).
    • Healthy run → issue state cleared, so a recurrence alerts immediately.
    • State is a small JSON of hashes and timestamps (no log text, no account data), carried between runs with actions/cache restore/save.
  • Mode RUNTIME_GUARD_ALERT_DEDUPE_MODE: off | dry_run | on. The workflow default is dry_run: it never suppresses, it only logs runtime_guard_dedupe … would_suppress=true|false so the effect can be observed. The script default when unset is off.
  • No change to what is sent until a maintainer sets the repo variable to on (NOTIFY-04 B7, separate approval).

Tests: tests/test_runtime_guard_alert_dedupe.py (off/dry_run/on, new entry, new issue type, count-only change, reminder, recovery, hashes-only state, pruning); existing test_cloud_run_runtime_guard.py still passes.

…fault

Same failure entries are re-reported by up to six 30-min runs (180-min lookback).
New entries / new issue types always alert; pure repeats are suppressed only in
mode=on (re-alert after 6h). Workflow default mode=dry_run logs would_suppress
and never suppresses. State: hashes + timestamps via actions/cache.
@Pigbibi
Pigbibi merged commit f9ae6f7 into main Oct 11, 2026
1 check passed
@Pigbibi
Pigbibi deleted the notify-04/b5-runtime-guard-dedupe branch October 11, 2026 09:09
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.

1 participant