/** * Lens B shadow orchestrator (IND-434): deduplicate related opportunities, * mine neutral axes over the deduplicated historical pool BLIND to outcome, * then join the owner-outcome labels and threshold the result. * * No persistence, no questions, no UI. The output is consumed only by aggregate * telemetry for human review. * * Pipeline: * 1. Dedup related opportunities: collapse examples sharing a dedup key to a * single representative (most recent), so a cluster of related opps can * neither dominate the miner nor inflate a side's independent support. * 2. Cap to the most recent OUTCOME_MAX_CANDIDATES for a bounded LLM pass. * 3. Build the miner pool — PoolCandidate carries id + publicContext + score * and, critically, NO outcome label. The miner is structurally blind. * 4. Mine neutral axes + assign candidates (evidence-verified). * 5. Join outcome labels (only now) and apply the k-support threshold. */ import type { PoolDiscriminatorMiner } from "../discriminator/discriminator.miner.js"; import type { OutcomeExample, OutcomeShadowResult } from "./outcome.types.js"; /** Input for one Lens B shadow mining+join pass. */ export interface OutcomeShadowInput { /** * Intent payload (+ summary) text that owns this scope. Used only as miner * context; never mixed with outcome labels. */ intentText: string; /** * Captured owner-outcome examples for exactly one recipient + intent + * fingerprint scope. Each carries a presentation-safe snapshot and a dedup * key; outcome labels live here but are withheld from the miner. */ examples: OutcomeExample[]; miner: Pick; /** Override the independent-support threshold (defaults to k). */ minIndependentSupport?: number; /** Override the minimum qualified sides. */ minComparedSides?: number; /** Override the LLM candidate cap. */ maxCandidates?: number; signal?: AbortSignal; } /** * Collapse related opportunities to independent examples: one representative * (most recent by occurredAt) per distinct dedup key. Deterministic — ties on * occurredAt fall back to opportunityId ordering. */ export declare function deduplicateOutcomeExamples(examples: OutcomeExample[]): OutcomeExample[]; /** * Run the Lens B shadow pipeline for one scope. * * Throws only when *mining* fails (callers are fire-and-forget and must catch). * A pool that is empty or below the compare floor after dedup returns an empty * result rather than throwing. */ export declare function runOutcomeShadow(input: OutcomeShadowInput): Promise;