cli-autocalibrate
Autocalibrate: Tuning the Two-Stage Status Assessment Engine
Hive detects agent status in two stages: internal/domain/terminal/assess (Stage 1, stateless: pane content -> assess.State) feeds internal/domain/terminal/status (Stage 2, stateful: debounces assess.State into a published terminal.Status). This skill is the closed loop for tuning both against a corpus of committed, deterministic recordings — never against live judgment calls that can't be replayed.
Corpus Layout
internal/domain/terminal/assess/testdata/<tool>/<scenario>.txt— single-frame fixtures for Stage 1 rule classification. Table ininternal/domain/terminal/assess/fixtures_test.go.test/calibration/sequences/<name>.jsonl+<name>.expected.json— multi-frame recordings (the{ts, content, title, inMode}shapehive x assess watch --recordproduces) plus a sidecar of the published-status sequencehive x assess replaymust reproduce exactly. Covers Stage 2 debounce timing (idle-confirmation delay, churn-as-working, approval immediacy, ...) that a single-frame fixture can't.test/calibration/scenarios/<name>.yaml— step/expectation scripts for live, in-container runs against a real pane (hive x assess scenario). Not wired intomise run cli:integration; run by hand.
The Tuning Loop
-
Find mismatches. Run the automated guardrail:
go test ./cmd/hive/internal/commands/... -run TestCalibrationCorpus_ReplayMatchesExpected -vThis replays every
test/calibration/sequences/*.jsonlthrough a freshassess.Engine+status.Trackeron a virtual clock (never wall time, never an ambient config file —status.DefaultOptions()only) and diffs the published-status sequence against its.expected.jsonsidecar. A failing subtest names the sequence and the exact frame index where the sequences diverge.