Align core crates with workspace lint policy (#200) - #228
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (91)
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Summary
Validation
WalkthroughThe pull request aligns workspace lint settings, adds ChangesWorkspace alignment
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (2 errors, 5 warnings)
✅ Passed checks (13 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Declare project-specific conditional compilation names in the workspace policy, then make the text provider inherit it. Compare its integral Levenshtein distances by representation so the stricter policy remains valid without introducing floating-point arithmetic.
Document the completed policy bootstrap, the mechanical core checkpoint, remaining lint families, and validation evidence so the staged migration remains auditable across sessions.
Make `chutoro-core` inherit the root workspace lint policy and apply the mechanical `missing_const_for_fn` and `use_self` fixes. Record the remaining all-target Clippy baseline and shared-cache test contention in the living ExecPlan so later lint families can be resolved without weakening the policy.
Move the seven parent modules that share a name with an existing child folder to `mod.rs` locations. Preserve module contents and public paths while satisfying the inherited `self_named_module_files` policy. Record the successful focused validation and the remaining core lint baseline in the ExecPlan for the next remediation stage.
Quote Rust identifiers and symbolic expressions in core documentation so `doc_markdown` can validate source and property-test Rustdoc consistently. Record the focused documentation-markup acceptance evidence in the ExecPlan; remaining semantic lint families stay in their explicitly staged backlog.
Describe the concrete failure and panic conditions of every core API reported by the inherited Rustdoc lints. Keep the exact scoped validation command in the ExecPlan so future crate onboarding does not accidentally lint dependencies before their opt-in.
Require callers to handle the four core values whose loss discards cache configuration or a source error code. Record the scoped API-ergonomics validation in the ExecPlan while later core lint families remain intentionally staged.
Replace the reported single-pattern matches with `let-else` bindings while preserving cache-test failure messages without `unreachable!`. Record the scoped idiom validation in the ExecPlan; numerical and bounds safety remediation remains in the next staged work.
Record why the expensive mutation stress test is ignored and lift the memory-estimation constant to module scope for the inherited hygiene lint.
Convert private GPU, graph-insertion, and metrics helpers to associated functions. This records the completed lint family without changing their fallback, insertion, or metric-emission behaviour.
Keep the CPU pipeline and cache construction total when an unexpected zero value is encountered. Express the fixed HNSW default directly rather than panicking after a validation call.
Replace impossible test branches with explicit parameter constraints and surface a graph-state race as an invariant error. Keep the remaining production accessor remediation as a separate, measured lint stage.
Treat a missing private LRU shard as an unavailable optimisation so distance lookups continue without retaining cache entries. Preserve normal sharded cache behaviour for every valid configuration.
Make the assertion test's intentional `core_distance` result discard explicit without changing its required panic contract.
Rename shadowed vector, norm, and similarity bindings to preserve the distance primitives' validation and numerical behaviour with clearer scopes.
Rename cache and result bindings so cached distance validation preserves its existing resolution and error behaviour without shadowed scopes.
Keep union-find, MST, HNSW insertion, and invariant collection inputs distinct from the values they resolve or materialize. This preserves their existing graph and error contracts while satisfying the workspace naming policy.
Keep origin and new-node adjacency lists, evictions, and healing inputs distinct while preserving insertion capacity and reciprocity behaviour.
Keep shared session handles and the clock-configured session distinct in concurrency and metrics tests to satisfy the workspace naming policy.
Return the established CPU HNSW invariant error when a harvested edge references a missing core distance. Keep short neighbour results on their existing fallback path and borrow mapper inputs that are only inspected.
Pair every requested distance with a temporary output slot so batch failures preserve the caller's buffer without relying on unchecked indexing.
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. chutoro-core/src/mst/property/strategies.rs Comment on file let mut perm: Vec<usize> = (0..node_count).collect();
shuffle(&mut perm, rng);
for i in 1..node_count {
for pair in perm.windows(2) {❌ New issue: Bumpy Road Ahead |
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. chutoro-core/src/hnsw/tests/search.rs Comment on lines +132 to +134 let neighbour = neighbours
.first()
.expect("a successful ef=1 search returns one neighbour");❌ New issue: Large Method |
Preserve the existing `f64` operations while expressing them through the numeric operation traits. Add the explicit `num-traits` narrowing boundary required by the public `f32` distance contract.
Propagate malformed linkage-node and condensed-cluster references as typed hierarchy errors, preserving valid hierarchy traversal and event ordering.
Reject MST endpoints outside the declared dataset and report inconsistent union-find or linkage references as typed hierarchy errors.
Keep malformed MST endpoints as typed errors while avoiding nested input validation control flow.
Distinguish the validated configuration wrapper from its integer value to keep hierarchy extraction bindings unambiguous.
Record the verified remote branch head and the external GitHub API and CodeRabbit blockers. Revert the experimental Nixie concurrency limit after direct rendering showed that scheduling did not cause the intermittent timeout.
Strengthen HNSW graph mutation safety, property coverage, and test fixtures while preserving the public `usize` connection-count contract. Document the expanded workspace lint policy, user-facing errors and metrics, and the related debugging and execution plans. Replace test-process error boilerplate with `thiserror` and add focused coverage for endpoint validation and representative public const APIs.
Record the outstanding standalone Rust executable separately from the validated source changes so the working tree is clean and the artifact remains auditable.
Keep the ExecPlan aligned with the completed workspace enrolment, filesystem-exception audit, validated local gates, and pending external review for PR #228.
|
@coderabbitai review |
Action performedReview triggered.
|
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. Large Methodchutoro-core/src/hnsw/insert/executor/tests/mod.rs: ensure_reverse_edge_evicts_and_scrubs_forward_link What lead to degradation?ensure_reverse_edge_evicts_and_scrubs_forward_link has 72 lines, threshold = 70 Why does this problem occur?Overly long functions make the code harder to read. The recommended maximum function length for the Rust language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method. How to fix it?We recommend to be careful here -- just splitting long functions don't necessarily make the code easier to read. Instead, look for natural chunks inside the functions that expresses a specific task or concern. Often, such concerns are indicated by a Code Comment followed by an if-statement. Use the EXTRACT FUNCTION refactoring to encapsulate that concern. |
This comment was marked as resolved.
This comment was marked as resolved.
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures. Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. (Treat o11y, code safety, documentation and validation coverage as in scope). ❌ Failed checks (2 errors, 5 warnings)
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Current revision and changed files =='
git rev-parse HEAD
git diff --name-only "$(git merge-base HEAD origin/main)" HEAD 2>/dev/null || true
printf '%s\n' '== Hierarchy error definitions and tests =='
ast-grep outline chutoro-core/src/hierarchy --items all --view expanded
rg -n -C5 'InvalidEdgeEndpoint|extract_labels_from_mst|HierarchyErrorCode|InvalidForestReference' \
chutoro-core/src/hierarchy chutoro-core/tests -g '*.rs'
printf '%s\n' '== Write graph marker bindings =='
rg -n -C4 'write_graph_marker_guard|let _ = &' chutoro-core -g '*.rs'
printf '%s\n' '== Documentation paths and relevant content =='
fd -t f 'users-guide\.md|developers-guide\.md|.*guide.*\.md' docs . 2>/dev/null || true
rg -n -i -C3 \
'extract_labels_from_mst|InvalidEdgeEndpoint|distance.cache|cache.*(hit|miss|eviction|latency)|workspace lint|check-cfg|dylint|find_test_binary|bench' \
docs -g '*.md' 2>/dev/null || true
printf '%s\n' '== Process helper and test coverage =='
ast-grep outline chutoro-test-support/src/process.rs --items all --view expanded
rg -n -C4 'find_test_binary|TestBinaryError|CARGO_BIN_EXE|NotFound|suffix' \
chutoro-test-support -g '*.rs'
printf '%s\n' '== Const-context and trybuild coverage =='
fd -t f . | rg '(trybuild|ui|compile|const).*\.rs$|\.stderr$' || true
rg -n -i -C3 'trybuild|const .*ChutoroBuilder|estimate_peak_bytes|with_min_cluster_size' \
chutoro-core -g '*.rs' -g 'Cargo.toml'
printf '%s\n' '== Issue 200 =='
gh issue view 200 --repo leynos/chutoro --json number,title,state,body,urlLength of output: 202086 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Revision and PR metadata =='
git rev-parse HEAD
gh pr view 228 --repo leynos/chutoro --json headRefOid,baseRefOid,updatedAt,url
printf '%s\n' '== Relevant changed files only =='
git diff --name-only "$(git merge-base HEAD origin/main)" HEAD | \
rg '^(chutoro-core/src/hierarchy|chutoro-core/src/hnsw/tests/write_lock\.rs|chutoro-core/tests/trybuild|chutoro-core/tests/session_api_surface\.rs|chutoro-test-support/src/process\.rs|docs/(users|developers)-guide\.md|dylint\.toml|Cargo\.toml|[^/]+/Cargo\.toml|docs/execplans/feat-align-workspace-lint-policy\.md)$' || true
printf '%s\n' '== Endpoint validation and code coverage =='
rg -n -C8 'InvalidEdgeEndpoint|invalid.*endpoint|endpoint.*invalid|HierarchyErrorCode::' \
chutoro-core/src/hierarchy chutoro-core/tests -g '*.rs'
printf '%s\n' '== Write graph marker bindings and fake reads =='
rg -n -C3 'write_graph_marker_guard|let _ = &' chutoro-core/src/hnsw/tests/write_lock.rs
printf '%s\n' '== User documentation relevant sections =='
rg -n -i -C5 'extract_labels_from_mst|hierarchy error|InvalidEdgeEndpoint|distance cache|hnsw.*cache|chutoro_hnsw' \
docs/users-guide.md 2>/dev/null || true
printf '%s\n' '== Developer documentation relevant sections =='
rg -n -i -C5 'workspace lint|check-cfg|dylint|no_std_fs_operations|find_test_binary|process helper|chutoro-benches|benchmark.*inherit' \
docs/developers-guide.md 2>/dev/null || true
printf '%s\n' '== Lint-policy plan status =='
rg -n -C3 'Remaining|defer|Deferred|complete workspace|private-item|filesystem|developer' \
docs/execplans/feat-align-workspace-lint-policy.md
printf '%s\n' '== Workspace lint inheritance and filesystem exclusions =='
rg -n -C2 '^\[lints\]|workspace = true|missing_docs_in_private_items|unexpected_cfgs|dylint_lib' \
Cargo.toml */Cargo.toml chutoro-providers/*/Cargo.toml 2>/dev/null
cat dylint.tomlLength of output: 42889
All seven reported checks are resolved in the current PR head:
No AI-agent prompt is required. No new GitHub issue is required for these checks. This result is based on static inspection of the current codegraph. Runtime validation was not executed in this environment. You are interacting with an AI system. |
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. chutoro-core/src/hnsw/insert/executor/tests/mod.rs Comment on lines +201 to +203 let mut helpers = TestHelpers::new(&mut graph);
helpers.enforce_bidirectional_all(2);
let violation = helpers.find_reciprocity_violation(2);❌ New issue: Code Duplication |
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Passed
6 Quality Gates Passed
See analysis details in CodeScene
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| tests.rs | 9.39 → 10.00 | Code Duplication |
Absence of Expected Change Pattern
- chutoro/chutoro-core/src/hnsw/tests/property/types.rs is usually changed with: chutoro/chutoro-core/src/hnsw/tests/property/strategies.rs
- chutoro/chutoro-providers/dense/src/simd/tests.rs is usually changed with: chutoro/chutoro-providers/dense/src/simd/kernels.rs
Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
@coderabbitai review |
Action performedReview triggered.
|
Summary
This branch advances issue #200
by making the workspace lint policy effective for
chutoro-coreand the textprovider, then remediating the resulting source, test, fixture and assertion
findings without weakening the policy.
It implements the staged policy-bootstrap and core-remediation work recorded
in the ExecPlan.
It does not close #200: remaining crate enrolment, private documentation work,
and filesystem-exemption narrowing remain explicitly planned.
Review walkthrough
for the strict workspace policy and its shared
check-cfgdeclarations.and chutoro-providers/text/Cargo.toml
for the deliberate initial adopters.
for representative bounds-safe and complexity-reducing core changes.
and MNIST test helpers
for the cross-crate fallible test-helper and fixture refactoring.
to see the deliberately deferred issue scope.
Validation
make check-fmt: passedmake lint: passed (Rustdoc, Clippy and Whitaker)make typecheck: passedmake test: 1,082 passed, 1 skippedmake markdownlint: passedmake nixie: passedNotes
The branch contains the later test, fixture and assertion refactors alongside
the initial policy work, so the validation above covers the complete branch
rather than only its final lint-remediation commit. The rebase retains main's
coordinated Arrow and Parquet upgrade alongside this branch's numeric boundary.
References