/** * Product-neutral contract for an AI conclusion that must be reviewed by a person. * * This is deliberately a vocabulary contract, not a domain model. Plant owns * execution facts, Twin owns engineering calculations, Figure owns rendering * checks, and Board owns edit patches. They can nevertheless expose the same * answer to a caller: what was observed, what was assumed, how certain it is, * what is missing, and whether a person must approve a proposed next step. */ export type AIConfidenceLevel = 'high' | 'medium' | 'low'; export interface AIAnalysisConfidence { level: AIConfidenceLevel; /** Stable, machine-readable reasons. Do not put model prose here. */ reasons: string[]; } export interface AIAnalysisLimitation { code: string; params?: Record; } export interface AIAnalysisClaim { code: string; severity?: 'info' | 'warning' | 'critical'; params?: Record; evidence: Record; method: string; assumptions: string[]; } export interface AIApprovalRequirement { /** AI output is advisory. A product authority must accept any state change. */ required: true; mode: 'review' | 'confirm'; reason: string; } /** * The portable part of a product AI response. * * `facts` and the specialized claim type intentionally remain generic. Moving * them here would make product-specific evidence look interchangeable and would * erase important operational, engineering, rendering, and board constraints. */ export interface GroundedAnalysisContract { kind: string; scope: unknown; window: unknown; confidence: AIAnalysisConfidence; limitations: AIAnalysisLimitation[]; claims: TClaim[]; facts: TFacts; /** A domain-owned candidate. It is never an instruction to mutate canonical state. */ proposal?: TProposal; /** Convenient transport flag for docks and GraphQL clients. */ approvalRequired: true; approval: AIApprovalRequirement; trace?: { source?: string; generatedAt?: string; version?: string; }; } /** A small runtime boundary for GraphQL/JSON consumers receiving untyped data. */ export declare function isGroundedAnalysisContract(value: unknown): value is GroundedAnalysisContract;