TZRO

What's TZRO

A zero-dependency, local-first agentic execution engine. It compiles natural language prompts into topologically-sorted DAG (Directed Acyclic Graph) workflows, executes them durably with checkpointing, and provides relational memory, knowledge graph, and micro-skill extraction.

Intelligent Task Offloading

Today's agentic coding workflows are fragile. A cloud-only "generate-and-run" chat loop means every directory listing, every file parse, every grep runs through a frontier API — burning tokens, hitting daily rate limits, and freezing your workflow mid-task. This is token-maxing: feeding a $15/MTok model with work a local 3B can handle in milliseconds.

tzro implements Inference Arbitrage — the principle that the right model for the job is rarely the most expensive one. By routing execution-level work and even code generation to a grammar-locked local engine (via tzro_code), you preserve your cloud budget for what actually requires frontier reasoning: architectural planning, complex judgment, and interactive user dialogue.

💡
The Core Insight

Directory traversal, file parsing, JSON formatting, and database sync are routing decisions, not frontier reasoning. A 4-bit quantized 3B model handles them perfectly — at zero API cost.

The Cloud Plans, Local Executes

The division of labor is explicit and non-negotiable:

☁️

Cloud — The Planner

Handles non-sensitive abstract graph compilation. Generates DAG workflows, makes architectural decisions, synthesizes final outputs. This is where frontier reasoning lives.

⚙️

Local Go Engine — The Executor

Handles execution and code generation: directory indexing, file parsing, tool dispatch, database sync, source file generation with compilation validation, and structured output generation. All behind 127.0.0.1.

Dimension Cloud-Only Loop tzro Cooperative Model
Cost per file scan ~$0.02–$0.08 $0.00 (local)
Rate limit exposure High — daily freezes Near-zero for execution tasks
Data residency Code leaves premises 100% loopback — code never leaves
Execution durability Stateless — lost on disconnect Checkpointed in SQLite

The 5-Minute Plug-and-Play Quickstart

Zero habit change. tzro plugs directly into your existing client tools — Claude Code, Cursor, Windsurf, GitHub Copilot, OpenCode, or Antigravity IDE — as an MCP server. You keep using your tools exactly as before; the sidecar silently intercepts execution-level work and routes it locally.

1
Single-Line Bootstrap

One command provisions everything. No package manager, no dependency tree, no build step.

Shell
curl -fsSL https://get.tzro.ai | sh

Behind the scenes, the bootstrap script performs:

  • Provisions the ~/.tzro/ directory (bin/, cache/, models/)
  • Downloads three binaries: tzro (CLI), tzro-mcp (MCP server), and tzrod (daemon)
  • Fetches the worker model — Agents-A1 4B GGUF (~3 GB)
  • Fetches the router model — MiniCPM5 1B GGUF (~1.2 GB) for fast classification
  • Fetches the vision projector — mmproj F32 GGUF for multimodal input
  • Initializes the local SQLite state database (~/.tzro/tzro.db)
  • Bypasses macOS Gatekeeper quarantine on downloaded binaries
  • Adds ~/.tzro/bin to your $PATH via shell profile detection
📦
What Gets Installed

Total footprint: ~5 GB (3 models + binaries + DB). Everything lives in ~/.tzro/. No root access required. Uninstall is rm -rf ~/.tzro.

2
Automated MCP Registration

The installer auto-detects your AI editors and offers to configure them automatically. It wires up the tzro-mcp binary as an MCP server and injects agent skill instructions into each editor's config.

Terminal Output
  ⚙  AI Editor Configuration

  ✔ Claude Code
  ✔ Cursor
  ○ Windsurf (not detected)
  ○ GitHub Copilot (not detected)
  ○ OpenCode (not detected)
  ✔ Gemini / Antigravity IDE

  Select interfaces to configure:
  Press Enter to accept detected defaults

You'll also be asked to select an integration tier that controls how aggressively agents delegate work to the local engine:

