GitNexus/gitnexus/test
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
..
fixtures fix(cpp): dependent-base resolution across nested/inline namespaces (#1634) (#1814) 2026-05-25 12:36:06 +01:00
helpers fix(test): retry Windows temp cleanup in cli-e2e teardown (#1688) 2026-05-18 18:17:54 +01:00
integration fix(lbug): resolve non-ASCII paths for KuzuDB on Windows (#1811) (#1817) 2026-05-25 21:28:12 +01:00
unit fix(wiki): add budget-aware grouping to prevent context overflow on large repos (#627) (#1832) 2026-05-26 12:32:07 +01:00
utils fix: skip Claude augment hook when GitNexus server owns DB (#1493) 2026-05-14 16:39:30 +01:00