Persist generation claims so every reader (daemon, --no-daemon, read-only) answers eligibility from the database #519

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

Summary

Readers without a live PackageHost cannot answer which package claims this path:

  • IndexAccess::path_claims defaults to None for every database-only LocalIndex (crates/daemon/src/access.rs:212).
  • The read-only path (crates/mcp-server/src/main.rs:1048-1100) reports eligibility as UNAVAILABLE whenever any_installed(root) is true. Now that every language is a package, that is effectively always.
  • Two eligibility.rs files (daemon 1,267 lines, mcp-server 1,367 lines) exist largely to carry this answer across the process boundary.
  • generation_packages (crates/indexer/src/schema.sql:166) does not persist the claims.

The result is that daemon, --no-daemon and read-only fallback answers differ for the same tree.

Proposal

When a generation is activated, persist each package's claims (extensions, filenames, and later shebangs) into a generation_claims table, keyed by generation. Every reader then answers eligibility and index_coverage from the database with no host process. Remove the RPC method and most of both eligibility.rs files.

This also gives #298 (shebang claims) a place to live.

Acceptance

index_coverage and eligibility answers are identical across daemon, --no-daemon and read-only modes, checked by the daemon⇄snapshot parity runner on a tree with active packages.

Found by an automated architecture review (2026-11-09).


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 Readers without a live `PackageHost` cannot answer *which package claims this path*: - `IndexAccess::path_claims` defaults to `None` for every database-only `LocalIndex` (`crates/daemon/src/access.rs:212`). - The read-only path (`crates/mcp-server/src/main.rs:1048-1100`) reports eligibility as UNAVAILABLE whenever `any_installed(root)` is true. Now that every language is a package, that is effectively always. - Two `eligibility.rs` files (daemon 1,267 lines, mcp-server 1,367 lines) exist largely to carry this answer across the process boundary. - `generation_packages` (`crates/indexer/src/schema.sql:166`) does not persist the claims. The result is that daemon, `--no-daemon` and read-only fallback answers differ for the same tree. ## Proposal When a generation is activated, persist each package's claims (extensions, filenames, and later shebangs) into a `generation_claims` table, keyed by generation. Every reader then answers eligibility and `index_coverage` from the database with no host process. Remove the RPC method and most of both `eligibility.rs` files. This also gives #298 (shebang claims) a place to live. ## Acceptance `index_coverage` and eligibility answers are identical across daemon, `--no-daemon` and read-only modes, checked by the daemon⇄snapshot parity runner on a tree with active packages. Found by an automated architecture review (2026-11-09). --- _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 #520 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 **#520** 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#519
No description provided.