Tier Delegation Trigger Best For
Conservative 8+ sequential tool calls Testing the waters, sensitive workflows
Balanced (recommended) 3+ sequential tool calls Most developers — good cost/quality tradeoff
Aggressive 2+ sequential tool calls Maximum local execution, lowest cloud spend

If you prefer manual configuration, the MCP server entry looks like this for any editor:

JSON — MCP Server Config
{
  "mcpServers": {
    "tzro": {
      "command": "~/.tzro/bin/tzro-mcp",
      "args": [],
      "env": {
        "TZRO_DIR": "/path/to/your/project"
      }
    }
  }
}
TZRO_DIR

TZRO_DIR tells the engine which directory to use as its project root. The daemon auto-discovers project structure, existing .agents/ configs, and any tzro.db state from prior runs.

3
Trigger an Offline Run

With the MCP server registered, your AI client can now delegate execution tasks to the local engine. Try it:

Shell
# From Claude Code, Cursor, or any MCP-compatible client:
"Use tzro to build markdown documentation for this entire directory."

# Or directly via CLI:
tzro chat "Explore this codebase and explain its architecture."

The sidecar compiles a DAG workflow, topologically sorts the nodes via the Kahn Compiler, and executes them in parallel where possible — all locally, all checkpointed.

Local Security & Sandbox Transparency

We assume you're skeptical of running a local executable that intercepts AI tool calls. Good. Here's the complete security architecture — no hand-waving, no "trust us" appeals. Least-Privilege Security-by-Design at every layer.

Data Sovereignty

100% of code parsing, file edits, and tool manipulations remain local behind the loopback interface. Sensitive corporate data never leaves the premises.

🔒

Loopback-Only Binding

The MCP server binds exclusively to 127.0.0.1. No external network interfaces are exposed. Zero attack surface from outside the machine.

💾

Local SQLite State

All execution state, memory, and knowledge graph data persists in ~/.tzro/tzro.db — a single file on your disk. No cloud sync, no telemetry.

🛡️
Zero Telemetry Guarantee

tzrod makes exactly zero outbound network requests during normal operation. Model weights are fetched once during bootstrap. Everything else is local. Verify this yourself: sudo lsof -i -P | grep tzrod.

Containerized Execution

When tasks require code execution beyond simple file operations, TZRO dynamically orchestrates short-lived, task-scoped container sandboxes leveraging local Podman socket routes.

  • Ephemeral containers — spun up per-task, destroyed on completion. No persistent state leakage between executions.
  • Rootless Podman — no Docker daemon, no root access. Runs entirely in userspace via podman --rootless.
  • Resource-capped — each container is CPU/memory-limited to prevent runaway processes from impacting your development environment.
Shell
# How tzro spawns a sandboxed execution container:
podman run --rm --read-only \
  --network=none \
  --memory=512m --cpus=1.0 \
  -v /project:/workspace:ro \
  tzro-sandbox:latest \
  sh -c "$TASK_COMMAND"

Grammar Gating (GBNF)

For structured output calls — tool dispatch, classification, parameter extraction, and validator passes — the local LLM is constrained by logit-level GBNF grammar rules that mathematically prevent arbitrary command injection. These are the security-critical call sites where output format matters.

On constrained calls, the model's output is restricted strictly to predefined JSON schemas. It cannot produce output outside the grammar — this is enforced at the logit sampling level, not by post-hoc filtering. If the grammar says the output must be a JSON object with keys tool, args, and reasoning, then that is the only structure the model can physically produce. Free-form generation calls (synthesis, reasoning text) are not grammar-constrained.

GBNF Grammar
# Example: Tool dispatch grammar constraint
root   ::= "{" ws "\"tool\":" ws tool-name "," ws
             "\"args\":" ws json-object "," ws
             "\"reasoning\":" ws string ws "}"
tool-name ::= "\"read_file\"" | "\"list_dir\"" | "\"search_files\"" | "\"web_search\""
🔐
Why This Matters

