fix(file-analyzer): preserve language and fall back when imports unresolved

Two bugs surfaced when analyzing Python projects that use absolute imports:

- The dispatch prompt (SKILL.md) and file-analyzer agent omitted the
  per-file `language` field, so `extract-structure.mjs` received null and
  passed it through to the graph.
- `extract-structure.mjs` used `if (importPaths)` to decide whether to
  trust pre-resolved imports. Empty arrays are truthy, so files where the
  project scanner could not resolve any imports (e.g. Python absolute
  imports) clobbered the parser's import count with 0, never falling
  back to tree-sitter's own analysis.

Bumps plugin version to 2.6.1 across the five tracked manifests and adds
unit tests for `buildResult` covering language pass-through and the
importCount fallback paths. To make the script testable, `buildResult` is
now exported and the CLI invocation is guarded so importing the module
no longer triggers `main()`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lum1104
2026-05-07 21:02:47 +08:00
Unverified
parent 53248fea8b
commit 7834f9bc75
9 changed files with 118 additions and 29 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "understand-anything",
"displayName": "Understand Anything",
"description": "AI-powered codebase understanding — analyze, visualize, and explain any project",
"version": "2.6.0",
"version": "2.6.1",
"author": {
"name": "Lum1104"
},