Layering: core depends on the signing crate via registry.rs, and get_dependencies emits no mod/crate edges so layering cannot be measured #526

Closed
opened 2026-11-09 08:03:48 +01:00 by buildagent · 1 comment
Member

Summary

Two layering problems. The second makes the first, and #32, impossible to verify with our own tools.

  1. core is not a foundation crate. crates/core/src/registry.rs (1,268 lines, the Forgejo release catalog) is why code-index-core depends on code-index-package, the signing crate (crates/core/Cargo.toml:27, registry.rs:43). Its only consumers are cli and mcp-server. Separately, mcp-server depends on the whole daemon crate just to get IndexAccess and LocalIndex.
  2. get_dependencies cannot answer a layering question. get_dependencies(crates/indexer/src/lib.rs) returned only 35 pub use re-exports. It returned no mod edges and no crate-level (Cargo) edges, so the reviewer had to read Cargo.toml from the shell. #28 (SCC/layering analysis) needs exactly these edges.

Proposal

  • Move registry.rs into package, or a new distribution crate, so core depends on nothing internal.
  • Split IndexAccess and the wire rows out of daemon into a small access crate that mcp-server, cli and daemon share.
  • Product: emit mod declarations as import edges, and Cargo [dependencies] (plus their equivalents in the other ecosystems: package.json, .csproj, composer.json, pyproject, Gemfile) as crate/package-level edges. get_dependencies and #28 can then report layering.

Acceptance

  • cargo tree -p code-index-core shows no internal crates.
  • get_dependencies on this repository lists the crate graph, and that graph matches cargo metadata.

Related: #32, #28. Found by an automated architecture review (2026-11-09); the Cargo edge was verified by hand.


Filed from a five-agent review of master @ e3ec6ead (bloat, robustness, agent usefulness, docs, architecture). Every finding was spot-checked in the main session before filing.

## Summary Two layering problems. The second makes the first, and #32, impossible to verify with our own tools. 1. **`core` is not a foundation crate.** `crates/core/src/registry.rs` (1,268 lines, the Forgejo release catalog) is why `code-index-core` depends on `code-index-package`, the signing crate (`crates/core/Cargo.toml:27`, `registry.rs:43`). Its only consumers are `cli` and `mcp-server`. Separately, `mcp-server` depends on the whole `daemon` crate just to get `IndexAccess` and `LocalIndex`. 2. **`get_dependencies` cannot answer a layering question.** `get_dependencies(crates/indexer/src/lib.rs)` returned only 35 `pub use` re-exports. It returned no `mod` edges and no crate-level (Cargo) edges, so the reviewer had to read `Cargo.toml` from the shell. #28 (SCC/layering analysis) needs exactly these edges. ## Proposal - Move `registry.rs` into `package`, or a new `distribution` crate, so `core` depends on nothing internal. - Split `IndexAccess` and the wire rows out of `daemon` into a small `access` crate that `mcp-server`, `cli` and `daemon` share. - **Product:** emit `mod` declarations as import edges, and Cargo `[dependencies]` (plus their equivalents in the other ecosystems: `package.json`, `.csproj`, `composer.json`, `pyproject`, `Gemfile`) as crate/package-level edges. `get_dependencies` and #28 can then report layering. ## Acceptance - `cargo tree -p code-index-core` shows no internal crates. - `get_dependencies` on this repository lists the crate graph, and that graph matches `cargo metadata`. Related: #32, #28. Found by an automated architecture review (2026-11-09); the Cargo edge was verified by hand. --- _Filed from a five-agent review of master @ e3ec6ead (bloat, robustness, agent usefulness, docs, architecture). Every finding was spot-checked in the main session before filing._
Author
Member

Consolidated into #543 and #517 during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.

Consolidated into **#543** and **#517** during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#526
No description provided.