Traditional LLM guardrails rely on prompt instructions ("don't run dangerous commands") which can be jailbroken. GBNF constraints are mathematical — the model literally cannot emit tokens outside the defined grammar. It's the difference between asking someone nicely not to open a door and welding the door shut.

Network Isolation

Mounted target repositories default to read-only parameters, and network interfaces inside execution containers are entirely decoupled (network=none) to block supply-chain leaks.

  • Read-only mounts — project directories are mounted with :ro flag by default. Write access requires explicit opt-in via task configuration.
  • Network decoupled — containers run with --network=none. No DNS resolution, no HTTP requests, no exfiltration vector.
  • No package installation — containers have no access to package registries. No npm install, no pip install, no supply-chain attacks.

Local Hardware Optimization

Running a local LLM sidecar will not freeze your laptop or disrupt your multitasking workflow. Here's exactly how we ensure that.

💻
Target Hardware Profile

tzrod is optimized for standard developer laptops — 16 GB RAM, 8-core CPU, no dedicated GPU required. The 4-bit quantized Qwen-3B model uses ~1.8 GB RAM at inference time.

Speculative Decoding

tzrod uses n-gram speculative decoding forward-projections to speed up local 3B–4B generation velocities by 1.8× on standard CPUs.

The technique works by maintaining a rolling n-gram cache of recently generated token sequences. When the model begins generating a new sequence, the speculative decoder proposes multiple candidate continuations in parallel based on n-gram frequency statistics. The main model then verifies these candidates in a single forward pass — accepting correct predictions for free and rejecting mismatches with zero wasted compute.

1.8× Throughput Boost

Measured on Apple M-series and Intel i7/i9 CPUs. JSON-structured output (tool dispatch) benefits most due to predictable token patterns.

🧠

Zero Quality Loss

Speculative decoding is mathematically lossless. Accepted predictions produce identical output to standard autoregressive generation.

Warm KV Prefix-Sharing

System prompts and tool schemas are pin-locked into KV Cache slot 0, eliminating redundant compilation on every request. The result: compilation times consistently under <100ms.

When tzrod starts, it pre-compiles the system prompt, all registered tool schemas, and the GBNF grammar into a persistent KV Cache prefix. This prefix is shared across all subsequent inference calls without re-processing. Only the user-specific context (task prompt, file contents, intermediate outputs) needs fresh computation.

Architecture
┌─────────────────────────────────────────────────────────┐
  KV Cache Slot 0 (pin-locked, persistent)               
  ├── System Prompt          ~420 tokens                  
  ├── Tool Schemas (26 tools) ~1,800 tokens               
  └── GBNF Grammar           ~200 tokens                  
├─────────────────────────────────────────────────────────┤
  KV Cache Slot 1 (dynamic, per-request)                 
  ├── Task Prompt                                        
  ├── File Contents / Context                            
  └── Intermediate Outputs                               
└─────────────────────────────────────────────────────────┘

Zero-Latency Attention Preemption

The AttentionScheduler instantly pauses background processing tasks and dumps their state to disk ($slot_0.bin) the exact millisecond a user triggers a foreground prompt.

This ensures an interactive foreground Time-to-First-Token (TTFT) of ≤ 450ms — regardless of how many background DAG nodes are currently executing. Your interactive coding session is never degraded by background work.

🎯
How Preemption Works

When a foreground prompt arrives, the AttentionScheduler: (1) signals the active background inference to yield, (2) serializes its KV state to $slot_0.bin, (3) loads the foreground context into the attention buffer, and (4) generates the response. Once the foreground response is complete, the background task resumes from its serialized state with zero recomputation.

Metric Without Preemption With AttentionScheduler
Foreground TTFT 2–8s (waits for background) ≤ 450ms (instant preempt)
Background state loss Full recomputation Zero — state serialized
Context switch overhead N/A ~30ms (KV dump + load)

Debugging & Visibility

