Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/preview-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Modsim 2.0.0a2 preview candidate
# Modsim 2.0.0a3 preview

This preview pins modpoll-wot 0.2.0a4. A local TCP simulator can load a full
profile 0.2 TM with an audit plan or its independently derived public audit TM.
Tests seed the same known values and verify the public model exposes only the
selected read spans.

### Previous preview

#### Modsim 2.0.0a2

This candidate uses published modpoll-wot 0.2.0a2 and immutable modbus-models-v1
inputs. Device mappings and contribution workflows now live in modbus-models;
Expand Down
13 changes: 13 additions & 0 deletions docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ run the preview workflow manually on v2 with its `tag` input. This skips all
publishing jobs, installs the existing PyPI wheel, uses fixtures from that exact
tag and runs the current acceptance tooling. It does not replace packages or
images. Record the separate validation run and tooling SHA.

### Audit model compatibility

Use the approved full TM or its public audit TM as the configuration for a
local TCP simulator. Seed known values for the selected properties with
`--initial PROPERTY=JSON` or `--initial-file`. Public audit TMs expose only the
selected read spans. Use identical initial values for the shared properties
when comparing full and public models.

Stop a foreground simulator with Ctrl-C. Restart with the same TM and initial
values to restore the original vector. A managed deployment can use
`modsim down -f deployment.yaml` and `modsim up -f deployment.yaml` on POSIX.
These checks verify software interoperability with the selected fixture.
2 changes: 1 addition & 1 deletion modsim/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0a2"
__version__ = "2.0.0a3"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "modsim"
version = "2.0.0a2"
version = "2.0.0a3"
description = "A Simple Modbus TCP Device Simulator used for modpoll tool"
authors = [{ name = "Ying Shaodong", email = "helloysd@gmail.com" }]
readme = "README.md"
requires-python = ">=3.10,<4.0"
dependencies = [
"pymodbus~=3.16.1",
"modpoll-wot==0.2.0a2",
"modpoll-wot==0.2.0a4",
"jsonschema>=4.21,<5",
"PyYAML>=6,<7",
]
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/io-module/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"source_sha256": "4c2aee3334faf6622f4ee34a23108fa0ec100a6b3110a78200eee79da8935596",
"generator": {
"package": "modpoll-wot",
"version": "0.2.0a2"
"version": "0.2.0a4"
},
"instance": {
"host": "127.0.0.1",
Expand Down
29 changes: 29 additions & 0 deletions tests/test_wot.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,32 @@ def test_defaults_and_constraints_are_respected(tmp_path):
args.model_initialization["origins"]["AI0_RAW"]
== "synthetic type/constraint fallback"
)


@pytest.mark.integration
def test_full_and_public_audit_models_share_selected_vectors(server):
import modpoll_wot

derive = getattr(modpoll_wot, "derive_audit_tm", None)
if derive is None:
pytest.skip("requires the independently built audit producer candidate")
source = model("HoldingRegister", 10, ["identity", "private_point", "status"])
source["modpoll:audit"] = {"identity": ["identity"], "status": ["status"]}
artifact = derive(json.dumps(source).encode(), title="Audit vector")
full = server(source, "--initial", "identity=4660", "--initial", "status=43981")
public = server(
json.loads(artifact.payload),
"--initial",
"identity=4660",
"--initial",
"status=43981",
)
for client in (full, public):
assert client.read_holding_registers(10, count=1, device_id=1).registers == [
4660
]
assert client.read_holding_registers(12, count=1, device_id=1).registers == [
43981
]
assert public.read_holding_registers(11, count=1, device_id=1).isError()
assert public.write_register(12, 7, device_id=1).isError()
11 changes: 6 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading