v9.4.0: Context Window Safety, Improved Deep Summary, Interactive CLI
What's New in v9.4.0
Context Window Safety (4 safeguards)
- Pre-flight token estimation in compileFinalResult() — if >80% of context window, aggressively compresses middle segments
- RESOURCE_EXHAUSTED recovery — automatic 30s wait + context reduction + retry in both processWithGemini() and compileFinalResult()
- Document hard cap — P0/P1 docs bypass budget up to 2x cap; prevents huge critical docs from blowing context
- VTT fallback cap — full-VTT fallback capped at 500K chars with truncation notice
- Deep summary truncation — docs >900K chars truncated before batching
Improved Deep Summary Prompt
- 10 numbered preservation priorities (identifiers, people, statuses, action items, blockers, decisions, cross-references, technical specifics, numerical data, checklists)
- Quality requirements: cross-doc references, table preservation, hierarchy preservation
- Engineering/business-specialized system instruction
Interactive CLI Prompt
- When running with >=3 context docs and >100K estimated tokens, CLI now asks "Enable deep summary? [y/N]" before proceeding
- Respects --deep-summary flag (skips prompt if already set)
- TTY-aware: only prompts in interactive terminals
Documentation
- README, QUICK_START, ARCHITECTURE fully updated
- Removed stale EXPLORATION.md references
- Added Deep Summary + Context Window Safety sections to ARCHITECTURE.md
Tests
- 332 tests passing (15 test files)
- New test for 2x hard cap exclusion behavior
Full Changelog: v9.3.1...v9.4.0