[WotCon] Add the WoT Connectivity samples and complete the documentation - #4156
Open
marcschier wants to merge 28 commits into
Open
[WotCon] Add the WoT Connectivity samples and complete the documentation#4156marcschier wants to merge 28 commits into
marcschier wants to merge 28 commits into
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
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
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.