Skip to content

feat(persona): give the persona HANDS — wire tool execution into the live brain (#15) - #1717

Merged
joelteply merged 1 commit into
canaryfrom
feat/persona-hands-tool-execution
Jun 21, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/persona-hands-tool-execution

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

The deliberation faculty could already decide to act (it emits native
tool_use calls), but build_workspace_cycle constructed it speak-only — no
executor, so the live persona could talk but never touch the world. This wires the
persona's nervous system: the model's tool calls now route to the core's
command surface (the same catalog the MCP server exposes).

The chain

  • CommandToolExecutor::for_persona(executor, persona) — production factory.
    Takes the substrate's wired Arc<CommandExecutor> (the one start_server
    builds with GridTrustAuthPolicy + interceptors), not a fresh
    CommandExecutor::new (AllowAll default, no interceptors). This is the
    load-bearing security choice: the transport carries
    CallerIdentity::airc(persona), so the persona is gated as itself — an
    Owner-gated command (data/delete, grid/trust) is refused at execution
    even if it appears in the tool surface.
  • PersonaBrainConfig.tool_executor — Some → build_workspace_cycle offers
    the dynamic AiSafe tool surface (ai_safe_tool_specs() = command_registry × AiSafe, nothing hardcoded) and wires the executor; None → speak-only (safe
    default).
  • materialize_adapters gains a tool_executor_for closure (same closure-DI
    shape as runtime_lookup) — keeps the supervisor decoupled from the command
    runtime.
  • The wired executor reaches the spawn task through the existing executor-ready
    oneshot
    : it now carries Arc<CommandExecutor> instead of () — one channel,
    both the ordering gate and the payload the hands ride.

Security model (stated)

Offer = the AiSafe surface; Execute = authorized-by-identity through
GridTrustAuthPolicy. Two independent layers, so a broad tool surface never
widens what a persona may actually do.

Tests

Covered by composition (each layer independently tested):

  • for_persona via the 20 command_executor tests
  • identity→ACL path via in_process_transport::scoped_persona_client_dispatches_with_identity_and_context
  • acts-then-speaks via llm_deliberation_faculty::persona_acts_then_speaks_threading_tool_results

Binary + persona_workspace + supervisor all green. (Live end-to-end — Asha
running a real command — is the integration proof, to validate on the running core.)

🤖 Generated with Claude Code

…he live brain (#15)

The deliberation faculty could already DECIDE to act (it emits native tool_use
calls), but build_workspace_cycle constructed it speak-only — no executor, so
the live persona could talk but never touch the world. This wires the persona's
nervous system: the model's tool calls now route to the core's command surface.

The chain:
- CommandToolExecutor::for_persona(executor, persona) — production factory.
  Takes the substrate's WIRED Arc<CommandExecutor> (the one start_server builds
  with GridTrustAuthPolicy + interceptors), NOT a fresh CommandExecutor::new
  (AllowAll default, no interceptors). That is the load-bearing SECURITY choice:
  the transport carries CallerIdentity::airc(persona), so the persona is gated
  AS ITSELF — an Owner-gated command (data/delete, grid/trust) is REFUSED at
  execution even if it appears in the tool surface.
- PersonaBrainConfig.tool_executor: Option<Arc<dyn ToolExecutor>>. Some →
  build_workspace_cycle offers the dynamic AiSafe tool surface
  (ai_safe_tool_specs(), command_registry × AiSafe — nothing hardcoded) and
  wires the executor. None → speak-only (the safe default for harnesses).
- materialize_adapters gains a tool_executor_for closure (same closure-DI shape
  as runtime_lookup) — keeps the supervisor decoupled from the command runtime.
- The wired executor reaches the spawn task through the existing executor-ready
  oneshot: it now carries Arc<CommandExecutor> instead of () — one channel,
  both the ordering gate AND the payload the hands ride. spawn_all takes it and
  builds a per-persona CommandToolExecutor.

Security model, stated: OFFER = the AiSafe surface; EXECUTE = authorized-by-
identity through GridTrustAuthPolicy. The two layers are independent, so a
broad tool surface never widens what a persona may actually do.

Covered by existing tests (composition): for_persona via the 20 command_executor
tests; the identity→ACL path by in_process_transport's
scoped_persona_client_dispatches_with_identity_and_context; acts-then-speaks by
llm_deliberation_faculty's persona_acts_then_speaks_threading_tool_results.
Binary + persona_workspace + supervisor all green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit 3936054 into canary Jun 21, 2026
4 checks passed
@joelteply
joelteply deleted the feat/persona-hands-tool-execution branch June 21, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant