Skip to content

videre: bind venue id to the adapter manifest name - #577

Merged
mfw78 merged 1 commit into
dev/m1from
sdk/543-venue-id-binding
Jul 24, 2026
Merged

videre: bind venue id to the adapter manifest name#577
mfw78 merged 1 commit into
dev/m1from
sdk/543-venue-id-binding

Conversation

@mfw78

@mfw78 mfw78 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Bind a venue id to its adapter manifest name at compile time. #[videre_sdk::venue(id = "cow", body = CowIntentBody)] on the impl Venue for CowVenue {} block fills the Venue marker (const ID, type Body) and, at expansion, reads $CARGO_MANIFEST_DIR/module.toml and emits compile_error! when the id disagrees with [module] name. The manifest is anchored via include_bytes! so a manifest edit re-runs the check.

The attribute dispatches on argument presence: with args it takes the new marker path (no component world), with no args it takes the existing adapter-world path (still required on impl VenueAdapter). A keeper links the client slice, never the adapter slice, so it cannot generate a world.

Why

CowVenue::ID was a hand-typed VenueId::from_static("cow") with nothing holding it to the manifest name the host installs under, so a rename of one and not the other compiled and failed only as a runtime routing fault. The macro makes the two drift a build error, keeping the id explicit at the definition site rather than making the manifest authoritative. It is opt-in, so hand-written Venue impls with hand-typed ids keep compiling.

Testing

cargo fmt --all --check, cargo clippy --workspace --all-targets --all-features --locked -D warnings, all 17 guest wasms (16 modules plus the cow adapter), cargo nextest run --workspace --all-features --locked, cargo test --doc, 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 #543

@mfw78
mfw78 merged commit fbc29bc into dev/m1 Jul 24, 2026
7 checks passed
@mfw78
mfw78 deleted the sdk/543-venue-id-binding branch July 24, 2026 06:59
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