Cooperative execution trades wall-clock latency for extreme cost savings — pennies vs. multi-dollar cloud bills. We don't pretend this is free. What we do provide is total visibility into what the background engine is doing, so you always know it isn't hanging.

Fullscreen TUI Dashboard

Launch the interactive terminal dashboard to visualize parallel Kahn Topological Sort execution levels, node states, and real-time progress:

Shell
tzro tui

The Bubble Tea TUI shows:

  • DAG visualization — nodes rendered by topological level with dependency edges
  • Node status — pending, running, completed, failed, or skipped (with color coding)
  • Live output streaming — real-time stdout from actively executing nodes
  • Resource metrics — CPU, memory, and token generation throughput

Token Tracking & Benchmark Comparison

Every task execution carries a TokenTracker embedded in its Go context, separately accumulating local and cloud token usage (prompt, completion, duration, tokens/sec) across all inference calls within that task. This infrastructure powers the offline benchmark comparison suite.

Shell — Benchmark Comparison
# Run the comparison suite against a specific task category
tzro compare --category docgen --output ./results/

# Example per-task output:3500 cloud tokens, 8200 local tokens, $0.0525, 14200ms, 12 tool calls

# Summary output:
Cloud token savings (ReAct → Cooperative): 72%
Cost savings: $0.5250$0.1470 (saved $0.3780)

The comparison harness runs each benchmark task under multiple conditions and attributes savings into three independently measured buckets:

Savings Bucket What It Measures Formula
DAG structural Savings from parallelization and topological compilation cloud_react − cloud_dag_raw
Pipeline compaction Savings from the 5-layer compaction pipeline cloud_dag_raw − cloud_dag
Local offloading Savings from routing execution to the local model cloud_dag − cooperative
📊
Benchmark-Only Instrumentation

Cost attribution is computed post-hoc by the comparison report generator using cross-condition deltas — it is not embedded in per-task production output. Token tracking is always active, but dollar-cost estimation is only surfaced through the tzro compare CLI and the generated markdown reports.

Logs & Compliance Audit

For debugging execution issues or generating compliance documentation:

Shell
# Live engine logs — see every tool dispatch, node transition, and error
tail -f ~/.tzro/logs/engine.log

# Generate a compliance audit report (HTML) for security review
tzro audit --compliance-html

# Inspect a specific task execution trace
tzro task status <taskId> --offline

The compliance audit generates a standalone HTML document covering:

  • Data flow attestation — proof that no data left loopback during the session
  • Tool execution log — every tool invoked, arguments passed, and outputs returned
  • Grammar constraint verification — confirmation that all LLM outputs matched GBNF schemas
  • Container lifecycle audit — creation, execution, and teardown timestamps for all sandboxes
⚠️
Latency Expectations

Local execution prioritizes cost savings over wall-clock speed. A task that takes 3 seconds on a frontier API might take 12–18 seconds locally on a 3B model. The tradeoff: that 3-second cloud call costs $0.08–$0.25. The local run costs $0.00 and doesn't count against your rate limit.

v1.0.0 — Recent Engine Advances

The v1.0.0 release introduces major architectural improvements that significantly increase local execution quality, reduce token waste, eliminate hallucinations, and enable concurrent inference workloads.

Dual-Sidecar Inference Architecture

Previous versions ran a single llama-server process for all local inference. This forced a tradeoff: use a fast small model (great for routing, bad at code) or a quality model (great at code, too slow for 30-step Probe chains). The hot-swap mechanism blocked all inference during model switches (~1-1.5s downtime per swap).

v0.9.0 replaces this with two independent llama-server processes running concurrently:

🏎️

Router Model (Fast)

A small model (e.g., Gallium-350M or MiniCPM5-1B) with a 2048-token context window. Handles tool selection, parameter extraction, Probe navigation, classification, and GBNF-constrained validation. Outputs are short (~5-50 tokens), latency is critical.

🎯

Worker Model (Quality)

A larger code-capable model (e.g., Agents-A1 4B) with a 16,384-token context window. Handles code generation, DAG planning, complex reasoning, repair passes, Edge Thought generation, and long-form synthesis.

Architecture
┌──────────────────────────────────────────────────────────┐
                     tzrod daemon                         
                                                          
  GlobalRouterModel              GlobalWorkerModel       
  ┌──────────────────┐          ┌──────────────────┐     
  │ Model: Gallium-350M│         │ Model: Agents-A1
  │ Port:  (dynamic)   │          │ Port:  (dynamic)
  │ Ctx:   2,048 tok   │          │ Ctx:   16,384 tok
  │ Slots: 1           │          │ Slots: 1
  └──────────────────┘          └──────────────────┘     
fast, routingquality, gen    
└──────────────────────────────────────────────────────────┘

Inference routing is explicit at the call site. The inference package exposes CallRouter() and CallWorker() functions:

Call Site Target Reason
Probe Thought Chain steps Router Navigation decisions, short outputs
Validator Pass (tool extraction) Router Structured JSON extraction
Complexity classification Router Single-word classification
DAG planning Worker Complex structured reasoning
Code generation & repair Worker Quality code output
Edge Thought generation Worker Needs large context window (16k)
Terminal synthesis Worker Quality long-form summarization
JSON — config.json
{
  "ggufModelPath":    "Agents-A1-4B-Q4_K_M.gguf",
  "routerModelPath":  "Gallium-350M.Q8_0.gguf"
}
💡
Graceful Fallback

If routerModelPath is empty or the router fails to start, all CallRouter() calls transparently fall back to CallWorker(). The system works exactly like the previous single-sidecar mode — just slightly slower for routing tasks.

Structured Content-Aware Compaction

Previous compaction pipelines treated all content identically — dumping code, tool outputs, and reasoning text into a single LLM "compress these steps" prompt. This caused the model to hallucinate type names and lose function signatures during compression.

⚠️
Core Principle

Code is NEVER LLM-compressed. The LLM only compacts the model's own reasoning text. Tool outputs are ground truth and are never paraphrased.

The Structured Compactor (internal/compactor/) classifies content into typed segments and applies the appropriate compaction strategy for each:

Content Type Strategy How It Works
Code Deterministic Code Skeleton extraction — function signatures, type declarations, doc comments. Bodies replaced with fingerprints: // [body: 42 lines, calls: foo(), bar()]
Reasoning LLM-compressed Model's own Thought field split into ~500-char chunks by sentence boundary, each compressed by the router with "Extract key conclusion." Preserves decisions, strips deliberation.
Tool Output Deterministic Middle-out truncation. Never LLM-compressed — tool outputs are ground truth.
Tabular Deterministic Header + N sample rows + summary line. Structure preserved, volume reduced.
Example — Code Skeleton Output
// Before compaction: 1207 lines of raw Go source
// After Code Skeleton extraction:

package inference

type LocalModelManager struct { ... }

func (m *LocalModelManager) Start(ctx context.Context) error {
    // [body: 89 lines, calls: m.ensureBinary(), m.spawnProcess(), m.healthCheck()]
}

func (m *LocalModelManager) CallRouter(ctx context.Context, ...) (*InferenceResult, error) {
    // [body: 42 lines, calls: m.routerClient.Chat(), m.fallbackToWorker()]
}

func (m *LocalModelManager) CallWorker(ctx context.Context, ...) (*InferenceResult, error) {
    // [body: 38 lines, calls: m.workerClient.Chat()]
}

This replaces the legacy monolithic compaction prompt and serves all compaction call sites: probe thought chains, recall refined context, accumulated context, and synthesis truncation.

Multi-Branch MCTS Evaluation

Edge Thoughts are compact reasoning states generated when the executor traverses a DAG edge whose target node has a non-zero Activation Threshold. In v0.9.0, Edge Thought evaluation gains a second mode: multi-branch evaluation, inspired by Monte Carlo Tree Search.

1️⃣

Single-Shot (Default)

