PureYAML/scripts/validation-coverage.tsv
Mihaela M d195dd3fa1 refactor(validation): retire the legacy Rule for one check type
A Rule was exactly a Check<Model.Value, Model.Value>: it fired on every
node, switched on the value itself, and carried the root. It was therefore a
second copy of the one check machinery, the duplication the validation idiom
exists to prevent (principle 10), now also resolved for the tagged layer.

Remove Rule and its Context. The model validator holds only checks; its
default is the type-directed BuiltinCheck.mappingKeysAreUnique; validating
takes a Check. Custom whole-tree rules become Check<Model.Value, Model.Value>
with the former context.root now context.document.

Behaviour is byte-identical: the mapping-key builtin reports the same issues
at the same paths in the same DFS order, so the public validate/collect/blank
surface is unchanged. All 399 tests pass; the coverage gate reconciles to 60
public types.
2026-06-28 16:43:31 +02:00

5.6 KiB

1# Public-type validation coverage manifest (validation-rules.md).
2# Every public type in the PureYAML target is classified exactly once.
3# `validated`: carries a runtime invariant the type system does not enforce; backed by a
4# Validation<Subject> in the framework phase.
5# `excluded`: a caseless namespace, a closed sum type whose illegal states are unrepresentable,
6# a pure data-transfer type, an error value, or engine/machinery that is not a validated subject.
7# scripts/check-validation-coverage.sh fails the build if a public type is missing here or a line
8# here is no longer public.
9# --- namespaces (caseless enums) ---
10# --- model ---
11# --- stream ---
12# --- parsing ---
13# --- emitting ---
14# --- decoding / encoding (Codable machinery) ---
15# --- tagged node subsystem ---
16# --- validation framework's own types ---