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

/**
 * Ranking. Fixed by #15 decision 3.
 *
 * Rank is computed ONLY from committed scores, using the document's own
 * weights, and stored fractionally — the real tabulation in #22 separates the
 * winner from the runner-up by 71.81 to 70.89, so rounding erases the result.
 *
 * There is NO ordering before commits exist. A published provisional ranking
 * anchors the evaluator about to score, and leaves no trace doing it.
 *
 * Within-document totalling is not normalisation: #10 bans cross-RFP scores
 * and global ratings, and summing by the RFP's own published weights is the
 * retailer's own arithmetic.
 *
 * There is no win rate, no cross-RFP metric, and no vendor-visible rank —
 * including their own (#14 decision 3, and the map's standing guardrail).
 */
export interface Ranked {
  responseId: string
  /** Null when the response failed a mandatory gate — disqualification is not a rank. */
  total: number | null
  disqualified: boolean
}

/** Pre-commit triage. Every column here is deterministic; no model judged any of it. */
export interface Triage {
  responseId: string
  gatesPassed: boolean
  mandatoryCoverage: { answered: number; total: number }
  derivedCost: number | null
}

export function rank(): Ranked[] {
  throw new Seam('#35', 'ranking assembly over committed scores')
}

export function triage(): Triage[] {
  throw new Seam('#35', 'pre-commit triage assembly')
}
