Put the composition and every close on the log, and fold the room from it - #52
Open
andreisavu wants to merge 2 commits into
Open
Put the composition and every close on the log, and fold the room from it#52andreisavu wants to merge 2 commits into
andreisavu wants to merge 2 commits into
Conversation
…m it The log gains two rows beside the messages. ambion/composition is what a run started with: the assistant, the goal, the agents seated and the agents in reserve, each with its attention. ambion/close is the range an exchange turned out to hold. A row takes no seq and carries after, the last seq when it landed; it joins the same serial queue as the messages. room/fold.ts folds the roster, the reserve, the people, the open exchange and the closes from the entries. The roster is the latest composition and every seating and unseating after it. Presence is the last arrived until the next left. The open exchange is the first question a person asked after the last close. room/view.ts renders what an activation is given off the fold. readSession(name).seats() folds the same composition a running room folds, so a stopped room says who was in it. The room closes an exchange by writing the row where the fold still says the exchange is open and nothing is working. A run that starts over a log with an exchange open closes it first. stop writes no unseated: the next run writes its own composition, and the roster folds from that. A seating carries the attention it takes, and an arrival carries how the person reads, so the assistant reads preferences off the record. The leases the room holds and the summaries it owes stay in memory. Backlog item 19 closes. This is PR 4 of the stack SPLIT_PLAN.md cuts from #48. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJjjR3S6iwqEbDXsRDJgiq
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJjjR3S6iwqEbDXsRDJgiq
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.
PR 4 of the stack that
SPLIT_PLAN.mdon #48 cuts from that branch. Branches frommainafter #51.The one idea
The log gains two rows beside the messages, and every fact the room used to hold about its shape becomes a fold over the log.
ambion/compositionis what a run started with: the assistant, the goal, the agents seated and the agents in reserve, each with its attention.ambion/closeis the range an exchange turned out to hold. A row takes no seq and carriesafter, the last seq when it landed; it joins the same serial queue as the messages (RoomLog.write).room/fold.tsfolds the roster, the reserve, the people, the open exchange and the closes from the entries. The roster is the latest composition plus every seating and unseating after it. Presence is the lastarriveduntil the nextleft(room/presence.ts). The open exchange is the first question a person asked after the last close (room/exchange.ts).room/view.tsrenders what an activation is given off the fold.readSession(name).seats()folds the same composition a running room folds, so a stopped room says who was in it. A run starts from the composition row it writes.settled()andquiet()answer after the settle in flight, so the close and thequietevent are on the stream when they resolve.Behaviour that changes, stated in the docs
stopwrites nounseated. The next run writes its own composition row and the roster folds from that; a read of the stopped room folds the roster the run left.roster.md§5 and the roster test say so.exchange_closedfor it. Onmainthe exchange was run state and was lost.exchange.md§5 says so.presence.mdsays so. An absent person may return under a new identity.Still in memory, and stated as such
The lease table from PR 3 and the assistant's owed summaries.
agent.md§5 names the three entry kinds and says the leases and the summaries owed stay in memory. PR 5 moves both onto the log. The view takes the range the assistant is drafting from the room, since the owed fold is PR 5's.The tests that pin it
test/restart.test.ts, new: one composition per run on every storage, and a read of the stopped room folds the latest roster.test/wire.test.ts: the close and composition rows round-trip unchanged, and every row a JSONL log holds after a scenario is plain JSON.test/roster.test.ts:stopleaves the roster to the next composition, and the next run starts from its own.test/session.test.tsandtest/presence.test.ts: a stopped room folds its roster.What a later PR adds on top
wakeson the message,decide,resumeSession, and the owed fold withwakeson the close row.Checks
pnpm format && pnpm checkis green, 143 tests. Every doc link resolves. Backlog item 19 closes. The build's three TS4023 lines fromtest/live/support.tsare onmaintoo.🤖 Generated with Claude Code
https://claude.ai/code/session_01SJjjR3S6iwqEbDXsRDJgiq
Generated by Claude Code