Adopt core 0.4.0: scoped instance routing - #8
Merged
Conversation
Bump the edgecommons pin to python-lib/v0.4.0 (tag commit ef4c624) and re-register all nine command verbs (sb/* + reconnect/repoll) through the new scope-aware register_scoped(verb, handler) form, enforcing SOUTHBOUND S2.2 addressed-instance routing: - The topic-addressed instance is authoritative; a conflicting body `instance` is refused with BAD_ARGS (checked before existence). - A topic-only address routes by the token (no single-device fallback). - Component-scoped deliveries keep the existing body routing: selector optional iff exactly one device is configured; missing -> BAD_ARGS, unknown -> NO_SUCH_INSTANCE. The resolver moves out of main.py into modbus_adapter/routing.py, inside the coverage gate, with tests for all three routing cases (tests/test_routing.py). set_command_availability is deliberately not adopted (all nine verbs are unconditionally served; writes.allow[] gating is per-signal/per-instance, which a component-wide verb state cannot represent) and receivedTs stays unemitted (direct client: capture == receive; serverTs already stamped) - both recorded as D-M8 in DESIGN.md. Docs (messaging-interface, explanation, how-to, AGENTS.md) updated to the scoped-routing contract in the same change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iQDskU2E1HLStYHoZrSTn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracked 0.4.0 adoption wave (follows the merged conformance + capture work). Adopts the core adapter enablers released as
python-lib/v0.4.0:What changed
edgecommonspin bumpedpython-lib/v0.3.0→python-lib/v0.4.0(tag commitef4c624) inrequirements.txt+pyproject.toml.register_scoped+ SOUTHBOUND §2.2 routing: all nine verbs (sb/read|write|status|signals|browse|pause|resume+reconnect/repoll) re-registered through the scope-aware form; the newmodbus_adapter/routing.py(resolve_instance, inside the coverage gate) enforces:instance→BAD_ARGS(checked before existence);BAD_ARGS, unknown →NO_SUCH_INSTANCE).set_command_availability: N/A, deliberately not adopted — every verb is unconditionally served; write gating is per-signal/per-instance (writes.allow[]), which a component-wide per-verb availability state cannot represent honestly for mixed-instance configs. Recorded inDESIGN.mdD-M8.receivedTs: N/A — direct-client poller, capture == receive;serverTsis already stamped at read completion per the four-slot model. Recorded in D-M8.docs/reference/messaging-interface.md,docs/explanation.md,docs/how-to-guides.mdstate the two-scope inbox + scoped routing in present tense;AGENTS.mdlayout/invariants updated;DESIGN.mdgains D-M8 and D-M3's stale v0.3.0-pin rationale is corrected.Validation
ef4c624): 141 passed (131 pre-existing + 10 new routing tests), no broker/PLC.routing.pyat 100%).🤖 Generated with Claude Code
https://claude.ai/code/session_014iQDskU2E1HLStYHoZrSTn