Skip to content

An epoch start shares what held: reuse the previous epoch's unchanged lead, stable source order, tallies out of block heads (M5: 13 starts 219,682 -> 255,515 shared tokens) - #5803

Merged
joelteply merged 1 commit into
canaryfrom
fable/epoch-start-order
Nov 6, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/epoch-start-order

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Stacked on #5802. Serves the residents' pace (the path's step 1, Fast; order of work line 2, a mind's context as an epoch). On the M5 every turnover re-prefilled everything after the system and tools head, because the front of the new start moved. This PR makes a start keep, in place, whatever held from the epoch it replaces. Each rule goes through its owner: the codec's start (View::begin), its restart order (motion), and the producers of moving counts.

What changed, by owner

(3) The start reuses what held (continuum-context view.rs, lead_with_what_held)

  • A start lays its blocks down in three steps:
    1. The previous epoch's blocks, in that epoch's order, for as long as the start renders each one byte for byte.
    2. The first block the previous epoch held in other bytes, laid where it stood. The engine reuses its bytes up to the first difference, so a card appended at the end of a list keeps the whole list before it.
    3. Everything else, in the start's order.
  • A source's items never pass one another, so her conversation and her acts stay in order.
  • Checkpoint spacing stays Cormac's; this only maximises the shared prefix.

(2) The start order is stable (continuum-context motion.rs)

  • Sources now order by measured stability: how often each rendered exactly as it did at the previous start. Most stable goes first. A tie keeps the order the last start laid them in (Motion::started_in), then the caller's order.
  • The old order used kept / (1 - p). That ratio moved with each start's sizes, so neighbours traded places between starts: [my work]/[room-kanban] for Aris at 19:05Z, and notices/[tasks] for Benchy at 17:24Z. Each swap ended the shared prefix where it happened.

(1) Moving counts never sit in a block's head (continuum-grounding RagItem::as_tally, continuum-cognition Grounding::split_tally, continuum-mind room_board_source.rs)

  • A producer marks units that state moving counts as tallies.
  • A block's tallies become a block of their own, <faculty> counts. That makes it a separate source, so it sorts by its own (low) stability and a count change appends a few lines without rewriting the body.
  • The board marks three units as tallies: its headline (you hold N; M claimable), the available-work lead, and its history count.
  • The board's cards now list oldest first, so a new card appends to the block instead of rewriting it from its first card. Newest-first put every new card at the head of Aiko's 30k-char list. Her holds still come first, and the newest card is now last, nearest her newest context. The board test now asserts that a just-dispatched card is delivered whole and last.
  • Her [investigation] call distribution changes every act and sat ahead of her workspace notice. It is now a tally pin (WorkingMemory::pin_tally), listed after every notice that holds.

Measured

  • Data: the M5, core ed142f1, 2026-11-06 16:13-19:17Z. The receipts are the 13 delib.view.turnover probes and the prompt captures (.prev.jsonl + .jsonl).
  • Replay: both rules applied alike to each recorded pair. Rule 1 splits the kanban's tallies into a block after the view and orders its claimable cards oldest first. Rule 3 reuses the previous prompt's blocks while each is still present, with list items kept in their order, plus the unchanged front of the first changed block.
  • Prices: 3.05 billed chars/token, 144 prefill tok/s measured.
