Conversation
…alf-restored boxes Add check_trigger_layer() function with three-phase validation: 1. Orchestrator heartbeat staleness (600s threshold) with FAIL-CLOSED semantics 2. Watchdog heartbeat staleness (300s per config) when trigger layer configured 3. Windows scheduled tasks (Aesop\AesopHeartbeat, Aesop\AesopIdleTick) health check Graceful degradation for fresh clones (no heartbeat dir) reports trigger:unconfigured (WARN, not FAIL). Prevents silent rot where STATE.md drifts 100+ PRs unnoticed. Test coverage: 4 new test cases - trigger:unconfigured when not configured (fresh clone scenario) - trigger:ok when orchestrator heartbeat fresh (<600s) - trigger:FAIL when orchestrator heartbeat stale (>=600s) - trigger:FAIL when heartbeat dir exists but file missing Exit codes: FAIL (exit 1) for missing/stale heartbeats when configured; WARN (exit 0) for unconfigured; OK (exit 0) when fresh. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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
Implements trigger-layer guardrail in
tools/power_selftest.pyto detect half-restored boxes (missing scheduled tasks/watchdog/heartbeats) that would silently rot for 100+ PRs (proven incident class).Design
New
check_trigger_layer()function with three-phase validation:Graceful degradation: fresh clones with no heartbeat directory report
trigger:unconfigured(WARN, not FAIL).Exit codes: FAIL (exit 1) for missing/stale heartbeats when configured; WARN (exit 0) for unconfigured; OK (exit 0) when fresh.
Check Semantics
Test Coverage
test_trigger_layer_unconfigured_warn: Fresh clone scenario (no heartbeat dir)test_trigger_layer_fresh_heartbeat_ok: Orchestrator heartbeat fresh (<600s)test_trigger_layer_stale_heartbeat_fail: Orchestrator heartbeat stale (>=600s)test_trigger_layer_missing_heartbeat_fail: Heartbeat dir exists but file missingAll 12 existing tests still pass.
Live Output
(Box has no trigger layer configured yet; reporting unconfigured gracefully.)
Generated with Claude Code