import type { LLMProvider } from '../runtime/types.js'; import type { ClaimVerdict, ClaimVerification } from './types.js'; export type FindingSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info'; /** An externally-produced security finding to adjudicate. Superset-compatible with Sentinel's Finding. */ export interface ExternalFinding { id: string; ruleId?: string; cwe?: string; owasp?: string; severity: FindingSeverity; title: string; /** The claim being made: description + impact, verbatim. */ assertion: string; evidence: Array<{ file: string; line: number; snippet: string; context?: string; }>; } export interface FindingVerifyRequest { /** Provenance; future sources get their own literal. */ source: 'shipsafe-sentinel'; findings: ExternalFinding[]; /** * Code slices keyed by file path. The caller supplies the slice; * verdicts may never blame missing context — a finding whose evidence * falls outside the supplied slices resolves to 'unverifiable'. */ files: Record; /** Optional project context (auth model, public routes, …). */ context?: Record; budget?: { maxCostUsd?: number; }; } export type FindingDecision = 'confirm' | 'dismiss' | 'downgrade' | 'unverifiable'; export interface FindingVerdict { findingId: string; decision: FindingDecision; /** Assay-native verdict on the finding's assertion, for audit. */ claimVerdict: ClaimVerdict; method: 'formal' | 'llm'; formalOverride?: ClaimVerification['formalOverride']; /** Evidence-anchored; cites file:line from the supplied slices. */ reasoning: string; /** Only when decision === 'downgrade'. */ newSeverity?: FindingSeverity; /** Only when decision === 'unverifiable' — what file/module was needed. */ missingContext?: string; } export interface FindingVerifyResponse { verdicts: FindingVerdict[]; stats: { formal: number; llm: number; overrides: number; durationMs: number; costUsd: number; }; } export interface FindingVerifyDeps { /** Injectable for tests; defaults to the configured Assay provider. */ provider?: LLMProvider; model?: string; } export declare function verifyFindings(request: FindingVerifyRequest, deps?: FindingVerifyDeps): Promise;