agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
54 lines • 2.97 kB
TypeScript
/**
* The arm verdict — the same three tiers, phrased for a substitution.
*
* ## Why not widen `verdictFor`
*
* `verdictFor` already carries an `action` word (`'ablating'` | `'restoring'`)
* and a third would have been one line. It ends its NOT-CONFIRMED sentence with
* "its ranking remains a correlational proxy only" — true of a suspect, which
* was RANKED before it was probed, and meaningless for an arm, which was never
* ranked at all. Widening the union would have forced that sentence onto the
* new tier or edited a string three existing tests pin byte-for-byte. So the
* tier LOGIC is shared (`probeFlipped`, the majority rule, the zero-tolerance
* baseline gate) and only the prose is new.
*
* ## The tiers, in refusal order
*
* 1. **Unstable baseline** → inconclusive. The incumbent could not reproduce
* the reference answer across its own seeds, so a difference measured
* against it is measuring the scenario, not the arm. Zero tolerance, exactly
* as `bisect.ts` and `localize.ts` apply it: ONE un-intervened flip is
* enough, because the majority rule would let a 1-in-3 flaky scenario reach
* a causal verdict.
* 2. **Arm did not take effect** → inconclusive. The run manifest contradicted
* what the arm declared. Any difference here is evidence about a
* configuration nobody meant to test.
* 3. **Inside the null band** → inconclusive. A majority flip whose mean
* similarity still sits within the baseline arm's own seed-to-seed spread is
* not separable from noise. Only applied when the flip comparator and the
* band are the same instrument (see `NullBand.gates`).
* 4. **Majority flip, outside the band, stable baseline** → confirmed. This is
* a causal claim of the same tier an ablation verdict makes: a
* counterfactual intervention, seeded reruns, variance reported, and a
* baseline that held.
* 5. **Minority flips** → inconclusive. 6. **No flips** → not-confirmed.
*
* Every claim is bounded by the scenario and the comparator, and says so — an
* arm confirmed on one question has been confirmed on one question.
*/
import type { AblationRunStats, AblationVerdict } from '../types.js';
import type { ArmApplication, NullBand } from './types.js';
/** Everything the verdict needs beyond the arm's own numbers. */
export interface ArmVerdictContext {
readonly baselineArmId: string;
/** The baseline arm reproduced the reference on EVERY seed. */
readonly baselineStable: boolean;
readonly baselineStats: AblationRunStats;
readonly band: NullBand;
/** Mean similarity fell below the band's floor. */
readonly outsideNullBand: boolean;
readonly application: ArmApplication;
}
/** Translate one arm's probe evidence into its verdict. See module docs. */
export declare function verdictForArm(armId: string, stats: AblationRunStats, context: ArmVerdictContext): AblationVerdict;
//# sourceMappingURL=verdict.d.ts.map