cow: cleave the cow venue from the composable-cow keeper#462
Conversation
lgahdl
left a comment
There was a problem hiding this comment.
Clean, well-executed split — unlike the similar zero-leak scripts in #432/#449/#450, this one gets the polarity right (rg match -> fail, no match -> pass) and its symbol list uses the CURRENT names of what actually moved out, correctly scoped to crates/cow-venue only (doesn't false-fail on composable-cow's own legitimate use of these symbols). Split completeness verified too: cow-venue no longer imports ComposableBody, CowIntent lost the Composable variant, and every downstream consumer (shepherd-sdk, twap-monitor) imports poll types directly from composable-cow with no leftover stale re-export path. Goldens/vectors were correctly updated, including the trailing-bytes failure vector switching from Composable(...) to Order(...) so it still exercises the failure path.
One gap in the gate itself:
|
|
||
| status=0 | ||
|
|
||
| symbols='composable|getTradeableOrder|IConditionalOrder|LegacyRevertAdapter|OrderNotValid|PollTryNextBlock|PollTryAtBlock|PollTryAtEpoch|PollNever' |
There was a problem hiding this comment.
This pattern omits bare Verdict — the structured poll seam type this very PR's lib.rs re-exports (pub use poll::{IConditionalOrder, LegacyRevertAdapter, Verdict};) and that's used throughout the codebase as composable_cow::Verdict. A stray use composable_cow::Verdict; (or a local re-export) landing back in cow-venue wouldn't match any of composable|getTradeableOrder|IConditionalOrder|LegacyRevertAdapter|OrderNotValid|PollTry*|PollNever, so this "zero-leak" gate would report a clean pass on that specific leak. Worth adding \bVerdict\b to the pattern.
There was a problem hiding this comment.
Confirmed and fixed at 69a18ea. Verified your premise first: composable-cow/src/lib.rs:15 does re-export it (pub use poll::{IConditionalOrder, LegacyRevertAdapter, Verdict};), and composable_cow::Verdict is used in four files across shepherd-sdk and shepherd-sdk-test, so a stray import landing back in cow-venue was genuinely invisible to the gate.
Added \bVerdict\b to the symbols list, placed next to IConditionalOrder and LegacyRevertAdapter so the pattern mirrors that re-export line.
Two things I checked rather than assumed. The gate greps with rg -in, so a case-insensitive Verdict would false-fail on any prose use of the word: there are zero occurrences of "verdict" in any case under crates/cow-venue, so widening the pattern is safe. And since you noted on #520 that a bite-test claim is not verifiable from a diff, here is the actual sequence, run three times against the pushed head:
- clean tree:
[cow PASS] cow-venue symbol scan empty - after appending
use composable_cow::Verdict;tocrates/cow-venue/src/lib.rs:[cow FAIL] composable symbols leak into crates/cow-venue, naming the injected line - after reverting:
[cow PASS]again
On placement, since there is a queue of cars behind this one: the gap survives to the end of the train unchanged (the tip's shepherd/scripts/check-cow-orderbook-only.sh:21 has a byte-identical symbols line), and of every open car only this one and the M5 grouping car touch the file, the latter only relocating it. So fixing it here costs no ripple conflicts across the twelve M4 cars behind it, and the relocation carries the corrected pattern forward.
b4bd0e5 to
63ce698
Compare
72b7b37 to
e9d8504
Compare
The venue crate is the orderbook alone. ComposableBody and the structured poll seam (Verdict, LegacyRevertAdapter, IConditionalOrder) move to the new composable-cow keeper crate, the Composable variant drops from the venue body, the goldens shed the composable vectors, and a blocking CI gate keeps composable symbols out of crates/cow-venue.
e9d8504 to
69a18ea
Compare
What
Splits crates/cow-venue in two: the venue keeps only the orderbook (
OrderBody, the borsh codec, classification, client); a newcomposable-cowcrate takesComposableBody, the structured poll seam (Verdict,LegacyRevertAdapter,IConditionalOrder), and everything ComposableCoW-specific. TheComposablevariant drops fromCowIntent.shepherd-sdk's cow module andtwap-monitornow import poll types fromcomposable-cowinstead of re-exporting them off the venue. Adds a blocking CI gate (check-cow-orderbook-only.sh) that scanscrates/cow-venuefor composable symbols and fails if any leak in. Goldens regenerated to drop the composable vectors.Why
The CoW venue contract is the orderbook alone: submit, quote, status, cancel, and orderbook-error mapping, with zero knowledge of ComposableCoW,
getTradeableOrderWithSignature, revert selectors, or TWAP. Mixing the composable keeper into the venue crate meant a new CoW keeper couldn't be written without dragging in composable machinery. This is a pure-Rust re-split with no contract dependency, so it lands ahead of the ADR-0013 poll wire-swap.Closes #395
Testing
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo nextest runforcow-venue,composable-cow,shepherd-sdk,twap-monitor(85 passed)scripts/check-cow-orderbook-only.shpasses locallyAI Assistance
Implemented with Claude Code.