Skip to content

refactor: merge modsim and modpoll-wot into a uv workspace (TOOL-01) - #139

Merged
gavinying merged 167 commits into
v2from
tool-01-workspace
Nov 13, 2026
Merged

gavinying merged 167 commits into
v2from
tool-01-workspace

Conversation

@gavinying

Copy link
Copy Markdown
Collaborator

Summary

Merges modsim (v2, 32b29ab) and modpoll-wot (main, 7c2d9d4) into this repository with their full history, as one uv workspace. The three packages keep their PyPI names and versions and are released separately. No protocol, schema, CLI or package behaviour changes.

  • packages/modpoll, packages/modsim, packages/modpoll-wot. Each tree is byte-identical to its repository at the freeze point; git log --follow reaches the original commits. Imported tags carry the package name (modsim-v2.0.0a12, modpoll-wot-v0.6.0a2); modpoll's own tags are unchanged.
  • One uv.lock. Inside the workspace modpoll and modsim take modpoll-wot from packages/modpoll-wot; uv build --no-sources keeps the published modpoll-wot== pin.
  • CI and releases run from the root: one CI and one release workflow per package, scoped by path. Release tags become modpoll-v*, modsim-v*, modpoll-wot-v*. modsim's job names gain a modsim prefix so modpoll's release guard, which reads check names, never sees them.
  • Interop jobs keep their pinned commits and releases; moving them to the workspace's own code is SIM-08 after the migration.
  • Images build from the repository root with the workspace lock. The modsim image installs the same packages as before; the modpoll image differs only in typing-extensions 4.15.0 → 4.16.0, which all three packages share.
  • One pre-commit configuration keeps each hook's former scope (modpoll-wot was never checked and still is not).
  • The 1.x release-please workflows stay on main only.

This PR is for the CI run. It lands on v2 by a direct push that keeps the merge commits, because the repository only allows squash merges.

Verification

  • Tests in the workspace: modpoll 261 passed / 51 skipped (tox py310: 254 passed), modsim 153 passed / 5 skipped, modpoll-wot 120 passed — the same counts as before.
  • make check for modpoll and modsim, mise run check for modpoll-wot, actionlint on all workflows.
  • Both images built locally from the new Dockerfiles; installed packages compared with images built from the frozen commits.

🤖 Generated with Claude Code

gavinying and others added 28 commits November 10, 2026 16:07
Default the listener to the standard Modbus ports (502 for TCP and UDP,
802 for Modbus/TLS) so modpoll reaches a local simulator without
--tcp-port. When the operating system reserves the port, fail before
starting and explain how to rerun with sudo or pick a port above 1023.
Managed deployments keep their explicit server port. Prepare 2.0.0a5.

BREAKING CHANGE: modsim without --port now listens on 502 instead of
5020; pass --port 5020 to keep the previous port.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Baseline Thing Models are fully open and a full read executes the whole
modpoll:acquisition plan, so the audit list only repeated acquisition
members. Remove the schema entry, parsing, AuditPlan and its docs, and
prepare 0.3.0a3. Documents that still declare modpoll:audit now fail as
an unsupported root project extension.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
modpoll-wot removed derive_audit_tm in 0.3.0a1 and the modpoll:audit
plan in 0.3.0a3, so the test always skipped. Describe known-value
checks with a full read instead.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat!: pin modpoll-wot 0.3.0a3 for 2.0.0a6 (WOT-03)

Use the same interpreter as modpoll 2.0.0a5, so modsim also rejects
Thing Models that still declare the removed modpoll:audit plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: regenerate the io-module TD with modpoll-wot 0.3.0a3

Only the recorded generator version changes; the TD is identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
)

