Skip to content

venue: restore the dropped empty-receipt guard on status and cancel - #590

Merged
mfw78 merged 1 commit into
dev/m1from
videre/491-empty-receipt-guard
Jul 24, 2026
Merged

venue: restore the dropped empty-receipt guard on status and cancel#590
mfw78 merged 1 commit into
dev/m1from
videre/491-empty-receipt-guard

Conversation

@mfw78

@mfw78 mfw78 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Restore the empty-receipt rejection on the venue status and cancel paths. A guard_receipt helper rejects an empty receipt as invalid-body before it reaches the export shim, and the Client::status/Client::cancel path rejects it before the transport. Both the adapter export glue and the client wrapper are covered by tests.

Why

The videre rename dropped the guard: status/cancel previously rejected an empty receipt with a dedicated VenueError::InvalidReceipt, and disowned_receipt_is_dropped_from_the_watch covered it, but the variant and the test were removed rather than adapted. Both paths then succeeded unconditionally on any receipt, including empty ones, so a disowned or never-issued receipt would be watched or cancelled silently instead of rejected.

Testing

Full battery on the pinned 1.94 toolchain, all green:

  • nix develop --command just ci (fmt, clippy -D warnings, doc, module wasms, cargo test --workspace --all-features)
  • nix develop --command just check-venue-agnostic
  • nix develop --command just check-cow-orderbook-only

AI Assistance

Implemented with Claude Code.

Note for review

The original guard used a dedicated VenueError::InvalidReceipt. VenueError is the bindgen mirror of the venue-error variant in wit/videre-types/types.wit@0.1.0, which is frozen and fans across repos, so restoring the dedicated variant is a value-flow-freeze decision (gated by nullislabs/videre-nexum-module#22). This car therefore reuses the existing invalid-body variant and touches no file under wit/. If a dedicated invalid-receipt variant is wanted, that is a separate WIT-freeze change. The issue also offered documenting the drop as intentional as an alternative resolution.

Closes #491

The videre rename dropped the empty-receipt rejection on the status and cancel paths, so any receipt including empty succeeded unconditionally. Restore the guard at the receipt seam: the venue export shim rejects an empty receipt before adapter dispatch and VenueClient::status/cancel reject it before the wire, both through a shared guard_receipt helper.

The original check used a dedicated invalid-receipt variant; that would extend the frozen videre:types@0.1.0 venue-error, so the guard reuses the existing invalid-body case with an empty-receipt message. A unit test and a before-the-transport client test restore the dropped coverage.
@mfw78
mfw78 merged commit ed2b1f9 into dev/m1 Jul 24, 2026
7 checks passed
@mfw78
mfw78 deleted the videre/491-empty-receipt-guard branch July 24, 2026 23:04
mfw78 added a commit that referenced this pull request Jul 25, 2026
…mismatch (#597)

The venue-error WIT variant gains two additive, venue-neutral cases for the representable adapter-detected conditions that #589 and #590 had shoved into invalid-body strings: invalid-receipt for an empty or structurally-invalid receipt, and receipt-mismatch for a venue-returned identifier that disagrees with the locally derived one. Both are threaded through the bindgen VenueError, the owned VenueFault mirror and the faults.rs conversions, and the two adapter call sites move off invalid-body onto them so a caller can branch without parsing a message. invalid-body and denied stay as the escape hatch for custom or unrepresentable errors.

The change is a purely additive edit to videre:types with no version bump, kept extensible per the pre-cleave freeze policy, so it lands cheaply in the monorepo before the carve.

Closes #591
mfw78 added a commit that referenced this pull request Jul 27, 2026
…mismatch (#597)

The venue-error WIT variant gains two additive, venue-neutral cases for the representable adapter-detected conditions that #589 and #590 had shoved into invalid-body strings: invalid-receipt for an empty or structurally-invalid receipt, and receipt-mismatch for a venue-returned identifier that disagrees with the locally derived one. Both are threaded through the bindgen VenueError, the owned VenueFault mirror and the faults.rs conversions, and the two adapter call sites move off invalid-body onto them so a caller can branch without parsing a message. invalid-body and denied stay as the escape hatch for custom or unrepresentable errors.

The change is a purely additive edit to videre:types with no version bump, kept extensible per the pre-cleave freeze policy, so it lands cheaply in the monorepo before the carve.

Closes #591
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