[engine] Add summary growth model for sublinear summary sizing#117
Merged
Conversation
…arly
Add `summaryGrowthModel` ('fixed' | 'logarithmic') and `summaryGrowthCoefficient`
parameters to SimulationConfig. The 'fixed' default preserves existing convergent
behaviour. 'logarithmic' applies a growing floor: coefficient × ln(1 + totalCompressed / 1000),
preventing summaries from converging to a fixed ceiling in long sessions.
- Extract `applySummaryFloor()` helper, applied in all 6 strategies
- Frontend: dropdown + conditional coefficient slider in ParameterPanel
- Sweep: enum sweep for model, numeric range for coefficient
- Tests: unit tests for floor function, integration tests for convergence
and growth behaviour
Closes #95
Co-Authored-By: Claude Opus 4.6 <[email protected]>
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
summaryGrowthModel('fixed' | 'logarithmic') andsummaryGrowthCoefficient(default: 1000) toSimulationConfigapplySummaryFloor()helper applied in all 6 strategies that produce summariesEngine Change
What: New
summaryGrowthModelparameter with two modes:'fixed'(default) — preserves existing convergent behaviour where summary stabilises atinterval / (ratio - 1)≈ 3.3k tokens'logarithmic'— applies a growing floor:coefficient × ln(1 + totalCompressedTokens / 1000), preventing the fixed-ceiling artefact in long sessionsWhy: At ratio=10 with 30k interval, summaries converge to ~3.3k tokens after 2-3 compactions. For 200-cycle sessions compressing 100k+ of history, a fixed 3.3k summary is unrealistically small. This was identified as modelling limitation #7 in FINDINGS.md and is the critical-path prerequisite for Phase 4 context quality experiments.
Impact on prior findings: None — the default
'fixed'model preserves identical results. Backwards compatibility verified by test.Closes #95
Test plan
applySummaryFloorunit tests (fixed passthrough, logarithmic floor, growth monotonicity)npm run buildsucceedsnpm run lintclean (0 errors)🤖 Generated with Claude Code