How camdenleibee/miniharness works
MiniHarness is an interactive scripted-conversation CLI: it reads user turns, obtains streamed assistant replies from a model client, maintains the conversation, and stops on a sentinel, turn limit, user exit, or client error. The CLI can save the resulting transcript. Scripted and replay clients are distinct model backends. The harness, conversation, and scanner implementations were not sampled, so their internal call wiring is shown only where the available interfaces and README support it.
Main entry points: harness.cpp Turn orchestrator · main.cpp CLI entry · scripted_client.cpp Scripted client · model_client.h Model interface
Components 15
CLI
- CLI entry
src/main.cpp
Conversation runtime
- Turn orchestrator
src/harness.cpp
Conversation core
- Sentinel scanner
src/sentinel_scanner.cpp - Conversation store
src/conversation.cpp - Role message
include/core/message.h
Model clients
- Model interface
include/model/model_client.h - Token sink
include/model/model_client.h - Scripted client
src/scripted_client.cpp - Replay client
src/replay_client.cpp - Response collector
src/model_client.cpp
Other components
- Terminal user
- Terminal input
- Terminal output
- Script file
scripts/greeting.script - Transcript file
Connections 20
- Terminal user → Terminal input: enters text
- CLI entry → Terminal input: reads through
- CLI entry → Scripted client: constructs
- Script file → Scripted client: loads script
- CLI entry → Turn orchestrator: starts
- Turn orchestrator → Terminal input: reads turns
- Turn orchestrator → Terminal output: writes replies
- Turn orchestrator → Model interface: requests replies
- Scripted client → Model interface: implements
- Replay client → Model interface: implements
- Model interface → Token sink: streams chunks
- Scripted client → Token sink: emits chunks
- Replay client → Token sink: emits chunks
- Response collector → Token sink: collects chunks
- Response collector → Role message: returns reply
- Turn orchestrator → Conversation store: maintains turns
- Turn orchestrator → Sentinel scanner: checks sentinel
- Conversation store → Role message: stores
- CLI entry → Conversation store: reads for saving
- CLI entry → Transcript file: writes transcript