feat(proto): org-management comms + spawn arms for agent gateway (RIG-2673) - #628
feat(proto): org-management comms + spawn arms for agent gateway (RIG-2673)#628rigel-mintaka wants to merge 1 commit into
Conversation
|
Compass engineering docs preview: https://compass-server-rig-2724-org.compass-eng-docs.pages.dev Deployed from |
…-2673) Add the three org-management comms-call arms (create_channel=7, update_members=8, create_channel_group=9 on CommsCallRequest.call; the matching results =8/=9/=10 on CommsCallResult.result) and the Manager- creation role=5/persona=6 fields on SpawnPeerRequest, reusing the existing comms.proto payload messages verbatim. Regenerated the internal Go (go/internal/gen) and agent TS (packages/compass-agent/src/gen) lanes. T1 of the frozen org-management-tools record (RIG-2673, #589); the single additive proto+regen commit both compass-server and compass-agent consume. Co-authored-by: Matt Wilkinson <matt@rigel.build>
60728dd to
836c472
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>
…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>
|
Holding this (converted to draft) — Matt ruled RIG-2751 contract-wide: no agent or client UI ever resolves account ids; every request field takes a These arms get re-authored handle-first as part of the RIG-2751 cutover (design record → Matt freeze → one coherent proto change across comms.proto + agent_gateway.proto). #630's handlers rebase onto the reshaped proto and do the server-side handle→id resolution. Un-drafting once RIG-2751 reshapes + rebases them. Ref: RIG-2751 |
This PR is part of a stack containing 2 PRs:
mainAdd the three org-management comms-call arms (create_channel=7,
update_members=8, create_channel_group=9 on CommsCallRequest.call; the
matching results =8/=9/=10 on CommsCallResult.result) and the Manager-
creation role=5/persona=6 fields on SpawnPeerRequest, reusing the existing
comms.proto payload messages verbatim. Regenerated the internal Go
(go/internal/gen) and agent TS (packages/compass-agent/src/gen) lanes.
T1 of the frozen org-management-tools record (RIG-2673, #589); the single
additive proto+regen commit both compass-server and compass-agent consume.
Co-authored-by: Matt Wilkinson matt@rigel.build