homelab-codex-ws/services/control-plane/tests
Oskar Kapala c9ee8eb06d fix(observer): quarantine malformed event files to prevent processing wedge
Recovery from bad merge of task/observer-poison-quarantine (c255a02)
which carried false deletes from a stale branch base. Re-applies only
the genuine observer changes on top of correct master state.

When an event file fails to parse (malformed JSON, truncated, corrupted),
the observer previously kept retrying on every cycle while the node's
checkpoint stayed pinned — all subsequent good events for that node lost.

Now: first parse failure -> atomic os.replace to STATE_DIR/observer_failed_events/<node>/
with collision handling. Checkpoint advances, downstream events flow.
Move failures are logged but don't crash the loop.

Complementary to the atomic_write_json fix on state files; this addresses
the same race-pattern on event files instead.

Regression test asserts: bad event quarantined to failed_events dir,
removed from hot path, subsequent good event processed (node online),
checkpoint moves to good event.
2026-06-12 13:11:15 +02:00
..
__init__.py feat(control-plane): route ha-diag-agent events through supervisor 2026-05-29 15:59:23 +02:00
test_incident_lifecycle.py fix(observer): quarantine malformed event files to prevent processing wedge 2026-06-12 13:11:15 +02:00
test_state_reliability.py test(control-plane): atomic write and resilient loader coverage 2026-06-03 12:27:05 +02:00
test_supervisor_ha.py feat(control-plane): shadow_mode for HA event auto-actions + deploy docs 2026-05-29 17:12:33 +02:00