[WotCon] Add the WoT Connectivity samples and complete the documentation - #4156
Merged
marcschier merged 39 commits intoAug 5, 2026
Merged
Conversation
…arcschier/wot-16-samples # Conflicts: # src/Opc.Ua.Types/Utils/FileSystem/VirtualFileSystem.cs
Adds three runnable samples: two flat OPC UA tag servers and an aggregation server that materializes them into a DI/Machinery/Pumps model through the WoT registry, plus an aggregation client that drives the result. The AggregationServer also ships a memory protocol binding, which doubles as the worked example for the binding contributor guide. Documents the WoT Connectivity surface end to end: a new protocol bindings guide, the expanded WoT Connectivity overview covering the registry, materialization and runtime projection, and the shadow-reload and shared byte-store sections for the runtime NodeSet and xRegistry guides. Registers the sample and test projects in the solution so they are built and run by CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
Brings across the binder registry, codec, planner and target-mapping tests, the custom-binder sample test, the combined-model preservation tests and the aggregation document tests, closing the last coverage gap against the integration branch. The custom-binder sample needed updating: WotEndpointPolicy now fails closed on unknown URI schemes, so a binding that introduces its own scheme has to opt it in. That is exactly the situation every custom binding author hits, so the sample now shows it and the contributor guide documents the policy, the failure it produces and the checklist item. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
TransferServicesExtensions.BindToTransferService already ships but had no tests. Adds argument validation, required-method-children and routing coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
…16-samples # Conflicts: # UA.slnx
…alization # Conflicts: # src/Opc.Ua.Types/Utils/FileSystem/VirtualFileSystem.cs
…16-samples # Conflicts: # src/Opc.Ua.Types/Utils/FileSystem/VirtualFileSystem.cs
marcschier
force-pushed
the
marcschier/wot-14-materialization
branch
from
August 1, 2026 11:47
cd84294 to
777e0a8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR lands the runnable WoT Connectivity (WoTCon) aggregation samples (two flat-tag source servers + one aggregation server + a loader/client) and rounds out the documentation and test coverage for the WoTCon 1.1 registry/materialization/binding stack, including wiring the new sample test project into UA.slnx.
Changes:
- Add three runnable sample projects under
samples/WotCon/and a dedicatedOpc.Ua.WotCon.Samples.Teststest project, and register them inUA.slnx. - Add/expand WoTCon integration and sample-document determinism tests (live registry client workflow, binding/mapping/codec tests, and sample topology tests).
- Complete/extend documentation for WoTCon, runtime NodeSet lifecycle behavior, xRegistry storage, and docs index links.
Reviewed changes
Copilot reviewed 51 out of 53 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| UA.slnx | Registers WoTCon sample projects and Opc.Ua.WotCon.Samples.Tests in the solution. |
| tests/Opc.Ua.WotCon.Tests/WotRegistryClientLiveServerTests.cs | Adds live-server end-to-end registry client integration tests (upload/refresh/readback, concurrency). |
| tests/Opc.Ua.WotCon.Tests/Samples/WotAggregationDocumentTests.cs | Adds determinism/canonicalization and round-trip tests for checked-in sample WoT documents. |
| tests/Opc.Ua.WotCon.Tests/Samples/WotAggregationDocumentGenerator.cs | Adds generator helpers to deterministically regenerate sample WoT documents from NodeSet sources. |
| tests/Opc.Ua.WotCon.Tests/Resources/WotAggregation/StructuredPumpMappingExample.td.json | Adds a dedicated structured mapping TD example used by tests/docs. |
| tests/Opc.Ua.WotCon.Tests/Properties/AssemblyInfo.cs | Adds assembly-level attributes for the WoTCon test assembly. |
| tests/Opc.Ua.WotCon.Tests/CombinedModelPreservationTests.cs | Adds tests guarding preservation of 1.02 NodeIds/surface and coexistence with 1.1 registry additions. |
| tests/Opc.Ua.WotCon.Tests/Binding/WotTargetMappingTests.cs | Adds target-mapping validation/propagation tests for uav:mapToNodeId / uav:mapToType / uav:mapByFieldPath. |
| tests/Opc.Ua.WotCon.Tests/Binding/WotCustomBinderSampleTests.cs | Adds an end-to-end test for the worked example custom mem:// binding and executor. |
| tests/Opc.Ua.WotCon.Tests/Binding/WotCodecTests.cs | Adds tests for built-in payload codec encode/decode and codec selection behavior. |
| tests/Opc.Ua.WotCon.Tests/Binding/WotBindingTestSupport.cs | Adds test helpers for generating TD fragments and extracting forms. |
| tests/Opc.Ua.WotCon.Tests/Binding/WotBinderRegistryTests.cs | Adds protocol binder registry selection/version/capability tests. |
| tests/Opc.Ua.WotCon.Samples.Tests/WotSampleEnvironment.cs | Adds in-process multi-host sample environment orchestration for end-to-end sample tests. |
| tests/Opc.Ua.WotCon.Samples.Tests/TestPorts.cs | Adds helpers for acquiring free TCP ports in sample tests. |
| tests/Opc.Ua.WotCon.Samples.Tests/Properties/AssemblyInfo.cs | Adds assembly-level attributes for the WoTCon samples test assembly. |
| tests/Opc.Ua.WotCon.Samples.Tests/Opc.Ua.WotCon.Samples.Tests.csproj | Introduces the net10-only sample test project referencing the sample executables. |
| tests/Opc.Ua.WotCon.Samples.Tests/AggregationStartupTests.cs | Adds tests ensuring sample TFMs and DI registration (e.g., OPC UA executor presence). |
| tests/Opc.Ua.Di.Tests/TransferServicesExtensionsTests.cs | Adds/updates DI Transfer service binding tests (unrelated to WoTCon samples but included in this PR). |
| samples/WotCon/README.md | Adds the full aggregation sample guide (topology, run steps, troubleshooting, tests, AOT publishing). |
| samples/WotCon/FlatTagServer/README.md | Adds minimal documentation for the flat-tag source server. |
| samples/WotCon/FlatTagServer/Properties/AssemblyInfo.cs | Adds assembly-level attributes for FlatTagServer sample. |
| samples/WotCon/FlatTagServer/Program.cs | Adds FlatTagServer entry point calling the reusable host runner. |
| samples/WotCon/FlatTagServer/FlatTagServerOptions.cs | Adds configuration model for the flat-tag source server (endpoints, namespace, deterministic values). |
| samples/WotCon/FlatTagServer/FlatTagServerHost.cs | Adds reusable HostApplicationBuilder-based hosting for FlatTagServer. |
| samples/WotCon/FlatTagServer/FlatTagServer.csproj | Adds the FlatTagServer sample project and references. |
| samples/WotCon/FlatTagServer/FlatTagNodeManager.cs | Adds the flat-tag NodeManager implementation exposing a deterministic subset of Pump tags. |
| samples/WotCon/AggregationServer/README.md | Adds documentation for the aggregation server and its sample in-memory binding example. |
| samples/WotCon/AggregationServer/Properties/AssemblyInfo.cs | Adds assembly-level attributes for AggregationServer sample. |
| samples/WotCon/AggregationServer/Program.cs | Adds AggregationServer entry point calling the reusable host runner. |
| samples/WotCon/AggregationServer/Bindings/MemoryWotBinding.cs | Adds the worked example mem:// binder + executor + channel + store implementation used in docs/tests. |
| samples/WotCon/AggregationServer/AggregationServerOptions.cs | Adds configuration model for AggregationServer (endpoint, PKI root, document size bounds). |
| samples/WotCon/AggregationServer/AggregationServerHost.cs | Adds reusable host configuration for registry/materialization plus binding executors (HTTP/Modbus/OPC UA). |
| samples/WotCon/AggregationServer/AggregationServer.csproj | Adds the AggregationServer sample project with restricted TFMs for runnable configs. |
| samples/WotCon/AggregationClient/README.md | Adds brief documentation for the one-shot aggregation loader/client. |
| samples/WotCon/AggregationClient/Properties/AssemblyInfo.cs | Adds assembly-level attributes for AggregationClient sample. |
| samples/WotCon/AggregationClient/Program.cs | Adds AggregationClient CLI entry point running the workflow and printing results. |
| samples/WotCon/AggregationClient/Documents/documents.json | Adds the manifest describing the sample document set and dependencies. |
| samples/WotCon/AggregationClient/AggregationClientRunner.cs | Adds the in-process workflow (connect, upload docs, refresh, browse, read values). |
| samples/WotCon/AggregationClient/AggregationClientModels.cs | Adds reusable options/result models for AggregationClient workflow output. |
| samples/WotCon/AggregationClient/AggregationClient.csproj | Adds the AggregationClient sample project and includes documents as content. |
| docs/XRegistry.md | Updates xRegistry documentation (ByteString write signature; adds WoTCon worked-example notes). |
| docs/WoTConnectivity.md | Expands WoT Connectivity docs to cover the 1.1 registry/materialization/bindings architecture and usage. |
| docs/RuntimeNodeSets.md | Updates runtime NodeSet docs with shadow/immediate reload sections and revised cross-links. |
| docs/README.md | Links new WoTCon/WoT bindings/sample documentation pages from the docs index. |
Suppressed comments (1)
docs/RuntimeNodeSets.md:234
- The related-docs link
SourceGeneratedNodeManagers.mdis broken (file not found underdocs/). This should link to the existing section inNodeManagers.mdto avoid dead links in published documentation.
## Related documentation
- [Source-Generated NodeManagers](SourceGeneratedNodeManagers.md) — strongly typed alternative.
- [Dependency Injection](DependencyInjection.md) — `IOpcUaServerBuilder` and service registration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
…n' into marcschier/wot-16-samples
WoT binding executors validate every outbound endpoint against WotEndpointPolicy, whose default blocks loopback so a server cannot be talked into reaching its own listeners on behalf of a remote caller. The aggregation sample federates SourceA and SourceB on the same host, so every materialized read was rejected with BadSecurityChecksFailed and the end-to-end sample test could not pass. Opt the sample in to loopback explicitly through the existing AddWotEndpointPolicy builder API, leaving the scheme allow-list, blocked hosts and private-range checks at their secure defaults, and document the knob in the sample README. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
The WoT protocol bindings and aggregation sample entries were indented as sub-bullets while the two sibling WoT entries added alongside them were at the top level, so the four new links did not read as one group. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
cristipogacean
approved these changes
Aug 3, 2026
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
…n' into marcschier/wot-16-samples
Merging master added an IOperationContext parameter to the NodeManager lifecycle add operation, so these tests no longer bound their argument to the intended overload. They pass null because the registration is created by the test fixture rather than on behalf of an executing request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
…n' into marcschier/wot-16-samples
## Summary - add optional WoT Connectivity asset TD mirroring into the WoT xRegistry - add DI opt-in via AddWotRegistryBridge and direct WotConnectivityServerOptions.RegistryBridge fallback - document default-off, best-effort failure policy and usage - add NUnit/Moq coverage for create, update, delete, disabled and failure paths ## Validation - dotnet build src\\Opc.Ua.WotCon.Server\\Opc.Ua.WotCon.Server.csproj -c Release -v:m (all TFMs, 0 warnings/errors) - dotnet test tests\\Opc.Ua.WotCon.Tests\\Opc.Ua.WotCon.Tests.csproj -c Release -p:CustomTestTarget=net10.0 (0 failed / 983 passed) --------- Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
…n' into marcschier/wot-16-samples
…marcschier/wot-16-samples
marcschier
merged commit Aug 5, 2026
39f655f
into
marcschier/wot-14-materialization
5 of 168 checks passed
marcschier
added a commit
that referenced
this pull request
Aug 5, 2026
…ation, Server and xRegistry work it builds on (#4128) ## Summary Adds OPC UA WoT Connectivity 1.1 to the stack, together with the Types, source generation, Server and xRegistry work it is built on. This branch is the merge point for the fourteen-PR stack that replaced integration PR #4093; every constituent PR was reviewed and approved separately and is listed below. 414 files changed, +108,936 / -3,199. Roughly 46k added lines of product code, 57k of tests, plus samples, tools and documentation. ## Types - Complete `ExtensionObject` raw-body decoding for binary, XML and JSON bodies by resolving the concrete type through the message context's encodeable factory, and simplify the `Variant` structure helpers by delegating to it (#4128). - Add `IAtomicFileReplace` as an optional `IFileSystem` capability so existing external implementations keep working, with atomic publish for `LocalFileSystem` via `File.Replace`/`File.Move` and for `VirtualFileSystem` by re-keying the in-memory entry (#4128). - Add lossless conversion between WoT documents and NodeSet2 (`Opc.Ua.Wot.WotNodeSetConverter`). A byte-exact `uav:nodeSet` envelope is preserved when requested, the structured `uav:nodes` projection is used when the readable vocabulary is incomplete, and NodeSet2 is otherwise synthesized from readable WoT terms. Unmapped JSON members survive a round trip as pointer-addressed residue (#4131). ## Source generation - Improve the NodeSet to ModelDesign conversion and the generated node state (#4132). - Generate OPC UA models directly from WoT Thing Description files (#4134). ## Server - Add live NodeManager shadow and immediate reload. A reload materializes a new generation beside the active one and switches atomically; the superseded generation is retired gracefully so existing MonitoredItems keep being served until they drain, or immediately when the caller asks for it. Includes the request admission and drain machinery that lets an orderly shutdown wait for admitted requests instead of tearing down underneath them (#4147). - Make subscription transfer between sessions transactional, so a failed transfer leaves neither session holding a partially moved subscription (#4150). ## xRegistry - Allow clients to use explicit registry roots rather than assuming a well-known location (#4130). ## WoT Connectivity - Add the WoT Connectivity 1.1 information model: a registry-first revision layered on the abstract xRegistry base model, incorporating the complete published OPC 10100-1 v1.02 surface as deprecated nodes in the same namespace so existing 1.02 clients keep working (#4139). - Add the protocol binding abstractions and planners that compile WoT forms into executable plans (#4140). - Add the HTTP, Modbus, OPC UA and MQTT binding executors (#4144). - Add the registry and its stores, including document versioning, validation, dependency resolution and refresh (#4146). - Add the registry client (#4142). - Materialize WoT Thing Descriptions into the server address space, deriving types from Thing Models and instances from Thing Descriptions (#4154). - Restore the WoT asset registry bridge so the deprecated 1.02 asset surface is backed by the registry (#4171). - Add the WoT Connectivity samples and complete the documentation (#4156), and restore the remaining coverage and docs (#4172). ## New projects `src/Opc.Ua.WotCon.Bindings`, `src/Opc.Ua.WotCon.Bindings.Mqtt`, `tests/Opc.Ua.WotCon.Bindings.Tests`, `tests/Opc.Ua.WotCon.Samples.Tests`, and the `samples/WotCon` AggregationServer, AggregationClient and FlatTagServer samples. ## Constituent pull requests Merged into this branch top-down, each independently approved: | PR | Title | | --- | --- | | #4128 | [Types] Complete ExtensionObject decoding and add an atomic file replace capability | | #4131 | [Types] Add lossless conversion between WoT documents and NodeSet2 | | #4132 | [SourceGeneration] Improve NodeSet to ModelDesign conversion and generated node state | | #4134 | [SourceGeneration] Generate OPC UA models from WoT Thing Description files | | #4147 | [Server] Add live NodeManager shadow and immediate reload | | #4150 | [Server] Make subscription transfer between sessions transactional | | #4130 | [XRegistry] Allow clients to use explicit registry roots | | #4139 | [WotCon] Add the WoT Connectivity 1.1 information model | | #4140 | [WotCon] Add the WoT protocol binding abstractions and planners | | #4144 | [WotCon] Add the HTTP, Modbus, OPC UA and MQTT binding executors | | #4146 | [WotCon] Add the WoT Connectivity registry and its stores | | #4142 | [WotCon] Add the WoT Connectivity registry client | | #4154 | [WotCon] Materialize WoT Thing Descriptions into the server address space | | #4156 | [WotCon] Add the WoT Connectivity samples and complete the documentation | | #4171 | Restore WoT asset registry bridge | | #4172 | Restore WoT coverage and docs | Supersedes #4093. ## Follow-up The WoT Connectivity and WoT Binding drafts have moved to 1.1-draft2 since this work was authored. Aligning with that revision - the removed group vocabulary, the new projection/View construct, the remaining model vocabulary terms and the two new portable-identity validation rules - is tracked separately and will follow in its own pull request. ## Validation Built for every target framework with zero warnings and zero errors, and validated at the tip of the stack with `Opc.Ua.WotCon.Tests` at 999 passed / 0 failed and `Opc.Ua.Server.Tests` at 4024 passed / 0 failed. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
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.
Adds the runnable WoT Connectivity samples and completes the documentation. This is PR 16 of a
stack splitting #4093, and the last one.
Samples
Three projects under
samples/WotCon/:flat sources into a runtime-loaded DI/Machinery/Pumps Pump model. It also ships a small in-memory
protocol binding, which is the worked example the binding contributor guide walks through.
Refresh, monitoring, andgeneration replacement.
Documentation
docs/WotBindings.md— the bindings that ship today (planner/executor architecture, bundledvs separate packages, operation coverage, target mapping, lazy channels, generation lifetime) plus
the contributor guide for adding your own, with diagnostics, tests, packaging, TFM, trimming and
NativeAOT guidance.
docs/WoTConnectivity.mdcovering the registry, dependency-closure materialization andruntime NodeSet projection.
docs/RuntimeNodeSets.mdgains the shadow-reload section anddocs/XRegistry.mdthe sharedbyte-store section. Both document APIs introduced earlier in the stack; they are collected here
because this is the documentation PR.
docs/README.mdlinks the new pages.Solution registration
Registers the three samples and
Opc.Ua.WotCon.Samples.TestsinUA.slnxso CI actually buildsand runs them.
Stack position
Sits on top of #4154 (materialization) and additionally merges #4142 (registry client) and
#4144 (protocol executors), because the samples exercise the whole stack —
AggregationServerneeds the OPC UA executor and the client sample needs the registry client. Its diff therefore shows
their content until they land.
It also carries
WotRegistryProjectionLiveTests.cs, which #4154 deliberately left out: those testsneed both the materialization runtime and the registry client, so this is the first branch where
they compile.
Validation
Opc.Ua.WotCon.Tests: 830 passed, 0 failed (769 from [WotCon] Materialize WoT Thing Descriptions into the server address space #4154 plus 61 from the live projectiontests).
Opc.Ua.WotCon.Samples.Tests: 6 of 7 pass locally; the remaining one fails withCryptographicException: The system cannot find the path specified, a known certificate-storeproblem on this machine that was previously reproduced against a clean baseline worktree and is
not related to this change. CI will confirm.
One fix was needed while bringing the sample across: its memory binding called
ResolveCodecwiththe pre-
out WotPayloadDescriptorsignature. The API gained the payload out-parameter and aboolresult during review of the binding PRs, so the sample now follows the sameif (!ResolveCodec(...)) return Unsupported(...)pattern as the shipped planners.Integration PR: #4093.