feat(renderer+rules): recursive section chunking + adoption gate for rerun-discovered rules#96
Merged
Conversation
…rerun-discovered rules Recursive chunking: a section chunk still over 8 KB with >=2 subsections splits one level deeper (topic -> section -> entry), the section file becoming a sub-index. OpenMeter validation: data-models/models.md went from 85 KB to a 9.8 KB routing sub-index + 84 per-model files; largest non-index chunk is now ~6 KB. Stale-cleanup prunes nested empty dirs. Adoption gate: on a deep-scan rerun (rules.json already populated), extract_output cmd_rules routes brand-new rule ids to proposed_rules.json instead of activating them — the user adopts/rejects in the viewer's Rules card (existing flow) before hooks enforce. Updates to active ids still apply directly; ignored/pending ids are not re-proposed. First scan keeps auto-adopting the baseline. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Builds on #94. Two changes validated on OpenMeter (the largest test repo so far, see openmeterio/openmeter#4486 for the pre-chunking state).
Recursive section chunking
A section chunk still over 8 KB with ≥2 subsections splits one level deeper (topic → section → entry), the section file becoming a sub-index with the same routing-table format.
OpenMeter blueprint results:
data-models/models.mdarchitecture/components.mdpatterns/key-decisions.mdDepth is capped (topic → section → entry); stale-cleanup now prunes nested empty dirs bottom-up.
Adoption gate for rerun-discovered rules
On a deep-scan rerun (
rules.jsonalready populated),extract_output.py cmd_rulesroutes brand-new rule ids toproposed_rules.jsoninstead of activating them — the user adopts/rejects them in the viewer's Rules card (existing flow) before hooks enforce. Updates to already-active ids still apply directly; ignored/pending ids are never re-proposed. The first scan keeps auto-adopting the baseline. Step 6 workflow doc tells the agent to report pending proposals in its final summary.Tests
13 new/updated tests (recursion, depth cap, hierarchical index reachability, nested-dir cleanup; adoption gate: first-scan auto-adopt, rerun proposal, in-place update, ignored/pending dedup). Full suite: 851 passed;
verify_sync.pygreen.🤖 Generated with Claude Code