Skip to content

[engine] Add summary growth model for sublinear summary sizing#117

Merged
jimmytacks merged 1 commit into
mainfrom
experiment/095-summary-growth-model
Apr 3, 2026
Merged

[engine] Add summary growth model for sublinear summary sizing#117
jimmytacks merged 1 commit into
mainfrom
experiment/095-summary-growth-model

Conversation

@jimmytacks
Copy link
Copy Markdown
Collaborator

Summary

  • Add summaryGrowthModel ('fixed' | 'logarithmic') and summaryGrowthCoefficient (default: 1000) to SimulationConfig
  • Extract applySummaryFloor() helper applied in all 6 strategies that produce summaries
  • Frontend: dropdown select + conditional coefficient slider in both ParameterPanel and SweepParameterPanel
  • Sweep support: enum sweep for the model parameter, numeric range for the coefficient
  • 8 new tests covering unit behaviour and full-simulation convergence/growth

Engine Change

What: New summaryGrowthModel parameter with two modes:

  • 'fixed' (default) — preserves existing convergent behaviour where summary stabilises at interval / (ratio - 1) ≈ 3.3k tokens
  • 'logarithmic' — applies a growing floor: coefficient × ln(1 + totalCompressedTokens / 1000), preventing the fixed-ceiling artefact in long sessions

Why: 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

  • applySummaryFloor unit tests (fixed passthrough, logarithmic floor, growth monotonicity)
  • Full simulation: fixed model produces identical results to default (backwards compat)
  • Full simulation: fixed model shows convergence
  • Full simulation: logarithmic model grows beyond convergence point
  • Full simulation: logarithmic summary grows over successive compactions
  • All 194 tests pass
  • npm run build succeeds
  • npm run lint clean (0 errors)

🤖 Generated with Claude Code

…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]>
@jimmytacks jimmytacks added enhancement New feature or request status: in-review PR raised, awaiting review experiment Research experiment (agent-driven) engine-change PR modifies simulation engine code labels Apr 3, 2026
@jimmytacks jimmytacks merged commit 2e46026 into main Apr 3, 2026
1 check passed
@jimmytacks jimmytacks deleted the experiment/095-summary-growth-model branch April 3, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine-change PR modifies simulation engine code enhancement New feature or request experiment Research experiment (agent-driven) status: in-review PR raised, awaiting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Summary growth model: allow summary size to grow sublinearly over long sessions

1 participant