PureYAML/Sources/Validation
Mihaela M 2e45ecaffe feat(validation): add type-directed Check dispatch
Introduce the core of the validation-rules idiom: a Check<Subject> with a
positive description, a when predicate, and a Bool or multi-error check
that fires only on values of its Subject type wherever they occur. AnyCheck
erases the subject and dispatches by runtime type, guarding an optional or
a wrong type from matching. The validator gains a checks list, a
validating(_:) overload, and a traversal that offers each node the values
it may specialise on. BuiltinCheck.mappingKeysAreUnique is the
type-directed counterpart of the legacy rule.

The machinery has its own negative tests (wrong type, optional, false
predicate yield nothing; same type twice yields two errors) and the builtin
ships a failing and a near-miss test. The coverage gate catches the five
new public types, which are classified as validation machinery. The default
validator is unchanged, so this is additive; retiring the legacy Rule,
moving the default onto the check, the combinator algebra, the error
rendering, and de-duplicating the Tagged validator are the remaining steps.
2026-06-28 07:23:23 +02:00
..
AnyCheck.swift feat(validation): add type-directed Check dispatch 2026-06-28 07:23:23 +02:00
Check.Builtins.swift feat(validation): add type-directed Check dispatch 2026-06-28 07:23:23 +02:00
Check.swift feat(validation): add type-directed Check dispatch 2026-06-28 07:23:23 +02:00
Context.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
DiagnosticValidation.swift feat(parser): harden diagnostics and streaming 2026-06-06 07:57:48 +02:00
Issue.Collection.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
Issue.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
Path.Component.swift feat(model): support complex mapping keys 2026-06-05 16:08:45 +02:00
Path.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
PreflightScanner.swift feat(parser): harden diagnostics and streaming 2026-06-06 07:57:48 +02:00
Result.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
Rule.Builtins.swift feat(model): support complex mapping keys 2026-06-05 16:08:45 +02:00
Rule.swift critic-fix(validation): make rules immutable 2026-06-05 11:27:06 +02:00
Severity.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
SubjectContext.swift feat(validation): add type-directed Check dispatch 2026-06-28 07:23:23 +02:00
Validatable.swift feat(validation): add type-directed Check dispatch 2026-06-28 07:23:23 +02:00
Validation.BatchReport.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.Diagnostic.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.DiagnosticKind.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.Report.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.ReportError.swift feat(validation): add diagnostic report errors 2026-06-05 21:06:42 +02:00
Validation.Source.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.SourceReport.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validator.swift feat(validation): add type-directed Check dispatch 2026-06-28 07:23:23 +02:00