Skip to content

A cut answer is censored evidence: one cut raises her next room - #5812

Merged
joelteply merged 2 commits into
canaryfrom
fable/cut-is-censored-need
Nov 7, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fable/cut-is-censored-need

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What this does for the residents: when a resident's answer is cut at max_tokens partway through, her very next turn now gets more room. Today it takes a second wasted turn before the room grows. This serves the path's Fast step (wasted acts) and goal 7 (one budget).

The defect

On the live M5 (fe91c2b), turns were cut at max_tokens mid-answer at rooms of 853, 288 and 435 tokens. The cause was in working_set.rs record_emission_in_memory. CutMidAnswer pushed answer.saturating_mul(2) into the answer ring as if it were an exact sample. need_of reads the p90 of 16 samples, which is the second-largest. So one doubled cut, being the largest sample, was never read.

The change

  • The answer ring holds ChannelSample (Observed<u32>, the one censoring type already used by held need). A landed answer is stored as Exact, a cut answer as AtLeast. The record no longer applies any factor. The peak is what was actually written.
  • One censored estimator. need::answer_need computes the answer p90 with product_limit, the same Kaplan–Meier estimator the reasoning and held window already use. It also keeps the largest cut bound still in the ring as OutputNeed::answer_at_least.
  • OutputNeed::answer_room is the larger of two values:
    • the p90;
    • the median past the bound (cut_answer_median).
  • Why the median past the bound, and not the bound itself. The replay measured the bound-only variant first. A cut act's think fills its budget (the room past her answer), so the answer's bound equals its old share. A room read from bounds then stays at the very cap that cut her: Aris was cut 6 times at room 241. Nothing is known about the answer's size beyond the cut, so the cut position is scale-free (Gott's delta-t argument). That makes P(whole > k·written) = 1/k, so the median of the whole answer is twice what was written. The factor is read from a bound that ages out with the ring; it is never written into a sample.
  • Where answer_room is read:
    • act_room;
    • ActRoom's answer share, so think_within leaves room for the answer;
    • total(), the want of a pass.
  • The reply claim's upward test is unchanged. It now adds answer_room(), so the cut answer gets no second factor.
  • One owner for the emission read: working_set/emission.rs (ResponseEmission::of). It holds EmissionStop, the channel split and the answer bytes, moved out of working_set.rs and verdict/mod.rs. The faculty and the replay both call it.
  • A cut inside an open tool call counts as CutMidAnswer. The call's bytes count as answer even when the response carries no mirrored ToolUse part.
  • Smaller pieces:
    • ActRoom::think_within is shared by act_reasoning_budget and the replay.
    • reached_p90 is named once.
    • NEED_SAMPLES is now pub.

Measured

Validator: core/continuum-cognition/examples/act_room_replay.rs.

  • Input: the real prompt captures of the four residents (~/.continuum/fixtures/prompt-captures/<id>.pidx + .prev), copied read-only at 2026-11-07 01:26 CST from the live M5, read through the capture store's own playback reader (continuum_capture::prompt_capture::{page, detail}, newest header per request).
  • Feed: every completed generation goes through ResponseEmission::of and record_emission_in_memory.
  • Rooms: acts are replayed at act_room(), the reply claim's floor. Passes (cognition/deliberation, where the live cuts were) are replayed at total().
  • Cut rule: the think is bounded at think_within(room). A turn whose demand reaches the room is a would-be cut and is recorded as that cut. A turn cut live whose room is now above its cap is counted as unknown.
  • Window: the newest 200 turns per kind.
  • Old rule: the same binary built with the old record rule (doubled Exact sample, which is what canary does).

Run: cargo run -p continuum-cognition --features metal --example act_room_replay -- <dir> 200 (about 4 s).

resident kind turns live cuts would-be cuts old → new unknown old → new median room old → new p90 room old → new
Benchy 2f50b223 act 110 0 10 → 7 0 → 0 568 → 607 745 → 1013
Benchy 2f50b223 pass 98 7 4 → 3 4 → 4 520 → 610 638 → 755
Aiko 75ece751 act 52 0 5 → 4 0 → 0 724 → 984 1019 → 1071
Aiko 75ece751 pass 138 10 12 → 6 8 → 10 603 → 861 1591 → 2501
Aris 8044b75b act 158 1 20 → 14 0 → 0 366 → 446 502 → 658
Aris 8044b75b pass 66 4 1 → 0 4 → 4 446 → 658 570 → 980
Atlas e5f4141d act 12 0 1 → 1 0 → 0 614 → 686 634 → 686
Atlas e5f4141d pass 66 2 3 → 2 2 → 2 531 → 646 871 → 885
all 700 24 56 → 37 (−34%) 18 → 20

