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:
docs/LLM_SPEC.md: https://github.com/HammerHeads-Engineers/spx-examples/blob/main/docs/LLM_SPEC.mddocs/MODEL_LANGUAGE.md: https://github.com/HammerHeads-Engineers/spx-examples/blob/main/docs/MODEL_LANGUAGE.md
Key directories (real paths)
Models:
library/domains/<domain>/<vendor|generic>/*.yamlExample (SCPI):
library/domains/measurement_instruments/generic/multimeter__scpi.yamlExample (Modbus):
library/domains/thermal_controllers/generic/thermal_controller__modbus.yamlExample (MQTT):
library/domains/iot/generic/environment_sensor__mqtt.yamlExample (BLE):
library/domains/ble/generic/temperature_sensor__ble_gatt.yaml
Shared helpers used by models:
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

