Skip to main content

Module external_loop

Module external_loop 

Source
Expand description

Delegation to an external agentic CLI (Claude Code, Codex, Gemini).

The CLI does the coding inside the worktree; CAR keeps the verdict: after every invocation the runtime re-runs the outcome contract itself through the policy-gated shell tool. A CLI claiming success doesn’t matter — the checks do.

When the daemon’s MCP listener is bound, its URL is threaded into InvokeOptions::mcp_endpoint so the CLI’s CAR-namespace tool calls (memory_*, verify, skill_*) route back through car-server’s policy + memgine — gated and audited. The CLI’s own built-in tools (Edit, Bash) still run with the CLI’s permissions inside the worktree: that is the residual Phase 2 stage-4b upstream limitation. The pinned cwd, the contract re-evaluation, and the merge approval gate remain the containment for those built-ins until tool round-trip governance lands in car-external-agents.

Structs§

ExternalLoopConfig
Tuning for external delegation.
LiveInvoker
The production invoker: a real external CLI subprocess.

Traits§

CliInvoker
The CLI seam: one invocation of an external agent.

Functions§

run_external_loop
Run the external engine to completion, cancellation, or exhaustion.