Repository navigation
feat(persona): give the persona HANDS — wire tool execution into the live brain (#15) - #1717
Merged
Merged
Conversation
…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]>
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.
What
The deliberation faculty could already decide to act (it emits native
tool_usecalls), butbuild_workspace_cycleconstructed it speak-only — noexecutor, 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 onestart_serverbuilds with
GridTrustAuthPolicy+ interceptors), not a freshCommandExecutor::new(AllowAll default, no interceptors). This is theload-bearing security choice: the transport carries
CallerIdentity::airc(persona), so the persona is gated as itself — anOwner-gated command (
data/delete,grid/trust) is refused at executioneven if it appears in the tool surface.
PersonaBrainConfig.tool_executor—Some→build_workspace_cycleoffersthe dynamic AiSafe tool surface (
ai_safe_tool_specs()=command_registry × AiSafe, nothing hardcoded) and wires the executor;None→ speak-only (safedefault).
materialize_adaptersgains atool_executor_forclosure (same closure-DIshape as
runtime_lookup) — keeps the supervisor decoupled from the commandruntime.
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 neverwidens what a persona may actually do.
Tests
Covered by composition (each layer independently tested):
for_personavia the 20command_executortestsin_process_transport::scoped_persona_client_dispatches_with_identity_and_contextllm_deliberation_faculty::persona_acts_then_speaks_threading_tool_resultsBinary +
persona_workspace+supervisorall green. (Live end-to-end — Asharunning a real command — is the integration proof, to validate on the running core.)
🤖 Generated with Claude Code