Repo-as-spec (spx-examples)
Use spx-examples as the canonical reference for:
directory layout and naming,
YAML structure and expressions,
catalog metadata (what shows up in installers/profiles),
MiL test conventions.
Spec files (GitHub, main):
Repo root (browse): spx-examples/tree/main
Source pinning rule
When preparing automated docs/model updates, do not rely on floating main references alone. Capture and report the exact source commit, for example:
git -C ../spx-examples rev-parse origin/developUse that SHA in page metadata or PR notes so review is reproducible.
Evidence matrix (required for substantial updates)
For larger updates, include a compact table in PR notes:
<page>
<path-or-url>
<sha>
<rationale>
Key directories (real paths)
Models:
library/domains/<domain>/<vendor|generic>/*.yamlBrowse: library/domains
Example (SCPI):
multimeter__scpi.yamlExample (Modbus):
thermal_controller__modbus.yamlExample (MQTT):
environment_sensor__mqtt.yamlExample (BLE):
temperature_sensor__ble_gatt.yaml
Shared helpers used by models:
extensions/Browse: extensions
Catalogs:
library/catalog/models.yaml(required for every new model)library/catalog/domains.yamllibrary/catalog/services.yamllibrary/catalog/industries.yaml
Validation tooling:
tools/validate_models.pyTests:
tests/shared/integration/(shared integration coverage)tests/devices/(SUT wrappers used by tests)tests/packs/<pack>/(pack-level test suites)
“Copy the closest thing” rule
Pick the closest existing model under
library/domains/….Copy it and rename the file to
lower_snake_case(keep the protocol suffix pattern, e.g.__modbus,__mqtt,__ble_gatt,__scpi).Align
name:with the file stem for new/updated models.Keep YAML structure consistent with
docs/MODEL_LANGUAGE.md(top-level keys, list vs mapping shapes).
Required updates for new models
When you add a new model file:
Add a catalog entry in
library/catalog/models.yaml(newid,name,path,domain,protocols,services,packages,profiles).Add/update tests in
tests/(shared tests or pack tests, depending on where the model belongs).Run validation and tests:
python tools/validate_models.py(printsModel validation passed.on success)pytest
What to keep stable
Determinism: time is driven explicitly from tests (MiL). Avoid wall-clock sleeps for simulation behavior.
Ports and services: if a model relies on a protocol adapter, ensure
docker-compose.ymlexposes the required ports/services for the test suite.Terminology: use consistent terms across docs/tests: SPX Server, Models, Instances, Scenarios, MiL tests, Snapshots.
Last updated

