Restructure to make document be able to trace by llm - #29
hungpham10 merged 3 commits into
Conversation
The document tools were unusable end-to-end due to four latent bugs: - parsers: parent->children links were never persisted (nodes cloned into Document.nodes before children wiring), so hydrate could never descend. - graph: path token chains were built in reverse order (root ended up last), so full-path queries never matched; also node cache was materialized after trie insertion, so the first ingest interned no keys. - graph: the four trie projections shared one storage without namespace — radix root pointers collided per shard, leaving only the last-written trie reachable. Add shard_bias to Radix/Search (default 0) and give each docs trie a distinct shard range. - graph: the string interner was RAM-only while tries persisted, so interned token payloads dangled after restart. Persist the interner blob alongside docs and restore it in open(); doc ids move to their own id range (>=6e11) so they no longer collide with node ids. MCP/CLI wiring: - doc_search now parses dotted patterns into token chains via the interner, with a case-insensitive key-scan fallback for non full-path queries. - new tools: doc_search_value (scalar substring scan), doc_ingest_dir (recursive bulk ingest with limit), doc_remove. - doc_hydrate takes max_depth to keep LLM payloads small; doc_list returns per-doc metadata (doc_id, path, format, root_node_id, nodes) instead of bare counts; search results include key/index. - CLI: fix `doc ingest` clap panic (positional `path` clashed with the global --path arg, renamed to `file`); doc search uses the same real pattern resolution.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (46.94%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
==========================================
- Coverage 74.01% 73.83% -0.19%
==========================================
Files 87 87
Lines 18837 19286 +449
==========================================
+ Hits 13942 14239 +297
- Misses 4895 5047 +152 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
No description provided.