The opposite failure, a room that grows too much, also shows in this table:

  • Median rooms rise 5–48%.
  • Aiko's pass p90 rises from 1,591 to 2,501.
  • A grant costs view room only; it costs no decode time, since she stops on her own.

Each bound leaves the ring after 16 turns. The test uncut_acts_bring_the_room_back_down_after_a_cut covers this.

What the replay does not model:

  • the allocation growing a grant above its floor by priority;
  • the time term's upward test;
  • a pending cut's retained peak.

Live acts were sent with a median maxTokens of 17–28k, which is the window room. So on live acts the floor binds only when the window is full. The live cuts in these captures are passes (purpose cognition/deliberation, carrying tools; for example Aiko's maxTokens 853 cut).

A bound-only variant (no median past the bound) was measured first, on the act-only replay: 31 act cuts, against 28 for the old rule. That result is why cut_answer_median exists.

Live receipt: not taken. No deploy or live read was done; this needs the 15-minute live read after merge. The check is the cut rate (delib.emission.cut_mid_answer) and finished work per hour on the M5. Owner: whoever deploys.

Tests

Each test has a // what this catches: note. All are in the existing test mods.

  • one_cut_answer_raises_the_next_room_above_the_cuts_demand
  • uncut_acts_bring_the_room_back_down_after_a_cut
  • a_cut_inside_an_open_tool_call_is_a_cut_answer
  • a_cut_answer_floor_holds_its_median_past_the_bound (reply claim)
  • Updated tests that pinned the doubled record:
    • a_capped_emission_records_its_bound_and_an_uncapped_one_verbatim
    • the peak heal
    • the channel test
    • reply_reserve (d)/(e)
    • capacity_and_wire
    • core's a_writing_turn_after_a_cut_gets_its_reply_on_a_46848_window (that test now also asserts answer_room = 10,808)

Results:

  • cargo test -p continuum-cognition --features metal,test-fixtures --lib --examples: 957 passed, 0 failed.
  • cargo test -p continuum-core --features metal --lib -- test_env::mind_integration::registry::deliberation: 17 passed, 1 failed. The failure is pinned_act_result_reaches_the_prompt_even_with_an_empty_broadcast, which panics at LivePin::retain(..).handle().expect("saved inventory"). That is the spill store's disk write, not this change. I did not rerun it on canary to confirm it fails there too.
  • cargo run -p source-hygiene --bin ratchets -- fe91c2b55: passed.
  • tools/scripts/oversized-edits.sh origin/canary: passed. The largest touched file is verdict/contribute.rs at 974 lines; it was 999 before.

17 files, +650/−273 (the replay example accounts for 197 of the added lines).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

A turn cut at max_tokens mid-answer pushed its answer DOUBLED into the p90
ring of 16, where one sample (the largest) is never read: one cut left the
room unchanged and only a second wasted act grew it (the M5, fe91c2b,
rooms of 853, 288 and 435).

- The answer ring holds ChannelSample (Observed<u32>): Exact when she ended
  it, AtLeast when the cap cut it. The record writes no factor; the peak is
  what was written.
- need::answer_need reads the answer p90 by the one censored estimator
  (product_limit) and keeps the largest live cut bound beside it;
  OutputNeed::answer_room is the larger of the p90 and the median past the
  bound (cut_answer_median: twice what was written, derived from a
  scale-free cut position; a bound alone grants the cap that cut her, the
  replay shows Aris cut six times at 241). It ages out with the ring.
- act_room, ActRoom's answer share (so the think budget leaves it) and
  total() read answer_room.
- The emission read moves to one owner (working_set/emission.rs,
  ResponseEmission::of): EmissionStop, the channel split and answer bytes,
  shared by the faculty and the replay. A cut with an open tool call is
  CutMidAnswer, and call bytes count as answer even without mirrored parts.
- examples/act_room_replay.rs: the validator, replaying real captures
  through the registry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 300a06c into canary Nov 7, 2026
17 checks passed
@joelteply
joelteply deleted the fable/cut-is-censored-need branch November 7, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant