Skip to documentation
ReferenceEvent model

Event model

Inheritance and functions

Record the extension points without inventing their execution semantics.

Format definition

Define bounded conditions/effects and reproducible library composition instead of executable script text.

Portable format · Suite implementation support

Parameters

events.effects[].kind

set-variable | trend-variable | reveal | set-flag | cancel-event | set-monitor-connection

Required

Closed operation vocabulary; each kind has its own required operands as defined in this section.

events.conditions[]

{ id: ID, all: Predicate[] }

Required; may be empty

All predicates must be true; empty all is explicitly true. No recursive or executable expression text.

events.conditions[].all[]

{ targetId: Variable ID | Flag ID, operator: eq | ne | lt | lte | gt | gte, value: number | boolean }

Required within a condition

Operand types must match the target. Boolean flags support only eq/ne; numeric comparisons use the variable's declared unit.

events.effects[].id

ID

Required

Identity used by ordered effect references.

events.effects[].targetId

ID

Required

set-variable/trend-variable target a variable; set-flag targets a flag; reveal targets a history entry, observation, or result; cancel-event targets a schedule; set-monitor-connection targets a patient.

events.effects[].value

number | boolean

Required for variable/flag/monitor-connection effects; prohibited for reveal/cancel

Absolute replacement or trend target, never an implicit increment. Numeric variable effects require a matching unit field.

events.effects[].unit

string

Required for numeric set-variable/trend-variable effects; prohibited for set-flag, reveal, cancel-event, and set-monitor-connection

Unit for a numeric variable target. It must match the target variable's declared unit; the format does not infer conversions.

dependencies[]

{ id: ID, scenarioId: ID, revision: positive integer, sha256: string }

Optional; default []

Pinned library content; digest is 64 lowercase hex characters. Floating latest dependencies are prohibited.

composition.overrides[]

{ targetId: ID, path: JSON Pointer, value: JSON value }

Optional; default []

Explicit overrides against a resolved dependency. Paths must exist; object/array values replace in full. No inferred deep merge.

Behavior and validation

  • Evaluate conditions against a frozen snapshot per operation. Unknown targets, wrong types, and unsupported operators invalidate the document. There is no network, filesystem, random, or arbitrary function execution.
  • Each effect kind has a closed operand shape: set-variable and trend-variable target numeric variables and require value/unit; set-flag targets a flag and requires boolean value; reveal and cancel-event prohibit value and unit; set-monitor-connection requires a Patient ID target, channel, and boolean value, and prohibits unit, durationSeconds, and interpolation. Consumers reject kind-specific fields that do not match the declared kind.
  • Effect ID arrays and action outcomes are ordered collections wherever this specification says operations or outcomes are ordered. Preserve their declared order; do not sort or deduplicate them during import or export.
  • Resolve dependencies topologically, reject cycles, verify bytes against pinned digests, then apply overrides in declared order. Duplicate writes to the same target/path are errors; do not silently choose a winner.
  • Exports for execution contain a fully resolved snapshot plus dependency provenance. Copy-versus-link is therefore settled at package creation; future library updates do not mutate an already exported scenario.

Shared format conventions · All format elements · Download specification

Implementation requirements

  • Library identity and dependency resolution.
  • Explicit override and merge precedence, including unknown fields.
  • Cycle detection and a policy for missing base definitions.
  • A constrained behavior language with deterministic execution and no implicit code evaluation.
  • Ordering rules for simultaneous state changes, timed events, results, and rewards.
  • Conformance examples that preserve content across implementations.