refactor(core): narrow public API surface (#85) - #156
Conversation
Summary of ChangesHello @avifenesh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a good step towards improving the encapsulation of agnix-core by narrowing its public API. The changes to make parsers, rules, and schemas modules private are correct, and re-exporting the Validator trait is the right approach to allow for custom validator implementations. I have one suggestion to potentially extend this refactoring to another module.
| mod parsers; | ||
| mod rules; | ||
| mod schemas; |
There was a problem hiding this comment.
This is a great refactoring to narrow the public API surface. In the same spirit, have you considered also making the file_utils module on line 15 private? It seems to be an internal utility, and making it private would further improve encapsulation. If it's intended to be part of the public API, perhaps it could be documented as such.
There was a problem hiding this comment.
Good suggestion! Applied in commit 413c841 - file_utils is now also private since it's not used by external consumers.
There was a problem hiding this comment.
Pull request overview
This PR narrows the public API surface of agnix-core by making internal implementation modules private while maintaining the stable public API and extensibility points.
Changes:
- Made
parsers,rules, andschemasmodules private to prevent coupling to internal implementation details - Re-exported the
Validatortrait to enable custom validator implementations viaValidatorRegistry - Updated CHANGELOG to document the API refinement
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/agnix-core/src/lib.rs | Made three internal modules (parsers, rules, schemas) private and re-exported Validator trait for public extensibility |
| CHANGELOG.md | Added entry documenting the API surface narrowing under the "Changed" section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Make parsers, rules, and schemas modules private - Re-export Validator trait to maintain extensibility for custom validators
Address review feedback from gemini-code-assist: file_utils is an internal utility not used by external consumers, so it should be private alongside parsers, rules, and schemas.
413c841 to
871e36b
Compare
- Remove unused pub use re-exports from parsers/mod.rs and schemas/mod.rs - Fix SkillSchema import path to use direct module path - Add #[allow(dead_code)] to internal modules (parsers, schemas) The dead code warnings appeared because these modules are now private and some items were only "used" via the public API surface. The items are preserved for future use and internal consistency.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Note: Per CLAUDE.md Critical Rule #11, this PR should not be merged until the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pub mod config; | ||
| pub mod diagnostics; | ||
| pub mod file_utils; | ||
| mod file_utils; |
There was a problem hiding this comment.
The PR description mentions only making parsers, rules, and schemas modules private, but the diff also shows file_utils being made private (line 15). The CHANGELOG correctly documents this change, but the PR description should be updated to match.
There was a problem hiding this comment.
Good catch! Updated the PR description to include file_utils. Thanks for the review.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Summary
parsers,rules,schemas, andfile_utilsmodules private in agnix-coreValidatortrait for custom validator implementations viaValidatorRegistrypub usere-exports from private modules#[allow(dead_code)]to internal modules to preserve items for future useChanges
crates/agnix-core/src/lib.rs:pub mod file_utils;→mod file_utils;pub mod parsers;→mod parsers;pub mod rules;→mod rules;pub mod schemas;→mod schemas;use rules::Validator;→pub use rules::Validator;crates/agnix-core/src/parsers/mod.rs: Removed unused re-exports, added#[allow(dead_code)]crates/agnix-core/src/schemas/mod.rs: Removed unused re-exports, added#[allow(dead_code)]crates/agnix-core/src/rules/skill.rs: Fixed import path for SkillSchemaTest Plan
cargo checkpassescargo clippy -- -D warningspassescargo test- all 763 tests passcargo build --releasesucceedsRelated Issues
Closes #85