- 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>
…SIM-05) (#31)

* feat!: load simulation data with --data and replay modpoll snapshots (SIM-05)

- --scenario becomes --data and deployment devices use data: instead of
  scenario:. Simulation data is defined and validated by modpoll-wot
  0.4.0a1 and carries no code; behavior scripts move to --script or a
  device's script:, and their values to scriptParameters:.
- A modpoll --export snapshot is accepted as simulation data. Unread points
  keep their defaults and are logged.
- Remove --initial-file; a data document's initial replaces it.
- Scaled values use modpoll-wot's scaled_raw, so exported floats such as
  230.10000000000002 with multiplier 0.1 are served again.
- The catalog interop tool and examples read catalog schema 7 paths at
  fd90607 and no longer read the removed vectors file. The released-runtime
  interop step is dropped until a release accepts --data.
- A new CI job reads a simulated device with released modpoll, exports a
  snapshot and checks that modsim replays it unchanged, scaled points
  included.
- Version 2.0.0a7. uv.lock is updated once modpoll-wot 0.4.0a1 is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: lock modpoll-wot 0.4.0a1 and format the replay test (SIM-05)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…2.0.0a8 (SIM-05) (#32)

The preview guard compared main.yml jobs with a fixed set that lacked the
new "modpoll snapshot replay" job, so v2.0.0a7 failed before publishing.
Tags and versions are immutable, so the same changes ship as 2.0.0a8; the
preview notes say v2.0.0a7 was never published. The guard test now restores
the removed job instead of assuming tox (3.14) is last.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…the loop (SIM-06) (#33)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…se test gaps (SIM-06) (#34)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s (POLL-02b) (#5)

Tools share one login through a private credentials file keyed by server, with
MODIOHUB_TOKEN taking precedence. The module only reads and writes the file and
parses modiohub:<id>@<version>; signing in stays with each tool. Version 0.5.0a1.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…2b) (#35)

* feat: sign in to ModioHub and simulate Workspace Thing Models (POLL-02b)

modsim login runs the browser authorization flow and keeps the tool session in the
credentials file shared with modpoll; logout forgets it. --config modiohub:<id>@<version>
reads a custom Thing Model with the login (a shared one without), checked against the
SHA-256 the server states. Deployment manifests keep refusing it so a hosted deployment
never carries a login. Needs modpoll-wot 0.5.0a1, which is not released yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* chore: release 2.0.0a9 with modpoll-wot 0.5.0a1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* chore: regenerate the io-module Thing Description for modpoll-wot 0.5.0a1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
The receiving service resolves the catalog product from the model
fingerprint (mf1 is identical for a TM, its TD exports and unmodified
forks), so tools no longer need to name the product: --product goes away
and local files, URLs and modiohub references all report without it.
Schema 3 reports that carry product remain valid, and a present product
must still match the product-id pattern. Version 0.6.0a1.
…e 2.0.0a10 (#36)

* fix: print the sign-in link quietly where no browser can open

A browser is tried only where there is a desktop, the opener's output is not shown, and
a failed attempt says to open the printed address. Ctrl-C while waiting is a one-line cancel.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* chore: release 2.0.0a10

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Without MODIOHUB_URL, login and Workspace reads now stand on the server of
the only stored live session (modpoll-wot 0.6.0a2 active_server), so a
staging login is no longer mistaken for the default server.
…ase 2.0.0a12 (SIM-07, SIM-04) (#37)

* feat!: listen on port 5020 by default (SIM-07)

The first command no longer needs administrator rights. TCP, UDP and TLS
share the default; port 502 stays available with --port 502.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat: simulate Modbus RTU over a virtual serial port (SIM-04)

--serial pty joins two pseudo-terminal pairs with a byte bridge so modpoll can
read a model-driven device without hardware; --serial PORT listens on an
existing port. pyserial becomes a dependency.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* chore: release 2.0.0a12

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* style: format the serial changes and type the serial server like the TCP one

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* chore: tell deptry that pyserial is used through pymodbus

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
The repository becomes a uv workspace for modpoll, modsim and modpoll-wot.
CI stays at the repository root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…L-01)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
modpoll and modsim take modpoll-wot from packages/modpoll-wot inside the
workspace; uv build --no-sources keeps the published pins. Shared
dependencies take the newer version any package locked before, except
modpoll's runtime dependencies, which keep modpoll's versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-01)

Workflows move to the root with one CI and one release workflow per package,
each scoped to its package directory and paths. Release tags carry the
package name (modpoll-v*, modsim-v*, modpoll-wot-v*). modsim job names gain a
modsim prefix so modpoll's release guard never reads them, and modsim's guard
follows the new workflow names. Release scripts stay in each package.
Images build from the repository root with the workspace lock; one
pre-commit configuration keeps each hook's former scope. The 1.x
release-please workflows stay on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…de the workspace (TOOL-01)

modsim resolved checked-in deployments against the Git root, which was the
modsim project until the repositories merged; its own examples now resolve
against the nearest modsim project first, so every earlier layout keeps its
root. The equivalence tool runs 2.x in its own interpreter, since the
workspace environment lives at the repository root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-01)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gavinying
gavinying merged commit b0f9d12 into v2 Nov 13, 2026
20 checks passed
@gavinying
gavinying deleted the tool-01-workspace branch November 13, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants