agent-orchestrator/backend/internal/lifecycle
harshitsinghbhandari b2161d5582 fix(lifecycle): clear ci-failed tracker on recovery/incident-over (PR #6 review)
Address review finding #1: the persistent ci-failed tracker leaked and could
stale-silence a future regression. It was only cleared when leaving the
ci-failed reaction AND incidentOver held at that moment — so a recovery to
another open-PR state (ci-failed -> approved -> merged) never cleared it.

- react() now clears ALL of a session's trackers when the state REACHED is
  incident-over (PR resolved / session terminal) OR a genuine recovery
  (approved/mergeable, which the open-PR ladder guarantees means CI is no
  longer failing). Keyed on the state reached, not the one left, since the
  recovery transition is typically review_pending->approved (empty beforeKey).
- Persistent ci-failed still survives the ambiguous review_pending limbo, so
  fail->pending->fail keeps one shared budget (§4.2).
- Document the out-of-lock react() dispatch caveat for the daemon integration
  step (review #2) and the intentionally-skipped agent-stuck 10m threshold.

Tests: re-arm after a genuine recovery (regression re-nudges, not silenced);
all session trackers cleared once the incident is over.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 02:26:45 +05:30
..
decide_bridge.go feat(lifecycle): activity resolves detecting + review polish 2026-05-27 01:49:28 +05:30
fakes_test.go feat(lifecycle): implement LCM Apply* pipeline (split A) 2026-05-27 01:26:15 +05:30
manager.go feat(lifecycle): ACT layer — reaction table + escalation engine (split B) 2026-05-27 02:17:51 +05:30
manager_test.go feat(lifecycle): ACT layer — reaction table + escalation engine (split B) 2026-05-27 02:17:51 +05:30
reactions.go fix(lifecycle): clear ci-failed tracker on recovery/incident-over (PR #6 review) 2026-05-27 02:26:45 +05:30
reactions_test.go fix(lifecycle): clear ci-failed tracker on recovery/incident-over (PR #6 review) 2026-05-27 02:26:45 +05:30