Fix six open issues: stale imports, MCP validation, import-graph gaps, dup importers, I/O errors, scope docs

- pipeline: re-resolve imports for every file on update (not just changed),
  so add/remove/rename of a target fixes unchanged importers; propagate hash
  and read errors instead of treating unreadable files as empty
- discovery: report unreadable walk entries to stderr instead of dropping them
- imports: strip `pub` visibility so `pub use` re-exports resolve; share
  extension/module-entry probe lists (adds cc,cxx,hpp,hh,hxx,mts,cts,jsx,mjs,cjs)
- store: DISTINCT + ORDER in importers_of to dedup repeated edges
- mcp: validate required tool args (explicit isError), emit JSON-RPC -32700
  parse errors and -32600 invalid-request instead of silently skipping
- README: document the 13-tool surface vs toktoken's 27 and known gaps
- tests: regression coverage for update re-resolution, pub-use re-exports,
  importer dedup, and MCP error reporting

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
endergebnisandCopilot committed 2026-09-04 18:49:06 +02:00
1 parent 6875998ab6
commit 4338e28ce0
7 files changed
+271 -49

No files matched your search

+9 -1
View File
@@ -32,10 +32,15 @@ pub fn discover(project: &Path) -> Result<Vec<SourceFile>> {
});
let mut out = Vec::new();
let mut skipped = Vec::new();
for entry in builder.build() {
let entry = match entry {
Ok(e) => e,
Err(_) => continue,
Err(e) => {
// Report unreadable entries instead of dropping them silently.
skipped.push(e.to_string());
continue;
}
};
let path = entry.path();
if entry.file_type().is_some_and(|t| t.is_dir()) {
@@ -54,6 +59,9 @@ pub fn discover(project: &Path) -> Result<Vec<SourceFile>> {
language,
});
}
for s in &skipped {
eprintln!("rustytokens: skipped unreadable entry: {s}");
}
out.sort_by(|a, b| a.rel.cmp(&b.rel));
Ok(out)
}