Skip to content

cow-venue: split refusal projection by read vs submit path - #580

Merged
mfw78 merged 1 commit into
dev/m1from
refactor/560-refusal-submit-read-split
Jul 24, 2026
Merged

cow-venue: split refusal projection by read vs submit path#580
mfw78 merged 1 commit into
dev/m1from
refactor/560-refusal-submit-read-split

Conversation

@mfw78

@mfw78 mfw78 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Splits the single refusal() constructor into refusal_for_submit (returns Refusal, keeps the AlreadyHeld success shape) and refusal_for_read (returns VenueError directly, collapsing AlreadyHeld to an error). quote_with and status_with now call refusal_for_read; post_order's submit path calls refusal_for_submit. The old Refusal::into_error helper is gone, replaced by the collapse living inside refusal_for_read.

Why

refusal()'s AlreadyHeld variant means success on the submit path and failure on every read path, but nothing at the type level enforced which reading a caller took; read paths just had to remember to call .into_error(). All three production call sites were already correct, but the shared constructor was a foot-gun for the next read-path call site added to this file. Splitting the constructor makes a read caller unable to compile against a refusal that still carries an unresolved already-held meaning.

Testing

Full battery green in the worktree: cargo fmt --all -- --check; cargo clippy --workspace --all-targets --all-features --locked -D warnings; cargo build --release --target wasm32-wasip2 --locked for the 16 non-cow-venue guest modules; cargo build --release --target wasm32-wasip2 --locked -p cow-venue --features cow-venue/adapter as a separate invocation; wasm output count 17 (expected 17); cargo nextest run --workspace --all-features --no-fail-fast --locked (795 passed, 1 skipped); cargo test --doc --workspace --all-features --locked; RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked; scripts/check-venue-agnostic.sh; scripts/check-cow-orderbook-only.sh.

AI Assistance

Implemented with Claude Code.

Closes #560

@mfw78
mfw78 merged commit 37fbf0b into dev/m1 Jul 24, 2026
7 checks passed
@mfw78
mfw78 deleted the refactor/560-refusal-submit-read-split branch July 24, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant