On this page

property.primitive

Intent

A reusable primitive semantic value suitable for validators, serializers, database mappings, SDK scalars, and value aliases.

Exact selection subject:

yaml
subject: property.primitive

The current Runtime IR is evidence, not authority. Target improvements needed for a usable template contract are called out explicitly.

Scope envelope

ScopeContext
eachproperty.primitive: PrimitivePropertyContext
allproperties.primitives: PrimitivePropertyContext[]
collection candidatescollects.group, collects.feature

For collects.<dimension>, the singular collector is added beside the plural selected-subject array. A collector is valid only when ownership is semantically provable.

Context tree

Context pathTypeMeaning / template use
property.primitive.idstringOpaque stable semantic identity.
property.primitive.nameNameContextStable semantic identity and finite naming variants.
property.primitive.descriptionstring|nullHuman semantic description.
property.primitive.tagsstring[]Semantic classifiers; empty when none.
property.primitive.explanationsExplanationContext[]Advisory usage/security/implementation notes.
property.primitive.groupSemanticLinkContext|nullOwning semantic group.
property.primitive.featureSemanticLinkContext|nullCanonical owning feature, when present.
property.primitive.lifecycleLifecycleContextDeprecation/removal semantics.
property.primitive.examplesCanonicalValue[]Valid examples.
property.primitive.typestring|number|booleanStructural discriminator.
property.primitive.kindstring|nullRefinement such as text, format, integer, decimal, float, double.
property.primitive.formatstring|nullNamed semantic format. For strings it's one of the canonical StringFormat values below. Number formats (such as int32) are separate.
property.primitive.moneyMoneyContext|nullFor format: money: currency (ISO 4217 or null) and minor_units (true when the amount counts cents). Null otherwise.
property.primitive.constraints.lengthLengthContext|nullExact/min/max length.
property.primitive.constraints.patternPatternContext|nullString matching rules.
property.primitive.constraints.rangeRangeContext|nullNumeric min/max.
property.primitive.constraints.multiple_ofnumber|nullNumeric divisibility.
property.primitive.constraints.bitsinteger|nullInteger width.
property.primitive.constraints.unsignedboolean|nullUnsigned integer semantics.
property.primitive.constraints.precisioninteger|nullDecimal precision.
property.primitive.constraints.scaleinteger|nullDecimal scale.

Usage rules

  • Group constraints under one predictable subtree even though current IR spreads several values across the property root.
  • type is structural; kind is a refinement, not a semantic role.

Runtime IR implications to audit

  • Properties should gain universal semantic metadata.
  • Consider normalizing primitive constraints canonically.

Template example — Jinja / Python constrained scalar

jinja
{% if property.primitive.type == "string" %}
{{ file.symbol }} = Annotated[
    str,
    StringConstraints(
        min_length={{ property.primitive.constraints.length.min }},
        max_length={{ property.primitive.constraints.length.max }},
    ),
]
{% endif %}

The example uses semantic context only. Any renderType/render_type helper shown is a pack-owned macro/partial consuming the documented TypeContext, not hidden Dryv context.

Audit questions

  • Can a real property.primitive pack generate code without parsing raw IR storage conventions?
  • Is any field here present only because the current IR happens to store it?
  • Does any nested item need first-class selection of its own?

String formats

String formats are a closed vocabulary (StringFormat). Anything else is a text property with a pattern.

uuid, ulid, email, url, uri, hostname, ipv4, ipv6, phone (loose), e164 (strict), slug, hex-color, base64, hex, jwt, semver, mime-type, locale, language-tag, country-code, currency-code, path, file-path, file-name, regex, html, markdown, json, yaml, xml, csv.

uuid, ulid, base64, hex and jwt are opaque: they can't carry length or pattern constraints. Dates and times are never string formats; use temporal properties.

Search in