Task · MDE-0043

Isolate callers from shared network inventory cache records

Description

Wave 3 found get_networks returns cached dictionaries directly. Collectors append organization fields, permanently enriching the shared raw cache until refresh and exposing caller-owned mutations to unrelated consumers.

Acceptance Criteria

Definition of Done

Implementation Plan

Add a failing cache-isolation regression, return per-record shallow copies from every get_networks path, and verify NetworkFilter behavior remains unchanged.

Implementation Notes

The failing regression proved a caller-added orgName persisted into a later cache read. get_networks now shallow-copies each selected record on filtered and unfiltered paths; the full inventory and NetworkFilter suites pass.

Final Summary

Isolated network inventory consumers from shared raw cache dictionaries with test-first mutation coverage; just check and just ci pass.

View the source file on GitHub