pub struct Contract {Show 19 fields
pub schema_version: u32,
pub status: Status,
pub maturity: Maturity,
pub ecosystems: Vec<Ecosystem>,
pub targets: Vec<Target>,
pub distributions: Vec<Distribution>,
pub versioning: VersioningBase,
pub versioning_pattern: Option<String>,
pub changelog: Changelog,
pub conventional_commits: bool,
pub release: Release,
pub contribution_provenance: ContributionProvenance,
pub provenance_level: ProvenanceLevel,
pub dependency_bot: DependencyBot,
pub health_badges: Vec<HealthBadge>,
pub license: String,
pub docs_site: DocsSite,
pub extra_fields: Map<String, Value>,
pub warnings: Vec<String>,
}Expand description
The canonical, fully-defaulted, targets-expanded OSS-RELEASE.md contract.
This is the exact shape of SCHEMA.md §4 (the stable machine contract). Every
field is present and defaulted; versioning is the base enum with the
calver pattern split into Self::versioning_pattern; extra_fields holds
preserved unknown frontmatter keys (forward-compat); warnings holds the
non-fatal notes. Field order matches SCHEMA.md §4 for readable output; JSON
consumers key-access, so order is not part of the contract.
Fields§
§schema_version: u32Contract schema version (bounded by KNOWN_SCHEMA_VERSION).
status: StatusApproval gate.
maturity: MaturityMaturity dial.
ecosystems: Vec<Ecosystem>Packaging ecosystems, de-duplicated to canonical order.
targets: Vec<Target>Concrete registry publish targets. Expanded from ecosystems when the
targets key is OMITTED (or written as a bare targets: / targets: null,
which read as absent); an explicit empty targets: [] — the literal empty
sequence — is the author’s authoritative “never publish anywhere” and is
honored as an empty set (not re-expanded), the machine-readable way to
declare a version-tracked but unpublished repo. An empty set is a valid,
honored state, not a misconfiguration. This re-meaning of the specific []
value did NOT bump KNOWN_SCHEMA_VERSION deliberately: the serialized
shape is a JSON array either way (an empty array is already producible today
by a contract with no ecosystems), so every consumer that reads targets
already handles [] — no reader breaks.
distributions: Vec<Distribution>The binary-distribution blocks (cargo-dist / goreleaser binaries +
installers + Homebrew tap). Empty for a registry-only repo, one entry for
a single-binary repo, one per independently-distributed binary for a
monorepo (each tagged by Distribution::package). Always a JSON
array in canonical output. Coexists with targets — a cargo-dist repo has
both. A bare distribution: mapping in the source deserializes as a
one-element list (v1 back-compat); a distributions: sequence carries many.
versioning: VersioningBaseBase versioning scheme.
versioning_pattern: Option<String>The calver pattern string, or null for non-calver schemes.
changelog: ChangelogChangelog configuration.
conventional_commits: boolWhether /oss-release-cut may derive the bump from commit types.
release: ReleaseRelease model + layout.
contribution_provenance: ContributionProvenanceContributor sign-off requirement.
provenance_level: ProvenanceLevelBuild-provenance level.
dependency_bot: DependencyBotDependency-update bot.
health_badges: Vec<HealthBadge>README health badges.
license: StringSPDX license id/expression.
docs_site: DocsSiteOptional documentation-site generator.
extra_fields: Map<String, Value>Preserved unknown frontmatter keys under a known schema_version
(forward-compat); never dropped.
An EMPTY map is OMITTED from canonical JSON (skip_serializing_if), so a
contract with no unknown keys carries no extra_fields key at all — the
“additive = absent-by-default” migration rule holds literally, and a
populated map serializes exactly as before. Kept symmetric with
Distribution::extra_fields (both omit-when-empty).
warnings: Vec<String>Non-fatal notes (aspirational draft producers, the unknown-field report).