cow-venue: split refusal projection by read vs submit path - #580
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Splits the single
refusal()constructor intorefusal_for_submit(returnsRefusal, keeps theAlreadyHeldsuccess shape) andrefusal_for_read(returnsVenueErrordirectly, collapsingAlreadyHeldto an error).quote_withandstatus_withnow callrefusal_for_read;post_order's submit path callsrefusal_for_submit. The oldRefusal::into_errorhelper is gone, replaced by the collapse living insiderefusal_for_read.Why
refusal()'sAlreadyHeldvariant 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