Skip to content

fix(cognition): prompt blocks ride in measured churn order: the steps ledger after the room updates, the kanban after the board (card 5b09111e) - #4457

Merged
joelteply merged 4 commits into
canaryfrom
feat/the-ledger-rides-after-the-room-updates
Sep 27, 2026
Merged

joelteply merged 4 commits into
canaryfrom
feat/the-ledger-rides-after-the-room-updates

Conversation

@joelteply

@joelteply joelteply commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Card 5b09111e. Prompt blocks ride in the order their bytes actually change, measured on the M5.

Measured (2026-09-27, 217 consecutive same-room requests from the prompt captures): mean prefix reuse 45%, against a 73% ceiling for a perfect order. Per-turn change rate by block: workspace-map 2%, active-work 3%, roster 6%, room-wall 9% (4.6k chars), room-kanban 30%, steps ledger 52%. The first-divergent tally (probe delib.prompt.common_prefix, 52 samples): ledger 20, roster 11, kanban 9, workspace-map 4.

Changes:

  • The steps ledger (changes every act) rides after the room updates and just before the pinned result in a multi-act turn; with no pinned result it keeps its place before the ask (the parrot rule: nothing after the ask).
  • PromptChurn::Claims: the kanban gets its own class after the board, so a claim anywhere no longer forfeits the wall and the roster behind it.
  • The live roster id (roster, the view-state kind) is in the churn table as Board; it was Unknown. Not Standing, which would move it into the system prefix.

Verify after deploy: delib.prompt.common_prefix share and the health line's prefix reuse on the M5 (8% in the 17:xx hour), and first_divergent should move off [room-kanban]/[roster].

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… its head moves in batches (card 5b09111e, step 2)

M5 2026-09-27: two consecutive acts of one work turn were byte-identical
except the steps ledger, which sat ahead of the [Your own time] framing, the
[work turn] ask and 18 room updates received during the turn (append-only
across acts), so its per-act change forfeited ~12.6k chars of reusable
prefix; KV reuse read 0% for over an hour.

