Documentation
¶
Overview ¶
Package facts derives what the policy needs from one Responses request: the prompt and recent dialogue for the classifier, a repeated tool-failure signature, the activity the tools show, whether a verification passed, and a context size estimate. Pure: request in, Facts out; no text is kept beyond the clipped dialogue. Ported from claude-model-router lib/facts.mjs.
Index ¶
Constants ¶
const FailureWindow = 40
FailureWindow is how many trailing items a repeated failure is looked for in.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Facts ¶
type Facts struct {
Prompt string
Dialogue []Turn
Continuation bool
Failure *Failure
Observed Observed
Verified bool
ApproxTokens int
Items int
}
Facts is the policy input derived from a request.
type Options ¶
Options bound the dialogue sent to the classifier and set where the observed activity and the verification check start. RecentTurns ≤ 0 sends no dialogue; MaxTextChars ≤ 0 clips every text to empty. ObservedFrom is the first input index whose tool calls count for Observed (never before the turn's prompt); VerifiedFrom is the first index a verification is looked for from, such as Items at the last model change.