Documentation
¶
Overview ¶
Package metrics is effectiveness accounting (SPEC-ADDITIONS §16): it optimizes useful outcomes per unit of scarce human attention, not raw activity. A regression is more attention per accepted arc, not fewer arcs.
Index ¶
Constants ¶
const LedgerFile = ".adh/metrics.json"
LedgerFile is the effectiveness ledger path (§16): a JSON array of Records a closed arc appends its cost to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Arc string `json:"arc"`
AttentionMinutes int `json:"attention_minutes"`
ComputeTokens int `json:"compute_tokens"`
Accepted bool `json:"accepted"`
}
Record is one closed arc's cost.
type StepClass ¶
StepClass counts an arc's history transitions resolved deterministically (evaluation, gate, commit, close) versus those that took a relayed model turn (a strategy/execution/critic reply) — the effectiveness north-star (§16): accretion (routing rules, checks, lessons) should drive the model share down over time. It is a coarse proxy classified from history text — a direction to watch, not a gate.
func ClassifyHistory ¶
ClassifyHistory classifies each history line as a deterministic step or a relayed model turn (§16). A line matching neither taxonomy is ignored, so the ratio counts only classified steps. It is pure.
type Summary ¶
type Summary struct {
Arcs int `json:"arcs"`
Accepted int `json:"accepted"`
AttentionMinutes int `json:"attention_minutes"`
ComputeTokens int `json:"compute_tokens"`
AttentionPerAccept float64 `json:"attention_per_accept"`
}
Summary aggregates records over a period. The json tags exist because Summary is now a payload: `metrics --jsonl` emits it directly, and without them a consumer would read Go field names where every other envelope in this family is snake_case. Free to add now — before this it was never serialised, so no consumer can be relying on the capitalised form.
func Summarize ¶
Summarize aggregates records. AttentionPerAccept — the headline effectiveness figure — divides attention by accepted arcs (never by zero).
func (Summary) AttentionDelta ¶
AttentionDelta returns this period's attention-per-accept minus the prior period's. A positive delta is a regression (more attention per outcome).