Skip to main content

Module spec

Module spec 

Source
Expand description

Artifact specs, loaded from the vendored, language-neutral asdecided-spec registry embedded at build time. Field, section, and map order are preserved everywhere (PORT-CONTRACT.d/04 §1, PORT-CONTRACT.d/09, PORT-CONTRACT.d/05 §3.1).

The Python registry ARTIFACT_SPECS is an ordered tuple of 5 specs: requirement, decision, roadmap, prompt, design. That order is load-bearing (classification tie-break, available_schemas(), registry iteration). All maps below preserve their JSON insertion order via Vec<(K, V)> so lookups and iteration match Python dict semantics.

Structs§

ArtifactSpec
One artifact type’s schema. Field names/order mirror the Python dataclass.

Constants§

RELATIONSHIP_SECTIONS
The canonical relationship-section vocabulary (references.py, PORT-CONTRACT.d/05 §3.1). Order is load-bearing: it is the canonical aggregation order for stats/relationship counts. Each entry is (canonical space name, snake key).

Functions§

available_schemas
available_schemas() = the spec names in registry order.
canonical_value
canonical_value tail: match candidate against the allowed vocabulary by casefold equality — the canonical allowed spelling wins, otherwise the candidate passes through. Callers supply their own first-line extraction.
relationship_descriptions
Canonical relationship-section descriptions, in declared order (relationship_descriptions from the JSON; PORT-CONTRACT.d/05).
snake
_snake(section) = section.replace(" ", "_") (spaces -> underscores only).
spec_for
The spec for a canonical type name, or None for "unknown" / unregistered.
specs
The ordered spec registry (ARTIFACT_SPECS): requirement, decision, roadmap, prompt, design — in that exact order.