Skip to content

Adopt core 0.4.0: scoped instance routing - #8

Merged
mbreissi merged 1 commit into
mainfrom
feat/core-0.4-adoption
Jul 27, 2026
Merged

Adopt core 0.4.0: scoped instance routing#8
mbreissi merged 1 commit into
mainfrom
feat/core-0.4-adoption

Conversation

@mbreissi

Copy link
Copy Markdown
Contributor

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

  • Dependency: edgecommons pin bumped python-lib/v0.3.0python-lib/v0.4.0 (tag commit ef4c624) in requirements.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 new modbus_adapter/routing.py (resolve_instance, inside the coverage gate) enforces:
    • topic-addressed instance authoritative — conflicting body instanceBAD_ARGS (checked before existence);
    • topic-only address routes by the token (no single-device fallback);
    • component-scoped delivery keeps the existing body routing (selector optional iff exactly one device; missing → 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 in DESIGN.md D-M8.
  • receivedTs: N/A — direct-client poller, capture == receive; serverTs is already stamped at read completion per the four-slot model. Recorded in D-M8.
  • Docs: docs/reference/messaging-interface.md, docs/explanation.md, docs/how-to-guides.md state the two-scope inbox + scoped routing in present tense; AGENTS.md layout/invariants updated; DESIGN.md gains D-M8 and D-M3's stale v0.3.0-pin rationale is corrected.

Validation

  • Full unit suite against edgecommons v0.4.0 (installed from the tag checkout at ef4c624): 141 passed (131 pre-existing + 10 new routing tests), no broker/PLC.
  • Coverage gate: 95.74% ≥ 90% (routing.py at 100%).

🤖 Generated with Claude Code

https://claude.ai/code/session_014iQDskU2E1HLStYHoZrSTn

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
@mbreissi
mbreissi merged commit a176f25 into main Jul 27, 2026
2 checks passed
@mbreissi
mbreissi deleted the feat/core-0.4-adoption branch July 27, 2026 19:07
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.

1 participant