Skip to content

Harness Deep Dive ​

Kompile's harness is the execution layer that sits between your coding agents (or direct LLM sessions) and your repositories, terminals, and quotas. It is deliberately opinionated: instead of trusting prompts to enforce discipline, it combines deterministic pre-tool enforcement, bounded coding tools, fail-closed verification, controlled subagent delegation, and evidence-backed auditing.

If you want the philosophy first, start with Why Kompile Is Opinionated. Otherwise, use the map below to jump straight to the subsystem you need.

How the harness fits together ​

┌─────────────────────────────────────────────────────────────────────────┐
│ Surfaces & Clients                                                      │
│   CLI TUI (kompile chat) · Web Harness (--web) · ACP v1 (Editors)       │
│   Passthrough CLIs (Claude, Codex, agy, OpenCode) · Mobile C ABI        │
└───────────────────────────────────┬─────────────────────────────────────┘
                                    │
┌───────────────────────────────────▼─────────────────────────────────────┐
│ Guardrails & Supervision                                                │
│   The Enforcer (deterministic pre-tool) · The Judge (post-turn/drift)   │
│   Reminders · Security & Permissions · Auditing & Provenance            │
└───────────────────────────────────┬─────────────────────────────────────┘
                                    │
┌───────────────────────────────────▼─────────────────────────────────────┐
│ Execution, Coordination & Intelligence                                  │
│   Subagents · Edit Coordinator & Message Bus · Monitors                 │
│   Persistent Memory · Graphs & Grounded Reasoning · Skills · Cost/Quota │
└─────────────────────────────────────────────────────────────────────────┘

1. Surfaces & Clients ​

Where you interact with Kompile and how external CLIs or editors connect to it:

PageWhat it covers
Why Kompile Is OpinionatedCore design principles: mechanical guardrails over prompt-only advice, containment, and honest cost accounting
CLI Harness (TUI & Config)Terminal UI layout, status bar, keybindings, /ui presets, and kompile configure wizards
How the Chat REPL WorksTurn loop internals, streaming, compaction, command routing, and session lifecycle
Web HarnessMulti-project browser workspace (kompile chat --web), SSE controls, embedded PTY terminal, processes, and insights
ACP v1 (Server & Client)Running Kompile as an Agent Client Protocol stdio server for Zed, JetBrains, Neovim, and Emacs
Installable Client HarnessesInstalling and managing supported external agent CLIs directly from /install
Embeddable Mobile Harness (C ABI)Embedding Kompile's harness inside mobile and native host apps over its C ABI

2. Guardrails & Supervision ​

How Kompile prevents destructive mistakes, catches drift, and preserves verifiable audit trails:

PageWhat it covers
The EnforcerDeterministic pre-tool rules: dedicated tool routing, read-before-edit, Build/Script/Lane/Draft enforcers, and /enforcer wizard
The JudgeLLM-backed compliance checks, cross-turn DirectionJudge drift detection, /judge wizard, and diff-archive rollback
RemindersPersistent project and user behavioral reminders injected cleanly into turns
Security & PermissionsPermission modes, workspace boundaries, secret redaction, and tool-gateway evaluation
Auditing & Provenance/policy-enforce transcript audits, JudgementLog, tool_call_catalog, diff_index, and build_provenance

3. Delegation, Monitors & Sync ​

How Kompile runs background work, coordinates concurrent agents, and carries work across tools and machines:

PageWhat it covers
Subagentstask, multi_task, quorum_task, vendor containment, /subagent-config caps, and mandatory progress reports
Edit Coordinator & Message BusFile-level edit locks (edit_coordinator) and agent-to-agent coordination
Monitors & Reactive Wake-UpsBackground process monitors, timers, and event-driven wake-ups without polling loops
Peers & SourcesEncrypted TLS peer federation (kompile peer), kompile sync, and unified artifact/storage sources
Import, Resume & Vendor SwitchingImporting transcripts from 11 external CLIs/IDEs, per-vendor resume (claude, codex, agy, opencode, qwen, gemini, pi, kompile), changing vendor mid-conversation (/auth, /provider, /model, /model failover), and kompile resume-all

4. Memory, Context, Storage & Cost ​

How Kompile retains durable knowledge, compacts long sessions, manages disk usage, grounds claims, reuses procedures, and tracks spend:

PageWhat it covers
Persistent MemoryProject and global memory files, typed memories, semantic recall, and MEMORY.md hygiene
Context Compaction (/compact & /auto-compact)Model-aware auto-compaction, manual /compact, reviewed scope retirement, and post-compaction memory/skill reload
Disk Space, Storage & Garbage Collection (/gc)Safe dry-run disk reports, lossless archive compression, cleanable vs. protected stores, gc-config.json, and Web /storage
Graphs & Grounded ReasoningPortable .kgraph knowledge graphs, OWL-RL/Datalog/PSL/MEBN reasoning, and verifiable derivation trails
Agent Skill (SKILL.md)Public skill specification (https://getkompile.github.io/kompile/SKILL.md) that teaches any agent how to operate Kompile
Skills & Skill ManagerCreating, discovering, and invoking reusable task skills with skill_manager
Cost & Quota EstimationPER_TOKEN / PLAN / UNKNOWN billing buckets, ModelPriceCatalog, cache-write TTLs, and /usage + /cost telemetry

Where to go next ​

Released under the Apache-2.0 License.