refactor(libsy): tighten public api boundaries - #292
Draft
nachiketb-nvidia wants to merge 1 commit into
Draft
Conversation
Signed-off-by: nachiketb <nachiketb@nvidia.com>
|
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
Tightens the Rust public API boundary for libsy/protocol cleanup from SWITCH-1179:
Linear: https://linear.app/nvidia/issue/SWITCH-1179/refine-libsy-and-protocol-public-api-boundaries
Classifier,Processor,State, and related internal data types crate-visible instead of root-public SDK surface.NoopDecision,PassthroughDecision, and theRandomDecisionalias) fromlibsy.text_request,prompt_text,text_response,completion_text) from the publicswitchyard_protocolAPI.slice_to_header_mapfrom the public metadata API and keeps it as a test helper.Why
These helpers and implementation traits were convenient while the SDK surface was still forming, but they are not stable public contracts. Keeping them public makes downstream users depend on internals we should be free to reshape.
The public surface should stay centered on the protocol types, algorithms/configs, driver API, and observable routing behavior. Test fixture builders, lossy text extraction helpers, classifier/processor plumbing, and concrete decision implementation details should not be part of that contract.
How
pub(crate)for libsy internals that are only needed inside the crate.crates/libsy/src/text.rsfor crate-local text helpers used by internal code/tests.crates/libsy/examples/support/mod.rsso examples remain readable without relying on protocol-level fixture helpers.What To Review
crates/libsy/src/lib.rsare the intended SDK surface.switchyard_protocolno longer exposes lossy text/header test helpers.Validation
cargo fmt --allcargo check --workspace --all-targetscargo fmt,cargo clippy,commitlintNo tests were added; this is intentionally a public API cleanup only.