/** * DiagDistillerRunner — Stage B runner for the split diagnostician pipeline. * * Takes the root-cause artifact from Stage A and produces an abstracted, * cross-scenario principle grounded on the T-01..T-10 core axiom registry. * * Extends BasePeerRunner following the DreamerRunner pattern (PRI-302). * The shared lease → buildContext → invoke → poll → fetch → validate → * succeed/fail pipeline is in the base class. This file only contains * Stage B–specific logic. * * Key constraints: * - Uses PDRuntimeAdapter for all LLM execution (no direct SDK calls) * - No plugin-layer imports (core is infrastructure-agnostic) * - Uses RuntimeStateManager for all state operations * - NO candidate commit — only writes PIArtifact (like DreamerRunner) * - Reads diagnostician_core_grounding flag from effectiveConfig (PRI-371) * - Validates groundedOnCorePrincipleIds against registry (fabricated IDs fail) * - Lineage integrity: output.sourceRootCauseArtifactId must match context * * @see PRI-372 * @see BasePeerRunner in runner/base-peer-runner.ts */ import type { RunHandle } from '../runtime-protocol.js'; import type { DiagDistillerOutputV1, DiagDistillerValidator } from '../diagnostician/diag-distiller-output.js'; import type { DiagRootCauseOutputV1 } from '../diagnostician/diag-rootcause-output.js'; import type { TaskRecord } from '../task-status.js'; import type { EffectivePdConfig } from '../config/pd-config-types.js'; import { type PDErrorCategory } from '../error-categories.js'; import { BasePeerRunner } from '../runner/base-peer-runner.js'; import type { PeerRunnerOptions, PeerRunnerDeps, PeerRunnerResult, PeerRunnerValidationResult } from '../runner/peer-runner-types.js'; /** Context built by DiagDistillerRunner.buildContext() and consumed by invokeRuntime(). */ interface DiagDistillerContext { readonly contextHash: string; readonly contextRefs: string[]; readonly rootCauseArtifactId: string; readonly rootCauseOutput: DiagRootCauseOutputV1; readonly coreGrounding: boolean; } export interface DiagDistillerRunnerDeps extends PeerRunnerDeps { readonly validator: DiagDistillerValidator; } export interface DiagDistillerRunnerOptions extends PeerRunnerOptions { /** Effective PD config for feature flag resolution (PRI-371). */ readonly effectiveConfig?: EffectivePdConfig; } /** * Stage B runner for the split diagnostician pipeline. * * Produces a DiagDistillerOutputV1 containing the abstracted principle, * core axiom grounding, scope, and confidence. Does NOT commit candidates — * that is the responsibility of Stage C (DiagRouterRunner). * * @see PRI-372 */ export declare class DiagDistillerRunner extends BasePeerRunner { private readonly validator; private readonly effectiveConfig?; constructor(deps: DiagDistillerRunnerDeps, options: DiagDistillerRunnerOptions); get permanentErrorCategories(): ReadonlySet; buildContext(taskId: string): Promise; invokeRuntime(taskId: string, context: DiagDistillerContext): Promise; validateOutput(output: unknown, taskId: string, _context: DiagDistillerContext): Promise; succeedTask(taskId: string, runId: string, output: DiagDistillerOutputV1, task: TaskRecord, contextHash: string, _context: DiagDistillerContext): Promise>; /** * Re-inject taskId and sourceRootCauseArtifactId if stripped by * stripLineageFields (PRI-272 / ERR-008). * Only fill when absent via Object.hasOwn — present-but-falsy values * must reach validation and fail loud (Runtime Contract Rule 3). */ protected postFetchTransform(taskId: string, untrustedOutput: unknown): void; /** * Check lineage strip contract invariant (EP-07). * * After validation passes, verify that the output's sourceRootCauseArtifactId * matches the context's rootCauseArtifactId. If they mismatch, the LLM * fabricated or altered the lineage field — emit telemetry and throw. */ protected checkLineageIntegrity(taskId: string, output: DiagDistillerOutputV1, context: DiagDistillerContext): void; protected emitSuccessTelemetry(taskId: string, output: DiagDistillerOutputV1, _context: DiagDistillerContext): void; } export {}; //# sourceMappingURL=diag-distiller-runner.d.ts.map