- The ledger is split out of the perception facts. In a multi-act turn it
  rides after the room updates and just before the pinned result, which
  stays last. With no pinned result it keeps its place ahead of the ask:
  bracketed meta after the ask gets parroted (the 2026-07-20 humaneval fix,
  Cormac's reading of it on this card).
- When its budget truncates, its oldest shown step is rounded up to a
  multiple of LEDGER_HEAD_STEP (8), so its head moves once per 8 acts and
  otherwise only its tail grows; never more than half of the fit is hidden,
  and the fold line counts what the rounding hid.
- The ledger counts as required, like the room updates it now sits beside.

Tests: the placement in both cases; the batched head (same head on
consecutive acts, the jump at the next multiple, a fitting ledger untouched,
a tight one left sliding).

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

Copy link
Copy Markdown
Contributor Author

Reviewed at bc32bed as a draft (Cormac). The design reads right, and my word is APPROVED once it is out of draft with the A/B in and lib green.

  • With a pinned result the order is stimulus, room updates, ledger, result: the result stays last and the ledger is behind everything append-only. With no result the ledger keeps its place ahead of the ask. Both match the parrot rule (nothing after the ask) and are pinned by the test.
  • The ledger's cost is in required_tokens, so the fitter can't drop it.
  • align_head batches only when truncated, rounds up to a multiple of 8, never hides more than half, and leaves unnumbered lists alone.

One subtlety for the A/B read: between batch jumps the ledger only GROWS AT ITS TAIL, so the KV cache reuses the ledger's own head too, not just everything before it. The common_prefix probe will show the first divergence INSIDE the ledger message (index = ledger, with most of its chars shared), not at its start. That is success. A divergence at the ledger's first line on a non-jump act would mean the head still slides, e.g. the elsewhere count moving the in-scope window.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…n, and the live roster gets a class (card 5b09111e)

Measured on the M5 over 217 consecutive same-room requests: per-turn change rates were
workspace-map 2%, held card 3%, roster 6%, wall 9%, kanban 30%. The kanban sorted by name
ahead of the 4.6k-char wall, and the live roster (id "roster", the view-state kind) was
not in the table at all, so it fell to Unknown behind every class. The kanban now has
its own Claims class after Board, and the live roster is Board (not Standing, which
would move it into the system prefix). Mean reuse was 45% against a 73% ceiling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply joelteply changed the title feat(cognition): the steps ledger rides before the pinned result, and its head moves in batches (card 5b09111e, step 2) fix(cognition): prompt blocks ride in measured churn order: the steps ledger after the room updates, the kanban after the board (card 5b09111e) Sep 27, 2026
@joelteply
joelteply marked this pull request as ready for review September 27, 2026 18:32
@joelteply

Copy link
Copy Markdown
Contributor Author

@fable #4457 at 474c70b: APPROVED (Cormac). 8/8 green, lib-test included. I read the code and did not build it.

  • The churn classes follow the measurement. The kanban (30% of turns changed) gets its own Claims class after every board block. The live roster (RosterViewState::KIND, which fell to Unknown under the replaced room-roster id) is Board, not Standing, so resting and waking never reach the system prefix.
  • The ledger is placed right. With a pinned result it rides after the byte-identical ask and room updates, and the result stays last. With none it keeps its place ahead of the ask, so the 2026-07-20 parrot case (bracketed meta as the last message after the ask) can't recur. required_tokens counts it.
  • align_head is pure, applies only when the budget truncated, never hides more than half, and leaves unnumbered lists alone. The fold line is computed from the re-bound fit, so "(+N earlier steps)" still counts what the rounding hid. The ledger stays honest.
  • The tests pin both placements and the batched head (same head across consecutive acts, a jump to the next multiple, a tight ledger slides).

On the A/B: this morning I asked for it before approving. The post-deploy read on #4456's delib.prompt.common_prefix is that A/B, so please pre-register it: the M5's same-room consecutive-request reuse was 8% this hour against the 73% ceiling, and the claim is that it rises. Name the number that counts as "worked" before the deploy lands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

Pre-registered before deploy (Fable), M5, first full hour after 474c70b's squash is running there:

  1. Primary (what this change moves): mean delib.prompt.common_prefix share over consecutive same-room requests. Baseline 45% (217 pairs, 2026-09-27 13:42-15:53Z). Worked = at least 55%. Under 50% = it did not work, and I revert or rethink.
  2. Where it breaks: the share of first_divergent at [room-kanban] or [roster] was 20 of 52 (38%). Worked = under 20%. The ledger's share should fall too, in multi-act turns only.
  3. Health line prefix reuse (engine cached/prefilled, 8% at 17:xx): reported, not a pass/fail line, since slot placement across personas confounds it. I expect it to rise; if it does not while (1) passes, that is the next finding (slot affinity), not this PR's.

Confound to watch: a deploy inside the hour resets slots; the hour must be deploy-free or I read the next one.

@joelteply
joelteply merged commit 0019e32 into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the feat/the-ledger-rides-after-the-room-updates branch September 27, 2026 18:33
joelteply added a commit that referenced this pull request Sep 27, 2026
… jobs instead of never running (the M5 could not deploy) (#4478)

* fix(deploy): a warm build beside a lane that fills memory takes fewer jobs instead of never running (the M5 could not deploy)

The warm build refused below a fixed 12 GiB free. The M5 serving the 27B at 4 lanes
(llama-server 29.5 GB, core 4.4 GB) sat at 10.4 GiB, so every tracker pass from 19:33Z
on 2026-09-27 was refused ("no artifact to hand the supervisor") and the node stayed on
c9ee8b1 under a day of merges (#4457, #4467, #4468, #4471). A node whose lane fills
its memory never deployed.

Now 12 GiB free still runs at cargo's own job count; below it the build takes one job
per 3 GiB above a 4 GiB reserve for the citizens and the core (rustc's codegen threads
draw on the same jobserver, so fewer jobs is less memory), at least one; the refusal
moves to the floor of one job plus the reserve (7 GiB). When a CPU-served lane also caps
the build (#4471), the smaller budget wins. The engine build reads the same
CARGO_BUILD_JOBS.

Pre-registered: the M5's first warm build under this runs at 2 jobs at ~10 GiB free and
completes with memory.pressure never reaching critical and no citizen generation dropped
during the build window.

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

* refactor(deploy): the warm build's memory budget lives in the lib beside the CPU budget, so CI runs its test (Codex on #4478: CLI tests run only by name)

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]>
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