/** * Structural claim verification (change: add-structural-claim-verification). * * The reverse of context retrieval: instead of OpenLore handing the agent facts, * the AGENT submits a structured claim about code structure and OpenLore returns a * deterministic verdict plus a citation it can show a human. This converts the * agent's confident-wrong failure mode ("this function is dead", "Y calls Z") into * checked-or-flagged, and makes the agent's output auditable. * * claim = { kind: 'calls'|'reaches'|'dead'|'impacts'|'safe-to-change'|'decision-current', subject, object? } * verdict = { verdict: 'confirmed'|'refuted'|'unverifiable', reason, receipt?, confidenceBoundary } * * Every verdict is a deterministic computation, never an LLM judgement and never a * confidence number (north star c6d1ad07). The structural kinds compute over the * call graph: * - `calls` → a direct caller→callee edge exists. * - `reaches` → forward reachability subject ⇒ object. * - `impacts` → backward reachability: object transitively calls subject, * so changing subject can require changes in object. * - `dead` → mark-and-sweep reachability (reuses {@link deadCodeIds}), * run twice (synthesized-inclusive vs directly-resolved) to * separate truly-unreached from reached-only-via-heuristic. * - `safe-to-change` → no internal caller depends on subject (blast radius is * empty by directly-resolved edges). * The decision kind computes over the recorded decision store instead (change: * add-decision-reference-claim-verification): * - `decision-current` → the subject decision id is recorded and neither * superseded (reusing the `stale-decision-reference` * retirement graph) nor rejected, so citing it is sound. * * The receipt reuses the grounding-certificate shape (`{ symbol, filePath, * lineSpan, contentHash }`) — the same span hash the freshness check compares — so * a human can audit the claim against the index at a named commit. `unverifiable` * is first-class: when a verdict rests on a dispatch blind spot it is named via * `add-confidence-boundary-disclosure`, rather than fabricating a decisive answer. */ import type { PendingDecision } from '../../../types/index.js'; export type ClaimKind = 'calls' | 'reaches' | 'dead' | 'impacts' | 'safe-to-change' | 'decision-current'; export type Verdict = 'confirmed' | 'refuted' | 'unverifiable'; export interface VerifyClaimInput { directory: string; kind: ClaimKind; /** * What the claim is about: a function/method name for structural kinds, or an * 8-character decision id for the `decision-current` kind. */ subject: string; /** The second symbol, for relational kinds (`calls`, `reaches`, `impacts`). */ object?: string; } /** * Verify a `decision-current` claim against the recorded decision store — is the * referenced decision still authoritative, or has it been superseded/rejected? * * This is the decision-graph analogue of the structural verifiers and is kept * deliberately separate from them: it does not touch the call graph (so the * structural verifier stays uncontorted, the reason `verify_claim`'s decision * clause was originally deferred), and it reuses the SAME retirement graph * (`buildRetirementGraph`) the `stale-decision-reference` finding walks, so the * two never disagree about what counts as superseded. * * Verdicts: * - `confirmed` — the id resolves to a recorded decision that is in force * ({@link AUTHORITATIVE_FOR_CITATION}) and neither superseded * nor rejected; citing it as current is sound. * - `refuted` — the decision has been superseded (reason names the live * superseder) or was rejected; citing it is stale/unsound. * - `unverifiable` — the id is malformed, no such decision is recorded here, or * the decision is recorded but not in force; the agent should * hedge or read the source. * * Pure decision-store read, no LLM (north star `c6d1ad07`). */ export declare function verifyDecisionCurrent(absDir: string, subject: string, /** Share one store read across many checks (the public-surface baseline checks several ids). */ loadStore?: () => Promise<{ decisions?: PendingDecision[]; }>): Promise; /** * Verify a structured structural claim against the deterministic call graph. * Read-only, offline, no LLM. Returns `unknown` (additive-by-cast like the * sibling handlers). */ export declare function handleVerifyClaim(input: VerifyClaimInput): Promise; //# sourceMappingURL=claim-verification.d.ts.map