/** * Root Cause stage (Stage A) output schema for the split diagnostician pipeline. * * This schema defines the output of the Root Cause stage, which identifies * the underlying cause of a pain signal using a 5-Whys causal chain and * categorises it into one of four root-cause categories. * * The taskId field is lineage data re-injected by the runner if stripped * by the adapter before LLM validation (ERR-008). * * @see PRI-372 */ import { type Static } from '@sinclair/typebox'; /** * Root-cause category literal union. * * Every root cause MUST be classified into exactly one of these four * categories. The category prefix in `rootCause` must match this value. * * @see PRI-372 */ export declare const RootCauseCategorySchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"People">, import("@sinclair/typebox").TLiteral<"Design">, import("@sinclair/typebox").TLiteral<"Assumption">, import("@sinclair/typebox").TLiteral<"Tooling">]>; /** Root-cause category: People | Design | Assumption | Tooling */ export type RootCauseCategory = Static; /** * A single entry in the 5-Whys causal chain. * * `why` is 1-indexed (1 = shallowest, 5 = deepest). */ export declare const CausalChainEntrySchema: import("@sinclair/typebox").TObject<{ why: import("@sinclair/typebox").TNumber; statement: import("@sinclair/typebox").TString; evidenceRefs: import("@sinclair/typebox").TArray; }>; /** A single entry in the 5-Whys causal chain. */ export type CausalChainEntry = Static; /** * Evidence entry linking a source reference to an explanatory note. */ export declare const DiagRootCauseEvidenceSchema: import("@sinclair/typebox").TObject<{ sourceRef: import("@sinclair/typebox").TString; note: import("@sinclair/typebox").TString; }>; /** Evidence entry linking a source reference to an explanatory note. */ export type DiagRootCauseEvidence = Static; /** * Intent tension source enum (SPEC §16.5). * * - `none` — no tension detected * - `action_drift` — Agent's action appears to drift from INTENT * - `intent_suspect` — INTENT itself may be stale, ambiguous, or contradictory * - `healthy_tension` — genuine strategic trade-off, no drift */ export declare const IntentTensionSourceSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"action_drift">, import("@sinclair/typebox").TLiteral<"intent_suspect">, import("@sinclair/typebox").TLiteral<"healthy_tension">]>; /** Intent tension source: none | action_drift | intent_suspect | healthy_tension */ export type IntentTensionSource = Static; /** * Evidence strength enum (SPEC §16.6). * * Coarse three-level scale; intentionally NOT a numeric confidence * (SPEC §16.3 forbids `intentTension.confidence`). */ export declare const EvidenceStrengthSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"weak">, import("@sinclair/typebox").TLiteral<"moderate">, import("@sinclair/typebox").TLiteral<"strong">]>; /** Evidence strength: weak | moderate | strong */ export type EvidenceStrength = Static; /** * Related INTENT.md field enum (SPEC §16.7). * * Snake_case keys mirror the INTENT.md section identifiers used in the * prompt block. The LLM picks one or more fields that the tension * relates to. */ export declare const IntentRelatedFieldSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"why">, import("@sinclair/typebox").TLiteral<"desired_outcome">, import("@sinclair/typebox").TLiteral<"non_negotiables">, import("@sinclair/typebox").TLiteral<"stop_escalation">, import("@sinclair/typebox").TLiteral<"current_strategic_focus">]>; /** Related INTENT field: why | desired_outcome | non_negotiables | stop_escalation | current_strategic_focus */ export type IntentRelatedField = Static; /** * Suggested Owner action enum (SPEC §21). * * PD surfaces tension; the Owner decides value. This field is a * SUGGESTION — never auto-applied. The Owner must record a * IntentDecisionRecord (PRI-470) before any follow-up action executes. */ export declare const SuggestedOwnerActionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"confirm_drift">, import("@sinclair/typebox").TLiteral<"revise_intent">, import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"dismiss">, import("@sinclair/typebox").TLiteral<"promote_to_principle">, import("@sinclair/typebox").TLiteral<"promote_to_rulehost">]>; /** Suggested Owner action: confirm_drift | revise_intent | observe | dismiss | promote_to_principle | promote_to_rulehost */ export type SuggestedOwnerAction = Static; /** Type guard: is `value` a valid IntentTensionSource? */ export declare function isIntentTensionSource(value: unknown): value is IntentTensionSource; /** Type guard: is `value` a valid EvidenceStrength? */ export declare function isEvidenceStrength(value: unknown): value is EvidenceStrength; /** Type guard: is `value` a valid IntentRelatedField? */ export declare function isIntentRelatedField(value: unknown): value is IntentRelatedField; /** Type guard: is `value` a valid SuggestedOwnerAction? */ export declare function isSuggestedOwnerAction(value: unknown): value is SuggestedOwnerAction; /** * IntentTension schema (SPEC §16.2). * * Optional object produced by Stage A when the Agent detects a tension * between its action and the Owner-authored INTENT.md. * * CRITICAL (SPEC §16.3): this object MUST NOT carry a `confidence` * field. The Stage A `confidence` (rootCause-level) is the only * diagnostician confidence. To enforce this, `additionalProperties: false` * is set so any extra property (including `confidence`) is rejected by * `Value.Check`. * * Lineage (SPEC §16.2): `intentDocHash` is optional but, when present, * MUST match the hash of the INTENT.md that was injected into the * prompt. The Stage A runner enforces this invariant (PRI-468). */ export declare const IntentTensionSchema: import("@sinclair/typebox").TObject<{ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"action_drift">, import("@sinclair/typebox").TLiteral<"intent_suspect">, import("@sinclair/typebox").TLiteral<"healthy_tension">]>; evidenceStrength: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"weak">, import("@sinclair/typebox").TLiteral<"moderate">, import("@sinclair/typebox").TLiteral<"strong">]>; relatedIntentFields: import("@sinclair/typebox").TArray, import("@sinclair/typebox").TLiteral<"desired_outcome">, import("@sinclair/typebox").TLiteral<"non_negotiables">, import("@sinclair/typebox").TLiteral<"stop_escalation">, import("@sinclair/typebox").TLiteral<"current_strategic_focus">]>>; evidence: import("@sinclair/typebox").TArray; explanation: import("@sinclair/typebox").TString; suggestedOwnerAction: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"confirm_drift">, import("@sinclair/typebox").TLiteral<"revise_intent">, import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"dismiss">, import("@sinclair/typebox").TLiteral<"promote_to_principle">, import("@sinclair/typebox").TLiteral<"promote_to_rulehost">]>; intentDocHash: import("@sinclair/typebox").TOptional; }>; /** * IntentTension — optional Stage A output describing a tension between * the Agent's action and the Owner-authored INTENT.md. * * `confidence` is forbidden on this object (SPEC §16.3). */ export type IntentTension = Static; /** * TypeBox schema for the Root Cause stage (Stage A) output. * * Consumed by the next pipeline stage and stored as a RunRecord output. * The host layer (runner) is responsible for re-injecting `taskId` if * the adapter strips lineage fields before LLM invocation (ERR-008). * * @see PRI-372 */ export declare const DiagRootCauseOutputV1Schema: import("@sinclair/typebox").TObject<{ valid: import("@sinclair/typebox").TBoolean; diagnosisId: import("@sinclair/typebox").TString; taskId: import("@sinclair/typebox").TString; summary: import("@sinclair/typebox").TString; causalChain: import("@sinclair/typebox").TArray; }>>; rootCause: import("@sinclair/typebox").TString; rootCauseCategory: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"People">, import("@sinclair/typebox").TLiteral<"Design">, import("@sinclair/typebox").TLiteral<"Assumption">, import("@sinclair/typebox").TLiteral<"Tooling">]>; evidence: import("@sinclair/typebox").TArray>; confidence: import("@sinclair/typebox").TNumber; ambiguityNotes: import("@sinclair/typebox").TOptional>; /** * Optional intent tension (PRI-468, SPEC §16). Present only when: * 1. The `intent_engineering` flag is on, AND * 2. The Stage A prompt was built with the INTENT context injected, AND * 3. The LLM chose to emit a tension. * * When absent (flag off or LLM omitted), Stage C passthrough must NOT * synthesize one (SPEC §18 — additive only, never generates). */ intentTension: import("@sinclair/typebox").TOptional, import("@sinclair/typebox").TLiteral<"action_drift">, import("@sinclair/typebox").TLiteral<"intent_suspect">, import("@sinclair/typebox").TLiteral<"healthy_tension">]>; evidenceStrength: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"weak">, import("@sinclair/typebox").TLiteral<"moderate">, import("@sinclair/typebox").TLiteral<"strong">]>; relatedIntentFields: import("@sinclair/typebox").TArray, import("@sinclair/typebox").TLiteral<"desired_outcome">, import("@sinclair/typebox").TLiteral<"non_negotiables">, import("@sinclair/typebox").TLiteral<"stop_escalation">, import("@sinclair/typebox").TLiteral<"current_strategic_focus">]>>; evidence: import("@sinclair/typebox").TArray; explanation: import("@sinclair/typebox").TString; suggestedOwnerAction: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"confirm_drift">, import("@sinclair/typebox").TLiteral<"revise_intent">, import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"dismiss">, import("@sinclair/typebox").TLiteral<"promote_to_principle">, import("@sinclair/typebox").TLiteral<"promote_to_rulehost">]>; intentDocHash: import("@sinclair/typebox").TOptional; }>>; }>; /** Typed output of the Root Cause stage (Stage A). */ export type DiagRootCauseOutputV1 = Static; /** * Validator interface for DiagRootCauseOutputV1. * * Accepts `unknown` input — implementations must perform runtime checks (ERR-001). * * @see PRI-372 */ export interface DiagRootCauseValidator { /** * Validate untrusted root-cause stage output. * * @param output - Raw output to validate (treated as unknown — ERR-001) * @param taskId - Expected taskId for lineage verification (ERR-008) * @returns Validation result with valid flag, errors, and optional error category */ validate(output: unknown, taskId: string): Promise<{ valid: boolean; errors: string[]; errorCategory?: string; warnings?: string[]; }>; } /** * Default validator for DiagRootCauseOutputV1 using TypeBox Value.Check / Value.Errors. * * Validates: * 1. Structural correctness via TypeBox schema * 2. taskId lineage match (ERR-008) * 3. rootCauseCategory consistency with rootCause prefix * 4. causalChain entry ordering (why field 1-5) * * @see PRI-372 */ export declare class DefaultDiagRootCauseValidator implements DiagRootCauseValidator { validate(output: unknown, taskId: string): Promise<{ valid: boolean; errors: string[]; errorCategory?: string; warnings?: string[]; }>; } //# sourceMappingURL=diag-rootcause-output.d.ts.map