Skip to content
This repository was archived by the owner on Nov 14, 2026. It is now read-only.

feat!: add simulation data and verification report schema 3 (WOT-04) - #4

Merged
gavinying merged 1 commit into
mainfrom
wot-04-simulation-data
Nov 12, 2026
Merged

gavinying merged 1 commit into
mainfrom
wot-04-simulation-data

Conversation

@gavinying

Copy link
Copy Markdown
Contributor

Defines simulation data, the declarative device values Modsim loads with --data, and fixes the verification report schema for the catalog's fixed model.tm.json path. Version 0.4.0a1.

Simulation data

  • schemas/simulation-data-1.json: version "1", initial (static values, scalars or arrays of scalars), generators (constant, sine, ramp, noise), bindings, tick, seed, writePolicy. No other fields, so simulation data never carries code; behavior scripts stay a simulator concern.
  • load_simulation_data(document, title=None, properties=None) returns a SimulationData. A document without version is a Modpoll --export snapshot: the device entry titled like the model (or the only entry) becomes initial; null points are left out and listed in unread; timestamp counts as a point only when the model has one. With properties, every referenced name must exist.
  • scaled_raw(value, multiplier) recovers the raw integer of a scaled value when it is an exact decimal multiple (230.1 with 0.1) or exactly the float Modpoll computes (230.10000000000002). No tolerance threshold.
  • modpoll-wot validate FILE --kind data checks data documents and snapshots.
  • profile.md gains a Simulation data section; snapshots are instance data and stay on the user's computer.

Verification report schema 3

Schema 2 required model.path to match models/*.tm.json. Open Modbus Catalog schema 7 keeps each baseline Thing Model at model.tm.json, so catalog reports could not validate. Schema 3 drops model.path; product ID and catalog commit identify the model. Schema 2 had no consumers and is removed.

Checks

  • mise run check: 96 tests, build, and installed-wheel smoke checks including validate --kind data on a snapshot.
  • Consumers were tested against this wheel locally: modsim 2.0.0a7 (113 tests plus an export → replay → read test with scaled points) and modpoll 2.0.0a6 (142 tests including modsim interop). Their pins move to 0.4.0a1 after this is published.

🤖 Generated with Claude Code

- Simulation data schema 1 (version, initial, generators, bindings, tick,
  seed, writePolicy) without executable code, load_simulation_data and
  `modpoll-wot validate --kind data`. A Modpoll --export snapshot, which has
  no version key, is accepted: the matching device's values become initial,
  unread (null) points are left out and listed.
- scaled_raw recovers the raw integer of a scaled value when it is an exact
  decimal multiple or exactly the float Modpoll computes, so exported values
  such as 230.10000000000002 with 0.1 can be served again.
- Verification report schema 3 drops model.path: catalog Thing Models sit at
  model.tm.json, so product ID and catalog commit identify them. Schema 2
  had no consumers and is removed.
- Version 0.4.0a1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gavinying
gavinying merged commit de31da3 into main Nov 12, 2026
5 checks passed
@gavinying
gavinying deleted the wot-04-simulation-data branch November 12, 2026 03:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant