GitNexus/gitnexus/src
Gergő Magyar 4870879b21
fix(wiki): add budget-aware grouping to prevent context overflow on large repos (#627) (#1832)
* fix(wiki): add budget-aware grouping to prevent context overflow on large repos (#627)

When the grouping prompt exceeds 100k tokens (e.g. Apache TVM with ~2,378
files and ~306k estimated tokens), batch files by top-level directory and
issue one LLM call per batch. Partial results are deterministically merged;
any batch failure falls back to directory-based grouping.

* fix(wiki): address review findings — exact assertions, progress fix, error logging

- Replace bounds-only .toBeGreaterThan assertions with exact .toBe values
- Add per-batch budget compliance assertion for sub-batch case
- Add assertion that partial LLM results don't leak through nuclear fallback
- Pass fixedPercent/percentRange to streamOpts in batched LLM calls
- Log batch failure in onProgress before falling back to directory grouping
- Strengthen mergeGroupings dedup test from .toContain to exact .toEqual

* chore(autofix): apply prettier + eslint fixes via /autofix command

* fix(wiki): prevent slug collisions and handle single-file oversize in batched grouping

mergeGroupings now normalizes module keys by slug so case/punctuation
variants ("API Routes" vs "API routes") merge into one module instead
of producing colliding .md files.

batchFilesForGrouping now truncates per-file symbol lists via binary
search when a single file exceeds GROUPING_TOKEN_BUDGET, so every
LLM request stays within the context window.

* style(wiki): apply prettier formatting to generator.ts

---------

Co-authored-by: Test <test@example.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-26 12:32:07 +01:00
..
cli feat(mcp): add limit/offset/summaryOnly pagination to impact tool (#1818) 2026-05-26 08:48:24 +01:00
config fix(php): avoid Blade templates entering PHP analysis (#1790) 2026-05-23 23:37:40 +01:00
core fix(wiki): add budget-aware grouping to prevent context overflow on large repos (#627) (#1832) 2026-05-26 12:32:07 +01:00
lib feat: configure prettier with pre-commit hook (#563) 2026-03-28 14:58:04 +00:00
mcp feat(mcp): add limit/offset/summaryOnly pagination to impact tool (#1818) 2026-05-26 08:48:24 +01:00
server fix(windows): pass windowsHide:true to every child_process spawn-family call (#1794) 2026-05-24 09:51:21 +01:00
storage feat(wiki): support local Claude and Codex providers (#1769) 2026-05-25 12:59:48 +01:00
types feat(cpp): Add structured resolver suppression outcomes (#1785) 2026-05-24 07:34:40 +01:00