Commandr
~/repos/Commandr — the L3 bus in the 5-layer agent toolchain. A filesystem contract plus the shell tools that operate it. Not a monolith app — identity is waist and services.
GitHub: https://github.com/vietbui1999ru/Commandr
Role in the 5-Layer Model
.agents/ filesystem contract. Harnesses stay swappable because the contract is plain files, not any tool’s API.
Current Status (2026-06-17)
Bus Directory Layout
~/.agents/index.json (written by bin/index).
bin/ Tools (on PATH)
Protocol SPEC (v0.3)
Contract file:protocol/SPEC.md. Wins over PRD.md, ARCHITECTURE.md, and CLAUDE.md for cross-harness behavior.
Conformance:
protocol/conformance.sh — 28 cases, C01–C28, 0 failures. Definition of done for every adapter.
Adapters
Two adapters, both validated against the same conformance suite: Claude Code (adapters/claude-code/):
stop-hook.sh— per-turn bus checkpoint onStopeventsession-end-hook.sh— emitssession_endonSessionEnd
adapters/opencode/):
checkpoint.js— listenssession.statusidle + deprecatedsession.idle; in-flight guard prevents double-fire- OpenCode
session_endmapping deferred — OpenCode sessions are persistent/resumable;session.deletedfires on explicit deletion, not conclusion
adapters/lib/ (checkpoint + session-end cores).
Mission Packet Format
Claim Atomicity
Single-machine:mv inbox/T → claimed/{hostname}_{pid}_T — one rename(2), no lock files, first wins.
Multi-machine (Phase 5): git push origin HEAD:refs/tasks/<id> — git ref creation is atomic by protocol.
Critical: separator is _ not -. SPEC §11.4 — dash parsing is ambiguous. Any _ in hostname is replaced with - before composing the claimed filename.
Council Quality Gate
3 Haiku evaluators launched in parallel, each scoring a different dimension (acceptance criteria, code quality, style). Majority vote (≥2/3). Result: onecouncil/<task-id>.json per task:
council_verdict in events.jsonl.
bin/council also supports --diff <range>|- — bus-less mode that outputs verdict JSON to stdout for use outside the bus (C25–C27).
Annotation Loop (SPEC v0.3)
Human notes injected as next-prompt context. The DiffViewer mobile PWA or any tool writesbin/annotate-write <task-id> <turn> "<body>" → creates annotations/<task>/<turn>-<seq>.json. Adapters pick up unconsumed annotations and inject them into the next agent turn via the context_injection mechanism.
This is the harness-independent human-in-the-loop channel — separate from the diff approval gate.
Key Design Invariants (do not re-grill)
Per the 11 locked decisions indocs/UNIFICATION-BLUEPRINT.md:
- No single vendor loop — decouple, keep harness swappable
- Thin waist —
.agents/bus is the one contract - Per-repo
.agents/is source of truth;~/.agents/index.jsonis derived - Bus scope = queue + neutral progress only; loop-internal state stays harness-local
- DiffViewer reads the BUS, not CC hooks (Phase 2)
- One council engine:
bin/council; wrappers (review-council,delegate-pi) delegate to it - Context: qmd (knowledge) + CGC on KuzuDB (code graph)
- Pi = L2 execution substrate, NOT L1 orchestrator
- Human gate = async review + harness-independent git pre-commit gate
- Dual-primary adapters (CC + OpenCode), both conformance-validated
- Commandr = the bus (not a monolith app)
- Agent-Native is action/state inspiration for the UI, not a replacement for
.agents/. - Builderio Skills are workflow packages consumed by runners, not lifecycle state.
- Builder.io Patterns for Commandr + DiffViewer defines the concrete action/artifact mapping: live SPEC actions go through
bin/tools; visual plans/recaps stay DiffViewer-local until a conformance-backed artifact event exists. - omp (oh-my-pi) is an L2 worker, not the owner of claims, approvals, events, or final task status.
omp Tool Bridge Candidate
When omp becomes a bus-aware worker, expose Commandr as model-callable custom tools with Zod schemas:
This is preferable to parsing prose from
omp -p long-term, but it should follow a simpler commandr-omp-runner wrapper so the bus contract hardens before custom tool work.
Related Pages
- Desktop AI Agent Control Plane — Architecture Synthesis — big-picture synthesis; Tauri path; where omp fits
- Builder.io Patterns for Commandr + DiffViewer — concrete Builder.io action/artifact integration plan
- DiffViewer — L5 UI that reads the bus
- Pi Agent (pi-mono) — L2 execution substrate; council subprocess
- omp (oh-my-pi) — potential L2 alternative; batteries-included Pi fork
- Agent Harness — harness engineering context
- Control Plane Expansion Plan — Gap Analysis and Phase 0.5 Roadmap — earlier gap analysis (pre-Unification Blueprint; partially superseded)