import type { TStageContext } from "../../../../lib/pipelines/index.js"; import type { TClaimMentionExtractionOutput, TSegmentationOutput } from "../stages/schemas.js"; import { type TIngestionSourceAnchor } from "../source-anchors.js"; /** * Where each segment actually begins in the input. * * The segmentation prompt requires `segment.text` be copied verbatim, so * the true offset is recoverable by searching — and searching is what * this does, because the model's own `span.start` drifts — off by one on * several segments of the recorded corpus. Small, and invisible until a * quote repeats, at which point the drifted hint picks the wrong * occurrence. * * Segments are emitted left to right and cover the input, so the scan * carries a cursor rather than searching from zero: that keeps a segment * whose text repeats earlier in the document from collapsing onto the * earlier copy. Among the candidates at or after the cursor, the one * nearest the model's reported start wins — the model's number chooses * between verified positions rather than supplying one. */ export declare function resolveSegmentStarts(inputText: string, segmentation: TSegmentationOutput | undefined): Map; /** * Non-fatal note codes for anchor resolution. None stops assembly: an * unresolved quote yields no anchor; an ambiguous one yields the * occurrence nearest the reported position when the quote is verbatim, * and no anchor when it is only approximately in the input; an approximate * one yields the nearest passage. Every one of them is reported because * silence here is indistinguishable from success — a model that starts * paraphrasing would otherwise take anchor coverage to zero with no signal. * A claim the mention stage produced no mention for was never looked up at * all; it is reported too, so "we did not look" is not read as "we found * nothing" or as success. So is the reverse: a mention the stage produced * that no claim references, whose passage is linked to no claim. A mention * id the stage emitted more than once is resolved from its first copy only, * so it gets at most one resolution note; later copies are ignored. */ export declare const SOURCE_ANCHOR_NOTE_CODES: { readonly unresolved: "SOURCE_ANCHOR_UNRESOLVED"; readonly ambiguous: "SOURCE_ANCHOR_AMBIGUOUS"; readonly approximate: "SOURCE_ANCHOR_APPROXIMATE"; readonly inputUnavailable: "SOURCE_ANCHOR_INPUT_UNAVAILABLE"; readonly notAttempted: "SOURCE_ANCHOR_NOT_ATTEMPTED"; readonly mentionUnclaimed: "SOURCE_ANCHOR_MENTION_UNCLAIMED"; }; /** Resolve every mention to a verified anchor in the input, by id. */ export declare function buildAnchorByMentionId(args: { ctx: TStageContext; inputText: string; segmentStartById: Map; segments: TSegmentationOutput["segments"] | undefined; mentions: TClaimMentionExtractionOutput | undefined; }): Map; /** Anchors for the mentions of one claim, in order, deduped by range. */ export declare function claimAnchors(mentionIds: readonly string[], anchorByMentionId: Map): TIngestionSourceAnchor[]; /** * The raw text this pipeline was given, or `""` for any input shape that * does not carry one. * * `TStageContext.input` is `unknown` and this assembler is public API * for consumers composing their own pipelines, whose `inputSchema` need * not be `{ text }`. Anchors are the only thing that reads the input, so * an empty string degrades exactly into the documented no-anchor * behavior — every match misses — rather than throwing out of finalize * on the happy path, after every LLM call has been paid for. */ export declare function readInputText(input: unknown): string; /** The `mentionIds` on a canonical claim record, defensively read. */ export declare function readMentionIds(record: Record): string[]; //# sourceMappingURL=source-anchor-resolution.d.ts.map