Skip to content

Put the composition and every close on the log, and fold the room from it - #52

Open
andreisavu wants to merge 2 commits into
mainfrom
claude/pr4-room-shape-on-log
Open

Put the composition and every close on the log, and fold the room from it#52
andreisavu wants to merge 2 commits into
mainfrom
claude/pr4-room-shape-on-log

Conversation

@andreisavu

Copy link
Copy Markdown
Contributor

PR 4 of the stack that SPLIT_PLAN.md on #48 cuts from that branch. Branches from main after #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/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 (RoomLog.write).
  • 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 plus every seating and unseating after it. Presence is the last arrived until the next left (room/presence.ts). The open exchange is the first question a person asked after the last close (room/exchange.ts). 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. A run starts from the composition row it writes.
  • The room closes an exchange by writing the row where the fold still says the exchange is open and nothing is working. settled() and quiet() answer after the settle in flight, so the close and the quiet event are on the stream when they resolve.
  • A seating carries the attention it takes, and an arrival carries how the person reads, so the fold has what the roster and the assistant need. The in-memory preferences map goes.

Behaviour that changes, stated in the docs

  • stop writes no unseated. 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.
  • A run that starts over a log with an exchange still open closes it first, and its host hears exchange_closed for it. On main the exchange was run state and was lost. exchange.md §5 says so.
  • A person present on the log at the start of a run is here already: a visit hands back a handle and commits nothing. presence.md says 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: stop leaves the roster to the next composition, and the next run starts from its own. test/session.test.ts and test/presence.test.ts: a stopped room folds its roster.
  • The other suites pass unchanged.

What a later PR adds on top

  • PR 5: the lease rows, wakes on the message, decide, resumeSession, and the owed fold with wakes on the close row.
  • PR 12: the checkpoint row.

Checks

pnpm format && pnpm check is green, 143 tests. Every doc link resolves. Backlog item 19 closes. The build's three TS4023 lines from test/live/support.ts are on main too.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SJjjR3S6iwqEbDXsRDJgiq


Generated by Claude Code

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants