Repository navigation
Context has a price: her act holds the window where her value per second peaks (card 7b7a696a) - #5822
Merged
Merged
Conversation
joelteply
added a commit
that referenced
this pull request
Nov 7, 2026
…ver untrimmed demand, and a settled holder above it is released (card 7b7a696a, step 1) (#5823) The M5, 2026-11-07, 19426f4 + fork 46c664457 (Fable's first-hour read): 71 acts vs 158 the hour before, median 104 s vs 50 s, decode 7-10 t/s vs 15-22, Benchy 392 s, 1 write. The cold-boot plan regrew the pool from 152,832 to 755,456 and #5816 grew minds toward targets of 150-557k (her untrimmed wish with headroom), so grants reached 197k and prompts grew from ~30k to 35-75k; every held token slows every act (Fable measured 3.54 +/- 0.30 s per act per 1k held tokens on 1,124 acts). Step 1, the stopgap, within the hour of the read: - grants.rs: a mind's target is her held need x SENT_HEADROOM (the existing named sent headroom), never her untrimmed demand. Growing past it is a priced decision (step 2). - window_grant.rs: a settled mind (served on her grant since it last changed) with no turn in flight holds no more than her target as the policy reads it, so what she holds above it is released at her next view start in every stage. A mind not yet served on her grant, or mid-turn, keeps all of it. Step 2 (this card, after #5822 lands): the target reads continuum-context price.rs, the window her priced plan holds, and SENT_HEADROOM leaves the grant path; 68ffe0f0 (requirements record what the priced plan holds, so the pool stops growing for unheld demand) rides with it. Tests: continuum-engine capacity:: 234 pass; continuum-serving --tests check clean; ratchets vs origin/canary 87/87. New: a_settled_holder_above_her_target_is_released_to_it (197k held, 30k need: released to 37,500; unserved or mid-turn keeps it). Updated with reasons: the drift test now uses production-shaped targets (a drift inside the headroom keeps the grant; that headroom is what makes drift free), and the roomy case asserts release instead of "keeps her surplus". Mutation: without the holds cap, the release test fails. Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
joelteply
force-pushed
the
fable/view-start-token-oracle
branch
from
November 7, 2026 14:19
2654bad to
cb3b9a1
Compare
joelteply
force-pushed
the
fable/context-has-a-price
branch
from
November 7, 2026 14:19
293f7ba to
6a36aeb
Compare
joelteply
added a commit
that referenced
this pull request
Nov 7, 2026
… through to names The dyno on #5822 (the residents' captures driven through allocate) found three defects: 1. Extrapolation: ~80% of the windows priced::hold chose lay below the smallest context ever measured (10,840), where the fresh-tokens line clamps. The search now runs only over windows whose held context lies inside ActTime::measured(); where none does the plan is the plan as before and the receipt says Priced::OutsideMeasured { measured }. The served window competes only when it is measured too (Held.at_window is None otherwise). 2. Tools priced to names: the cut was mostly her tool schemas going from 8.5-10.4k tokens to 245-717, a help call and an extra act each that no value the allocation weighs can see. ladder::Consumer types what a consumer is to her: Context (a choice may reach its hard limit) or Actionable (a choice never shows an item below its summary; the pointer stays reachable only through the hard-limit path, a window too small). Head carries its consumer (her tools are Actionable), Source::consumer declares a view source's (her held card is Actionable, whole under a choice), and ActClaims.view carries ViewClaim { claim, consumer }. The plan's hard limits stay her claims' own, so her recorded need never reads the price's floor. 3. The live fit rarely existed: keyed by her binding's window it reset on every window change and deploy (measured on 14-53% of acts). It now lives in her working memory, one ActTimeFit per (provider, model) (working_memory::act_times), checkpointed in her volatile snapshot. Tooling: `replay --allocate [--since] [--trace i,j]` is the allocation's dyno: per resident, sent and kept tokens, priced and unpriced, held over served window, predicted s/act, tools sent and kept, what the price decided and how many acts the live fit priced. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
force-pushed
the
fable/view-start-token-oracle
branch
from
November 7, 2026 17:36
cb3b9a1 to
bf0e87c
Compare
joelteply
added a commit
that referenced
this pull request
Nov 7, 2026
… through to names The dyno on #5822 (the residents' captures driven through allocate) found three defects: 1. Extrapolation: ~80% of the windows priced::hold chose lay below the smallest context ever measured (10,840), where the fresh-tokens line clamps. The search now runs only over windows whose held context lies inside ActTime::measured(); where none does the plan is the plan as before and the receipt says Priced::OutsideMeasured { measured }. The served window competes only when it is measured too (Held.at_window is None otherwise). 2. Tools priced to names: the cut was mostly her tool schemas going from 8.5-10.4k tokens to 245-717, a help call and an extra act each that no value the allocation weighs can see. ladder::Consumer types what a consumer is to her: Context (a choice may reach its hard limit) or Actionable (a choice never shows an item below its summary; the pointer stays reachable only through the hard-limit path, a window too small). Head carries its consumer (her tools are Actionable), Source::consumer declares a view source's (her held card is Actionable, whole under a choice), and ActClaims.view carries ViewClaim { claim, consumer }. The plan's hard limits stay her claims' own, so her recorded need never reads the price's floor. 3. The live fit rarely existed: keyed by her binding's window it reset on every window change and deploy (measured on 14-53% of acts). It now lives in her working memory, one ActTimeFit per (provider, model) (working_memory::act_times), checkpointed in her volatile snapshot. Tooling: `replay --allocate [--since] [--trace i,j]` is the allocation's dyno: per resident, sent and kept tokens, priced and unpriced, held over served window, predicted s/act, tools sent and kept, what the price decided and how many acts the live fit priced. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
force-pushed
the
fable/context-has-a-price
branch
from
November 7, 2026 17:36
1fa12e9 to
761369c
Compare
…ond peaks Card 7b7a696a. On the M5 (build 19426f4) the pool regrew 152,832 -> 755,456 tokens, the grants grew toward untrimmed demand, and her prompts went from ~30k to 35-75k tokens: 71 acts in the first hour against 158 the hour before, median act 104 s against 50 s. Every held token slows every act, and the allocation filled whatever window it was served. Measure (continuum_context::price, validator `replay --act-price`): per binding, from her acts' own engine timings, three weighted least-squares lines (decode s/output token and prefill s/fresh token against the context each ran over, fresh tokens per act against the prompt) compose her act's seconds at a held context; a fourth, engine seconds per act fitted directly, is the check. Sufficient statistics only; an undetermined line, or a marginal within one standard error of none, is ContextPrice::Unmeasured. Price (allocation/priced.rs): the allocation holds the window W in [least, served] that maximizes (V(W) - V(least)) / T(W): the search's own value above her least plan, per measured second of her act. The exchange rate is that ratio itself (Dinkelbach), no constant. Allocating at W reproduces the priced optimum, so her view's start, its room and the turnover depth see one consistent window. `least` keeps every hard limit, her held head levels, her newest result whole and her reply's need: never priced out. Unmeasured, or a window no larger than `least`, plans exactly as before. Wiring: the faculty folds each reply's timing into an ActTimeFit carried in her PromptFeedback beside her density (reset with it on a binding change) and passes its price into ActClaims; the window.flex probe names what the price decided. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… through to names The dyno on #5822 (the residents' captures driven through allocate) found three defects: 1. Extrapolation: ~80% of the windows priced::hold chose lay below the smallest context ever measured (10,840), where the fresh-tokens line clamps. The search now runs only over windows whose held context lies inside ActTime::measured(); where none does the plan is the plan as before and the receipt says Priced::OutsideMeasured { measured }. The served window competes only when it is measured too (Held.at_window is None otherwise). 2. Tools priced to names: the cut was mostly her tool schemas going from 8.5-10.4k tokens to 245-717, a help call and an extra act each that no value the allocation weighs can see. ladder::Consumer types what a consumer is to her: Context (a choice may reach its hard limit) or Actionable (a choice never shows an item below its summary; the pointer stays reachable only through the hard-limit path, a window too small). Head carries its consumer (her tools are Actionable), Source::consumer declares a view source's (her held card is Actionable, whole under a choice), and ActClaims.view carries ViewClaim { claim, consumer }. The plan's hard limits stay her claims' own, so her recorded need never reads the price's floor. 3. The live fit rarely existed: keyed by her binding's window it reset on every window change and deploy (measured on 14-53% of acts). It now lives in her working memory, one ActTimeFit per (provider, model) (working_memory::act_times), checkpointed in her volatile snapshot. Tooling: `replay --allocate [--since] [--trace i,j]` is the allocation's dyno: per resident, sent and kept tokens, priced and unpriced, held over served window, predicted s/act, tools sent and kept, what the price decided and how many acts the live fit priced. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
force-pushed
the
fable/context-has-a-price
branch
from
November 7, 2026 18:47
761369c to
0186968
Compare
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.
Card 7b7a696a (P0). Stacked on #5819 (
fable/view-start-token-oracle, itself stacked on #5814). Do not merge before them.How this serves the minds: a resident's prompt is charged at what it costs her act in seconds. She keeps the context that is worth its time and collapses the rest, even when her window could hold more. It never prices out what she acts through, and it never prices where nothing was measured. This advances path step 1 (Fast: median act under 60 s at four residents) and goal 7 (one budget).
The regression
The M5 ran build 19426f4 with fork 46c664457. The pool regrew from 152,832 to 755,456 tokens, and grants grew toward untrimmed demand (150k to 557k). Residents' prompts went from about 30k to 35-75k tokens. In the first hour there were 71 acts, against 158 the hour before. The median act took 104 s, against 50 s. The allocation filled whatever window it was served.
Step 1: measure (
continuum_context::price)The fit runs per (provider, model), from her acts' own engine timings (
GenerationTiming). It fits three weighted least-squares lines:Together they give an act's seconds at a held context,
T(X), and its derivative, the marginal seconds per held token. A fourth line fits engine seconds per act directly and checks the composed curve. The fit keeps only sufficient statistics. A line that is undetermined, or a marginal within one standard error of zero, isContextPrice::Unmeasured.ActTime::measured()is the range of prompt contexts the fit was measured over.The validator is
cargo run -p continuum-context --example replay -- --act-price --since <UTC>.Step 2: price it (
allocation/priced.rs)The allocation holds the window
Wthat maximizesR(W) = (V(W) - V(least)) / T(W).Vis the search's own value (Σ priority x ln(1 + tokens));Tis her measured seconds atW, less the reply's grant.Exchange rate. No constant is involved. At the peak,
dV/dW = R x dT/dW, so the exchange rate between value and seconds isRitself: her optional context's value per second (Dinkelbach's form). The one measured quantity behind it is her act time. Her least plan's value appears in every plan the price can choose, so the rate leaves it out. Counting that value too gives a rate about 7x higher, which priced every optional token out on the M5's numbers.Why a window instead of a per-token term in the search. Allocating at a smaller window is the same as a higher price on every token, up to level steps. So the priced plan is the existing plan at
W, and every downstream reader (her view's start, its room, the turnover depth) sees one window.search.rsis unchanged.What a price choice never does:
ActTime::measured(). Where no such window exists, the plan is the plan as before, and the receipt saysPriced::OutsideMeasured { measured }. The served window competes only when it is measured too;Held.at_windowisNoneotherwise.ladder::Consumertypes this per consumer kind:Context: a choice may reach the hard limit.Actionable: a choice never shows an item below its summary.ActionableHead. Her held card is anActionableview source (Source::consumer), whole under a choice.Priced::WindowBinds, planned exactly as before.least):Search. A ternary search over
Wwithin the measured part of[least, window], accurate to the token. It takes about 2 ms per act.Value signal. Value is still priority x ln(tokens). Using the measured re-read hazard (#5806) as the history value is card 4e97192b.
Wiring
ActTimeFitper (provider, model) in her working memory (working_memory::act_times). It is checkpointed in her volatile snapshot, so window changes and restarts keep it.PromptFeedback, which resets on every window change and deploy. The dyno found it measured on only 14-53% of acts.learn_prompt_density.ActClaims.price,ActClaims.view: Vec<ViewClaim { claim, consumer }>andHead.consumercarry the inputs.delib.window.flexprobe logspriced.Tooling:
replay --allocateThis is the allocation's dyno: each captured act's claims are driven through
allocate, priced and unpriced. It reusescaptures::loadand the view replay'scut. Per resident it reports:--trace i,jprints every claim for the named acts.Tests
price/tests.rs:Unmeasured.allocation/priced/tests.rs, on the M5's measured act time:a_large_window_is_not_filled_when_its_tokens_cost_more_than_they_add: inside the measured contexts, and never priced at the served window by extrapolation;the_price_never_chooses_outside_the_measured_contexts: a curve measured over 60k-146k never holds below 60k; one measured only belowleastplans as before (OutsideMeasured);what_she_acts_through_is_never_priced_below_its_summary: verbs at least at summaries and the held card whole; a window between the names-only floor and the summaries floor binds and plans as before;a_small_window_plans_as_before,her_newest_result_is_never_priced_out,a_cheaper_context_holds_more.working_memory/act_times.rs: a fit is kept per engine and model across a checkpoint round trip, and other models' acts never join it.cargo test -p continuum-context --lib --examples: 106 + 21 passed;cargo test -p continuum-cognition --lib --features test-fixtures,metal -- llm_deliberation_faculty working_memory context_streams: 215 passed;cargo checkon continuum-cognition and continuum-core tests (test-fixtures,metal): clean;ratchets origin/fable/view-start-token-oracle: every count unchanged.Measured
The curve. From
replay --act-price --since 2026-11-06T13:00Zon the M5's captures: Qwen3.6-35B-A3B, 1,124 completed acts, prompts from 10,840 to 145,858 tokens, read at 2026-11-07 13:04Z.Marginal seconds per 1k tokens held, from the composed curve:
The direct line gives 3.73 ± 0.31 s per 1k over the whole range. The composed curve runs high above 80k, where there are only 68 acts.
The dyno.
replay --allocate --since 2026-11-07T01:00Zon the four residents' captures, head 1fa12e9, read at 15:07Z. The node fit is over 653 acts; measured contexts are 11,206 to 148,458.What the dyno shows. The price now stays inside its measurement, and the kept median sits on the lower bound of the measured range (11,206). The curve's peak for most acts lies below the smallest context it was measured at. It does not choose that peak; it holds the smallest measured context. That is a real limit: the price stops at the edge of its own measurement rather than following the curve further down. Tools never go below their summaries; the remaining tool cut is whole schemas down to name and description. The live fit, now kept per engine and model, priced 46-98% of acts; Aris is lowest because her fit's marginal stays within one standard error longer.
What the dyno cannot show:
cut, and the reply's need from her previous twenty outputs. That is close to the live claims, not identical.After-deploy check (owner Fable, deadline: first live hour after #5814, #5819 and this PR deploy on the M5): per resident, median act and acts/h at the same window grants as 19426f4, from the captures. Also check each act's
pricedfield ondelib.window.flex, which should be mostlyHeldinside the measured range, and tool grants at or above the summaries. The pass criterion is a median act at or below 60 s with grants unchanged. The card stays open until that receipt is posted.Rebased onto #5819 at bf0e87c (2026-11-07), head 761369c
The only conflict was
continuum-context/src/lib.rs: canary'spub mod navand this PR'spub mod priceare both kept.Measured on the M5 (local, nice 19, own target dir, serving untouched) at 761369c:
cargo test -p continuum-context --lib --examples: 111 + 21 passed.cargo test -p continuum-cognition --lib --features test-fixtures,metal: 974 passed, 0 failed, 1 ignored.cargo test -p continuum-core --lib --features test-fixtures,metal -- deliberation: 19 passed.ratchets p5819(bf0e87c): exit 0, every count unchanged.Recording her priced need: the "pool bloat" item above, which said this belongs with the governor's owner, is now #5833, stacked on this PR. Her need is now the window this price chose. It is never a sum of floors and never her view's uncollapsed overflow, and it is never past the model's trained context.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo