Repository navigation
feat(store): TREE subscriptions and delivery over derived participants (RIG-4189) - #1778
Merged
mattwilkinsonn merged 2 commits intoOct 10, 2026
Conversation
This was referenced Oct 6, 2026
|
Compass engineering docs preview: https://compass-comms-rig-4189-tree.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
marked this pull request as ready for review
October 6, 2026 10:22
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. |
rigel-mintaka
force-pushed
the
compass-comms/rig-4189-tree-delivery
branch
from
October 10, 2026 04:28
5123bb5 to
fcc49bc
Compare
…s (RIG-4189) UpdateChannelMembers on a TREE channel refuses add/remove and turns a subscribe toggle into a channel_subscriptions override, seeding the delivery cursor on subscribe. The five delivery membership queries drive from a participants CTE: the subtree descent for the channel-keyed sites and the ancestor ascent for the account-keyed ones, with unsubscribed as the default. SetChannelPolicy refuses mandatory and OWNER_ONLY on TREE. Co-authored-by: Matt Wilkinson <matt@rigel.build>
…g (RIG-4189) The stored arm of each delivery participants CTE now skips TREE channels. An outsider subscribe toggle names the account, not the channel. A delivery pgtest drives @handle and @agentS through the consumer on a TREE channel, and the OWNER_ONLY assertion checks that the TREE guard fired. Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-comms/rig-4189-tree-delivery
branch
from
October 10, 2026 06:11
fcc49bc to
5b7fa1e
Compare
Contributor
Author
|
Review at head Scope: the rebase delta from the last reviewed head
|
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 T5 (
docs/designs/ui/compass-channels-in-agent-tree/design.md§ Plan): subscriptions and delivery for TREE channels. Stacked on #1772.UpdateChannelMembersreturnsErrInvalidArgumentfor add or remove. A subscribe or explicit unsubscribe of a derived participant upserts itschannel_subscriptionsoverride (newUpsertChannelSubscription); subscribe seeds the D2 cursor in the same tx. A toggle for an account outside the derived set isErrNotFound.participantsCTE: stored member rows UNION ALL the TREE-derived set, withCOALESCE(cs.subscribed, FALSE).SubscribedAgents,ChannelAgentMembers(@mentions and@agents).SweepChannels,UndeliveredMessages,InSweepSet.membership_mode = 1guard keeps EXPLICIT channels out of the recursions, and the stored arm skips TREE channels, so the arms never overlap. Recursions use UNION, so parent cycles terminate.SetChannelPolicyrefuses a mandatory flip andOWNER_ONLYon TREE.Tests
TestChannelTreeSubscriptionDrivesEveryDeliverySite: an untoggled participant is in none of the four delivery gates; after subscribe it is in all four (SubscribedAgents,SweepChannels,UndeliveredMessages,InSweepSet); its override does not reach the mid agent; unsubscribe removes it again.TestChannelTreeReparentOutMakesOverrideInert: after a reparent out, the override row remains but the agent is in no delivery site and not inChannelAgentMembers.TestChannelTreeAgentMembersAreTheSubtree:ChannelAgentMembersis exactly the subtree minus the author.TestChannelTreeMembershipWritesRefused: add, remove, mandatory and OWNER_ONLY returnErrInvalidArgument(OWNER_ONLY checks that the TREE guard fired, not the owner-is-member check); an outsider subscribe returnsErrNotFound.TestTreeChannelMentionsRouteToDerivedAgents(delivery): through the consumer's recovery scan,@leafand@agentsposted by the anchor reach leaf and mid as owed mentions; the author and an agent outside the subtree get none.ChannelAgentMembers; COALESCE default TRUE;InSweepSetTREE arm removed.ok. vet,sqlc-drift, the migration gate and lint: clean.Open decision: RIG-4678 (whether TREE re-entry replays messages from the agent's absence; today it does, the same as EXPLICIT remove/re-add).
Spec-impact: none
Ledger-impact: none
Refs RIG-4189, RIG-1622
Co-authored-by: Matt Wilkinson matt@rigel.build