/** * ScribeOutputV1 — Output schema for the Scribe peer runner. * * The Scribe reads a Philosopher artifact and produces a formal principle * draft with statement, rationale, applicability, and anti-patterns. * This is the third stage in the internalization pipeline * (Dreamer → Philosopher → Scribe → Artificer). * * @see docs/adr/0003-peer-agent-state-machine-orchestration.md */ import { type Static } from '@sinclair/typebox'; import type { IntentContractV1 } from './intent-contract.js'; export interface ScribePrincipleDraft { readonly title: string; readonly statement: string; readonly rationale: string; readonly applicability: readonly string[]; readonly antiPatterns: readonly string[]; readonly confidence: number; } export interface ScribeSourceTrace { readonly dreamerArtifactId?: string; readonly philosopherArtifactId: string; } export interface ScribeOutputV1 { readonly taskId: string; readonly sourcePhilosopherArtifactId: string; readonly principleDraft: ScribePrincipleDraft; readonly sourceTrace: ScribeSourceTrace; readonly risks: readonly string[]; readonly generatedAt: string; /** * PRI-703 Phase 1 (Owner decision 2026-09-07): structured Owner-intent * contract — the single alignment anchor for rule generation / evaluation / * repair. Optional on the wire for backward compatibility: scribe outputs * that predate this field lack it and downstream stages degrade * best-effort (rc-9 observable, never silent). Present-but-malformed is a * hard validator rejection — a corrupted anchor is worse than none. */ readonly intentContract?: IntentContractV1; } export declare const ScribePrincipleDraftSchema: import("@sinclair/typebox").TObject<{ title: import("@sinclair/typebox").TString; statement: import("@sinclair/typebox").TString; rationale: import("@sinclair/typebox").TString; applicability: import("@sinclair/typebox").TArray; antiPatterns: import("@sinclair/typebox").TArray; confidence: import("@sinclair/typebox").TNumber; }>; export declare const ScribeSourceTraceSchema: import("@sinclair/typebox").TObject<{ dreamerArtifactId: import("@sinclair/typebox").TOptional; philosopherArtifactId: import("@sinclair/typebox").TString; }>; export declare const ScribeOutputV1Schema: import("@sinclair/typebox").TObject<{ taskId: import("@sinclair/typebox").TString; sourcePhilosopherArtifactId: import("@sinclair/typebox").TString; principleDraft: import("@sinclair/typebox").TObject<{ title: import("@sinclair/typebox").TString; statement: import("@sinclair/typebox").TString; rationale: import("@sinclair/typebox").TString; applicability: import("@sinclair/typebox").TArray; antiPatterns: import("@sinclair/typebox").TArray; confidence: import("@sinclair/typebox").TNumber; }>; sourceTrace: import("@sinclair/typebox").TObject<{ dreamerArtifactId: import("@sinclair/typebox").TOptional; philosopherArtifactId: import("@sinclair/typebox").TString; }>; risks: import("@sinclair/typebox").TArray; generatedAt: import("@sinclair/typebox").TString; intentContract: import("@sinclair/typebox").TOptional; }>; export type ScribeOutputV1TB = Static; export interface ScribeValidationResult { readonly valid: boolean; readonly errors: readonly string[]; readonly errorCategory?: string; } export interface ScribeValidator { /** * Validate untrusted LLM/runtime output. * * Receives `unknown` — must perform runtime validation before * treating as ScribeOutputV1 (ERR-001, ERR-005). */ validate(output: unknown, taskId: string, expectedSourcePhilosopherArtifactId?: string): Promise; } export declare class DefaultScribeValidator implements ScribeValidator { validate(output: unknown, taskId: string, expectedSourcePhilosopherArtifactId?: string): Promise; } /** * EP002-R3 (live evidence, glm-5.3-flash structured-output path): the model * sometimes serializes the nested `intentContract` object as a JSON-encoded * STRING. The information content is complete — only the carrier is wrong — * so present-but-string is normalized in place to the parsed object before * validation instead of dead-ending as output_invalid. A string that does not * parse, or parses to a non-object, is left untouched and fails validation * loudly (rc-2/rc-9: normalization never invents data, never silently drops). * * Mutates `untrustedOutput` in place (BasePeerRunner.postFetchTransform * contract) and returns true when a normalization happened. */ export declare function normalizeStringEncodedIntentContract(untrustedOutput: unknown): boolean; //# sourceMappingURL=scribe-output.d.ts.map