|
tin
1.5.9
|
verified-tsm.machine.v1 is the machine IR used by tin tooling. YAML is the recommended hand-authored form; JSON is the canonical automation artifact for generators, diagram exporters, validation, replay fixtures, and integrations.
Use YAML for compact reviews, JSON when another tool produces or consumes the machine, and C++ or the .hsm DSL when behavior should live directly in source.
YAML comments use # and are discarded before validation or generation.
Optional top-level fields currently used by examples include:
copyrightlicensestateseventstargettransportsruntimeevidenceThe validator requires schema, machine.initial, and transitions. If machine.name is omitted, the CLI derives it from the source filename. If states or events are omitted, the CLI infers them from transition sources, targets, and event names.
machine declares the initial state. name and namespace are optional generator metadata.
namespace is dotted in JSON and lowers to C++ namespace separators when a C++ skeleton is generated.
Flat states only need a name:
Composite states name an initial child. Children name their parent. Dotted names encode hierarchy:
Supported state metadata:
name: required state identifier;parent: parent state for hierarchical states;initial: initial child selected when a composite state is entered;kind: normal, choice, fork, or join;region: orthogonal-region metadata for tooling;entry: entry callback name;exit: exit callback name.Payload-free events only need a name:
Payload events declare fields. Current generator field types are bool, int32, uint32, float32, float64, string, and bytes.
Each transition row names source state, event, target state, and optional behavior hooks.
For payload-free transitions with no hooks, YAML can use a compact three-token row. The order is source, event, target:
Supported transition metadata:
source: required source state;event: required event;target: required target state;kind: external, local, or internal;guard: guard callback name;action: action callback name.The legacy JSON spellings from and to are still accepted on input. Code generation normalizes authoring notes away and uses only semantic fields.
YAML should use normal # comments. JSON has no comment syntax, so comment and comments fields are allowed at the top level, on machine, on explicit state/event declarations, and on transition rows. They are intentionally ignored by code generators.
The optional runtime object documents the intended runtime configuration for generators and review tools.
The current C++ generator treats this as metadata. Production code still selects concrete runtime policies in C++.
Supported runtime vocabulary:
dispatch_model: direct, queued, or per_region_queued;queue.storage.kind: static_storage, target_storage, freertos_queue, or zephyr_queue;queue.storage.capacity: positive integer queue capacity;queue.overflow: reject_newest, drop_oldest, or overwrite_latest;task_count: non-negative integer task count;timer_slots: non-negative integer timer slot count.The optional target object records the deployment profile and compile-time configuration a generated artifact is intended to match.
profile names the tin platform profile. tick.rep and tick.period mirror the TSM_TICK_REP and TSM_TICK_PERIOD compile-time configuration. Constraint values are boolean review flags that target adapters and CI checks can inspect.
The optional transports array describes external handoff points that tools or adapters can inspect.
Validation checks that transport event names refer to declared events and that local transport metadata uses a local link.
The optional evidence object gives verification and trace tooling a place to record obligations.