feat(comms): org-management agent tools — comms adapters, hub dispatch, spawn role/persona (RIG-2673) - #630
Open
rigel-mintaka wants to merge 1 commit into
Conversation
|
Compass engineering docs preview: https://compass-server-rig-2724-org-au33.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
force-pushed
the
compass-server/rig-2724-org-mgmt-proto
branch
from
August 25, 2026 23:05
60728dd to
836c472
Compare
rigel-mintaka
force-pushed
the
compass-server/rig-2724-org-mgmt-handlers
branch
from
August 25, 2026 23:30
11db9be to
9584e0b
Compare
…h, spawn role/persona (RIG-2673) Wires the compass-server half of the org-management agent tools (RIG-2673 T2–T4) on top of the T1 proto arms (#628): the three comms adapters, their hub dispatch, and the spawn role/persona thread-through. Every operation flows through the existing agent→Runner→Server relay under the server-resolved account, so the authz, idempotency, and event fan-out are identical to a human caller's. ### T2 — comms adapters (`go/internal/comms/agent_caller.go`) `CreateChannelAsAccount`, `UpdateChannelMembersAsAccount`, `CreateChannelGroupAsAccount` — each mirrors `UpdatePinnedBoardAsAccount`: guard empty account → `errNoActor`, then `WithActor` + the shared handler path, returning `resp.Msg`. No home-channel defaulting (create-channel names no channel; update-members carries `channel_id` explicitly; create-group names only an optional parent). Founding membership rides `CreateChannel`'s `expandOwnerMembership`, so a Manager can immediately post to the channel it just made. ### T3 — hub dispatch (`go/internal/runnerhub/hub.go`, `relay_comms.go`) Extended the `CommsCaller` interface with the three methods and added three `executeCall` cases on the `Pin` pattern, each wrapping the matching `CommsCallResult` oneof. The default-case error string's variant list now includes the three new arms. A tool error renders in-band as `CommsCallError`, never a stream teardown. ### T4 — spawn role/persona thread-through (`go/server/lifecycle.go`) Dropped the `Persona: ""` / `Role: ""` hardcodes in the `store.CreateAgent` literal for `req.GetPersona()` / `req.GetRole()`. Under the D9 owner-acts model the caller's owner is the authority, so a Manager-creating spawn legitimately carries role+persona set-at-creation; the values are stored via `CreateAgent` (the source of record) and threaded to the Runner from the created store account — an empty-field spawn is byte-identical to today's field-less spawn. ### Tests (red-green) - T2 pgtests (`org_mgmt_pgtest_test.go`): founder-membership + `ChannelChanged` fan-out, member-add, group-create; each with empty-account → `errNoActor` and an invisible/non-member target → `CodeNotFound` (the D9 collapse a human gets). - T3 relay tests (`relay_org_mgmt_test.go`): each arm forwards under the bound account with `call_id` round-trip; a create-channel tool error is in-band, not a transport teardown. - T4 spawn pgtests (`spawn_role_persona_pgtest_test.go`): role and persona each stored + on the Provision wire; empty-field spawn stores + wires empty (wire-level regression); idempotent re-spawn keeps stored values. Verified: `go build ./...`, `gofmt`, `compass-go:lint` (0 issues), and the affected `internal/comms` / `internal/runnerhub` / `server` suites all green (pgtests via the throwaway-container path). Refs RIG-2724, RIG-2673. Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-server/rig-2724-org-mgmt-handlers
branch
from
August 25, 2026 23:40
9584e0b to
10fb626
Compare
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 2 PRs:
mainWires the compass-server half of the org-management agent tools (RIG-2673 T2–T4) on top of the T1 proto arms (#628): the three comms adapters, their hub dispatch, and the spawn role/persona thread-through. Every operation flows through the existing agent→Runner→Server relay under the server-resolved account, so the authz, idempotency, and event fan-out are identical to a human caller's.
T2 — comms adapters (
go/internal/comms/agent_caller.go)CreateChannelAsAccount,UpdateChannelMembersAsAccount,CreateChannelGroupAsAccount— each mirrorsUpdatePinnedBoardAsAccount: guard empty account →errNoActor, thenWithActor+ the shared handler path, returningresp.Msg. No home-channel defaulting (create-channel names no channel; update-members carrieschannel_idexplicitly; create-group names only an optional parent). Founding membership ridesCreateChannel'sexpandOwnerMembership, so a Manager can immediately post to the channel it just made.T3 — hub dispatch (
go/internal/runnerhub/hub.go,relay_comms.go)Extended the
CommsCallerinterface with the three methods and added threeexecuteCallcases on thePinpattern, each wrapping the matchingCommsCallResultoneof. The default-case error string's variant list now includes the three new arms. A tool error renders in-band asCommsCallError, never a stream teardown.T4 — spawn role/persona thread-through (
go/server/lifecycle.go)Dropped the
Persona: ""/Role: ""hardcodes in thestore.CreateAgentliteral forreq.GetPersona()/req.GetRole(). Under the D9 owner-acts model the caller's owner is the authority, so a Manager-creating spawn legitimately carries role+persona set-at-creation; the values are stored viaCreateAgent(the source of record) and threaded to the Runner from the created store account — an empty-field spawn is byte-identical to today's field-less spawn.Tests (red-green)
org_mgmt_pgtest_test.go): founder-membership +ChannelChangedfan-out, member-add, group-create; each with empty-account →errNoActorand an invisible/non-member target →CodeNotFound(the D9 collapse a human gets).relay_org_mgmt_test.go): each arm forwards under the bound account withcall_idround-trip; a create-channel tool error is in-band, not a transport teardown.spawn_role_persona_pgtest_test.go): role and persona each stored + on the Provision wire; empty-field spawn stores + wires empty (wire-level regression); idempotent re-spawn keeps stored values.Verified:
go build ./...,gofmt,compass-go:lint(0 issues), and the affectedinternal/comms/internal/runnerhub/serversuites all green (pgtests via the throwaway-container path).Refs RIG-2724, RIG-2673.
Co-authored-by: Matt Wilkinson matt@rigel.build