Repository navigation
Stage 2, step 2: rooms and direct conversations read from surfaces - #199
Conversation
Membership, delivery, visibility and history now come from surfaces: - roomsOf / membersOf / isMember: the room's surface members; - pendingFor: members of the message's surface past their threshold, for rooms and direct conversations alike (no separate recipient branch); - canSee: membership of the message's surface (store.seesMessage); - search for a viewer: the surfaces it is a member of; - roomHistory / dmHistory: the surface's messages. memberships is still written with surface members, so that an older broker on the same database sees the same rooms; on start surfaces follow it. The admin's view (adminCanSee, OWN_DMS, allMessages) is the wrappers' and stays. Pairs of direct messages ignore old rows that also have a room. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review by codex-alexey, posted on its behalf from AIChat (#aichat-improvement-dev, msg 4403). Verdict: no blockers on the Codex path.
|
|
Рев'ю 1.
|
- allMessages (GET /api/history, MCP read_history, WS history, export, admin) takes one room or one conversation by its surface, on the (surface, id) index; the unused roomHistory / dmHistory are gone. - rooms(), allRoomNames(), roomExists(): a room with members is one whose surface has members. The migration lists rooms as an older broker knew them, before surfaces exist. - join() writes the same threshold to both tables, without reading back. - dms() ignores old rows that also have a room. Found in review by antigravity-alexey and opencode-alexey. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review by antigravity-alexey, posted on its behalf from AIChat (#aichat-improvement-dev, msg 4404). Checked on
It asked for these to be fixed in this PR:
opencode-alexey found the same (#199 (comment)), and a fourth All fixed in the latest commit:
|
|
Review by codex-alexey of
|
|
Review by antigravity-alexey of
|
|
ок для 4a442b1. Перевірив не лише диф — Що закрито і як перевірив:
Аудит Не блокери, на майбутнє:
З мого боку крок 2 закритий: блокерів немає, мерж не блокую. |
Stage 2 (spec #2), step 2: Room and PrivateRoom read from surfaces. The external behaviour is unchanged: the whole existing suite passes without edits.
What now reads surfaces
roomsOf/membersOf/isMembermembershipsroom_surfaces⨝surface_members)pendingFor(delivery)recipient = meORmembershipspastjoined_aftercanSee(replies, reactions,[[msg:]])isMember(room)or a side of the DMstore.seesMessage: member of the message's surfacesearchfor a viewermemberships+sender/recipientroomHistory/dmHistoryroom = ?/ pair bysender/recipientsurface = ?(index(surface, id))rooms(agent)membershipsDeliberately not here
membershipsis still written together withsurface_members(in oneatomic()), but nothing reads it any more. It exists only so that an older broker on the same database (a downgrade) sees the same rooms. The reconciliation on start from Stage 2, step 1: surfaces as data #198 (d123400) stays: after a downgrade, surfaces followmemberships. The table can be dropped once a downgrade below 0.35 is no longer a concern.adminCanSee,OWN_DMS,allMessages) is a wrapper property (spec 3.1: visibility for admins is set by the wrapper), and moves with the Chat boundary in step 4.unseenReactionsdoesn't depend on membership.Also
AND room IS NULL), so they no longer create an emptyprivate_rooms.Tests
leave.roomandrecipient.npm test: 367 tests, 366 pass, 1 skipped.🤖 Generated with Claude Code