Documentation
¶
Overview ¶
Package outcomecal joins recorded local task outcomes with the packet stance (answered or abstained) that preceded them and reports calibration only. It never writes, and it never changes a threshold: a proposed threshold is reported with applied=false and must pass the learned-trace admission evaluation gate before any mechanism change (AGENTS.md invariant 5).
Index ¶
Constants ¶
const ( ProposalProposed = "proposed" ProposalInsufficient = "insufficient-sample" ProposalNoScoredRecords = "no-scored-records" )
Proposal states.
const MinimumSample = 20
MinimumSample is the smallest joined sample that may carry a proposal. Below it the report abstains instead of inventing a calibrated threshold (AGENTS.md invariant 2).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix struct {
AnsweredSuccess int
AnsweredFailure int
AbstainedSuccess int
AbstainedFailure int
UnknownSuccess int
UnknownFailure int
}
Matrix is the answered/abstained by success/failure contingency table. Failure covers every non-passed recorded outcome (failed and blocked today).
func (Matrix) Classified ¶
Classified is the number of rows whose stance is known.
type Observation ¶
Observation is one joined row: the packet stance for a task, whether the task outcome succeeded, and the relevance-floor score when the record carries one.
func Observe ¶
func Observe(record trace.Record) Observation
Observe projects one recorded trace onto the calibration join.
Stance and Score are absent from the schema-version-1 record: `corvint record` stores the task outcome, not the packet decision that preceded it or the score that decision used. Every record therefore classifies as Unknown with no score until the producer records those fields; the report counts those rows explicitly rather than guessing a stance.
type Proposal ¶
Proposal is the threshold that would have maximised abstention accuracy on this sample. It is never applied. The threshold is reported in tenths because the candidate grid is the eleven decile edges of [0, 1] and the canonical wire encoding carries integers only.
type Report ¶
type Report struct {
TraceState string
Since string
Window int
SampleSize int
Matrix Matrix
UnknownReason string
Accuracy float64
HasAccuracy bool
ScoreCoverage int
ScoreReason string
Buckets []Bucket
Insufficient bool
ProposalState string
Proposal Proposal
}
Report is the whole read-only calibration result.
func Build ¶
func Build(observations []Observation, traceState string) Report
Build joins the observations into the calibration report. It reads only the supplied rows and writes nothing.