Generates one confidence score, makes a binary Continue/Spawn/Halt decision. Zero overhead for deterministic nodes (Activation Threshold = 0.0).

🌳

Multi-Branch (MCTS)

Generates K candidate actions in a single inference call. Each candidate is evaluated through speculative rollouts and scored by a Value Function. The highest-scoring candidate is committed.

The Speculation Fence gates speculative candidate evaluation by Tool Proactivity Level:

Proactivity Level During Speculation After Commit
L0-L2 (Observe/Prepare/Suggest) Execute for real Already executed
L3 (Reversible Action) Imagined — LLM simulates output Executed for real
L4 (External Side Effect) Blocked — candidate pruned Executed for real
🔒
Safety Guarantee

Only the committed winning candidate executes L3+ tools for real. Speculative evaluation never causes real-world side effects — it either runs low-risk tools, imagines high-risk outputs, or prunes dangerous candidates entirely.

Two-Tier Context Budget

Accumulated Context — the structured collection of completed upstream node outputs injected into each DAG node's prompt — previously had no budget controls. Large Probe outputs or verbose tool responses would consume the entire context window, drowning downstream nodes in noise.

v0.9.0 introduces tiered per-node output budgets with a dynamic ceiling:

Node Type Priority Budget Allocation
Recall Node Highest Full output preserved — recall is purpose-built for synthesis
Validator Node High Extracted parameters and tool results preserved
Action Node Medium Tool outputs with content-aware truncation
Probe Node Low Compacted thought chain — never raw history
Deterministic Node Lowest Minimal output — these produce structured data with little prose
💡
Synthesis Bypass

Synthesis nodes (terminal output generators) bypass the context ceiling entirely. They receive full-fidelity output from all upstream nodes to produce the most accurate final response.

Recall Nodes & Map-Reduce Synthesis

When a Probe Node completes a 15-30 step exploration, its accumulated thought chain can contain 20K+ tokens of interleaved tool outputs, reasoning, and code. Feeding this raw history directly into a synthesis node caused two failure modes:

  • The Synthesis Cliff — one-shot synthesis on massive input produced hallucinated types and lost function signatures
  • Prefill Latency — processing 20K+ tokens of raw history in a single inference call caused 15-30 second delays

Recall Nodes solve this. The Kahn Compiler automatically injects a Recall Node after every Probe Node, separating discovery from synthesis:

Pipeline
┌─────────────────────────────────────────────────────────┐
  Probe Node (explores)                                   
  └── 15-30 steps of read_file, list_dir, search_files   
  └── Output: 20K+ tokens of raw thought chain              
├─────────────────────────────────────────────────────────┤
  Recall Node (synthesizes) — auto-injected               
                                                          
  Step 1: MAP                                             
    Classify each chunk as "Signal" or "Sludge"            
                                                          
  Step 2: REDUCE                                          
    Extract key facts from Signal chunks only              
                                                          
  Step 3: SYNTHESIZE                                      
    Produce aligned, goal-directed output                  
├─────────────────────────────────────────────────────────┤
  Downstream Nodes — receive clean, ~2K token summary     
└─────────────────────────────────────────────────────────┘
🗺️

Map — Signal vs. Sludge

The execution history is chunked and each segment is classified. Tool errors, repeated navigations, and model deliberation are tagged as "Sludge" and excluded from synthesis. Only high-value discoveries pass through.

🎯

Reduce — Targeted Extraction

Signal chunks are processed with goal-directed extraction — pulling function signatures, architecture patterns, and concrete findings. The Structured Compactor handles code segments deterministically.

📊
Benchmark Impact

In docgen benchmarks, Map-Reduce Recall improved documentation quality from 3.75 → 4.75 (out of 5.0) while reducing local token consumption from 183K → 16K tokens — a 91% reduction.

AST-Based Symbol Extraction & Anchor Verification

Docgen benchmarks revealed that the local 4B model hallucinated 67% of type names in documentation outputs — the LLM judge scored these 4.25/5.0 while manual audit scored 2.65/5.0, a 38% quality inflation rate. The root cause: the model lacked sufficient context to identify real public symbols in the source files it had read.

