Skip to content

API Reference parrot_tools.contracts.verifier

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.contracts.verifier

View source

Versioned citation and claim verification gate (FEAT-539 M10).

The single gate both answer producers pass through. It is deterministic and LLM-free: it takes a draft (claims plus the citations the draft attached to each claim) and the dossier this request was authorized to see, and it releases only what survives verification.

A citation survives when all of the following hold:

  • it belongs to this request's authorized dossier — a model cannot cite a contract the caller never had access to;
  • its (contract_id, node_id) pair is not retired;
  • the version and source hash match the archived evidence, and the quote is nonempty and appears verbatim in that version's body;
  • the recorded page matches.

Claim-to-citation support is explicit: a claim whose citations were all rejected is dropped, and unrelated surviving evidence cannot rescue it. Zero surviving citations turns a lookup into not_found.

Class AnswerDraft

A model's proposed answer, before verification.

Fields:

Field Type Default Description
answer_kind str 'lookup'
claims list[Claim]
handoff Optional[HandoffBrief] None
pattern Optional[str] None
reason Optional[str] None

Class CitationVerifier

Verify a draft against archived evidence and release an answer.

Parameter Type Default Description
catalog Any The tenant-bound catalog (retirement suppressions).
evidence EvidenceArchive The tenant-bound immutable evidence archive.

Method CitationVerifier.verify

Verify a draft and build the answer that may be released.

verify(draft: AnswerDraft, *, dossier: Sequence[ContractCard], pattern: Optional[str] = None, question: Optional[str] = None) -> VerificationOutcome

Parameter Type Default Description
draft AnswerDraft The producer's proposed answer.
dossier Sequence[ContractCard] The cards this request was authorized to read.
pattern Optional[str] None The retrieval pattern, recorded on the answer.
question Optional[str] None

Returns: VerificationOutcome — class:VerificationOutcome. Only kinds and citations that survive every check reach the returned answer.

Class Claim

One sentence of a draft answer and the citations it rests on.

Support is explicit precisely so an unsupported claim can be removed without taking the rest of the answer with it.

Fields:

Field Type Default Description
text str
citations list[Citation]

Class RejectedCitation

One citation that did not survive, with the reason it failed.

Fields:

Field Type Default Description
contract_id str
node_id str
reason str

Class VerificationOutcome

The released answer plus everything that was removed on the way.

Fields:

Field Type Default Description
answer ContractAnswer
rejected list[RejectedCitation]
dropped_claims list[str]

Attributes:

Attribute Type Description
released_citations list[Citation] Citations that survived verification.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally