runtime: extract a generic launcher and split the bare and cow binaries#446
Conversation
lgahdl
left a comment
There was a problem hiding this comment.
Clean extraction — verified the Runtime trait shape at the actual head commit and shepherd/nexum-cli's usage matches it correctly (no trait/impl mismatch), the backwards-edge from the host layer into shepherd-cow-host is genuinely fixed (coupling moved to exactly crates/shepherd, confirmed by nexum-launch's Cargo.toml having zero cow deps and check-venue-agnostic.sh now sweeping nexum-launch/nexum-cli), and every Dockerfile/justfile/script touch point consistently retargets shepherd as the shipped binary with no stale path left. Extensibility for a future third composition is clean too (new bin crate + Runtime impl + a 2-line main.rs, no changes needed to nexum-launch).
One naming note worth considering, not blocking: the new crate/binary is named shepherd, same as the repo itself, while every other cow-domain crate in the workspace uses a shepherd-* prefix (shepherd-cow-host, shepherd-sdk, shepherd-backtest) — but this one is actually the top-level composition root, not a cow-domain crate, so the bare name reads inconsistently with that existing convention and is ambiguous with the repo name in cargo tree -p shepherd/search contexts. Something like shepherd-engine might disambiguate. Also a very small doc nit: crates/shepherd/src/main.rs's crate doc says "the engine itself stays cow-free," which could be misread as self-contradictory since shepherd is the one binary that isn't cow-free — it means the nexum-runtime/nexum-launch layers underneath. Approving either way, these are non-blocking.
44b6d6a to
734c391
Compare
nexum-launch owns the shared CLI, config load, tracing init, and the preset-driven run; nexum-cli becomes the bare Ext=() engine binary over CoreRuntime with no cow edge; the cow composition root moves to a new shepherd binary wiring the cow-api extension as a Runtime preset. The venue-agnostic guard's crate-graph check now covers the launcher and the bare binary, and the cow deployment tooling builds shepherd.
f21855f to
1d291e0
Compare
|
Thanks - checked both notes against the end-of-train state. Doc nit ("the engine itself stays cow-free") - addressed by end-of-train. The crate doc is reworded at the tip (
That separates "the cow composition root" (this binary) from "the engine" (the launcher/runtime underneath, which stays cow-free), so the self-contradiction reading is resolved in context. No change needed. Naming ( |
Closes #380
What
Extracts a generic
nexum-launchlibrary (shared CLI, config load, tracing init, preset-driven launch) out ofnexum-cli.nexum-clinow ships a barenexumbinary composed overnexum-launchwithExt=()and zero cow dependencies. Adds a newshepherdbinary crate that owns the cow composition root (reference lattice + cow-api extension + Prometheus add-on), wired over the same launcher. Updates the Dockerfile, justfile, andcheck-venue-agnostic.shto build/ship/scanshepherdas the production binary and to sweepnexum-launchandnexum-clifor venue leakage alongsidenexum-runtime.Why
The CLI composition root previously wired the cow extension in directly, making
nexum-clidepend onshepherd-cow-host- a backwards edge from a generic host binary into a specific downstream extension. Splitting a generic launcher library plus a bareExt=()engine binary from the cow composition root keeps the host layer venue-agnostic and moves cow wiring to where it belongs.Closes #380
Testing
Existing gate: fmt, clippy, workspace check, nextest, doctests.
AI Assistance
Implemented with Claude Code.