import type { InternalizationChannel, PipelineTopologyMode } from './peer-runner-contracts.js'; import type { InternalizationRouteKind } from './internalization-route.js'; import type { CandidateRecord } from '../store/candidate/candidate-store.js'; /** * PRI-720 C6: all deterministic dreamer task ids for one candidate across * channels. Seed dedup MUST check all of them — the C6 demotion changes the * channel suffix of the derived id, so taskId-equality alone would miss a * chain already seeded under the pre-demotion id (double-seed → * double-activation of the same candidate). */ export declare function dreamerTaskIdsForCandidate(candidateId: string): string[]; /** * PRI-720 C6: candidate-level seed dedup — finds an existing dreamer task for * this candidate under ANY channel suffix (the demotion changes the derived * id's channel, so exact-id lookups would miss pre-demotion chains). */ export declare function findExistingDreamerTask(getTask: (taskId: string) => Promise, candidateId: string): Promise; export interface IntakeToInternalizationBridgeInput { candidateId: string; recommendationKind: string; route: InternalizationRouteKind; ready: boolean; sourcePainId?: string; workspaceDir?: string; now?: string; /** * PRI-720: topology mode for the seeded chain. Hosts resolve this from the * `prompt_full_pipeline` feature flag (or explicit operator/lab options) at * seed time. The seed ALWAYS serializes the resolved mode explicitly * ('standard' when absent here), so field absence on a record identifies a * pre-PRI-720 legacy chain (full-chain topology, AC12). */ pipelineMode?: PipelineTopologyMode; /** * PRI-720 C6: parsed diagnostician recommendation content (the candidate's * `sourceRecommendationJson`). Optional for backward compatibility — when * absent, rule-candidate routes keep the pre-existing behavior. When * present, a rule recommendation WITHOUT complete mechanical trigger * evidence (triggerPattern + observable action) is demoted to the prompt * channel instead of entering the RuleCode sub-chain (deterministic field * check — never an LLM judgment). */ recommendation?: unknown; /** Diagnostician task ID that produced this candidate (lineage). */ sourceTaskId?: string; /** Artifact ID of the diagnostician artifact (lineage). */ sourceArtifactId?: string; /** Run ID of the diagnostician execution (lineage). */ sourceRunId?: string; } export type BridgeDecision = { decision: 'seeded'; taskId: string; taskKind: 'dreamer'; channel: InternalizationChannel; /** PRI-720 C6: present when a rule candidate without mechanical evidence was demoted to prompt. */ demotedFromChannel?: InternalizationChannel; } | { decision: 'already_exists'; taskId: string; } | { decision: 'not_internalizable'; reason: string; } | { decision: 'invalid_candidate'; reason: string; }; export declare function hasRuleMechanicalEvidence(recommendation: unknown): boolean; export declare const MVP_ENABLED_CHANNELS: ReadonlySet; export declare const CANDIDATE_KIND_TO_ROUTE: Record; export declare const ROUTE_CHANNEL_MAP: Record; export declare function computeBridgeDecision(input: IntakeToInternalizationBridgeInput): BridgeDecision; export interface BridgeTaskSeed { taskId: string; taskKind: 'dreamer'; channel: InternalizationChannel; /** PRI-720: explicit topology mode written on every new seed ('standard' | 'full_chain'). */ pipelineMode?: PipelineTopologyMode; /** PRI-720 C6: present when a rule candidate was demoted to prompt (no mechanical evidence). */ demotedFromChannel?: InternalizationChannel; diagnosticJson: string; status: 'pending'; attemptCount: number; maxAttempts: number; } export declare function buildDreamerTaskSeed(input: IntakeToInternalizationBridgeInput): BridgeTaskSeed | BridgeDecision; /** * Build a dreamer task seed from a CandidateRecord, preserving diagnostician lineage. * * Extracts sourceTaskId, sourceArtifactId, and sourceRunId from the candidate record * so the resulting dreamer task carries real dependencyTaskIds and inputArtifactRefs * instead of empty lineage and weak candidate:// refs. * * This is the preferred factory for candidate→dreamer seeding. New production * entrypoints should call this rather than hand-building the bridge input. * The optional sourcePainId is for callers that already have a painId in scope * (e.g. PainSignalBridge). */ export interface BuildDreamerSeedFromCandidateOptions { route: InternalizationRouteKind; ready: boolean; sourcePainId?: string; /** PRI-720: seed-time topology mode (see IntakeToInternalizationBridgeInput.pipelineMode). */ pipelineMode?: PipelineTopologyMode; } export declare function buildDreamerSeedFromCandidate(candidate: CandidateRecord, options: BuildDreamerSeedFromCandidateOptions): BridgeTaskSeed | BridgeDecision; export interface BridgeTaskStore { getTask(taskId: string): Promise<{ taskId: string; } | null>; createTask(input: { taskId: string; taskKind: string; status: 'pending'; attemptCount: number; maxAttempts: number; diagnosticJson: string; }): Promise<{ taskId: string; }>; } export declare function seedIntakeTask(input: IntakeToInternalizationBridgeInput, store: BridgeTaskStore): Promise; //# sourceMappingURL=intake-to-internalization-bridge.d.ts.map