Files
AWG2_harness/traffic_core/src
founder b42d99068b refactor(traffic): split traffic.rs into a module directory, code move only
traffic.rs was 1026 lines of production code, by far the largest module. The split the
spec has described since the beginning is now done, along the responsibility boundaries
that already existed inside the file:

  traffic/mod.rs       shared models and the three entry points
                       (inspect_drift_summary, reconcile_traffic, peer_status_table)
  traffic/parse_tc.rs  pure parsers for tc/ip output, plus all 16 existing tests
  traffic/inspect.rs   inspect_and_diff and the class-id contract
  traffic/apply.rs     teardown, full rebuild, and the tolerated-error wrappers

No logic changed. The function set before and after the move is identical - verified by
extracting function names from the old blob and the four new files and diffing them: 26
against 26, no additions, no removals. Bodies moved verbatim; the only edits are module
paths, pub(super) markers on the items that cross a file boundary, and doc comments on
the non-obvious parts (why filter parsing is block-based, why the class-id sort is
textual, what each tolerated-error wrapper is allowed to swallow).

Note on visibility: the shared models stay private in mod.rs. Rust makes private items
visible to descendant modules, so the submodules can construct TrafficDrift and
FilterInspect without widening anything to pub(crate).

Splitting the tests out with their parsers is the practical win: parse_tc.rs is 100% pure
functions and now reads as the tested surface of the module, rather than 16 tests sitting
at the bottom of a thousand-line file next to code that needs a live container.

cargo test --workspace: 110 + 4 passed, same count as before the move, all 16 traffic
tests now reporting under traffic::parse_tc. clippy -D warnings clean.
2026-08-06 18:46:52 +05:00
..