Commit 3a10eaa
refactor(policy-event): fold agent edr/dto.rs into wire submodule (#341)
Move ~2,900 lines of EDR wire DTOs from
`apps/agent/src-tauri/src/edr/dto.rs` (3,011 lines, 186 DTOs) into a new
`clawdstrike_policy_event::wire` module, split across 21 files by
functional cluster (health, findings, policy_events, developer_activity,
package_manager, endpoint_security, network_extension,
policy_event_history{,_causal}, privacy, causal_graph, secret_touches,
control_upload, simulation, policy_delta, daemon, response_actions,
evidence_bundles, receipts, protection_state, deception). Each file
stays under 500 lines; visibility widens from `pub(crate)` to `pub` so
control-api and SDKs can share a single source of truth.
The agent's `edr/dto.rs` shrinks to 216 lines: re-exports
`clawdstrike_policy_event::wire::*` and keeps only the 5 DTOs that
reference agent-private types (NetworkExtensionReloadRequestProof,
ControlResponseAckPostbackRoute, DaemonStatus, ProviderStatus,
StoredEndpointEvidenceBundle):
- EdrPolicyDeltaApplyResponse
- EdrPolicyDeltaApplyEnforcementProof
- EdrNetworkExtensionEgressPolicyProofResponse
- EdrControlAckPostbackRetryResponse
- EdrControlAckPostbackRetryAttemptRecord
Extension impls (`matches_index_entry`, `hydrate_attribution`,
`from_stored`) that hung off wire types and called agent-private helpers
become plain functions in the agent's `edr/dto.rs` to satisfy Rust's
orphan rule. Call sites are updated in `api_server.rs`,
`api_server/policy_history.rs`, `api_server/evidence_archives.rs`,
`edr/handlers/causal.rs`, `edr/handlers/response.rs`, and the test
fixtures.
`cargo build --workspace` and `cargo test -p clawdstrike-policy-event`
both pass clean; agent test count is unchanged (475 pass / 29 fail), and
the 29 failures pre-exist on `main` (verified via `git stash` before
applying this change).
Co-authored-by: bb-connor <bb-connor@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 82ed6b3 commit 3a10eaa
30 files changed
Lines changed: 3429 additions & 2910 deletions
File tree
- apps/agent/src-tauri/src
- api_server
- tests/policy_events
- edr
- handlers
- crates/libs/clawdstrike-policy-event/src
- wire
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2338 | 2338 | | |
2339 | 2339 | | |
2340 | 2340 | | |
2341 | | - | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
2342 | 2347 | | |
2343 | 2348 | | |
2344 | 2349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
92 | 104 | | |
93 | 105 | | |
94 | 106 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | | - | |
| 1506 | + | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
| |||
1514 | 1514 | | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | | - | |
| 1517 | + | |
1518 | 1518 | | |
1519 | 1519 | | |
1520 | 1520 | | |
| |||
0 commit comments