docs: enrich OOM-fix streaming-refactor plan + gitignore fix#144
Merged
Conversation
Adds the comprehensive implementation plan for fixing the `codeiq enrich` OOM at ~/projects/ scale (49k files / 434k nodes, exit 137 on 15 GB host). Plan structure: 4 phases (Quick wins -> TreeCursor -> Streaming three-pass refactor -> Verification harness), 12 tasks total, each shippable as one PR. Includes a ralph-loop execution recipe so the loop can drive the plan to completion without human gates inside each phase. Research backing the plan: - Empirical pprof on airflow (9,151 files): 91% allocations from tree-sitter.(*Tree).cachedNode, peak RSS 3.8 GB - Trajectory: istio 1.1 GB / airflow 3.8 GB / ~/projects ~9-15 GB - Code walk: GraphBuilder dedup maps never released after Snapshot; ServiceDetector emits 434k CONTAINS edges - Kuzu defaults: 80% of system RAM for buffer pool, no streaming Appender API in v0.7.1-v0.11.3 (issue #2739) - ETL patterns: ID-only dedup + compact NodeIndex for linkers (drops Properties/Annotations) fits ~35 MB at scale Completion criterion (from plan): /usr/bin/time -v codeiq enrich ~/projects/ must complete with peak RSS < 4 GiB, exit 0, populated graph. Also fixes the .gitignore quirk that was preventing `docs/superpowers/plans/*.md` from being trackable: `docs/superpowers/*` ignored the plans/ directory itself, so the later `!docs/superpowers/plans/*.md` negation couldn't take effect. Added `!docs/superpowers/plans/` to un-ignore the directory first.
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
Lands the comprehensive implementation plan for fixing the `codeiq enrich` OOM at `~/projects/` scale (49k files / 434k nodes — exit 137 on 15 GB host).
Plan path: `docs/superpowers/plans/2026-05-13-enrich-oom-fix.md` (829 lines).
Plan structure
Ralph-loop ready
The plan includes a §"Ralph-loop execution recipe" with:
.gitignore fix
`docs/superpowers/` was ignoring the `plans/` directory itself, so the later `!docs/superpowers/plans/.md` negation couldn't re-include files. Added `!docs/superpowers/plans/` to un-ignore the directory before un-ignoring the .md files.
Research provenance
Four parallel research agents informed this plan:
Out of scope
Plan §"Out of scope" lists:
Each is its own future PR.
Test plan