/** * The review history (DES-RUNS-REVIEW-001 ยง6): every review, its numbers, its recommendations and what happened * to each. One JSON file in the state home, `daemon-insights.json` (the `daemon-` prefix the state-home fence * already classifies), written atomically. A malformed file starts empty and never fails the boot. */ import type { Candidate, Confidence, Finding, MetricId, RecommendationKind, SampleStat, Window } from './analyze.js'; import type { Verdict } from './stats.js'; export declare const INSIGHTS_FILENAME = "daemon-insights.json"; /** Reviews kept (about four months at the default cadence). */ export declare const MAX_REVIEWS = 60; export type ReviewStatus = 'running' | 'completed' | 'failed' | 'cancelled'; export type RecommendationState = 'new' | 'accepted' | 'dismissed'; export interface Recommendation { /** `:`: unique across the history. */ id: string; candidate: string; kind: RecommendationKind; title: string; evidence: Candidate['evidence']; expectedEffect: string; confidence: Confidence; changeMind: string; impact: number; basis: Candidate['basis']; action: Candidate['action']; state: RecommendationState; reason: string | null; decidedAt: string | null; /** The approve-queue proposal filed for a steering-rule or memory recommendation. */ proposalId: string | null; proposalError: string | null; } export interface SeriesPoint { metric: MetricId; window: SampleStat; baseline: SampleStat; verdict: Verdict; } export interface Review { runId: string; trigger: 'schedule' | 'manual'; scheduleId: string | null; launchedAt: string; endedAt: string | null; status: ReviewStatus; window: Window; baselineWindows: Window[]; projectIds: string[]; /** The seat's plain-language summary; `null` when the run wrote no usable report. */ summary: string | null; /** Whether the seat's report was read (false = crew's own wording is shown, labelled "not interpreted"). */ interpreted: boolean; totals: Record | null; /** The `all` segment's metrics: the trend lines. */ series: SeriesPoint[]; improvements: Pick[]; regressions: Pick[]; recommendations: Recommendation[]; watching: { id: string; title: string; line: string; }[]; error: string | null; } export declare function defaultInsightsPath(env?: NodeJS.ProcessEnv): string; export declare class InsightsStore { private readonly path; private reviews; constructor(path?: string); /** Newest first. */ list(): Review[]; get(runId: string): Review | undefined; /** The latest review that finished with numbers, of one scope (its sorted project ids joined; `''` = all runs): * that scope's next window starts where this one's ended. No scope given = any review. */ lastCompleted(scope?: string): Review | undefined; running(): Review[]; add(review: Review): void; update(runId: string, patch: Partial>): Review | undefined; findRecommendation(id: string): { review: Review; rec: Recommendation; } | undefined; updateRecommendation(id: string, patch: Partial>): Recommendation | undefined; /** Recommendations nobody has decided yet, across the history. */ newCount(): number; private persist; } //# sourceMappingURL=store.d.ts.map