Silent-source (stale) event trigger #33

Merged
Gilles merged 14 commits from feat/29-stale-trigger into master 2026-10-28 22:46:08 +00:00
Owner

Closes #29

Part of the server monitoring plan (phase 2.1). Stacked on #32 (base feat/28-sources-json-dedup).

Changes

  • Trigger.STALE ("Source muette", default severity alert), in the new PERIODIC_TRIGGERS set (never evaluated on upload).
  • Expected period: rule param after (validated duration, stored in seconds) or else the stream's latest report expect_every. No period → never silent.
  • engine.check_stale(): for each enabled stale rule, the latest DONE report of every matching stream (ref, type, custom name, variant); silent when now - max(uploaded_at, last_seen_at) > period + max(10 min, 10 %). State tracked in EventRuleState.active: one alert on the edge, then one info event ("de nouveau active") when the stream reports again. _raise gained an optional severity override for that.
  • Celery beat: apps.events.tasks.check_stale_sources every 5 minutes, seeded on post_migrate (IntervalSchedule).
  • Argus's own daily self-reports (sweep-closed-prs, prune-history) now announce expect_every: 1d.
  • README, feature catalog; tests in apps/events/test_stale.py.

Checks

pytest (215 passed), pylint 10/10, autopep8, bandit clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA

Closes #29 Part of the server monitoring plan (phase 2.1). **Stacked on #32** (base `feat/28-sources-json-dedup`). ## Changes - `Trigger.STALE` ("Source muette", default severity alert), in the new `PERIODIC_TRIGGERS` set (never evaluated on upload). - Expected period: rule param `after` (validated duration, stored in seconds) or else the stream's latest report `expect_every`. No period → never silent. - `engine.check_stale()`: for each enabled stale rule, the latest DONE report of every matching stream (ref, type, custom name, variant); silent when `now - max(uploaded_at, last_seen_at) > period + max(10 min, 10 %)`. State tracked in `EventRuleState.active`: one alert on the edge, then one **info** event ("de nouveau active") when the stream reports again. `_raise` gained an optional `severity` override for that. - Celery beat: `apps.events.tasks.check_stale_sources` every 5 minutes, seeded on `post_migrate` (IntervalSchedule). - Argus's own daily self-reports (`sweep-closed-prs`, `prune-history`) now announce `expect_every: 1d`. - README, feature catalog; tests in `apps/events/test_stale.py`. ## Checks pytest (215 passed), pylint 10/10, autopep8, bandit clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
feature: silent-source (stale) event trigger
All checks were successful
ci / test (pull_request) Successful in 3m8s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
bffcbf777b
- New periodic trigger `stale`: the expected period is the report's
  expect_every, or the rule's own `after` delay; streams with neither
  are ignored. Silent past period + max(10 min, 10 %) raises the event
  once, and an info "de nouveau active" event when the stream reports
  again (last_seen_at of de-duplicated reports counts).
- Celery beat task check_stale_sources every 5 minutes, seeded like
  the reports app's periodic tasks.
- Argus's own daily self-reports announce expect_every: 1d.

Closes #29

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
Author
Owner
<!-- argus-link-bot:argus/backend --> 📊 [Rapports Argus pour cette PR](https://reports.stationmyr.net/argus/backend/pr/33)
Merge branch 'feat/28-sources-json-dedup' into feat/29-stale-trigger
All checks were successful
ci / test (pull_request) Successful in 3m13s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
b360b5b648
Merge branch 'feat/28-sources-json-dedup' into feat/29-stale-trigger
Some checks failed
ci / test (pull_request) Has been cancelled
ci / e2e (pull_request) Has been cancelled
ci / docker (pull_request) Has been cancelled
ci / deploy (pull_request) Has been cancelled
a011a0927e
Merge branch 'feat/28-sources-json-dedup' into feat/29-stale-trigger
All checks were successful
ci / test (pull_request) Successful in 3m12s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
8d4dcd400f
Gilles changed target branch from feat/28-sources-json-dedup to master 2026-10-28 22:34:03 +00:00
Merge remote-tracking branch 'origin/master' into feat/29-stale-trigger
All checks were successful
ci / test (pull_request) Successful in 3m8s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
5a9af39b62
# Conflicts:
#	README.md
Gilles merged commit b8b8956725 into master 2026-10-28 22:46:08 +00:00
Gilles deleted branch feat/29-stale-trigger 2026-10-28 22:46:09 +00:00
Sign in to join this conversation.
No description provided.