Task · OPN-0066

Persist device-inventory seen identities across restart

Description

Device inventory derives its new_device event from an in-memory seen set, while the source state file persists only family hash and last-emitted time. After restart the restored hash can suppress the first unchanged poll, but the next heartbeat or unrelated inventory change emits every pre-existing device as newly observed. The shipped dashboard then raises false new-device events after ordinary exporter restarts.

Acceptance Criteria

Definition of Done

Implementation Plan

Extend the config-snapshot provider/source state seam so the device provider can save and restore committed seen identities, begin with a restart regression, preserve the current commit-after-whole-poll rule, and keep malformed or old state safe by treating missing provider state as a fresh baseline without corrupting family state.

Final Summary

Fixed by d3f47f4b. Configsnapshot state now persists committed device identity keys alongside the family cursor, excludes pending failed-poll observations, tolerates legacy family-only state and isolates malformed provider state. The restart regression failed before the fix and passed after it; integrated just check passed. CodeRabbit completed one pass with zero findings.

View the source file on GitHub