Repository navigation
feat(store): attach channels to agents with tree or explicit membership (RIG-4186) - #1762
Open
rigel-mintaka wants to merge 4 commits into
Open
rigel-mintaka wants to merge 4 commits into
rigel-mintaka wants to merge 4 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Compass engineering docs preview: https://compass-comms-rig-4186-chann.compass-eng-docs.pages.dev Deployed from |
…ip (RIG-4186) Migration 0009 adds channels.parent_agent_id and membership_mode with their CHECKs and indexes, plus channel_subscriptions with its own RLS, tenant_isolation policy and grants. CreateChannel accepts an agent anchor and a mode, authorizes the attach against the owner set, and writes no member rows for a TREE channel. ReparentChannel runs the participant gate before every shape refusal. Co-authored-by: Matt Wilkinson <matt@rigel.build>
… (RIG-4186) ReparentChannel now takes the channel row lock before the participant and destination checks, so a concurrent member removal is seen. Create refuses an agent anchor on a DM kind and names the owner-account FK. Co-authored-by: Matt Wilkinson <matt@rigel.build>
… (RIG-4186) Co-authored-by: Matt Wilkinson <matt@rigel.build>
…001 fold (RIG-4186) Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-comms/rig-4186-channel-tree-store
branch
from
October 6, 2026 06:16
f0ba02f to
1a144e8
Compare
This was referenced Oct 6, 2026
mattwilkinsonn
added this pull request to stack #1828
October 7, 2026 00:34
mattwilkinsonn
approved these changes
Oct 7, 2026
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
Store half of channels-in-the-agent-tree, task T2 (
docs/designs/ui/compass-channels-in-agent-tree/design.md§ Plan).0002_channel_tree.sql(rebased onto the 0001 fold; renumbered in its own commit):channels.parent_agent_id(FKagent_accounts) andmembership_mode(IN (0, 1)).channels_group_xor_agentandchannels_tree_mode_needs_agent,channels_parent_agent_idx, and the partial uniquechannels_agent_name_key.channel_subscriptionswith its account index, its own ENABLE/FORCE RLS, thetenant_isolationpolicy and grants. A later table inherits none of these from 0001.channels. Each has a per-clausesquawk-ignore:channelsis small, the new column is all NULL, andlock_timeoutbounds the wait. The 0004 FK precedent is the same.CreateChannel:requireAgentAttachAuthzchecks that the actor is the agent's owner or a same-owner agent. An unknown or foreign agent getsErrNotFound.ListChannelsreports until T4 swaps the return for thegetChannelre-read.ReparentChannel:ChannelParticipant, the design's sketch) runs before the row lock, so a non-participant never takes the lock.FOR UPDATE, against committed membership, so a concurrent member removal cannot be bypassed.ErrNotFound.ErrInvalidArgument. A name clash at the destination isErrConflict.ChannelMembershipModetype;NewChannel.ParentAgentID/.MembershipMode.Out of scope here (later stack PRs): rebinding
requireChannelMemberonto the probe (T3); carrying the new columns throughChannelreads and thegetChannelre-read (T4); delivery and subscription toggles (T5); the RPC edge (T6).Tests
channel_tree_pgtest_test.go, 12 tests:channel_subscriptionsrows written under tenant A;pg_blocking_pids) → NotFound.TestRLSCatalogEnabledAndForcednow listschannel_subscriptions.ok.go vet -tags pgtest,sqlc-drift, andsql-migration-gate:checkall pass. golangci-lint (untagged andpgtest) reports no new findings.Spec-impact: none
Ledger-impact: none
Refs RIG-4186, RIG-1622
Co-authored-by: Matt Wilkinson matt@rigel.build