Skip to content

Commit 67f7330

Browse files
bb-connorclaude
andauthored
refactor: extract clawdstrike-hushd-config crate, dedupe agent/hushd config types (#339)
Phase 1 P1-D of the desktop-agent refactor swarm. The desktop agent writes a runtime YAML config that hushd must read. Both sides previously defined their own private DTOs with the same field names. Drift between writer and reader would silently break daemon startup at runtime, so this PR centralises the on-disk format in a new shared crate, `clawdstrike-hushd-config`. Crate layout: - `runtime::RuntimeConfig` - top-level on-disk shape - `siem::SiemConfig + ExportersConfig + per-provider configs` - `spine::SpineConfig` - replaces hushd's local SpineConfig - `webhook::GenericWebhookConfig + WebhookAuthConfig` Writer (`apps/agent/src-tauri/src/daemon.rs`): dropped 14 local DTOs (lines 81-202 pre-extraction) and replaced them with re-exports from the new crate. The construction sites in `build_runtime_siem_config`, `build_runtime_spine_config`, and `build_generic_webhook_exporter` now build the shared types directly. Reader (`crates/services/hushd/src/config.rs`): re-exports `clawdstrike_hushd_config::SpineConfig` and drops the local copy. Added a contract test that round-trips the writer's full sample YAML into hushd's `Config` so future drift is caught at compile or test time. Added a legacy-YAML test that proves existing on-disk configs with `keypair_path: String` still deserialize into the shared `Option<PathBuf>` field. 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 6278bea commit 67f7330

13 files changed

Lines changed: 657 additions & 207 deletions

File tree

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ members = [
3434
"crates/libs/hunt-correlate",
3535
"crates/libs/clawdstrike-ocsf",
3636
"crates/libs/clawdstrike-policy-event",
37+
"crates/libs/clawdstrike-hushd-config",
3738
"crates/libs/clawdstrike-logos",
3839
"crates/libs/logos-ffi",
3940
"crates/libs/hushspec",
@@ -180,6 +181,7 @@ logos-ffi = { path = "crates/libs/logos-ffi", version = "0.2.7" }
180181
logos-z3 = { path = "crates/libs/logos-z3", version = "0.2.7" }
181182
clawdstrike-ocsf = { path = "crates/libs/clawdstrike-ocsf", version = "0.2.7" }
182183
clawdstrike-policy-event = { path = "crates/libs/clawdstrike-policy-event", version = "0.2.7", default-features = false }
184+
clawdstrike-hushd-config = { path = "crates/libs/clawdstrike-hushd-config", version = "0.2.7" }
183185
nono = { path = "infra/vendor/nono", version = "0.11.0", default-features = false }
184186

185187
[profile.release]

apps/agent/src-tauri/Cargo.lock

Lines changed: 36 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/agent/src-tauri/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ which = "6"
6060
# Shared crypto/data primitives
6161
hush-core = { path = "../../../crates/libs/hush-core" }
6262
clawdstrike-policy-event = { path = "../../../crates/libs/clawdstrike-policy-event", default-features = false, features = ["simulate"] }
63+
clawdstrike-hushd-config = { path = "../../../crates/libs/clawdstrike-hushd-config" }
6364
base64 = "0.22"
6465

6566
# NATS / Spine (adaptive SDR)

0 commit comments

Comments
 (0)