Skip to content

fix(flow): report host drift when expected compute inventory is empty #4356

Description

@chet

Machine actual sync returns before querying Core when Flow has no expected computes. The cycle is still marked successful, so the empty result replaces the drift table and erases orphan-host findings. When expected computes do exist, missing-in-expected detection also considers DPU MachineDetails even though only HOST records participate in expected compute linking.

Build matching and drift from the same host-only actual inventory, and query it even when the expected side is empty.

Technical Details

syncMachines exits before GetMachines for an empty Flow component set. The successful return flows into ReplaceAllDrifts. Separately, syncMachineIDs filters MachineDetails to HOST, but both missing-in-expected loops iterate the unfiltered response.

A Core query failure must remain distinguishable from a valid empty actual inventory.

Done When

  • An actual HOST with zero expected computes produces missing_in_expected drift.
  • DPU MachineDetails never produce compute missing_in_expected drift.
  • Removing the final expected compute does not erase valid orphan-host drift.
  • Core query failure preserves the last reliable drift snapshot.
  • Tests cover mixed HOST/DPU data, zero expected, zero actual, and final-row deletion.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions