Skip to main content

Module catalog

Module catalog 

Source
Expand description

The canonical Workshop catalog.

The catalog is the locale-independent semantic identity layer between textual Workshop spellings and WIR. Every builtin has a canonical id and a Kind; locale tables map canonical identities to client spellings and back, so parser, emitter, analyzer, and tooling never embed locale-specific strings as identity.

Locale coverage is data ([docs/adr/0001-catalog-boundaries.md]): the primary locale (the first declared one, en-US) is complete — every entry and enum member carries a primary-locale alias — while additional declared locales may be partially covered. Missing target-locale mappings fail explicitly at conversion/emission time; the catalog reports exact per-locale coverage machine-readably (Catalog::locale_coverage, Catalog::identity).

The catalog dataset declares its own version and a deterministic content digest (sha256) recomputed by the catalog pipeline (workshop-catalog-gen build); Catalog::load rejects a digest mismatch, so dataset changes are deliberate and reproducible.

Structs§

Catalog
The validated canonical Workshop catalog.
CatalogEntry
One catalog builtin.
CatalogIdentity
The machine-readable catalog identity (ADR-0001 Decision 5): the four identities that evolve independently — implementation version, catalog dataset version plus content digest, locale coverage, and target evidence — plus the data provenance record. Serialized with the ADR’s kebab-case identity names.
EnumDomain
One enum value domain (e.g. Color, Beam).
EnumMember
One enum member within a domain.
Locale
A normalized Workshop client locale, e.g. en-US.
LocaleCoverage
Per-locale mapping coverage: how many canonical entries (builtins, localized preset identities, and enum members) carry a mapping for the locale out of the declared total.
LocalizedStringEntry
A locale-independent identity for a preset used by the Workshop String value. Unlike a custom Value::String, this identity must resolve through reviewed client-locale aliases before it can be parsed or emitted.
ParamCoercions
Literal substitutions accepted at one parameter position and normalized into the parameter’s declared semantic type before it enters WIR.
Provenance
Provenance of the catalog data.
TargetMeta
Target-format metadata recorded in the catalog.

Enums§

Kind
The kind of a catalog builtin.

Constants§

CATALOG_DATA
The embedded catalog data.

Functions§

build_canonical
Rebuild the canonical catalog form with a fresh content digest: validate, canonicalize, and (re)write the digest field. Byte-idempotent, so the committed dataset and its digest are reproducible from the data file.
canonicalize
Canonicalize catalog data: parse, validate, and re-serialize deterministically (object keys sorted, stable formatting). Re-running on the same input produces byte-identical output, so the data pipeline is reproducible. Validation intentionally skips digest verification so a stale digest can be repaired by build_canonical.
content_digest
The deterministic content digest of catalog data: sha256 of the canonical (sorted-key, pretty) serialization of the parsed content with the self-referential digest field removed. Independent of file formatting; changes whenever any semantic content changes.