You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codecoradev/tole (MIT, adaptation of pi harness spec)
Document version
v1.1 (2026-08-27 replan: chat-first)
Status
v1.0 approved & executed through Phase 2; v1.1 replan approved
Owner
CodeCora
0. Identity (v1.1 replan)
tole = a durable conversational harness: a personal-assistant chatbot
that can call tools, whose sessions persist and resume. Light coding
ability comes from tools — it is not an autonomous coding agent.
Primary direction: chatbot / personal assistant (tole chat), with
durable sessions as the core differentiator (write-once log, crash-resume,
replayable audit).
Optional integrations (first-class builtins when present):
uteke (memory: recall + documents) and cora-code (code intelligence).
Coding-lite: file CRUD + git add/commit + gh issue/PR ops exist as
tools; the agent can do light coding work interactively.
Dynamic tools: a generic run_command builtin (approval-gated) lets
the model use any CLI on the host without recompilation; no TOML tool DSL
(rejected: poor UX).
Single provider protocol (OpenAI-compatible; TOLE_* > OPENAI_* env)
is sufficient for the foreseeable future.
1. Problem Statement
Current LLM agents (pi, Claude Code, etc.) are ephemeral: state lives in memory, a crash means loss of context, and there is no replayable audit trail. For development workflows that need durability, safety, and auditability (fixing GitHub issues, responding to code-review findings, documentation Q&A), existing harnesses fall short:
Not durable — a crash mid-turn repeats work from scratch; expensive tool calls are re-executed.
No approval gates — tools execute directly; there is no ReadOnly/Write/Destructive tiering.
Not embeddable — monolithic CLI harnesses; Corin (desktop) and mobile (Flutter) cannot reuse the same core.
Not integrated with the Cora ecosystem — cora search (code graph), uteke (memory), and gh CLI are not first-class.
Goals
Rust harness with a write-once conversation tree (append-only entries, immutable) persisted as one JSONL file per session (industry pattern: Claude Code, Codex, pi).
Register state machine — namespaced mutable cells (lane/op/pending/fact) as the operation program counter.
Namespaced mutable cells: lane, op, pending, fact; written atomically with entries in one commit.
P0
register
FR-R2
The register is the only mutable state; acts as the operation program counter.
P0
state
FR-S1
Operation state machine with explicit transitions (e.g. idle → running → awaiting-approval → running → done/failed); invalid transitions are rejected.
P0
state
FR-S2
After a crash, the state machine + register are restored by replaying the session file and the operation resumes from the checkpoint.
P0
storage
FR-D1
JSONL backend, one file per session (default); optional SQLite backend behind the same Storage trait (feature-gated).
P0
storage
FR-D2
Versioned schema (STORAGE_VERSION), migrate-on-open; version newer than the binary → clear error.
P0
tool
FR-T1
Tool trait with risk tiers: ReadOnly / Write / Destructive; metadata (name, description, argument schema) exposed to the provider.
P0
tool
FR-T2
Tool execution is sequential; results (including errors) are recorded as tool-result entries.
P0
approval
FR-A1
Approver trait: the core provides the policy engine and the config-driven AllowlistApprover; the host provides the InteractiveApprover (y/N prompt) impl via injection.
P0
approval
FR-A2
Tool calls with tier ≥ configured threshold must pass the approver before execution; decisions are recorded in the tree.
P0
provider
FR-P1
Provider trait abstracting the LLM (stream/chat completion); concrete implementations in the host or a separate crate.
P0
provider
FR-P2
Provider receives a tree snapshot (or window) + tool metadata; never writes the register directly.
P0
Note: provider currently has no stub file in core (lib.rs documents it) — create provider.rs in Phase 1a.
5. Risk Tiers & Approval Matrix
Tier
Definition
Example tools
Default approval
ReadOnly
Does not change world state
cora search, uteke recall, gh view
Auto-allow (allowlist)
Write
Changes state, reversible
patch file, gh pr create, uteke remember
Approver required (auto-allow for internal allowlist)
Destructive
Not reversible / broad impact
force push, drop database, delete branch, rm -rf
Approver required, always interactive; cannot be allowlisted