Conversation
…nternal - Re-export `normalize_line_endings` at crate root as stable public API - Remove `normalize_line_endings` from `__internal` module re-exports - Gate `__internal` module behind `#[cfg(any(test, feature = "__internal"))]` - Add `__internal` Cargo feature for fuzz/bench/integration test use - Add `required-features = ["__internal"]` to validation bench target - Update agnix-lsp to import from `agnix_core::normalize_line_endings`
…n tests - Add `features = ["__internal"]` to fuzz crate dependency on agnix-core - Add self-referential dev-dependency in agnix-core to enable __internal for integration tests (cfg(test) does not apply to the library when compiling integration tests) - Add "__internal" to workspace root dev-dependency feature list
…CHANGELOG - Add integration test verifying normalize_line_endings is accessible via the public API (agnix_core::normalize_line_endings) - Document __internal feature gate and normalize_line_endings promotion in CHANGELOG.md under [Unreleased]
Add Cow::Borrowed contract assertion for LF-only input and lone CR normalization case, completing full coverage of the public API contract.
- Swap #[doc(hidden)] / #[cfg(...)] attribute order to match Rust convention - Add Stability: stable annotation to normalize_line_endings public API - Use ## prefix for __internal feature comment to match __internal_unchecked - Strengthen api_contract test: add Cow::Owned assertions for CRLF/CR cases, empty string, mixed line endings, and pointer identity for Cow::Borrowed
…e_line_endings API
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 refines the API surface of 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 effectively gates the __internal module behind a feature flag and promotes normalize_line_endings to a stable public API. The changes are well-implemented across the workspace, including updates to Cargo.toml files, consumers of the function, and documentation. The new integration test for normalize_line_endings is comprehensive. I have one suggestion to improve the test structure for better maintainability.
There was a problem hiding this comment.
Pull request overview
This PR resolves #472 by reducing unintended semver surface area in agnix-core while keeping a production-used utility function available as a stable API.
Changes:
- Feature-gates
agnix_core::__internalbehind the new__internalCargo feature (orcfg(test)), preventing unconditional public exposure. - Promotes
normalize_line_endingsto a stable crate-root API (agnix_core::normalize_line_endings) and updates consumers accordingly. - Updates fuzz/bench/test configuration (features + required-features) and adds an integration test to lock in the
Cow/zero-copy contract.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/agnix-lsp/src/backend/events.rs | Switches to the new stable agnix_core::normalize_line_endings import. |
| crates/agnix-core/tests/api_contract.rs | Adds an API contract test ensuring stable behavior and Cow guarantees for normalize_line_endings. |
| crates/agnix-core/src/lib.rs | Re-exports normalize_line_endings at crate root; gates __internal behind __internal feature / cfg(test). |
| crates/agnix-core/fuzz/Cargo.toml | Enables __internal feature for fuzz targets that rely on hidden re-exports. |
| crates/agnix-core/Cargo.toml | Introduces __internal feature; adds bench required-features; adds self dev-dep to enable __internal for integration tests. |
| Cargo.toml | Enables __internal in workspace root dev-dependency features. |
| Cargo.lock | Lockfile update reflecting the self dev-dependency entry. |
| CLAUDE.md | Documents the new __internal gating and crate-root stable API for normalize_line_endings. |
| CHANGELOG.md | Notes the __internal feature gate and stable API promotion. |
| AGENTS.md | Mirrors the documentation updates for agent guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed gemini-code-assist's suggestion: split the single |
Summary
Resolves #472.
__internalCargo feature flag toagnix-coreto gate the__internalmodule, removing the implicit semver obligations created by its previously unconditional public visibilitynormalize_line_endingsto a stable public API at the crate root (agnix_core::normalize_line_endings), sinceagnix-lspuses it in production code and it is a genuine utility with no internal type dependenciesagnix-lspimport path, fuzz crate dependency, integration test dev-dependency, workspace root dev-dependencies, and benchmarkrequired-featuresChanges
crates/agnix-core/src/lib.rspub use parsers::frontmatter::normalize_line_endingsas stable public re-export__internalmodule behind#[doc(hidden)] #[cfg(any(test, feature = "__internal"))]crates/agnix-core/Cargo.toml__internal = []featurerequired-features = ["__internal"]to thevalidationbenchmark target__internalfor integration tests (standard Cargo pattern;cfg(test)does not apply to integration test compilations)crates/agnix-lsp/src/backend/events.rsagnix_core::__internal::normalize_line_endingstoagnix_core::normalize_line_endingscrates/agnix-core/fuzz/Cargo.tomlfeatures = ["__internal"]to theagnix-coredependencyCargo.toml(workspace root)"__internal"to workspace dev-dependency features alongside"__internal_unchecked"crates/agnix-core/tests/api_contract.rsnormalize_line_endings_is_public_apitest covering allCowcontract cases:Cow::Ownedfor CRLF, lone CR, and mixed;Cow::Borrowedfor LF-only and empty; pointer identity for zero-copy guaranteeCHANGELOG.md,CLAUDE.md,AGENTS.mdTest Plan
cargo test --workspace- 3680+ tests, 0 failurescargo build --package agnix-lsp- compiles without__internalfeaturecargo check --package agnix-core(default, no--internal) -__internalmodule absentcargo check --package agnix-core --all-features-__internalmodule presentcargo bench --bench validation --package agnix-core --features __internal -- --test- benchmark compilesdiff CLAUDE.md AGENTS.md- files are byte-for-byte identical