MCP-prep cleanup: signature in scan_project, drop lib.rs, clippy-clean#48
Conversation
…y-clean
- scan_project now embeds the signature line, matching update_file
- Remove empty src/lib.rs that was registering an unintended library target
- Rename test_hybrid_search_incoming_edge to test_directional_graph_excludes_callers
to reflect the new directional-graph semantics
- Make clippy clean under -D warnings:
- Mark Indexer::{update_file,remove_file} #[allow(dead_code)] (legitimate
one-shot API surface alongside IndexWorker)
- Collapse two nested if blocks in generator.rs
- Introduce ParseResult type alias for CodeParser::parse return type
|
CI failed with the same signature as #47 —
So I believe this is the same fastembed model-download flake that affected #47 (11 tests starting in parallel, fresh
Let me know which (if either) you want and I'll push it. Generated by Claude Code |
There was a problem hiding this comment.
Pull request overview
This PR performs a small set of pre-deployment cleanups to ensure consistent embedding text generation, remove an unintended library crate target, and make the project clippy-clean under cargo clippy -- -D warnings.
Changes:
- Align symbol embedding text between full-project indexing (
scan_project) and incremental updates by includingSignature: {}in the embedding payload. - Remove the empty
src/lib.rsto avoid producing an unintendedlibtarget alongside theamdbbinary. - Clippy hygiene: simplify nested conditionals, rename/clarify an integration test, and reduce
clippy::type_complexityby introducingParseResult.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration_test.rs | Renames and slightly refactors a focus/depth integration test to reflect directional graph semantics. |
| src/lib.rs | Removes an empty library crate entrypoint to prevent unintended lib target creation. |
| src/core/parser.rs | Introduces ParseResult alias and uses it for CodeParser::parse to address clippy type complexity. |
| src/core/indexer.rs | Adds signature to the embedding text in scan_project; adds #[allow(dead_code)] for wrapper methods kept as a public API. |
| src/core/generator.rs | Simplifies nested if blocks into single conditions to satisfy clippy/readability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Three targeted cleanups requested before MCP deployment, plus the clippy follow-ups required to make
cargo clippy -- -D warningssucceed.Fixed
scan_projectembedding text — was missing theSignature: {}line thatupdate_filealready had. Both code paths now produce identical embedding text, so a file re-scanned by the daemon won't get a different vector representation than the one written atinittime.src/lib.rs— it was registering an unintendedlibcrate target alongside the[[bin]], producing build ambiguity. The binary already declares its modules insrc/main.rs, so no other change was needed.test_hybrid_search_incoming_edge→test_directional_graph_excludes_callers— the old name implied reverse-traversal behavior that v0.6.0 explicitly removed ingenerate(). The body keeps the same setup but the new name documents the actual contract: a callee focus (target_funcindef.rs) does not drag callers (user.rs) in via--depth 1. Usedfn caller()instead offn main()to keep the call graph unambiguous.Clippy hygiene (required by
-D warnings)Indexer::update_file/Indexer::remove_filewith#[allow(dead_code)]— they're a legitimate one-shot wrapper API aroundIndexWorkerkept for callers who don't want to manage worker lifetime; not used internally.if-in-ifblocks insrc/core/generator.rsinto single&&expressions.pub type ParseResult = (Vec<CodeSymbol>, DependencyGraph, Vec<CodeRoute>, Vec<CodeWarning>);and used it asCodeParser::parse's return type to silenceclippy::type_complexity.Test plan
cargo clippy --all-targets -- -D warnings— cleancargo build --release— 0 warnings, 0 errorscargo test— blocked in this sandbox (same constraint as PR v0.6.0: Production-ready bug fixes and improvements #47: every integration test invokesamdb init, fastembed downloadsXenova/bge-small-en-v1.5from HuggingFace, sandbox blockshuggingface.cowithx-deny-reason: host_not_allowed). CI onubuntu-latestshould be able to run them.Generated by Claude Code