The Symbol Extractor (internal/symbols/) solves this with deterministic, AST-verified symbol identification. Every file read during a Probe Node's Thought Chain is parsed using pure-Go tree-sitter (no CGO required), emitting structured tuples:

Go — Symbol Tuple
type Symbol struct {
    Name      string     // e.g. "CompactContent"
    Kind      SymbolKind // func | type | interface | method | class | ...
    Signature string     // e.g. "func CompactContent(content string, ...) string"
    File      string     // source file path
    Line      int        // declaration line number
    Exported  bool       // visibility flag
}

These tuples are persisted in a SQLite Symbol Index table per Probe execution. The Probe's context window carries only a count ("N symbols extracted"), not the full index — keeping token usage minimal during exploration.

After the Recall Node produces its synthesis, the Symbol Anchor Check diffs referenced identifiers against the index:

Check Action
Dot-qualified external refs (e.g., context.Context) Skipped — known external
Identifier found in Symbol Index Anchored ✓
Identifier NOT in Symbol Index Unanchored — flagged
>20% unanchored rate Correction pass triggered (~500 tokens)
🌐
12 Languages Supported

Ships with embedded grammars for Go, TypeScript, JavaScript, Python, Java, Rust, Dart, C++, C#, Kotlin, Swift, and Ruby. Additional grammars are lazy-loaded from ~/.tzro/grammars/ on first use.

Directory Preloading

Probe Nodes explore codebases through iterative Thought Chain steps — the local model decides which file to read next based on previous observations. But a 4B model frequently makes poor navigation decisions: it fixates on a single directory, misses key files, or wastes steps on irrelevant paths. The result: incomplete exploration and missing context in synthesis.

Directory Preloading (internal/executor/probe_preload.go) eliminates this "routing problem" by injecting source context before the Thought Chain begins. The preloader walks target directories and concatenates their readable files into the prompt:

📦

Go Files

AST-extracted exported symbols — types, functions, methods, and variables. Function bodies are stripped. Test files (*_test.go) are excluded.

📝

Markdown & Text

Raw content with file headers. Documentation, READMEs, and design docs are included verbatim to preserve semantic context.

📐
Context Budget

Pre-loaded content is capped at 32K characters (~8K tokens) — fitting comfortably in the router model's 16K context window alongside system prompts (~2K tokens) and per-step prompts (~1K tokens). Files are processed in sorted order for deterministic output.

Repo Mapping & Direct Synthesis

Not every task needs a 15-30 step Probe exploration. When a task's target files are known upfront (e.g., "document the internal/executor/ package"), the full Thought Chain is overhead: the model navigates to the directory, reads each file sequentially, then synthesizes — burning steps on pure routing rather than reasoning.

Repo Mapping (internal/repomap/) generates a deterministic, AST-based codebase architecture map: every Go source file's exported structs, interfaces, and functions extracted into a structured markdown document. Combined with Direct Synthesis, the Probe can satisfy the task with a single-shot inference against this pre-compiled context.

Pipeline — Direct Synthesis vs. Thought Chain
Standard Probe (Thought Chain):
  Step 1  → list_dir("/internal/executor/")         ~2s
  Step 2  → read_file("executor.go")                ~3s
  Step 3  → read_file("probe.go")                   ~3s
  ...     → 15-30 steps of exploration               ~45-90s total
  Recall  → Map-Reduce synthesis                    ~5s

Direct Synthesis:
  RepoMap → AST-extract all symbols deterministically  ~200ms
  Synth   → Single-shot inference against repo map     ~3s
  Total: ~3s (vs. 50-95s)
Plan Template Selection

The router classifies the task category and selects a structural starter template from a registry (ADR-0048). The planner then makes targeted mutations to this template rather than generating a complete graph from scratch — reducing structural failures from ~30% to near zero for complex task types.