PureYAML/Sources/Validation
Mihaela M 1915a00fde feat(validation): add the combinator algebra for checks
Add the declarative combinators the validation idiom composes rules from,
as free functions returning closures: comparison operators (==, !=, <, <=,
>, >=) lifting a key path and a literal into a predicate; take to dig to a
value and run arbitrary logic; all to apply many checks to one context; lift
to run child-typed checks against a value reached by key path; and && / ||
to compose two checks (concatenating their errors, or short-circuiting so
errors surface only when both fail). Both the context-rooted and
subject-rooted key-path forms are provided so an author can pin the subject
type in either clause.

A key path is immutable and read-safe but not declared Sendable, so a
@Sendable predicate captures it through a small @unchecked Sendable box.
lookup is omitted: it resolves references against a component store the
generic model does not carry; a consumer with references supplies it.

Each combinator has a pure-function test against a hand-built context, per
the idiom's requirement to unit test the operators in isolation.
2026-06-28 09:27:17 +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.Combinators.swift feat(validation): add the combinator algebra for checks 2026-06-28 09:27:17 +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