Repository navigation
Description
Summary
E-01 (terminal-state closure — "no running row older than execution_timeout_seconds + 300s") does not exclude #1081 pull-CLAIMED rows. It is the last canary invariant without lease-awareness now that S-01 has it (shipped with the pull phases) and E-05 gets it in #1982.
Listed as remaining in docs/testing/PULL_MIGRATION_TESTING.md §8 (T3.7) but never filed.
Why
A pull-claimed row (lease_expires_at IS NOT NULL) is status='running' and owned exclusively by the lease-reaper, which re-queues or poison-parks it on its own schedule bounded by MAX_REDELIVERY. Its age is therefore not evidence of the stuck-execution class E-01 exists to detect — a re-delivered row can legitimately carry an old started_at across attempts while the machinery is working exactly as designed.
The db-layer sweeps already encode this: mark_no_session_executions_failed carries lease_expires_at IS NULL, and PULL_MIGRATION_TESTING.md §Appendix records six such sweep exclusions. The canary is the layer that hasn't caught up.
Impact
Nuisance today (no agent is piloted), but it lands squarely on #1766: the soak's AC is "canary green throughout", and M7 reads canary_violations to decide go/no-go. A critical-severity E-01 stream from the pilot agent is worse than noise — it is indistinguishable from the real lights-out condition, so it either aborts a healthy soak or trains the operator to ignore the one invariant they most need.
Acceptance Criteria
- E-01 skips rows with a non-NULL
lease_expires_at, mirroring S-01's exclusion (agent.running_lease_expires_at.get(eid) is not None) - A NULL-lease control row of the same age still fires — the exclusion is keyed on the lease, not a blanket silencing
- The reasoning lives in the module docstring, as S-01/E-05 do, not just an inline comment
-
snapshot.py's comment onrunning_lease_expires_atupdated to list E-01 among its readers - Confirm no other invariant reading
running_exec_idsneeds the same treatment (E-02 was assessed as not needing it — record that verdict either way)
Technical Notes
src/backend/canary/invariants/e01_terminal_state_closure.py; field already collected asAgentSnapshot.running_lease_expires_at, so this is a read, not new plumbing.- Precedent: S-01 (
s01_slot_row_bijection.py:75-79), E-05 (fix(pull): make the pilot flag a true either/or + soak measurement set (#1766) #1982). - Related: feat: pull / work-stealing coordination (push→pull dispatch) #1081, Production soak-test of pull/work-stealing coordination (#1081) before default-on #1766, Research and implement orchestration invariant catalog + continuous canary harness #411.
Activity
fix(canary): make E-01 lease-aware so a healthy pull turn stops pagin…