Implement EXT-14: commands-as-tools dispatched through the command bus #114

Merged
weichen merged 1 commits from feature/ext-13-15-shared-runs into main 2026-10-09 16:19:11 +00:00
Owner

Summary

Base implementation of EXT-14 (commands-as-tools, Q4 option A; proposal modules/documents/docs/proposals/2026-10-09-ext-g1-b1-b3-exec-backend.md §2):

  • agent-command pin cc1ad77 → 5c6dd0c (library PRs #4/#5): additive optional ExposeAsTool{Risk low|medium|high} on CommandSpec, and agent accepted as a canonical entrance (model-initiated calls were folding into "api").
  • cmdbus.Bus.CommandTools() projects enabled, exposed commands (risk defaults low; description falls back to title); runmgr.Manager.SetCommandSource wires the bus into the run: exposed commands appear in runCtx.Tools() (deduped — registry tools win), and model calls to them dispatch through the command bus with Entrance="agent", Actor/Owner = conversation owner, ConversationID set — same audit envelope and the same high-danger inline-confirm-card flow. Composition root wires a busAdapter.

Why

RDM's entire surface is rdm.* commands; without this bridge the agent cannot reach the two-trees-one-net during a run, and the V0.1 end-to-end acceptance (C-11, all-conversation operation) is impossible.

Tests

Red → green: TestCommandToolsProjected, TestCommandToolDispatchesThroughBus (runmgr), TestCommandToolsFiltering, TestCommandToolDispatchEnvelope (cmdbus). go test ./... 32/32 ok. CI on this PR is the GATE.

Compat

No pkg/extension change; commands without exposeAsTool and runs without a command source are byte-for-byte unchanged.

## Summary Base implementation of **EXT-14** (commands-as-tools, Q4 option A; proposal `modules/documents/docs/proposals/2026-10-09-ext-g1-b1-b3-exec-backend.md` §2): - `agent-command` pin `cc1ad77 → 5c6dd0c` (library PRs #4/#5): additive optional `ExposeAsTool{Risk low|medium|high}` on `CommandSpec`, and `agent` accepted as a canonical entrance (model-initiated calls were folding into "api"). - `cmdbus.Bus.CommandTools()` projects enabled, exposed commands (risk defaults low; description falls back to title); `runmgr.Manager.SetCommandSource` wires the bus into the run: exposed commands appear in `runCtx.Tools()` (deduped — registry tools win), and model calls to them **dispatch through the command bus** with `Entrance="agent"`, Actor/Owner = conversation owner, ConversationID set — same audit envelope and the same high-danger inline-confirm-card flow. Composition root wires a `busAdapter`. ## Why RDM's entire surface is `rdm.*` commands; without this bridge the agent cannot reach the two-trees-one-net during a run, and the V0.1 end-to-end acceptance (C-11, all-conversation operation) is impossible. ## Tests Red → green: `TestCommandToolsProjected`, `TestCommandToolDispatchesThroughBus` (runmgr), `TestCommandToolsFiltering`, `TestCommandToolDispatchEnvelope` (cmdbus). `go test ./...` 32/32 ok. CI on this PR is the GATE. ## Compat No `pkg/extension` change; commands without `exposeAsTool` and runs without a command source are byte-for-byte unchanged.
weichen added 1 commit 2026-10-09 16:17:01 +00:00
Why: RDM's capabilities are rdm.* commands; the agent run has no bridge
to them, so the V0.1 end-to-end goal (full-conversation operation) and
the agent-driven two-trees-one-net access are unreachable (Q4 option A).
Evidence: SELF - red tests first: TestCommandToolsProjected and
TestCommandToolDispatchesThroughBus failed on undefined symbols, then
green; TestCommandToolsFiltering and TestCommandToolDispatchEnvelope
cover projection filtering (risk default low, description falls back to
title, unexposed commands absent) and the full dispatch receipt with
Entrance=agent preserved through CanonicalEntrance; go test ./... 32/32
packages ok.
Impact: agent-command pin cc1ad77 -> 5c6dd0c (library PRs #4/#5: optional
ExposeAsTool field + "agent" entrance). cmdbus gains CommandTool view and
Bus.CommandTools; runmgr gains SetCommandSource with projection into
runCtx.Tools (dedup: registry tools win) and routing in ExecuteTool -
model calls dispatch through the bus with Entrance=agent, Actor/Owner =
conversation owner, ConversationID set; high-danger commands keep the
inline-confirm-card flow via the bus; unregistered source = current
registry behavior. Composition root wires a busAdapter. No
pkg/extension change.
Refs: proposal 2026-10-09-ext-g1-b1-b3 section 2; Agent-Command #4/#5
weichen merged commit 545dc404e5 into main 2026-10-09 16:19:11 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#114