/** * Crystallization evidence-brief schema — hoisted VERBATIM out of * `crystallization-types.ts` so that file clears the 300 raw-line cap. * Nothing here was rewritten: same constraints, same `.superRefine` * guard, same issue message, same MISSING_BRIEF_SECTION mapping. * * `crystallization-types.ts` re-exports every public name from this * path, so `EvidenceBriefSchema` / `EvidenceBrief` / * `hasAllFourBriefSections` / `parseEvidenceBrief` / * `safeParseEvidenceBrief` stay importable from their original module * and from `crystallization/index.js`. */ import { z } from 'zod'; /** Brief-section cap; the event-level free-text columns in * `crystallization-types.ts` reuse the same bound. */ export declare const CRYS_BRIEF_SECTION_MAX = 4000; /** * EvidenceBrief — the 4-section brief (spec §4.7). * * Hard shape invariant: ALL FOUR KEYS must be present at parse * time, with non-empty NL content. The `.refine(...)` guard is * what makes a brief a "brief" — without it, the projection is * not a brief and the recommendation MUST NOT be rendered * (service layer enforces this; Zod makes it a parse-time * guarantee). * * Field semantics: * - what_happened — 1-2 sentence factual account of the run. * - why_it_matters — 1-2 sentence explanation of why this is * worth promoting. * - what_learned — 1-2 sentence learning: failure modes * encoded, preferences extracted. * - what_action — 1-sentence recommended action with * rationale. */ export declare const EvidenceBriefSchema: z.ZodObject<{ what_happened: z.ZodString; why_it_matters: z.ZodString; what_learned: z.ZodString; what_action: z.ZodString; }, z.core.$strict>; export type EvidenceBrief = z.infer; /** * Helper for downstream code that needs to know whether a parsed * brief satisfies the 4-section rule. Useful for the CLI when a * payload arrived from the LLM and the brief-section guard has * already passed — it returns the section count, always 4 here. */ export declare function hasAllFourBriefSections(brief: EvidenceBrief): boolean; /** * Convenience: strict-parse an unknown payload as a standalone * EvidenceBrief. Throws ZodError on failure. */ export declare function parseEvidenceBrief(input: unknown): EvidenceBrief; /** * Safe-parse twin of parseEvidenceBrief. Same Result-like envelope * shape; same MISSING_BRIEF_SECTION code mapping (covers both * refine-guard failures and per-section missing/empty failures). */ export declare function safeParseEvidenceBrief(input: unknown): { ok: true; row: EvidenceBrief; } | { ok: false; code?: 'MISSING_BRIEF_SECTION'; findings: Array<{ path: string; message: string; }>; }; /** * Decide whether a ZodIssue[] is a "brief section" failure: every * issue points at one of the four required keys (the section is * missing, or empty after trim), OR the explicit refine-guard issue * is present. Used by both `safeParseCrystallizationEvent` and * `safeParseEvidenceBrief` so callers see a single * `MISSING_BRIEF_SECTION` code regardless of which Zod boundary * caught the failure. */ export declare function isBriefSectionFailure(issues: ReadonlyArray): boolean;