A01: Fix scheduler aggregation to not mask stale/failed sources

Bug: has_any_success allowed one healthy source to give overall 'ready'
when another source was stale/not_started/running — masking failures.

Fix:
- Added has_any_stale and has_any_running tracking
- Overall status is 'degraded' if ANY source is failed/stale/running
- Overall status is 'ready' ONLY when ALL enabled sources are healthy
- 'not_started' when no sources are enabled
- readiness (ready flag) still NOT blocked by import health (A01 requirement)

Verification:
- 7/7 readiness tests pass
- 124/124 Python tests pass (1 skipped)
- Stale source now shows 'degraded' instead of 'ready'
- Failed source still shows 'degraded'
- All healthy sources show 'ready'
This commit is contained in:
ik
2026-09-10 19:32:33 +07:00
parent e996c6da41
commit 883e63aa8b
2 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ def test_community_scheduler_stale_does_not_block_readiness() -> None:
import_interval_seconds=3600, community_import_interval_seconds=1800, now=now,
)
assert ready is True # A01: stale does NOT block readiness
assert components["community_scheduler"]["status"] == "stale" # Overall reflects stale source
assert components["community_scheduler"]["status"] == "degraded" # Stale source shows as degraded
assert components["community_scheduler"]["sources"]["rf4db"]["status"] == "stale"
assert components["community_scheduler"]["sources"]["rf4db"]["blocking"] is False