-
Notifications
You must be signed in to change notification settings - Fork 2
sdk: add the keeper macro and typed venue client #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces a second, unenforced source of venue identity.
#[videre_sdk::venue]derives an adapter's registration id from its ownmodule.toml, butVenue::IDon the keeper side is a hand-typed string literal in a completely separate crate, with no macro, build script, or type-level link back to the adapter's manifest. If the CoW adapter's registered id inmodule.tomlever changes (or a second deployment registers under a different id),CowVenue::IDkeeps compiling and silently routes to a venue id that no longer resolves — failing only at runtime with a routing fault, not a compile error. Worth generatingVenueimpls (or at leastID) from the same manifest source#[videre_sdk::venue]reads, or having the venue macro emit a shared marker type the keeper side imports instead of hand-typing the string.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed still valid at HEAD. Both sources are still there and still unlinked:
cow-venue/module.toml->[module] name = "cow", whose own comment says "The manifest name is the venue id the registry installs", and which#[videre_sdk::venue]reads.cow-venue/src/client.rs->const ID: VenueId = VenueId::from_static("cow"), hand-typed.Tracked in #543 (M3), to land pre-cleave while the macro (L2) and the adapter (L3) are still one repo.
One framing correction: at the tip both sources live in the same crate (
shepherd/crates/cow-venue/), in adjacent files, rather than "a completely separate crate". That narrows the drift window but does not close it, since there is still no compile-time link, and your failure mode is exactly right: a renamed[module] nameleavesCowVenue::IDcompiling and routing to an id that no longer resolves, surfacing only as a runtime routing fault.Because they are colocated and the venue macro already parses the manifest, there is a cheaper fix than codegen: have
#[videre_sdk::venue]emit a compile-time assertion that the crate'sVenue::IDequals the manifest-derived name. Drift becomes a compile error whileVenue::IDstays explicit and greppable. #543 records that as the preferred option, with full generation as the stronger alternative.Unrelated to this thread but worth closing the loop on your opening comparison: #453's
block_onhas since been brought in line withrt::complete. It no longer loops, it polls once and fails loud onPending(a named panic rather than a silent spin), so the two paths now share the same single-poll posture.