supervisor-go: add ledger package with Append/Read APIs, tests; refactor CLI to use package; update README

This commit is contained in:
shadowmo
2026-02-23 21:28:28 -06:00
parent bca500623b
commit 6f2a1aa4b1
4 changed files with 235 additions and 122 deletions

View File

@@ -3,14 +3,30 @@
Runnable stub demonstrating CognitiveOS control-plane concepts without
an actual LLM.
## Run
This directory now contains a small ledger package (ledger/) with Append
and Read APIs and unit tests, plus a tiny CLI demo (main.go) that
appends route/session/output events to a JSONL ledger.
go run . -ledger ./ledger.jsonl
## Run (demo)
Then type requests and observe: - deterministic route decision -
session_spawn + child_output_received - final_output_emitted
Build or run the CLI:
go run . -ledger ./ledger.jsonl
Then type requests and observe the deterministic route decision,
spawn/output events, and final output. The ledger file will be created
as JSONL at the path you provide.
## Tests
Run the unit tests for the ledger package:
go test ./ledger
The tests create a temporary ledger file, append events, and validate
read-back and hash chaining.
## Notes
- This is intentionally minimal and deterministic.
- Replace `childWorkerStub` with real model calls later.
- This is intentionally minimal and deterministic.
- Replace `childWorkerStub` with real model calls later.