@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
31 lines (30 loc) • 1.42 kB
TypeScript
import { z } from "zod";
import type { RecallEvalRow } from "./score.js";
export declare const RECALL_JUDGMENT_RUBRIC: string;
declare const judgmentSchema: z.ZodObject<{
key: z.ZodString;
judgment: z.ZodEnum<{
irrelevant: "irrelevant";
partial: "partial";
relevant: "relevant";
}>;
reason: z.ZodString;
}, z.core.$strip>;
export type RecallJudgment = z.infer<typeof judgmentSchema>;
export type RecallJudgments = Map<string, RecallJudgment>;
export interface RecallJudgmentPair {
key: string;
case: string;
project: string | null;
prompt: string;
snippet: string;
}
/** Stable across runs and reordering: comments (fid, created, citations) and dates change while the memory does not. */
export declare function judgmentKey(prompt: string, snippet: string): string;
/** A missing file has no judgments; a `{"rubric": ...}` header row is skipped; a later row for a key replaces an earlier one. */
export declare function loadJudgments(file: string): RecallJudgments;
/** Every (case, injected snippet) pair a run produced, in case order. */
export declare function judgmentPairs(rows: RecallEvalRow[]): RecallJudgmentPair[];
/** Writes the rubric, then each pair without a judgment once, for a judge to answer. Returns how many pairs. */
export declare function writeUnjudged(file: string, rows: RecallEvalRow[], judgments: RecallJudgments): number;
export {};