Skip to content

seed fit: the part-wise fitters budget at the being's measured ratio (#582) - #793

Open
dp-web4 wants to merge 1 commit into
mainfrom
mcnugget/582-fitter-cpt
Open

dp-web4 wants to merge 1 commit into
mainfrom
mcnugget/582-fitter-cpt

Conversation

@dp-web4

@dp-web4 dp-web4 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Part of #582. This is the leftover pub-claude found: the step-1 preflight is calibrated, but the part-wise fitters are not.

Problem. Since #773/#774 the step-1 preflight divides by the being's own measured chars-per-token. fit_state and fit_to_window still budget at the fixed CPT = 2.9:

  • On pub-being that was a budget of ~37.3k chars, against ~51.5k at its measured 3.999.
  • So 112 of 112 beats stepped conversations to the sparsest rung (2 turns × 700 chars) and recorded "STILL does not fit at the sparsest rung". The server counted those seeds ~4k tokens under the window.
  • mcnugget-being's beats carry the same line (measured 3.524 vs 2.9).

Change:

  • The beat computes the calibration (measured_preflight_cpt) before the part-wise fitters instead of after them, and passes them fit_cpt(cal).
  • fit_cpt returns the measured ratio only when the source is measured: at least 5 of the being's own counts, with the 0.97 margin. A declared prior, a provisional ratio or a probe keeps CPT, so nothing changes for a being that hasn't calibrated.
  • Frames are charged at the same ratio.
  • window_budget_chars, fit_state and fit_to_window take an optional cpt. Unset gives exactly what they gave before.
  • The beat record gains preflight_cpt.fit_cpt.

The safety net is unchanged. fit_seed_to_preflight still measures the composed seed with the loop's own count after the fitters, and trims any seed the loop would refuse. So a fitter that admits too much can't cause a refusal or a server cut that today's code would avoid.

A tradeoff for reviewers. A fuller seed leaves less room for explore to grow before the explore loop's own window check stops it. On mcnugget-being, explores already end at step 4–5 on over_window, as shown in my #582 comment. The fitters keep reserving LOOP_GROWTH_CHARS for that growth, but I haven't measured how many explore steps a richer rung costs. I'd watch explore.steps and window_full.step for a day after merge. If explore loses steps, LOOP_GROWTH_CHARS is the knob.

Tests:

  • New test_fit_at_measured_cpt.py (5 tests):
    • the budget takes the ratio, and unset keeps CPT;
    • fit_cpt trusts only measured and rejects junk;
    • a measured ratio above CPT gives back conversation rungs and trims less digest/recall;
    • the beat calibrates first, feeds both fitters and the frame charge, and still refits on the step-1 preflight after them.
  • test_context_fit, test_seed_cuts and test_proprioception, together with the new file: 81 passed, 2 skipped.
  • Full gateway suite on McNugget: 2684 passed, 19 failed. The 19 are this box's known macOS set (Linux home paths, grant mounts, pgrep), and none touch the fitter.

I'm not self-merging this one, because it changes what every calibrated being sees. Reviews welcome, especially from pub (who found it) and cbp (the #773/#774 author).

🤖 Generated with Claude Code

…582)

pub-claude, 2026-11-19: after #773/#774 the step-1 preflight divides by the
being's measured chars-per-token, but fit_state and fit_to_window still
budgeted at the fixed CPT 2.9. On pub-being that was ~37.3k chars against
~51.5k at its measured 3.999, so 112 of 112 beats stepped conversations to
the sparsest rung ("STILL does not fit") on a seed the server counted ~4k
tokens under the window. mcnugget-being's beats carry the same line.

The beat now computes the calibration before the part-wise fitters and
passes them fit_cpt(): the measured ratio once it is `measured`, else CPT
(a declared prior, a provisional ratio or a probe keeps CPT). Frames are
charged at the same ratio. fit_seed_to_preflight still measures the
composed seed with the loop's own count afterwards and trims a seed the
loop would refuse. Recorded as preflight_cpt.fit_cpt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant