corpus library

The attest validation-corpus API.

Experimental. Every member of this library is annotated @experimental: it is young, it will evolve with the corpus (widget-based cases, richer matching), and it is exempt from the 1.0 stability promise — breaking changes may land in minor releases, always changelogged.

This is a separate entry point from package:attest/attest.dart so the core rule-engine surface stays focused. Import it to author labelled correctness cases (CorpusCase, ExpectedFinding) — the ground-truth data the precision/recall harness measures each rule against.

A case is a lazily-built SemanticsSnapshot plus the findings a human confirmed it should produce, anchored to semantics identifiers. See test/corpus/README.md for the directory convention and how to add a case.

Classes

CorpusCase
One labelled case in the validation corpus: an input plus its ground truth.
CorpusMetrics
The full corpus result: per-rule metrics plus authoring warnings.
ExpectedFinding
A single accessibility violation the corpus expects a case to produce.
GateViolation
One reason the corpus gate failed.
MetricsHarness
Runs the validation corpus and computes per-rule precision, recall and false-positive rate — the measured correctness that the 1.0 bar rests on.
RuleMetrics
The confusion-matrix tallies and derived rates for one rule over the corpus.

Enums

CorpusCategory
What role a CorpusCase plays in measuring correctness.
GateViolationKind
The gate conditions a rule can breach.

Constants

declaredHeuristicPrecision → const Map<String, double>
The declared precision bar for every bundled heuristic rule.

Typedefs

Auditor = FutureOr<List<Finding>> Function(SemanticsSnapshot snapshot, Standard standard)
Audits a built snapshot under a standard pack and returns its findings.