Repository navigation
Expose concrete resource handles behind private I/O ports - #125
Closed
Stephen Belanger (Qard) wants to merge 1 commit into
Closed
Stephen Belanger (Qard) wants to merge 1 commit into
Stephen Belanger (Qard) wants to merge 1 commit into
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.
Applications previously had to name types such as
SpanHandle<BraintrustClient>and propagate SDK implementation parameters whose trait bounds were private. The stream adapter and evaluation hooks also exposed that coupling. Resources retained a whole client just to reach transport or delivery services.Expose concrete
SpanHandle,Experiment,Dataset, their builders, andDatasetIterator. Keep dependency injection behind private resource API, span submission, and delivery lifecycle ports. The resource HTTP adapter owns only the shared HTTP pool; tracing and lifecycle ports are implemented directly by the queue. Public methods retain their existing operation behavior, credential scopes, and shared registration state.Experiment span builders now own the captured dependencies and can outlive their experiment. Update stream adapters, evaluation hooks, tests, and documentation to use concrete handles. Remove obsolete experiment API compatibility modules and deny private bounds/interfaces at the crate level.
Stacked on #124. Finished-span behavior and the remaining eager operation/runtime work follow in separate layers. Planning notes remain local.
Validation: 279 unit/integration tests and 9 doctests passed (one existing integration test and four doctests ignored), strict Clippy and rustdoc, formatting, and
git diff --check. Consumer coverage stores concrete resource types directly, checks owned Send/Sync handles and builders, uses resources/pagination after client drop, and verifies accepted writes drain after the last resource/client is dropped. A weak-reference regression confirms resource dependencies release the original client state.