Start (turnover act) Shared prefix before (tokens) After (tokens)
Aiko 468b0119 14,149 29,535
Aiko 9c054d0e 31,126 30,963
Aiko c62f8de1 14,143 22,181
Aiko 34ffb086 14,143 22,260
Aiko 54a0d83f 13,678 13,675
Aris 358a35b1 19,434 19,393
Aris 5de962fd 13,678 13,675
Aris a5d9d67b 13,678 13,871
Aris 2dc03a95 19,539 19,475
Aris 5a508f83 19,715 19,641
Aris bba062d0 16,890 21,369
Benchy a3242b5d 14,716 14,723
Benchy c3e67a28 14,792 14,754
13 starts 219,682 255,515 (+35,833 tokens, about 249 s)
  • A start whose "after" is a few dozen tokens lower than "before" shares the same blocks as before. Its kanban block is just shorter once the tally lines move out.
  • What still ends the prefix is content that really changed at the front, not order:
    • which contracts are in force (Aiko 54a0d83f, Aris 5de962fd / a5d9d67b: [Your own time] vs [Directed Presence]);
    • the workspace map;
    • the wall's recipe and ledgers;
    • an open-view line that lost its intent note or read further;
    • a task whose result arrived.
  • I tested holding the contract set fixed: no gain, because the wall changed right behind it.
  • Prefill over all 158 recorded pairs: 8,033 s as captured, 6,818 s with Her prompt only appends: facts and tool switches are keyed items, her previous turn renders identically (M5: ~6,000 prefill-seconds in 3 h) #5802, 6,569 s with this PR on top.
  • Within an epoch: the kanban re-appended in 10 pairs, and only one of those was a count-only change (136 chars). Splitting the tallies matters at starts, not between acts.

Validation at 80bc75e (crate-scoped, nice -n 19, own target dir, no workspace build, no reboot):

Crate Tests Result
continuum-context lib 74 pass
continuum-cognition --features metal lib 940 pass
continuum-grounding lib 6 pass
continuum-mind --features metal room_board, loop_dedup, service_loop, turn_frame 105 pass
continuum-academy --features metal eval 34 pass
continuum-core --features metal,accelerate test_env::mind_integration 96 pass
  • Ratchets pass against origin/canary: prompt_messages_outside_the_view 9 -> 8, no other change.
  • oversized-edits.sh passes.
  • No new clippy findings in the touched lines.

Post-deploy check (owner: Fable; the same 3 h window shape)

  • For each delib.view.turnover, read the engine's resume: for that act: cached before (head only, 11,198 / 9,078) vs after. Expect it to rise to the last checkpoint at or before the new shared prefix. Converting the new prefix into reuse depends on checkpoint placement, which is Cormac's.
  • Count turnovers per hour and check that the kanban counts block appends a few lines while the body stays put.
  • Worse than canary on median act time means the node goes back to canary at once.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply added a commit that referenced this pull request Nov 6, 2026
…er measured re-read cost

Her view now measures how often she asks again for what she already observed
(continuum-context rereads.rs, kept in Motion with the per-source stats #5803/#5805
keep): at every act each observing occurrence is exposed at its age in acts, and an
arrival with the same request fingerprint and outcome hash is a re-request at that age,
tallied over every level and over collapsed ones separately, halved at each start.

depth.rs chooses each instrumented growing source's start: walking its items newest
first, an item stays whole only while hazard x whole x (1 + (S-C)/(W-S)) exceeds the
turnover miss it saves, miss(S) = g (S-C)/(W-S). An age nobody was exposed at, a source
whose items carry no act, or no measured growth is Unmeasured and keeps the half rule.
start_grants (cognition) applies the chosen shares and probes delib.view.depth.

Replay (--append-tail 144 --measured-depth, 15 captures, deliberation + act):
8,478,327 -> 8,395,003 prefill tokens (-0.98%), 3 fewer turnovers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Base automatically changed from fable/prompt-stability to canary November 6, 2026 23:41
…nchanged blocks, orders sources most stable first, and keeps tallies behind what holds

On the M5 (core ed142f1, 2026-11-06 16:13-19:17Z) all 13 turnovers resumed only from the
system+tools head (11,198 / 9,078 tokens): the start's front moved.

- continuum-context View::begin lays a start's blocks out to share the longest prefix with the
  epoch it replaces (lead_with_what_held): that epoch's blocks in its order while each renders
  byte for byte, the first changed one laid where it stood (its unchanged front is reused too),
  then the rest; a source's items never pass one another.
- motion: sources order by measured stability (how often each rendered as at the start before),
  most stable first; a tie keeps the order the last start laid them in. The old
  kept / (1 - p) ratio moved with each start's sizes and swapped neighbours.
