Canonical async tool + MCP runtime slice #60

Merged
lost-rob0t merged 28 commits from feature/issue-54-tools-mcp-canonical-async into main 2026-08-16 14:15:12 +00:00
lost-rob0t commented 2026-08-16 13:57:31 +00:00 (Migrated from github.com)

Advances #54 and #52, with a partial core loading ABI for #48 and the #49/#50 concrete-pack work intentionally left external. #53 authority semantics remain intact.

Canonical async architecture

  • rlm_tool: canonical tool_invoke_execute -> async Future; sync tool_invoke starts/awaits the same async operation
  • plan-runtime tool calls use the execute ABI directly so an existing async worker never nests a Future wait
  • MCP connect/command/close/server-handle follow the same execute -> async -> sync-await direction
  • stateful async MCP calls return updated client/server state in structured Future results
  • cancellation control signals propagate through tool, MCP facade, send, and transport boundaries
  • tool and MCP operations share the bounded rlm_async scheduler; no second pool

MCP lifecycle

  • inert multifile mcp_server/2 definitions and query/discovery predicates
  • explicit install/run/stop/restart/connect sync+async lifecycle
  • owned running transports are distinct from borrowed client connections
  • definitions do not auto-install, auto-start, connect, import tools, or grant capabilities
  • imported MCP tools register into the normal rlm_tool contract and therefore retain capability/schema/limit/trace enforcement

External tool-pack boundary

  • core now provides a low-level multifile category/loader ABI in rlm_tool_loader
  • loading registers schemas/handlers but does not grant capabilities
  • concrete filesystem/git/process/network tool packs are not moved into core
  • #48 remains open for its full convenience API/idempotency/category acceptance surface; #49/#50 remain follow-up extraction/packaging work

Authority

No authority UI or agentProlog/ work is included. Canonical policy remains approve_diff, allow_once, allow_session, dangerous; dangerous does not bypass capabilities, schemas, confinement, budgets, network policy, validation, or tracing.

Validation

Adds directionality regressions, exactly-once tool execution, timeout/cancellation cleanup, sync/async outcome+trace parity, inert MCP definitions, explicit lifecycle ownership, MCP command/server parity, imported-tool capability/schema gates, loader-is-not-authorization tests, shared scheduler bounds, and a fail-fast per-case runner for nested-wait regressions.

Existing completion/chain canonical directionality tests remain enabled. Full deterministic and REAL OpenRouter gates are required before squash merge.

Refs #54 #52 #48 #49 #50 #53

Advances #54 and #52, with a partial core loading ABI for #48 and the #49/#50 concrete-pack work intentionally left external. #53 authority semantics remain intact. ## Canonical async architecture - `rlm_tool`: canonical `tool_invoke_execute` -> async Future; sync `tool_invoke` starts/awaits the same async operation - plan-runtime tool calls use the execute ABI directly so an existing async worker never nests a Future wait - MCP connect/command/close/server-handle follow the same execute -> async -> sync-await direction - stateful async MCP calls return updated client/server state in structured Future results - cancellation control signals propagate through tool, MCP facade, send, and transport boundaries - tool and MCP operations share the bounded `rlm_async` scheduler; no second pool ## MCP lifecycle - inert multifile `mcp_server/2` definitions and query/discovery predicates - explicit install/run/stop/restart/connect sync+async lifecycle - owned running transports are distinct from borrowed client connections - definitions do not auto-install, auto-start, connect, import tools, or grant capabilities - imported MCP tools register into the normal `rlm_tool` contract and therefore retain capability/schema/limit/trace enforcement ## External tool-pack boundary - core now provides a low-level multifile category/loader ABI in `rlm_tool_loader` - loading registers schemas/handlers but does not grant capabilities - concrete filesystem/git/process/network tool packs are not moved into core - #48 remains open for its full convenience API/idempotency/category acceptance surface; #49/#50 remain follow-up extraction/packaging work ## Authority No authority UI or `agentProlog/` work is included. Canonical policy remains `approve_diff`, `allow_once`, `allow_session`, `dangerous`; `dangerous` does not bypass capabilities, schemas, confinement, budgets, network policy, validation, or tracing. ## Validation Adds directionality regressions, exactly-once tool execution, timeout/cancellation cleanup, sync/async outcome+trace parity, inert MCP definitions, explicit lifecycle ownership, MCP command/server parity, imported-tool capability/schema gates, loader-is-not-authorization tests, shared scheduler bounds, and a fail-fast per-case runner for nested-wait regressions. Existing completion/chain canonical directionality tests remain enabled. Full deterministic and REAL OpenRouter gates are required before squash merge. Refs #54 #52 #48 #49 #50 #53
Sign in to join this conversation.
No description provided.