Skip to content

Close an exchange with a message, and owe one kind of activation (#66) - #67

Open
andreisavu wants to merge 1 commit into
mainfrom
claude/library-simplification-review-8rnqnm
Open

andreisavu wants to merge 1 commit into
mainfrom
claude/library-simplification-review-8rnqnm

Conversation

@andreisavu

Copy link
Copy Markdown
Contributor

A close of an exchange was a row beside the messages. The summary it owed
had its own id shape, its own fold, its own retry accounting and its own
set of end reasons. A pending wake had the same four things, written once
more. Two machines answered one question: which activation does the room
owe a seat, and when.

A close is now a closed message on the record. It holds its person and
the range it turned out to cover, it carries the assistant in wakes when
the exchange owes a summary, and it reaches that seat the way every other
message reaches one. So:

  • One fold answers every activation the room owes (dueActivations in
    room/lease.ts). foldOwed, Owed, judged, withAttempts and the
    second "came to nothing" set are gone, and room/fold.ts drops from 250
    lines to 115.
  • One id shape names every activation, so parseId has one variant and
    seatOf no longer takes the assistant's name to read an id.
  • What an activation may do is read off the message that woke it
    (handOf in room/view.ts), rather than off the spelling of its id.
  • The log holds four kinds of entry, and wire.ts holds one row type less.
  • messages() holds every exchange boundary, so a host reads the history
    of exchanges from one read. Before this, a closed exchange was legible
    only on the event stream or by reaching past Ambion into Pi's session.

Two behaviours changed with it.

A running lease answers a close the way it answers any other message, so a
resumed room waits for a dead run's draft lease to expire instead of
re-sending the wake at once. Backlog item 30 is the same wait.

quiet means what it says: a seat is live through its backoff, a draft
included, so the room reports quiet only once it owes nothing. That
closes backlog item 43. The routing's compose guard now asks whether the
assistant holds a live lease, so a question that lands inside a draft's
backoff still wakes it to compose.

The chaos sweep on both storages, the handover under load, 200 seeds of
the walk and the history, and the full gate all pass. test/support/chaos.ts
read the leases a dead run left after resuming the name, which let a claim
of the new run's count as inherited; it reads them before the run exists.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01XHJVkbjScXStrKhY27Xjtd

A close of an exchange was a row beside the messages. The summary it owed
had its own id shape, its own fold, its own retry accounting and its own
set of end reasons. A pending wake had the same four things, written once
more. Two machines answered one question: which activation does the room
owe a seat, and when.

A close is now a `closed` message on the record. It holds its person and
the range it turned out to cover, it carries the assistant in `wakes` when
the exchange owes a summary, and it reaches that seat the way every other
message reaches one. So:

- One fold answers every activation the room owes (`dueActivations` in
  `room/lease.ts`). `foldOwed`, `Owed`, `judged`, `withAttempts` and the
  second "came to nothing" set are gone.
- One id shape names every activation, so `parseId` has one variant and
  `seatOf` no longer takes the assistant's name to read an id.
- What an activation may do is read off the message that woke it
  (`handOf` in `room/view.ts`), rather than off the spelling of its id.
- A checkpoint carries no closes. The log keeps every message, so every
  closed exchange is on the record whatever a checkpoint drops, and the
  floor is what says the room owes nothing for a close below it. `reads`
  and the floor lose their draft branches with it.
- `messages()` holds every exchange boundary, so a host reads the history
  of exchanges from one read. Before this, a closed exchange was legible
  only on the event stream or by reaching past Ambion into Pi's session.

Two behaviours changed with it.

A running lease answers a close the way it answers any other message, so a
resumed room waits for a dead run's draft lease to expire instead of
re-sending the wake at once. Backlog item 30 is the same wait.

`quiet` means what it says: a seat is live through its backoff, a draft
included, so the room reports `quiet` only once it owes nothing. That
closes backlog item 43. The routing's compose guard now asks whether the
assistant holds a live lease, so a question that lands inside a draft's
backoff still wakes it to compose.

What the assistant is owed comes off `state.due` rather than a second scan
of the closes, so one rule says what the room owes: a close the assistant
judged stays judged, whether or not a checkpoint has passed it.

The chaos sweep on both storages, the handover under load, 200 seeds of
the walk and the history, and the full gate all pass.
`test/support/chaos.ts` read the leases a dead run left after resuming the
name, which let a claim of the new run's count as inherited; it reads them
before the run exists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XHJVkbjScXStrKhY27Xjtd
@andreisavu
andreisavu force-pushed the claude/library-simplification-review-8rnqnm branch from 0546ca9 to 4134f03 Compare September 11, 2026 14:07
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