- Tallies leave the head: RagItem::as_tally marks units that state moving counts; a block's
  tallies become their own `<faculty> counts` block (Grounding::split_tally). The board marks its
  headline, available-work lead and history; its cards list oldest first, so a new card appends.
  Her [investigation] distribution is a tally pin, listed after every notice that holds.

Replay of the 13 recorded starts: shared prefix 219,682 -> 255,515 tokens (+35,833, ~249 s at
144 tok/s); all 158 pairs, prefill 8,033 s as captured, 6,818 s with #5802, 6,569 s with this.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fable/epoch-start-order branch from 80bc75e to 6764141 Compare November 6, 2026 23:42
@joelteply

Copy link
Copy Markdown
Contributor Author

Pure rebase onto canary after #5802 merged (squash b4026c2): git rebase --onto origin/canary 28df5d265. git range-diff 28df5d265..80bc75e4c origin/canary..676414192 gives 1: 80bc75e4c = 1: 676414192, an identical patch. Cormac's PASS at 80bc75e covers it; merging on green CI at 6764141.

@joelteply
joelteply merged commit 640a07b into canary Nov 6, 2026
20 of 29 checks passed
@joelteply
joelteply deleted the fable/epoch-start-order branch November 6, 2026 23:53
joelteply added a commit that referenced this pull request Nov 7, 2026
… the rest, so the reply's priority never collapses her newest turn

#5807's CI (merged with canary #5802/#5803): reply_priority_grows_the_reply_not_at_history_or_required_input
failed, history 1 on the pass and 0 on the act. Receipts (16,384 window, d601074):

- start_room is the same on both turns (979: view grants 3,570 + room 0 - reply short 2,591 on the pass;
  2,376 + 0 - 1,397 on the act), and start_grants raised the growing start to cover her newest turn
  (newest 570, start 766 on both).
- start_shares then split the growing room in proportion to what each source lacks of its GRANT, and the
  grants are the act's: the reply's priority moved her conversation's grant (3,197 on the pass, 2,003 on the
  act). Conversation share 449 on the pass, 437 on the act: 1,331 chars vs 1,295, her newest turn 1,296.
  The act collapsed it by one char.
- The same split on canary alone: conversation grant 3,461 / 2,161 (tools 8,240), the same leak with more
  slack; it passed by margin. tool/output's +474 tokens in this fixture (tools 8,714) removed the margin
  and exposed it. The reply WAS reaching her history through the split; the fixture window is not stale.

Fix: StartSource carries `newest` (its newest item's cost); start_shares gives each growing source its
newest item, capped by its grant and the start, before the proportional share. start_grants passes it.
After: pass and act render byte-identical history (segments equal, est 10,754 both).

Test: continuum-context allocation::tests::a_growing_source_holds_its_newest_item_whatever_the_grants_divide
(the receipt's numbers: both grants hold the newest turn).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Nov 7, 2026
…and a marker can only name a verb she holds (#5807)

* Every handle she's shown is one she can open: tool/output is native, and a marker can only name a verb she holds

tool/output was catalog-only (NATIVE defaulted false), so a native-call model
could not emit it, while every folded act, repeat, saved result, thought
handle, collapsed receipt and too-large note named it (2026-11-06, the M5: no
act called it). And the slash name the text used is not the name her tool
list offers (the first alias, read_output), so the prose never matched her
function list even for native verbs.

- tool/output moves beside the spill it reads (continuum-cognition), declares
  native: true, disclosure Always (the only tier a room's narrowed surface
  keeps, and a handle can appear in any surface), effect Reopens, and projects
  its outcome: a read that brought nothing back is Failed, like grep exit 1.
  Its description and param docs are cut to a few words (it rides every act).
- VerbRef<C> (kernel sdk_codegen): a reference to a command by TYPE, built only
  in a const from a native command in her hands (VerbRef::in_hands) or in every
  surface (VerbRef::always); a non-native or narrowed verb fails const
  evaluation (compile_fail doctests). It renders through wire_name, the one
  function her offered tool list is named by (OfferStyle/offer_style_for moved
  down beside it; tool_dialect re-exports them and routes to_wire_spec_with
  through it).
- Reopen (tool_output.rs): THE reopen affordance, one verb, one call form, the
  command's own params serialized: read_output({"act":3}),
  read_output({"outputId":"h"}). Migrated: actions fold + repeat, saved-result
  recall, thought pointers, newest-result too-large note, result attribution,
  collapsed pointers, open-views banner, spill byte-offset refusal, web/fetch
  filter note.
- CollapsedReceipt: one type renders the collapsed line and reads it back
  (accepted only when its fields re-render to the exact text); replaces the
  recogniser that accepted a form the index never emitted.
- tool_dialect::offered_name_of_stored: a verb name stored before a rename
  resolves through its kept alias and renders as offered today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* tool/output lives in the mind's ring beside its spill, and never sizes what she sees

The ratchets on the first commit: cognition files naming crate::commands rose
upward_imports 33 -> 48 and closed module cycles; moving the command made its
file touched, so its self-sized sites had to go (ONE-BUDGET: a touched file
leaves with none).

- tool_output.rs moves to cognition/tool_executor/ (beside spill.rs), so every
  reopen site imports within the mind ring; core's web/fetch note and the core
  -> cognition dependency are reverted (web/mod.rs carries self-sized sites
  this slice does not own; its "page it with tool/output" note is a follow-up).
- The read no longer sizes itself: render_slice_chars (a fraction of the
  window, a second budget the turn's allocation never saw) and the grep
  defaults (2 context lines, 50 matches) are gone. spill::Allowance::{Whole,
  Chars} types the read's bound: tool/output reads Whole (bounded by the saved
  file, which was held in memory once), a reopen with no selection is the whole
  output (ToolEffect::Reopens), and her view sizes it. The tail header names
  "the newest N of M lines", never a budget.
- Reopen's argument serialization names its boundary (her tool-call wire).
- Agentic surface re-pinned at the measured 17927 (+441: tool/output's ten
  params, the reach itself).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* A view start holds each growing source's newest item before it shares the rest, so the reply's priority never collapses her newest turn

#5807's CI (merged with canary #5802/#5803): reply_priority_grows_the_reply_not_at_history_or_required_input
failed, history 1 on the pass and 0 on the act. Receipts (16,384 window, d601074):

- start_room is the same on both turns (979: view grants 3,570 + room 0 - reply short 2,591 on the pass;
  2,376 + 0 - 1,397 on the act), and start_grants raised the growing start to cover her newest turn
  (newest 570, start 766 on both).
- start_shares then split the growing room in proportion to what each source lacks of its GRANT, and the
  grants are the act's: the reply's priority moved her conversation's grant (3,197 on the pass, 2,003 on the
  act). Conversation share 449 on the pass, 437 on the act: 1,331 chars vs 1,295, her newest turn 1,296.
  The act collapsed it by one char.
- The same split on canary alone: conversation grant 3,461 / 2,161 (tools 8,240), the same leak with more
  slack; it passed by margin. tool/output's +474 tokens in this fixture (tools 8,714) removed the margin
  and exposed it. The reply WAS reaching her history through the split; the fixture window is not stale.

Fix: StartSource carries `newest` (its newest item's cost); start_shares gives each growing source its
newest item, capped by its grant and the start, before the proportional share. start_grants passes it.
After: pass and act render byte-identical history (segments equal, est 10,754 both).

Test: continuum-context allocation::tests::a_growing_source_holds_its_newest_item_whatever_the_grants_divide
(the receipt's numbers: both grants hold the newest turn).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Nov 7, 2026
…s sources by measured change; tool lists share one canonical head

Every recorded turnover on the M5 (core ed142f1, 2026-11-06) re-decided her collapse from
scratch and resumed from the system head.

- continuum-context view/log.rs: an item collapses ONCE. A start writes her oldest collapsed run
  (summaries, handles, fold blocks) to a log and lays that log down again byte for byte at every
  later start, appending what collapses now; a logged item still rises with room (rendered whole
  at its source's front, its entry kept). The log folds only when a source's logged history
  outgrows its grant (Start::log_folded, log_kept_chars on delib.view.turnover).
- motion: per-act change rate per source (decayed to her last epoch) blended with what her
  starts measured; a start ranks units by the exchange argument over the shared prefix
  (s(1-q)/q + k, the log by what it keeps), Unmeasured to the tail, hysteresis by measurement
  error. Only at a start; within an epoch the view only appends.
- tool_surface: one canonical order, how widely held then by name (Always, Core, OnDemand,
  Withheld), so a smaller tool set is the head of a larger one (Benchy's 30 vs 39 diverged at 18).

Replay (the codec's replay example, real View code, all captures, 144 tok/s): prefill
6,269,985 -> 5,010,840 tokens (-20.1%). Score on the 13 recorded starts: shared 255,515 (#5803)
-> 306,970 tokens (+1+2), ceiling 370,142.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Nov 7, 2026
…er measured re-read cost

Her view now measures how often she asks again for what she already observed
(continuum-context rereads.rs, kept in Motion with the per-source stats #5803/#5805
keep): at every act each observing occurrence is exposed at its age in acts, and an
arrival with the same request fingerprint and outcome hash is a re-request at that age,
tallied over every level and over collapsed ones separately, halved at each start.

depth.rs chooses each instrumented growing source's start: walking its items newest
first, an item stays whole only while hazard x whole x (1 + (S-C)/(W-S)) exceeds the
turnover miss it saves, miss(S) = g (S-C)/(W-S). An age nobody was exposed at, a source
whose items carry no act, or no measured growth is Unmeasured and keeps the half rule.
start_grants (cognition) applies the chosen shares and probes delib.view.depth.

Replay (--append-tail 144 --measured-depth, 15 captures, deliberation + act):
8,478,327 -> 8,395,003 prefill tokens (-0.98%), 3 fewer turnovers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Nov 7, 2026
…hat she won't need again (#5806)

* A turnover collapses what she won't need again: collapse depth from her measured re-read cost

Her view now measures how often she asks again for what she already observed
(continuum-context rereads.rs, kept in Motion with the per-source stats #5803/#5805
keep): at every act each observing occurrence is exposed at its age in acts, and an
arrival with the same request fingerprint and outcome hash is a re-request at that age,
tallied over every level and over collapsed ones separately, halved at each start.

depth.rs chooses each instrumented growing source's start: walking its items newest
first, an item stays whole only while hazard x whole x (1 + (S-C)/(W-S)) exceeds the
turnover miss it saves, miss(S) = g (S-C)/(W-S). An age nobody was exposed at, a source
whose items carry no act, or no measured growth is Unmeasured and keeps the half rule.
start_grants (cognition) applies the chosen shares and probes delib.view.depth.

Replay (--append-tail 144 --measured-depth, 15 captures, deliberation + act):
8,478,327 -> 8,395,003 prefill tokens (-0.98%), 3 fewer turnovers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* A measured depth never starts her under her newest item: the start is what its lowered grants hold

The depth prices each growing source's base (her floor with her newest item whole) in rounded
tokens; #5807's StartSource::newest prices her newest item ceiled. Lowering a grant to the depth's
share, and sizing the start to the depth's own sum, could leave her one token under her newest
item: the failure #5807 fixed (her newest turn collapsed by a char), reached again through the
measured depth.

- depth_grant (epoch.rs): THE rule for how a measured depth lowers a grant: to the chosen share,
  never below the floor or her newest item, never above the plan's grant.
- The growing start is the sum of the lowered grants, never chosen.start (probed beside it as
  chosen_tokens on delib.view.depth).

Test (prompt/epoch/tests.rs, the file's one test mod):
a_measured_depth_never_starts_her_under_her_newest_item. A 501-char newest item at 0.01 tokens
per char (6 ceiled) whose depth base rounds to 5:
- the guard on the grant alone (the previous head): granted 500 of 501 chars, FAILED;
- the start from the lowered grants without .max(source.newest): 500 of 501, FAILED;
- both: passed; continuum-cognition --lib 954 passed, 1 ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* One clock ages her items: each occurrence's birth is the act her view first held it

Codex on #5806: depth::collapsible aged an item by how many newer items its source held
while Rereads bucketed its hazard by acts since birth, and prime reconstructed that birth
as acts minus the newer-item count. A source idle for eight acts priced a 9-act-old item at
age 1; a source that appended three items in one act read them as three ages.

Now Rereads records each occurrence's birth act where it enters (an arrival at act(), what
a start finds at prime), keeps the births with her view (serialized; drained at each start
to what the sources still offer), and answers Rereads::age(id) from them. depth reads that
age, so both read one clock; prime rebuilds the index from recorded births, never from
position, and the first act after a restart ticks the clock like every other. The seen set
is gone: the births map is it. depth::collapsible takes the measurement by reference (a
view-less claims() passes a fresh clock), so no Option stands in for a missing clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Her epoch length is read off her one clock: Motion no longer counts acts

Motion.epoch_acts counted every act beside Rereads' clock, and always equalled the acts since
the last start on it. Deleted with its writer (Motion::act, View::advance's call); the current
epoch's length is Rereads::epoch_acts (acts - acts_at_start), read where a start closes the
epoch and where a change rate is extrapolated over her epoch. last_epoch_acts stays: it is the
closed epoch's length, a different fact, now u64 like the clock. No shim for saves with the old
field: serde ignores it, and the current epoch's length comes from the clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply added a commit that referenced this pull request Nov 7, 2026
…sources by measured change; one canonical tool head (replay: -20% prefill) (#5805)

* Her collapsed history is a log laid down byte for byte; a start places sources by measured change; tool lists share one canonical head

Every recorded turnover on the M5 (core ed142f1, 2026-11-06) re-decided her collapse from
scratch and resumed from the system head.

- continuum-context view/log.rs: an item collapses ONCE. A start writes her oldest collapsed run
  (summaries, handles, fold blocks) to a log and lays that log down again byte for byte at every
  later start, appending what collapses now; a logged item still rises with room (rendered whole
  at its source's front, its entry kept). The log folds only when a source's logged history
  outgrows its grant (Start::log_folded, log_kept_chars on delib.view.turnover).
- motion: per-act change rate per source (decayed to her last epoch) blended with what her
  starts measured; a start ranks units by the exchange argument over the shared prefix
  (s(1-q)/q + k, the log by what it keeps), Unmeasured to the tail, hysteresis by measurement
  error. Only at a start; within an epoch the view only appends.
- tool_surface: one canonical order, how widely held then by name (Always, Core, OnDemand,
  Withheld), so a smaller tool set is the head of a larger one (Benchy's 30 vs 39 diverged at 18).

Replay (the codec's replay example, real View code, all captures, 144 tok/s): prefill
6,269,985 -> 5,010,840 tokens (-20.1%). Score on the 13 recorded starts: shared 255,515 (#5803)
-> 306,970 tokens (+1+2), ceiling 370,142.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* An absent source's logged history leaves with it: a start never lays down log it did not charge

Codex on #5805: `arrange` charged logged chars only to the sources a start was given, but
`begin` re-emitted the whole retained log, so the entries of a source absent from the start
(shed for want of its floor in `fit_view`, a stream that ended, a room she left) were laid
down charged to no one, survived a zero-source start, and kept the source's items marked
collapsed, so its return showed her stale pointers. Nothing in the caller contract forbids
the absence: `fit_view` sheds sources at a start by design ("A later act's advance offers it
again").

Now `log::arrange` decides, per entry, whether this start charges it (its source is
supplied), and `begin` keeps exactly those: the charge and the emission are one decision.
The dropped chars are receipted (`Start::log_dropped_chars`, probed on delib.view.turnover).

Reproduced first: a zero-source start rendered "head" + s1..s3's three pointers (960 chars
uncharged). Tests: an absent source's log leaves and its items come back whole; a zero-source
start lays down no log; a zero-grant start folds the log to the floor.
Replay (--append-tail 144, stable prev captures): Aiko and Atlas unchanged; Aris prev
1,100,314 -> 1,110,400 tokens (+0.9%), the cost of no longer re-emitting an absent source's
log uncharged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Collapse depth from her measured re-read cost: a turnover collapses what she won't need again (#5806)

* A turnover collapses what she won't need again: collapse depth from her measured re-read cost

Her view now measures how often she asks again for what she already observed
(continuum-context rereads.rs, kept in Motion with the per-source stats #5803/#5805
keep): at every act each observing occurrence is exposed at its age in acts, and an
arrival with the same request fingerprint and outcome hash is a re-request at that age,
tallied over every level and over collapsed ones separately, halved at each start.

depth.rs chooses each instrumented growing source's start: walking its items newest
first, an item stays whole only while hazard x whole x (1 + (S-C)/(W-S)) exceeds the
turnover miss it saves, miss(S) = g (S-C)/(W-S). An age nobody was exposed at, a source
whose items carry no act, or no measured growth is Unmeasured and keeps the half rule.
start_grants (cognition) applies the chosen shares and probes delib.view.depth.

Replay (--append-tail 144 --measured-depth, 15 captures, deliberation + act):
8,478,327 -> 8,395,003 prefill tokens (-0.98%), 3 fewer turnovers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* A measured depth never starts her under her newest item: the start is what its lowered grants hold

The depth prices each growing source's base (her floor with her newest item whole) in rounded
tokens; #5807's StartSource::newest prices her newest item ceiled. Lowering a grant to the depth's
share, and sizing the start to the depth's own sum, could leave her one token under her newest
item: the failure #5807 fixed (her newest turn collapsed by a char), reached again through the
measured depth.

- depth_grant (epoch.rs): THE rule for how a measured depth lowers a grant: to the chosen share,
  never below the floor or her newest item, never above the plan's grant.
- The growing start is the sum of the lowered grants, never chosen.start (probed beside it as
  chosen_tokens on delib.view.depth).

Test (prompt/epoch/tests.rs, the file's one test mod):
a_measured_depth_never_starts_her_under_her_newest_item. A 501-char newest item at 0.01 tokens
per char (6 ceiled) whose depth base rounds to 5:
- the guard on the grant alone (the previous head): granted 500 of 501 chars, FAILED;
- the start from the lowered grants without .max(source.newest): 500 of 501, FAILED;
- both: passed; continuum-cognition --lib 954 passed, 1 ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* One clock ages her items: each occurrence's birth is the act her view first held it

Codex on #5806: depth::collapsible aged an item by how many newer items its source held
while Rereads bucketed its hazard by acts since birth, and prime reconstructed that birth
as acts minus the newer-item count. A source idle for eight acts priced a 9-act-old item at
age 1; a source that appended three items in one act read them as three ages.

Now Rereads records each occurrence's birth act where it enters (an arrival at act(), what
a start finds at prime), keeps the births with her view (serialized; drained at each start
to what the sources still offer), and answers Rereads::age(id) from them. depth reads that
age, so both read one clock; prime rebuilds the index from recorded births, never from
position, and the first act after a restart ticks the clock like every other. The seen set
is gone: the births map is it. depth::collapsible takes the measurement by reference (a
view-less claims() passes a fresh clock), so no Option stands in for a missing clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Her epoch length is read off her one clock: Motion no longer counts acts

Motion.epoch_acts counted every act beside Rereads' clock, and always equalled the acts since
the last start on it. Deleted with its writer (Motion::act, View::advance's call); the current
epoch's length is Rereads::epoch_acts (acts - acts_at_start), read where a start closes the
epoch and where a change rate is extrapolated over her epoch. last_epoch_acts stays: it is the
closed epoch's length, a different fact, now u64 like the clock. No shim for saves with the old
field: serde ignores it, and the current epoch's length comes from the clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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