Repository navigation
feat(store): owner-set visibility and derived TREE members on channel reads (RIG-4188) - #1772
Open
rigel-mintaka wants to merge 5 commits into
Conversation
… reads (RIG-4188) The three channel predicate copies grant agent-attached channels to the anchor owner set; projections carry parent_agent_id and membership_mode to the wire; message and topic reads gate on participation; and loadChannelMembers materializes each TREE channel subtree, with subscribers intersected with it. CreateChannel returns the post-commit getChannel read. The RPC response and event assertion lands with the RPC wiring. Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
Compass engineering docs preview: https://compass-comms-rig-4188-chann.compass-eng-docs.pages.dev Deployed from Changed pages: |
…lves to participants (RIG-4188) Message and topic reads join one participant-channel CTE instead of per-row OR subplans, restoring the driving relation. ChannelByNameForViewer narrows a multi-match to channels the viewer participates in, so a same-owner sibling channel of the same name no longer makes an agent own channel ambiguous. The product spec states that owner-set visibility does not grant history. Co-authored-by: Matt Wilkinson <matt@rigel.build>
… doc contracts (RIG-4188) A name that matches several visible channels narrows to the viewer's participant channels only when that set is non-empty, so a non-participant sibling gets the same ambiguity its channel list shows, not a not-found. Message and topic doc comments go back to their full contracts, reworded from membership to participation. Co-authored-by: Matt Wilkinson <matt@rigel.build>
… participant CTE (RIG-4188) Restores the subtree-agent FindAskMessage/AnswerAsk positives and adds unscoped search and owner ListMessages cases. The per-query participant CTE is renamed participating, so it is not mistaken for channel visibility, and both query files say the copies must stay equal to ChannelParticipant. Co-authored-by: Matt Wilkinson <matt@rigel.build>
Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
marked this pull request as ready for review
October 6, 2026 09:16
mattwilkinsonn
added this pull request to stack #1828
October 7, 2026 00:34
mattwilkinsonn
approved these changes
Oct 7, 2026
|
Stacked PR 1779 failed testing in the merge queue. Please investigate the failure and re-submit the stack. |
This branch has not been deployed
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.
This PR is part of a stack containing 5 PRs:
mainSummary
Channels-in-the-agent-tree, task T4 (
docs/designs/ui/compass-channels-in-agent-tree/design.md§ Plan): visibility predicates and read paths. Stacked on #1764.ListChannels,ChannelVisibleTo,ChannelsByNameForViewer) gain theviewerCTE and the owner-set disjunct. The anchor's owner and every agent of that owner see an attached channel. Reading history still needs participation.parent_agent_idandmembership_modemove through the three projections,channelFromRowand all four of its call sites,store.Channel.ParentAgentID/.MembershipMode, andchannelToWire.CreateChannelreturns the post-commitgetChannelread instead of a hand-built literal.channelFromRowis now the only place aChannelis built.GetPageCursorSeq,ListMessages,SearchMessages,FindAskMessage,UpdateMessageBlocksAsAuthorandResolveTopicForUpdatejoin oneparticipatingCTE (member rows UNION TREE channels on the actor's chain or owned by the actor) instead of a member-row JOIN. The SQL headers say the six copies must stay equal toChannelParticipant.ChannelByNameForViewernarrows several visible matches to the viewer's participant channels when there is at least one, so an owner-set sibling's same-named channel does not shadow an agent's own.ChannelMembersByChannelIDsruns one set-based descent over the TREE channels requested. It returns(channel_id, account_id)pairs, so each channel gets its own anchor's subtree plus the anchor's owner.subscribedcomes fromchannel_subscriptionsjoined only to those participants, so a stale override from an agent reparented out is not on the wire.Deferred to T6
The comms-boundary half of hop (v) is the
CreateChannelRPC response plus exactly oneChannelChangedcarryingparent_agent_id. That needs the RPC request fields T6 wires (parent_agent_handle,membership_mode). T4 asserts the store return value and thechannelToWire/publishChannelChangedpayload. T6 (same owner) adds the RPC assertion.Tests
TestChannelVisibilityOwnerSetParity: owner and same-owner sibling see the channel; another user doesn't;ChannelVisibleToagrees withListChannelsin every case.TestChannelTreeParticipantReadsAndWrites: a subtree agent and the owner read history, search (scoped and unscoped), cursor and topic writes; an author reparented out cannot edit.TestChannelTreeOwnerSetSiblingReadWriteDenials: an owner-set sibling sees the channel but gets nothing from list, search, cursor, UpdateTopic, edit or AnswerAsk; the subtree agent can answer the ask.TestChannelByNameForViewerNarrowsOwnerSetDuplicatesToParticipants: an agent resolves its ownstandup; the owner and a non-participant sibling get the ambiguity error.TestChannelTreeMembersAreAttributedAndSubscriptionsIntersect: two TREE channels at different anchors in oneListChannels, each with exactly its own subtree; 0 member rows; a stale override and a foreign override are on neither list.TestChannelTreeProjectionCarriesAnchorAndMode(all three projection copies) andTestChannelTreeCreateUnderAgent(theCreateChannelreturn value).TestChannelToWireCarriesTreeAttachmentandTestPublishChannelChangedCarriesTreeAttachment.ChannelVisibleTo;CreateChannelliteral;ListMessagesback on the member JOIN;FindAskMessagechain arm dropped.ok. vet,sqlc-driftand lint: clean.Spec-impact:
docs/specs/product/compass.mdstore scoping: attached channels are visible to the anchor's owner set; history, search and topic access need participation.Ledger-impact: none
Refs RIG-4188, RIG-1622
Co-authored-by: Matt Wilkinson matt@rigel.build