fix: regenerate invalidated modules in whole-repository-mode --update runs - #100
Open
kiboook wants to merge 1 commit into
Open
fix: regenerate invalidated modules in whole-repository-mode --update runs#100kiboook wants to merge 1 commit into
kiboook wants to merge 1 commit into
Conversation
… runs
first_module_tree.json is only ever written by the LLM clustering path,
so it stays {} for any repo small enough to skip clustering
("whole-repository documentation mode"). generate_module_documentation()
computed the processing order exclusively from that file, so once
--update/--compare-to invalidated (deleted) an affected sub-module's .md
via module_tree.json, the regeneration loop had nothing to iterate and
the run always ended in IncompleteGenerationError.
Fall back to module_tree for the processing order only when
first_module_tree is empty. The normal clustered-repo path is untouched,
since first_module_tree is non-empty there and the fallback never
triggers.
Fixes FSoft-AI4Code#99
kiboook
force-pushed
the
fix/incremental-update-whole-repo-mode
branch
from
August 31, 2026 08:37
54615ec to
e27accc
Compare
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.
Fixes #99
Problem
--update --compare-to <commit>never regenerates an invalidated modulewhen the repo went through whole-repository documentation mode (module
clustering skipped because the repo fits in one context window). It
correctly deletes the affected module's
.md, then fails every time withIncompleteGenerationError. See #99 for the full trace of why.Root cause
generate_module_documentation()computed the processing order only fromfirst_module_tree.json, which stays{}forever for whole-repo-moderepos (only the LLM clustering path writes it) — even though
module_tree.jsoncan have real sub-modules a prior whole-repo agent runinserted. So the regeneration loop had nothing to iterate over for an
invalidated module.
Fix
Extracted the processing-order lookup into
DocumentationGenerator.resolve_processing_order(), which falls back tomodule_treeonly whenfirst_module_treeproduces an empty order. Thenormal clustered-repo path is unaffected, since
first_module_treeisnon-empty there and the fallback never triggers.
Testing
tests/test_processing_order_fallback.py(4 unit tests, no LLM/network needed) covering: fallback when
first_module_treeis empty,first_module_treestill wins when non-empty (regression safety forthe normal path), both-empty doesn't crash, and nested children are
still walked leaf-first through the fallback.
tests/test_overview_structure.pyagainst this change — all pass.
--update --compare-tonever regenerates invalidated modules in whole-repository documentation mode (always ends inIncompleteGenerationError) #99 (tinyauth/payment/notification TypeScript fixture, 2 commits): before the
fix, the run reproducibly failed with
IncompleteGenerationError;after the fix,
generate --update --compare-to <sha>succeeds, thechanged module regenerates, the two unaffected modules are correctly
skipped ("✓ Module docs already exists"), and the overview is rebuilt
referencing all three.