Repository navigation
Fix module clustering size estimates and source file coverage - #146
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Large repositories could skip clustering because the split decision counted only selected leaf snippets. For goja, 1,632 leaf tokens represented 392,218 tokens of indexed implementation, and initial clustering returned an empty tree.
The split decision now counts every component in the current file scope, including methods omitted by leaf selection. Source files without indexed symbols are retained with full-source file nodes. Each file has one leaf-module owner; parent modules may retain aggregate component lists.
Changes
Measurements without LLM calls
Both clustering implementations were exercised with the same deterministic completer. Before uses base commit
364b67a. These are initial clustering trees, before documentation agents optionally add modules. Artifacts are disabled and the threshold is unchanged at 36,369 tokens.The larger post-change totals include previously absent symbol-free source files. Goja's selected inventory includes 77 non-test Go files and one JavaScript file. Every non-test Go file has exactly one module owner after clustering. All split repositories have zero duplicate file owners.
* Small repositories intentionally retain an empty module tree for one-page documentation. Their documentation agent receives all 8/8 and 5/5 selected files; neither invokes the clustering completer. With default artifact analysis enabled, cJSON and inih also remain below threshold at 30,928 and 6,894 tokens.
Validation
tree_sitter_phpunavailable to reproduce the CI dependency set. Source-file exclusions are shared with the analyzers and do not import parser grammars.pytest -p no:cacheprovider -o addopts="" tests/ -q.uvx ruff@latest checkanduvx ruff@latest format --checkpassed on all 22 changed Python files;git diff --checkpassed.codewiki generate --no-cache --no-artifacts --max-depth 2 --verboseon a scratch copy of goja using the configured Codex backend. The initial saved tree has 7 top-level groups and 27 leaf modules; after documentation-agent delegation it has 30 leaves. Both saved trees cover all 78 selected files, including all 77 non-test Go files, exactly once. The smoke run was intentionally interrupted after validating clustering and delegation; full wiki generation was not completed. Scratch copies and measurement outputs were removed.Limits
The chosen metric deliberately sums component source, so class/method source may overlap. Source outside indexed components is counted in full only when the file has no code symbols. Ignored, unsupported, and unreadable files remain outside coverage, and dependency resolution itself is unchanged.
Files remain indivisible: goja's
vm.gois a 37,272-token single-file leaf and is logged as oversized. Existing cached partial trees are not automatically rewritten; regenerate them with a fresh output or--no-cache. Small one-page repositories may still have an empty tree if their agent chooses not to delegate.