On this page

operation

Derived additions: facets.http.is.*, inputs[].is.*, input_groups.<kind>[], path.effective and path.segments[]. See derived.md.

Intent

A callable semantic behavior supporting service methods, controllers/routes, SDK calls, handlers, access controls, execution semantics, schedules, failures, and events.

Exact selection subject:

yaml
subject: operation

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

Scope envelope

ScopeContext
eachoperation: OperationContext
alloperations: OperationContext[]
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
operation.idstringOpaque stable semantic identity.
operation.nameNameContextStable semantic identity and finite naming variants.
operation.descriptionstring|nullHuman semantic description.
operation.tagsstring[]Semantic classifiers; empty when none.
operation.explanationsExplanationContext[]Advisory usage/security/implementation notes.
operation.groupSemanticLinkContext|nullOwning semantic group.
operation.featureSemanticLinkContext|nullCanonical owning feature.
operation.rolecreate|update|delete|detail|list|search|validate|transform|action|nullSemantic role.
operation.inputOperationInputContext | nullThe single input: kind (fields or schema), value (the schema, for a schema input), and fields[] with name, value (null for unknown/dynamic schema fields) and optional. Always named: a schema input lists the schema's fields.
operation.outputOperationOutputContext | nullThe single output: value.
operation.failuresSemanticLinkContext[]Declared failure contracts.
operation.emitsSemanticLinkContext[]Emitted events.
operation.access.authenticatedbooleanAuthentication requirement.
operation.access.policiesSemanticLinkContext[]Required policies.
operation.execution.modesync|asyncExecution mode.
operation.execution.timeout.secondsinteger|nullTimeout.
operation.execution.rate_limitRateLimitContext|nullLimit/window.
operation.execution.cache.ttl.secondsinteger|nullCache lifetime.
operation.execution.transaction.requiredboolean|nullTransaction requirement.
operation.execution.retryRetryContext|nullAttempts/backoff.
operation.execution.idempotency.keyOperationPortLinkContext|nullNamed input port used as idempotency key.
operation.execution.audit.requiredboolean|nullAudit requirement.
operation.execution.invalidatesSemanticLinkContext[]Invalidated operations.
operation.facets.http.methodHttpMethod|nullHTTP method.
operation.facets.http.path.localstring|nullOperation-declared path, unchanged from Runtime IR.
operation.facets.http.path.effectivestring|nullDerived full path: active application HTTP root + ordered owning-group HTTP roots + operation-local path.
operation.facets.http.inputsHttpInputBindingContext[]Input field (or whole schema input)→path/query/header/cookie/body/multipart/form bindings. port.field is the field name, or null for the whole input; port.name is the field name, or input.
operation.facets.http.outputsHttpOutputBindingContext[]Output→status/representation bindings.
operation.facets.http.failuresHttpFailureBindingContext[]Failure→status/representation bindings.
operation.facets.websocket.path.localstring|nullOperation-declared WebSocket path.
operation.facets.websocket.path.effectivestring|nullDerived full WebSocket path using the same scope-root composition rule.
operation.facets.scheduleScheduleFacetContext|nullInterval/daily schedule.

Usage rules

  • Ports have stable indices and an optional canonical name; unnamed ports project as input_0, output_0.
  • path.local preserves the authored operation path. path.effective is the Engine-composed route using the active application root, root-to-leaf owning-group HTTP roots, then the local path. Packs that mount routers beneath their own prefixes may still intentionally use local; external API descriptions and direct route registrations should normally use effective.

Runtime IR implications to audit

Effective path resolution is derived from existing canonical scope facts; it does not add Runtime IR fields.

Template example — Handlebars / controller method

The controller flattens the input into one parameter per HTTP binding, then passes the service one input object:

hbs
@{{operation.facets.http.method}}("{{operation.facets.http.path.local}}") async
{{operation.name.camel}}(
{{#each operation.facets.http.inputs}}
  {{port.name.camel}}:
  {{renderValue port.value @root.file.dependencies}}{{#unless
    @last
  }},{{/unless}}
{{/each}}
) { return this.service.{{operation.name.camel}}({
{{#each operation.facets.http.inputs}}{{port.name.camel}}{{#unless @last}},
  {{/unless}}{{/each}}
}); }

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

  • Are named ports the correct canonical improvement?

Facet cardinality

Initial context cardinality is intentionally singular:

text
operation.facets.http       0..1
operation.facets.websocket  0..1
operation.facets.schedule   0..1

If one behavior must be exposed through several independent HTTP bindings, model those as distinct operations that may share underlying semantic behavior rather than turning the context path into an array.

Search in