updater: stop whole-repository --update from looping (#113) - #114
Merged
Merged
Conversation
A baseline built in whole-repository mode (empty module_tree.json, one overview.md) and then updated against a wider scope ran unbounded: the fallback rule was forced off, the routing agent created a new leaf per orphan and every leaf mapped back onto the overview page, so the page was rewritten once per leaf, each time fanning out the same sub-modules under x_2, x_3, ... names. - Gate the whole-repo fallback on the clustering threshold: if the current scope would be clustered by a fresh build, fall back to a full build. - In whole-repo mode route orphans to the single page without an LLM call and without creating leaves; run the overview once. - Skip sub-module requests that are already documented (plain or parent-prefixed name) and tell the agent, instead of suffixing _N.
Closed
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 #113.
Problem
A baseline generated in whole-repository mode (
module_tree.json == {}, oneoverview.md, typically from a narrow--include) and then updated with--updateagainst a wider scope ran for hours and produced dozens of colliding pages (overview_approval.md,overview_overview_approval_2.md,_3, ...).Traced in the code:
orchestrator.pyforcedratios["fired"] = Falsein whole-repo mode, so the fallback-to-full-build rule could never fire, whatever the size of the current scope.overview.mdonce per created leaf. Each rewrite fanned out the same sub-modules again.generate_sub_module_documentationresolved name collisions by appending_2,_3, ... so the repeated fan-out never converged.Fix
max_token_per_module(the same threshold a fresh build uses to decide whether to cluster), the update returnsfull_fallback; the CLI already handles that by preserving the old docs and rebuilding. The record now carriesclustering_tokensandtau_cluster.plan_sub_module_specskeeps the issue LLM-chosen module names collide in flat output directory, silently overwriting or losing documentation files #76 parent-prefix behaviour, but a request whose plain and prefixed names both exist is reported back to the agent as already documented, with an explicit instruction not to request it again.