singularity-forge/.plans
Jeremy McSpadden 39b3daee6f feat: add token optimization suite for prompt caching, compression, and smart context selection
Introduces six new modules that work together to reduce token usage across
the dispatch pipeline while preserving semantic content quality:

- Provider-aware token counting with per-provider char/token ratios
- Prompt cache optimizer for maximizing Anthropic/OpenAI cache hit rates
- Structured data formatter (compact notation for decisions/requirements/tasks)
- Deterministic prompt compressor (light/moderate/aggressive levels)
- Semantic chunker with TF-IDF relevance scoring for context selection
- Summary distiller for condensed dependency summaries

Integration points:
- inlineDependencySummaries uses distillation before truncation (3+ deps)
- inlineDecisionsFromDb/inlineRequirementsFromDb use compact format at non-full levels
- buildExecuteTaskPrompt compresses carry-forward when it exceeds 40% of budget
- context-budget.reduceToFit combines compression with section-boundary truncation
- computeBudgets accepts optional provider for accurate char/token ratios

All existing 1475 unit tests + 30 integration tests pass with zero regressions.
157 new tests cover all optimization modules.
2026-03-17 22:02:27 -05:00
..
autocomplete-qol-improvements.md feat(autocomplete): add /thinking completions, GSD subcommand descriptions, and test coverage (#1019) 2026-03-17 18:27:17 -06:00
dynamic-model-discovery.md feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
fix-high-cpu-process-lifecycle.md fix: reduce CPU usage on long auto-mode sessions (#921) 2026-03-17 13:58:14 -06:00
issue-125-provider-fallback.md feat: add cross-provider fallback when rate/quota limits are hit (#125) 2026-03-14 15:45:44 -05:00
issue-524-git2-migration.md feat: move git operations to Rust via git2 crate (#572) 2026-03-15 20:02:10 -06:00
issue-575-dynamic-model-routing.md feat: dynamic model routing for token consumption optimization (#579) 2026-03-16 07:53:53 -06:00
issue-672-parallel-milestone-orchestration.md feat: parallel milestone orchestration foundation (#672) 2026-03-16 20:32:10 -06:00
native-perf-optimizations.md feat: native perf optimizations — deriveState, JSONL, paths, parsing (#576) 2026-03-15 20:16:42 -06:00
onboarding-detection-wizard.md feat: add project onboarding detection and init wizard 2026-03-17 17:31:52 -05:00
preferences-wizard-completeness.md feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
startup-performance.md Perf/gsd startup speed (#497) 2026-03-15 13:33:43 -06:00
token-optimization-suite.md feat: add token optimization suite for prompt caching, compression, and smart context selection 2026-03-17 22:02:27 -05:00
tui-dashboard-cleanup.md refactor: TUI dashboard cleanup, dedup, and feature improvements (#931) 2026-03-17 14:02:26 -06:00