/** * astroengine interpretation brief -- a chart as compact, citable LLM input, * and an audit that the model cited real facts. * * This is the "novel and accurate" seam. An LLM writes fluent, original prose * (novel); to keep it honest (accurate) it is given only the validated fact * atoms, each tagged with a stable id, and asked to cite the id(s) every * statement rests on. {@link auditCitations} then checks those citations * resolve -- a claim that cites an id not in the brief invented its provenance * and is flagged. The chart math was never the model's to hallucinate. * * Pairs with the MCP app, where the host model is already the interpreter: * feed it {@link Brief.prompt} instead of raw positions it would guess at. */ import type { FactKind, InterpretationContext } from "./interpretation.js"; import type { Reading } from "./interpret.js"; import type { Zodiac } from "./chart.js"; import type { Realm, Certainty } from "./provenance.js"; /** Default instruction header prepended to {@link Brief.prompt}. */ export declare const BRIEF_INSTRUCTIONS: string; /** A one-line framing for the realm and certainty, or `""` when neither needs it. */ export declare function realmFraming(realm?: Realm, certainty?: Certainty): string; export interface BriefOptions { /** Keep only the top-N facts by salience. Default: all. */ limit?: number; /** Restrict to certain atom kinds. */ kinds?: FactKind[]; /** Drop facts below this salience. */ minSalience?: number; /** Fold a resolved {@link Reading}'s entries in as suggested readings. */ reading?: Reading; /** Prepend {@link BRIEF_INSTRUCTIONS}. Default `true`. */ header?: boolean; } /** A salience-ranked fact in a {@link Brief}. */ export interface BriefFact { id: string; kind: FactKind; text: string; salience: number; } /** A chart rendered as citable LLM input. */ export interface Brief { jdUt: number; zodiac: Zodiac; /** The facts offered, ranked by salience. */ facts: BriefFact[]; /** A prompt-ready, id-tagged rendering of {@link Brief.facts}. */ prompt: string; } /** * Render an {@link InterpretationContext} as a compact, id-tagged {@link Brief} * for an LLM to interpret and cite. * * @param ctx A projection from {@link interpretationContext}. * @param opts Capping, kind filter, an optional {@link Reading} to fold in, and * whether to prepend {@link BRIEF_INSTRUCTIONS}. * @returns The {@link Brief}: a ranked `facts` list and a ready `prompt`. */ export declare function chartBrief(ctx: InterpretationContext, opts?: BriefOptions): Brief; /** A model-produced statement and the fact ids it claims to rest on. */ export interface Claim { text: string; cites: string[]; } /** The result of {@link auditCitations}. */ export interface CitationAudit { /** True when every cited id resolves to a fact in the context. */ ok: boolean; /** Total claims examined. */ claims: number; /** Claims that cited at least one fact. */ cited: number; /** Claims with no citation. */ uncited: number; /** Distinct cited ids that resolve to a real atom. */ valid: string[]; /** Distinct cited ids with no matching atom -- invented provenance. */ unknown: string[]; } /** * Check that a model's claims cite only facts that exist in the context -- the * accuracy half of "novel and accurate". A claim citing an id not in `ctx` * fabricated its provenance, so `ok` is false and the id lands in `unknown`. * * @param claims The model's statements with their cited ids. * @param ctx The {@link InterpretationContext} the brief was built from. * @returns A {@link CitationAudit}. */ export declare function auditCitations(claims: Claim[], ctx: InterpretationContext): CitationAudit;