Skip to main content

Module normalize

Module normalize 

Source
Expand description

Normalization pipeline: validate every field/enum/cross-field floor, materialize all defaults, and expand targets from ecosystems.

A faithful port of check-oss-release.py’s normalize. contract show emits the canonical (normalized) form; contract validate runs the identical pipeline and discards the document, emitting only pass/fail (ADR-0001 §1).

Every field is validated independently and all problems are collected — an invalid enum records an error and substitutes a default so the pass continues to surface every other problem (mirroring the Python Problems collector). The built Contract is only meaningful when Normalized::is_valid holds; callers gate on that (or, in the CLI, on the process exit code), never on parsing a document that failed.

Structs§

Normalized
The result of a normalization pass: the canonical Contract plus the Problems gathered while building it.
Problems
Collected fatal errors and non-fatal warnings from a normalization pass.

Enums§

LoadError
Why the contract file could not be loaded (distinct from a validation failure, which is carried by Problems). Maps to a §2 exit-2 system error.

Constants§

CONTRACT_FILENAME
The contract file the normalizer reads, relative to the repo root.

Functions§

normalize
Read <repo_root>/OSS-RELEASE.md through the Fs port and normalize it.
normalize_str
Normalize the full text of an OSS-RELEASE.md (frontmatter + body).