Commit every message on one serial queue, under a key - #50
Merged
Conversation
The record becomes a log. log/log.ts replaces record.ts. RoomLog.commit runs the key check, the readThrough check, the append and the cache update inside one link of a promise chain, and what the room does with a fresh message runs there too. A message exists when its write is confirmed: a write that fails leaves nothing on the record, nothing on the stream, and wakes nobody. A repeated key hands back the message the first commit landed. The entries on the storage do not change: messages only. A seat's say and the assistant's two tools take Pi's tool call id as the key; a delivery takes the key the host passes, or a fresh one. The composition is checked against the replayed record, so a name the record knows as a person is refused at the first call, and a visit is checked after the replay. The test storage regains the faulty opener, which the log's fourth test needs. The layer table gains the log/ row. This is PR 2 of the stack SPLIT_PLAN.md cuts from #48. It carries 0f44d6c from that branch, with the path change to log/log.ts. 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 2 of the stack that
SPLIT_PLAN.mdon #48 cuts from that branch. Branches frommainafter #49.The one idea
The record becomes a log, and every message commits on one serial queue.
log/log.tsreplacesrecord.ts.RoomLog.commitruns the key check, thereadThroughcheck, the append and the cache update inside one link of a promise chain, and what the room does with a fresh message runs there too, before the next commit starts. A message exists when its write is confirmed: a write that fails leaves nothing on the record, nothing on the stream, and wakes nobody. A repeated key hands back the message the first commit landed. Rule 5 is enforced where the write happens.deliver({ key })takes the key the host passes, or a fresh one.Messagegainskey.The tests that pin it
test/log.test.ts: a repeated key lands once and returns the first message; of two commits under onereadThrough, one lands and the other is refused with what it missed and consumes no seq; a message is invisible until its write resolves; a commit whose write fails leaves nothing, and the next one takes its seq.test/session.test.ts: the new cases ondeliverwith a key and on a failed write.test/presence.test.ts: reworked onto the queue, same claims.Extract
git cherry-pick -x 0f44d6con #49, with the path change tolog/log.ts. Two conflicts, both against #49's layout: the import block insession.tsand the layering sentence inagent.md. Two additions the plan did not list: the simplefaultyOpenerreturns totest/support/storage.tsbecause the fourth log test needs it (#49 had dropped it; PR 6 replaces it with the tapped version), and the layer table indocs/toolchain.md§1 gains thelog/row.What a later PR adds on top
closeandcompositionentry kinds,Row,RowDataandwrite().leaseentry kind.cursor,known,found, the "in doubt" tests.checkpointentry kind andcompact.Checks
pnpm format && pnpm checkis green, 120 tests. Every doc link resolves. 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