fix(substrate): tighten alarm Period 86400 → 3600 to close 24-37h state lag#190
Merged
Merged
Conversation
…te lag CloudWatch alarms with Period=86400 + EvaluationPeriods=1 only evaluated at 24h boundaries, so Sat SF emissions at 12:00 UTC Sat were not visible in alarm state until ~17:05 PT Sun (~37h lag from cron start to first alarm-state refresh). The substrate framework's "every miss is an incident in <24h" promise was structurally untrue at the alarm layer. Switch to Period=3600 + EvalPeriods=24 + DatapointsToAlarm=1: - Same 24h trailing evaluation window (24 × 3600 = 86400) - Hourly refresh cadence instead of daily - DatapointsToAlarm=1 means any single failing hourly period in the trailing 24 fires the alarm (matches the prior "any 24h Min < 1" semantics; weekly rows still emit once per Sat with 23 trailing notBreaching periods, alarm fires iff that one real datapoint is < 1) - Cost: 24× more CloudWatch eval reads/day; bounded. Live operator step required after merge: re-run `./infrastructure/setup_substrate_alarms.sh` once to apply the new Period to all 10 existing alarms (script is idempotent). Closes ROADMAP P0 line 2082. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Live operator step (after merge)
Script is idempotent — applies the new Period semantics to all 10 existing alarms (9 per-row + 1 aggregate).
Test plan
pytest tests/test_substrate_alarms_script.py(17/17, +3 regression tests pinning Period=3600, EvalPeriods=24, DatapointsToAlarm=1)bash -n infrastructure/setup_substrate_alarms.shcleanaws cloudwatch describe-alarms --alarm-name-prefix alpha-engine-substrate-showsPeriod: 3600on all 10 alarmsRelated
🤖 Generated with Claude Code