Skip to content

API Contract Model

An api.* contract defines one coherent endpoint surface. It owns endpoint names, endpoint kinds, payload message references, frame policy, timing policy, state ownership, failure semantics, authority, limits, and conformance level.

Endpoint Kinds

Kind Runtime shape Use for
Event publish or subscribe stream observations, state, telemetry, and fanout
Control periodic timed exchange commands with period, deadline, validity, and overrun sensitivity
Procedure bounded request and response non-periodic synchronous actions or queries
Operation long-running command feedback, cancellation, result, and terminal state

Endpoint kind is enforced. A Procedure cannot be registered in place of a Control endpoint, and a required timed endpoint cannot silently accept an untimed request.

Runtime Timing Envelope

Message payloads do not duplicate transport timestamps.

Events expose three distinct times.

Field Meaning
observed_at_sync_ns when the source data was acquired or observed
published_at_sync_ns when the publisher committed the Event
received_at_sync_ns when the subscriber received it

Controls and timed requests expose the execution path.

Field Meaning
generated_at_sync_ns when the command intent was produced
sent_at_sync_ns when it entered transport
execute_at_sync_ns requested execution time
valid_until_sync_ns last acceptable execution time
accepted_at_sync_ns provider acceptance time
scheduled_for_sync_ns provider schedule target
dispatched_at_sync_ns dispatch to implementation or device boundary
sampled_at_sync_ns time of the response sample, when applicable
completed_at_sync_ns completion time
responded_at_sync_ns response transport time
lateness_ns execution lateness relative to schedule

This separates data acquisition time from middleware transit time and execution time without proliferating stamped payload variants.

Frame Rule

  • fixed frames belong in API semantics
  • dynamic frames belong in the domain message that owns the value
  • pure spatial types do not carry a frame field
  • a provider must reject or transform an unsupported frame according to its API contract

Contract Metadata

Public API contracts declare frames, timing, state_model, failure_semantics, authority, limits, and conformance. Controls also declare endpoint timing behavior such as periodicity, validity, scheduling, and late handling.

Full Inventory

See the generated API Contract Reference for every official endpoint and message reference.