Documentation
¶
Overview ¶
Package slotlearn turns the local read ledgers into negative labels for context slot order and proposes bounded slot-weight traces that only the frozen held-out gate may admit (learned-trace-admission-v0, LTA-V0-009..012). It runs only from the explicit `corvint eval --learn-slot-weights` step; the live context path never imports it.
Index ¶
Constants ¶
const ( // MaxLabelPaths bounds the distinct negative-label paths kept. MaxLabelPaths = 256 // MaxProposals bounds the slot-weight traces the gate scores. MaxProposals = 4 ReasonNoLabels = "no negative labels" ReasonNoImprovement = "no held-out improvement" ReasonNotRequested = "improved; --admit not given" ReasonAdmitted = "admitted" )
Variables ¶
This section is empty.
Functions ¶
func Learn ¶
Learn reads the labels, scores the proposals on the frozen held-out gate and, only with admit and an improved proposal, writes the admitted trace.
func Propose ¶
func Propose(classes map[string]int) []contextindex.SlotWeights
Propose raises the most-missed serving slots by one and then two steps, most frequent class first, at most MaxProposals traces.
func Reset ¶
Reset removes the admitted trace so the context packet returns to the default slot order. An absent trace is not an error.
func ServingSlot ¶
ServingSlot is the closed table from a missed path to the slot that serves that kind of path: tests, prose (the packet's `documentation` relation, by the same suffixes), other docs/ files (lexical), or a code definition.
Types ¶
type Labels ¶
type Labels struct {
Paths []string
UnplannedPaths int
ObservedMisses int
PlannedReads int
SkippedRows int
Truncated bool
Classes map[string]int
}
Labels are the negative labels: repository paths an agent needed that the packet did not supply, each mapped to the slot that should have served it.
func ReadLabels ¶
ReadLabels reads both ledgers through their bounded readers. Unplanned reads and observed misses are labels; planned re-reads are disclosed as a count only, because the packet already carried those paths.