[claude] Integrate health snapshot into Daily Run pre-flight (#923) #1280

Merged
claude merged 1 commits from claude/issue-923 into main 2026-03-24 01:43:50 +00:00
Collaborator

Fixes #923

What

Before the orchestrator builds the agenda and burns any cycles, it now runs the Quick Health Snapshot (#710) to check CI, open P0/P1 issues, test flakiness, and token economy. If the overall status is red the Daily Run aborts with a non-zero exit code so the loop does not waste cycles when mandatory systems are down.

Changes

timmy_automations/daily_run/orchestrator.py

  • Imports health_snapshot.{generate_snapshot, get_token, load_config} at module level
  • New run_health_snapshot(args) function: prints pre-flight block, returns 0 (proceed) or 1 (abort)
  • main() calls run_health_snapshot() before touching Gitea or generating the agenda
  • Two new CLI flags:
    • --skip-health-check — bypass the snapshot entirely
    • --force — continue even when health is red

tests/timmy_automations/test_orchestrator.py (new)

13 unit tests covering:

  • Green/yellow snapshots return 0
  • Red snapshot returns 1 and aborts before Gitea
  • --force overrides the abort
  • --skip-health-check bypasses the snapshot
  • Snapshot exceptions degrade gracefully (returns 0, logs warning)
  • Output includes PRE-FLIGHT header and P0 counts
  • JSON mode includes error key on abort

Tests

tox -e unit  →  435 passed
Fixes #923 ## What Before the orchestrator builds the agenda and burns any cycles, it now runs the Quick Health Snapshot (#710) to check CI, open P0/P1 issues, test flakiness, and token economy. If the overall status is **red** the Daily Run aborts with a non-zero exit code so the loop does not waste cycles when mandatory systems are down. ## Changes ### `timmy_automations/daily_run/orchestrator.py` - Imports `health_snapshot.{generate_snapshot, get_token, load_config}` at module level - New `run_health_snapshot(args)` function: prints pre-flight block, returns 0 (proceed) or 1 (abort) - `main()` calls `run_health_snapshot()` before touching Gitea or generating the agenda - Two new CLI flags: - `--skip-health-check` — bypass the snapshot entirely - `--force` — continue even when health is red ### `tests/timmy_automations/test_orchestrator.py` (new) 13 unit tests covering: - Green/yellow snapshots return 0 - Red snapshot returns 1 and aborts before Gitea - `--force` overrides the abort - `--skip-health-check` bypasses the snapshot - Snapshot exceptions degrade gracefully (returns 0, logs warning) - Output includes PRE-FLIGHT header and P0 counts - JSON mode includes error key on abort ## Tests ``` tox -e unit → 435 passed ```
claude added 1 commit 2026-03-24 01:43:28 +00:00
feat: integrate health snapshot into Daily Run pre-flight check
Some checks failed
Tests / lint (pull_request) Failing after 36s
Tests / test (pull_request) Has been skipped
3ed582a22c
Before the orchestrator builds the agenda and burns any cycles, it now
runs the Quick Health Snapshot (#710) to check CI, open P0/P1 issues,
test flakiness, and token economy.  If the overall status is red the
Daily Run aborts with a non-zero exit code so the loop doesn't waste
cycles when mandatory systems are down.

New CLI flags on orchestrator.py:
- --skip-health-check  bypass the pre-flight snapshot entirely
- --force              continue even when health status is red

Adds 13 unit tests in tests/timmy_automations/test_orchestrator.py
covering green/yellow/red paths, --force override, --skip-health-check,
graceful degradation on snapshot errors, and JSON output.

Fixes #923
Refs #710
claude merged commit 6c76bf2f66 into main 2026-03-24 01:43:50 +00:00
claude deleted branch claude/issue-923 2026-03-24 01:43:50 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1280