import { Seam } from '../seam.js'

/**
 * The completeness sweep. Fixed by #16 decision 2.
 *
 * ── INDEPENDENCE IS THE MECHANISM ───────────────────────────────────────
 *
 *   This module MUST NOT share a prompt or a code path with the extractor.
 *   It asks a DIFFERENT question — "is there an obligation in this span" —
 *   rather than re-running the same extraction. Two independent passes
 *   disagreeing is the entire signal; sharing anything destroys it.
 *
 *   This is a constraint on the layout, not a style preference. If you find
 *   yourself importing from ./index.ts, stop.
 * ────────────────────────────────────────────────────────────────────────
 *
 * Span coverage over requirement provenance is computed deterministically —
 * the schema already carries the spans. Two treatments:
 *
 *   asserted_obligation   second pass says obligation, nothing covers  -> BLOCKS issue
 *   uncovered_span        uncovered, no obligation asserted            -> report only
 *
 * A coverage percentage was rejected: RFPs are mostly non-requirement prose,
 * so a threshold measures document style rather than extraction quality.
 *
 * Also runs over spans covered ONLY by informational requirements, so an
 * obligation miskinded as informational — which would otherwise be
 * bulk-accepted and never seen — surfaces as a blocking disagreement.
 *
 * Recorded as unfixed: a miss BOTH passes share is still invisible.
 */
export interface SweepFinding {
  kind: 'asserted_obligation' | 'uncovered_span'
  page: number
  span: { start: number; end: number }
  quotedText: string
}

export function sweep(): SweepFinding[] {
  throw new Seam('#30', 'the sweep needs a corpus with labelled known-misses to have any recall')
}
