/** * peaks-loop v3.0.0 — Slice C.1 * * Monotonic-improvement guard for the loop runtime. Compares adjacent * cycles' per-evaluator scores (rescaled gateAction → 0..1) and * returns a structured envelope indicating: * * - status: 'pass' | 'warn' | 'block' | 'skip' * - regressions: per-evaluator score deltas where current < previous * - reason: human-readable summary * * Karpathy §2 Simplicity First: pure function, no IO, no new deps. * * File budget: ≤ 800 lines (Karpathy §2). */ import type { CheckMonotonicOptions, MonotonicCycle, MonotonicReport, MonotonicScoreRow } from './monotonic-guard-types.js'; export type { CheckMonotonicOptions, MonotonicCycle, MonotonicRegression, MonotonicReport, MonotonicScoreRow } from './monotonic-guard-types.js'; /** Convert an envelope-shaped verdict row to `MonotonicScoreRow`. * Pure helper, exported for the CLI layer. */ export declare function toScoreRow(evaluator: string, gateAction: 'pass' | 'warn' | 'block', degraded: boolean, observedAtIso?: string): MonotonicScoreRow; /** Default threshold = 5% of [0,1] scale → 0.05. */ export declare const DEFAULT_MONOTONIC_THRESHOLD = 0.05; /** Compare `previous` against `current` and report monotonicity. * * - missing previous cycle → skip (`MONOTONIC_NO_PREVIOUS`) * - evaluators not present in both cycles → skip that evaluator * - score unchanged / up → ok * - score ↓ ≤ threshold → ok * - score ↓ > threshold → regression row + status 'block' * with `code = MONOTONICITY_VIOLATION`. */ export declare function checkMonotonicImprovement(previous: MonotonicCycle | null, current: MonotonicCycle, options?: CheckMonotonicOptions): MonotonicReport; /** Read `.peaks/_sub_agents//shared/` cross-session signal — on * any IO error, return `null` so the guard never crashes on missing * cross-batch signal (per Slice C (b) case "跨 session 读 * .peaks/_sub_agents//shared/ 跨批 signal → 不 crash"). * Pure helper; only present for the cross-session case. */ export declare function loadCrossSessionSignal(projectRoot: string, sid: string): MonotonicCycle | null;