Task · MDE-0042

Reconcile client-store membership and refresh API-owned fields

Description

Wave 3 found successful client snapshots only upsert IDs and never remove departed clients, so stale entries can permanently consume the global cap. Existing records also retain stale display and identity fields such as description, manufacturer, OS, network name, and organization association.

Acceptance Criteria

Definition of Done

Implementation Plan

Wave 2 L1: freeze complete_snapshot=True only after every selected network fetch succeeds without truncation; add failing churn and field-refresh tests first; reconcile membership before cap admission only for complete snapshots; preserve derived DNS state; run focused checks and return evidence without tracker or external writes.

Implementation Notes

Wave 3 reproduced stale client membership and stale API-owned fields. Correct reconciliation depends on distinguishing complete snapshots from emission-capped or failed fetches.

Wave 2 red: complete/incomplete snapshot regressions failed with TypeError because ClientStore.update_clients had no complete_snapshot signal. The collector now asserts completeness only when every selected network fetch succeeds without truncation; complete snapshots reconcile membership before cap admission, incomplete snapshots retain data, and API-owned fields refresh while derived DNS state survives. Green: 4 focused tests, typecheck, and just check with 2913 passed.

Final Summary

Parked after audit. Resume by freezing a complete-snapshot signal at the collector/store seam, then reclaim departed IDs before cap admission and refresh every API-owned field without erasing derived state.

Wave 2: added an explicit complete-snapshot seam, reclaimed departed clients before cap admission only for complete fetches, and refreshed API-owned identity/display fields without erasing derived state. Verified by churn, truncation, rename, and field-refresh regressions plus just check.

View the source file on GitHub