chore: Tidy up the imports - #231
Merged
Merged
Conversation
grahamking
force-pushed
the
gk-libsy-pub-cleanup
branch
2 times, most recently
from
July 31, 2026 19:06
c673b15 to
efa9df2
Compare
1. `libsy` exports everything public at `libsy::` and names the types
explicity, no `use module::*`.
None of the internal modules are visible. This should give us the
ability to move things around later.
2. Normalize imports so that inside a crate:
- Structs are imported and used directly. `use crate::thing::Thing; let t = Thing{ .. }`
- Functions have one level of prefix. `thing::do_it()`
That's probably the most common way to do it in Rust, although there's
all ways. I find it makes it easier to read, and having a standard is
better than a bit of everything like before.
Signed-off-by: Graham King <grahamk@nvidia.com>
grahamking
force-pushed
the
gk-libsy-pub-cleanup
branch
from
July 31, 2026 19:08
efa9df2 to
29c93a9
Compare
grahamking
marked this pull request as ready for review
July 31, 2026 19:16
WalkthroughThe change reorganizes ChangesLibsy API migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/libsy/src/algorithms.rs`:
- Line 9: Add concise /// purpose documentation above the public module
declarations: document fall_through in crates/libsy/src/algorithms.rs at lines
9-9, affinity and escalation in crates/libsy/src/algorithms/util.rs at lines
4-5, and subagent in crates/libsy/src/algorithms/util.rs at line 9. Ensure each
public module has its own documentation comment.
In `@crates/libsy/src/lib.rs`:
- Around line 80-109: Restore public compatibility modules for the previously
exposed switchyard_libsy::algorithms and switchyard_libsy::stage_router paths,
re-exporting the corresponding current APIs from the existing algorithms and
stage-router implementations. Mark these modules deprecated if appropriate,
while preserving their public accessibility; do not add a crate-root re-export
for the internal FallThrough type.
In `@crates/switchyard-components/src/stage_router.rs`:
- Around line 12-15: Update the module documentation link associated with the
stage-router re-exports to reference the public switchyard_libsy root or another
publicly available root item instead of switchyard_libsy::stage_router; leave
the re-export list unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 18699be5-9b5b-4772-8495-36160968a437
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (37)
crates/libsy/examples/ensemble.rscrates/libsy/examples/research_agent.rscrates/libsy/examples/research_agent_core.rscrates/libsy/examples/streaming_agent.rscrates/libsy/src/algorithms.rscrates/libsy/src/algorithms/fall_through.rscrates/libsy/src/algorithms/llm_class.rscrates/libsy/src/algorithms/noop.rscrates/libsy/src/algorithms/passthrough.rscrates/libsy/src/algorithms/rand.rscrates/libsy/src/algorithms/stage.rscrates/libsy/src/algorithms/subagent_affinity_tests.rscrates/libsy/src/algorithms/util.rscrates/libsy/src/algorithms/util/affinity.rscrates/libsy/src/algorithms/util/escalation.rscrates/libsy/src/algorithms/util/llm_judge.rscrates/libsy/src/algorithms/util/prompts.rscrates/libsy/src/algorithms/util/stage.rscrates/libsy/src/algorithms/util/subagent.rscrates/libsy/src/algorithms/util/tool_signals.rscrates/libsy/src/core.rscrates/libsy/src/core/algorithm.rscrates/libsy/src/core/classifier.rscrates/libsy/src/core/driver.rscrates/libsy/src/core/state.rscrates/libsy/src/lib.rscrates/libsy/src/observability.rscrates/libsy/tests/observability.rscrates/switchyard-components/src/stage_router.rscrates/switchyard-py/src/libsy_bindings.rscrates/switchyard-server/Cargo.tomlcrates/switchyard-server/src/config.rscrates/switchyard-server/src/lib.rscrates/switchyard-server/src/response.rscrates/switchyard-server/src/routing_log.rscrates/switchyard-server/src/usage_metrics.rscrates/switchyard-server/tests/server.rs
ayushag-nv
approved these changes
Jul 31, 2026
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.
libsyexports everything public atlibsy::and names the typesexplicity, no
use module::*.None of the internal modules are visible. This should give us the
ability to move things around later.
use crate::thing::Thing; let t = Thing{ .. }thing::do_it()That's probably the most common way to do it in Rust, although there's
all ways. I find it makes it easier to read, and having a standard is
better than a bit of everything like before.
Assisted-by: Claude:Opus 5 medium
Signed-off-by: Graham King grahamk@nvidia.com
Summary by CodeRabbit