On this page

Semantic value

Derived additions: value.is.* classification flags and value.generated planned representations. See derived.md.

Used by: schema/composite fields, operation/workflow ports, event payloads, and other ValueRef-like semantic carriers

This is the authoritative contract for a reusable semantic value carried by a field, port, event payload, result, or similar ValueRef-like semantic carrier.

A field value is not a "constraint" and not an ambiguous reference. It has one explicit structural kind:

text
property
schema
unknown
dynamic

Carrier-local semantics stay on the owning context. For example, field optionality/nullability/array/default/relation/query rules remain on a field; port ordering/direction stays on the port.

Context tree

Context pathTypeMeaning
value.kindproperty|schema|unknown|dynamicPrimary field-value discriminator.
value.propertyPropertySemanticValueContext|nullReusable property meaning when kind=property.
value.schemaSchemaContext|nullFull schema context from ../schema.md when kind=schema.

No nested payload exists for unknown or dynamic.

PropertySemanticValueContext

A property-backed field has a second discriminator because reusable properties have several semantic kinds:

Context pathTypeMeaning
value.property.kindprimitive|enum|composite|literal|union|record|tuple|generic|temporalExact reusable-property kind.
value.property.primitivePrimitivePropertyContext|nullFull context from ../property.primitive.md.
value.property.enumEnumPropertyContext|nullFull context from ../property.enum.md.
value.property.compositeCompositePropertyContext|nullFull context from ../property.composite.md.
value.property.literalLiteralPropertyContext|nullFull context from ../property.literal.md.
value.property.unionUnionPropertyContext|nullFull context from ../property.union.md.
value.property.recordRecordPropertyContext|nullFull context from ../property.record.md.
value.property.tupleTuplePropertyContext|nullFull context from ../property.tuple.md.
value.property.genericGenericPropertyContext|nullFull context from ../property.generic.md.
value.property.temporalTemporalPropertyContext|nullFull context from ../property.temporal.md.

Exactly one property-kind branch is active and it must match value.property.kind.

The nested property context is the same context contract used when that property is selected directly. It is not a reduced copy and must not be redefined here.

Property example

A decimal property field conceptually exposes:

text
field.value.kind
    property

field.value.property.kind
    primitive

field.value.property.primitive
    → full PrimitivePropertyContext
      including:
        type = number
        kind = decimal
        constraints.precision
        constraints.scale
        constraints.range
        ...

A database-model template can therefore read:

hbs
{{#if (eq field.value.property.kind "primitive")}}
  {{#if (eq field.value.property.primitive.kind "decimal")}}
    precision:
    {{field.value.property.primitive.constraints.precision}}, scale:
    {{field.value.property.primitive.constraints.scale}}
  {{/if}}
{{/if}}

without performing a second registry lookup.

Schema example

A field carrying another schema exposes:

text
field.value.kind = schema
field.value.schema = full SchemaContext

A template can use only identity:

hbs
{{field.name.camel}}: {{field.value.schema.name.pascal}};

or explicitly request deeper nested schema facts if its generation genuinely needs them.

The full SchemaContext contract is reused from ../schema.md; it is not copied here.

Unknown and dynamic

text
unknown
    concrete value type is intentionally unspecified/opaque

dynamic
    runtime value is intentionally permitted to vary

Target packs choose their target-language representation.

Dryv does not convert either one into a fake property/schema reference.

Demand-driven and recursive safety

"Full context of X" defines the available typed vocabulary, not eager expansion.

If a template requests only:

text
schema.fields.*.value.schema.name.pascal

Dryv only needs the nested schema name.

If a template explicitly requests nested fields, those paths may be materialized under the same SchemaContext contract.

Template analysis and context resolution must keep reference expansion bounded and cycle-safe so schema↔schema or composite↔composite relationships cannot recursively explode context.

Runtime IR implications

The current IR already distinguishes field kinds:

text
property
schema
unknown
dynamic

That distinction should remain canonical.

What needs improvement is the inspection/context layer:

  • property references must resolve to the complete matching reusable-property semantic context;
  • schema references must resolve to the same SchemaContext vocabulary;
  • templates must not parse reference prefixes to discover which one they received;
  • field-local usage semantics must remain separate from reusable value-definition semantics.

Reuse outside fields

The same contract is reused unchanged:

text
SchemaFieldContext.value
CompositeFieldContext.value
OperationPortContext.value
WorkflowPortContext.value
EventContext.payload

A carrier never replaces this rich semantic value with a bare link merely because it is not a schema field.

Search in