/** * MedicalSopEngine — Full SOP wired (Phase 6, Sprint 6). * * Implements PipelineEngine with pipelineShape 'medical-sop'. * Full ordered SOP: * Gate 1 (consent) → fail-closed, ZERO downstream on refuse * Gate 2 (red-flag) → 0-LLM short-circuit on emergency match * (3) NumericsQueryLayer — deterministic compute, NO LLM * (4) FactStore.getActiveFacts — active medications (ADR-7) * Gate 3 (EgressGuard) → literature-retrieval axis, default false * (5) LiteratureRetriever.retrieve — {disabled} sync when axis off → ABSTAIN * (6) DisclaimerComposer.footer * (7) AuditLog.append("answer" | "abstain") * (8) return PipelineResult & { medicalAnswer } * * Zero-arg constructor preserved for selector.ts:126. * All timestamps injected via opts.now — never the wall clock. * No LLM calls, no SDK imports. No network import. */ import type { BoberConfig } from "../config/schema.js"; import type { PipelineResult } from "../orchestrator/pipeline.js"; import type { PipelineEngine, PipelineEngineName } from "../orchestrator/workflow/engine.js"; import { AuditLog } from "./audit.js"; import { ConsentGate } from "./consent.js"; import { DisclaimerComposer } from "./disclaimer.js"; import { EgressGuard } from "./egress.js"; import { LiteratureRetriever } from "./retrieval/literature.js"; import { HealthDataStore } from "./health-store.js"; import { FactStore } from "../state/facts.js"; import type { GuardrailSet } from "./types.js"; import type { LLMClient } from "../providers/types.js"; /** * Optional deps injected by tests. * Production code leaves this undefined; run() constructs real instances. * bober: simple optional-deps seam; swap for a DI container if the dep graph grows. */ export interface MedicalSopDeps { auditLog?: AuditLog; consentGate?: ConsentGate; disclaimer?: DisclaimerComposer; /** Inject the real MedicalGuardrails (or a test fake). Sprint 3. */ guardrails?: GuardrailSet; /** Spy/fake LLMClient — asserted NEVER called on red-flag short-circuit (carry-forward S2 fix). */ llmClient?: LLMClient; /** Spy/fake numerics layer — asserted NEVER called on red-flag short-circuit. */ numerics?: () => unknown; /** Injected EgressGuard for tests. Production builds from config. */ egress?: EgressGuard; /** Injected LiteratureRetriever for tests. Production uses EgressGuard from config. */ literature?: LiteratureRetriever; /** Injected FactStore for medications (tests pass :memory:). */ facts?: FactStore; /** Injected HealthDataStore for numerics (tests pass :memory:). */ healthStore?: HealthDataStore; } /** * Medical-SOP pipeline engine. * * Zero-arg constructor is preserved so that src/orchestrator/workflow/selector.ts * can call `new MedicalSopEngine()` without changes (Sprint 1 contract). * Fakes are injected via the optional `deps` constructor argument. */ export declare class MedicalSopEngine implements PipelineEngine { private readonly deps?; readonly name: PipelineEngineName; constructor(deps?: MedicalSopDeps | undefined); run(userPrompt: string, projectRoot: string, config: BoberConfig, // was _config — now consumed (EgressGuard.fromConfig) opts?: { runId?: string; now?: string; }): Promise; } //# sourceMappingURL=engine.d.ts.map