Adopt the validation-rules discipline that every public type is either validated or excluded, enforced mechanically rather than by review. A new gate enumerates the public surface from the compiler symbol graph and fails the build, naming the type, if any public type is missing from the coverage manifest or any manifest entry is no longer public. scripts/validation-coverage.tsv classifies all 58 public types: the value models with the mapping-key-uniqueness runtime invariant are validated, and the namespaces, closed sum types, data-transfer values, error types, and engine machinery are excluded with a one-line reason each. The gate runs in check-all.sh and CI; a planted unclassified type was confirmed to fail it. This is the coverage-first phase of moving the validation layer to the type-directed Validation idiom; the framework backing the validated entries, the de-duplication of the Tagged validator machinery, and the exhaustive tests follow.
5.4 KiB
5.4 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 --- |