CTT follow-up: monitored items, alarms, codecs, history, and model validation#4002
Conversation
Use the matrix accessor for Variant, Number, Integer, and UInteger matrix copies so the payload remains a shaped MatrixOf<Variant> instead of becoming a null ArrayOf<Variant> under matrix TypeInfo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document the server Variant copy corruption as the root cause of the batched CTT BadDecodingError and remove the unproven symmetric CTT codec claim. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record the D8, null-array, rank-one zero-dimension wire shape produced by the pre-fix Variant copy path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject malformed Variant matrix dimensions consistently across binary, JSON, streaming XML, and XmlParser paths while preserving valid inline binary empty matrices. Add encoder/decoder regressions and net48-compatible cross-codec tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cover the in-memory XmlParser decoder alongside the streaming XmlDecoder for malformed multi-dimensional Variant matrices (zero dimension and dimension/length product mismatch) plus a valid round-trip, and extract the shared malformed XML payloads into constants. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exercise the same decode path as the cross-codec conformance suite (DataValue-wrapped Variant matrix, streaming XmlParser constructor, ReadDataValue, XDocument dimension mutation) to prove XmlParser rejects malformed matrix dimensions with BadDecodingError in parity with XmlDecoder. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t root (#4001) # Description The CTT reference server config was incomplete for Historical Access of array nodes and NodeManagement. This wires up historizing for one-dimensional array nodes, fills in the corresponding CTT config slots, and sets the NodeManagement root node. ## Changes - **Historize array nodes** (`ReferenceNodeManager`): added `HistoricalArrayNodeNames` (14 `Scalar_Static_Arrays_*` types matching the historized scalar element types) to the `EnableHistoryArchivingAsync` loop, so array nodes get `Historizing`, HistoryRead/HistoryWrite access levels, a registered historian, seeded history, and a `HistoricalDataConfigurationType` companion. - **Array-aware seeding**: `SeedHistoricalNodeAsync` now branches on `ValueRank`. Scalar seeding is factored into `CreateHistoricalScalarValue` (behaviour unchanged, preserving aggregate/CTT oracles); arrays use `CreateHistoricalArrayValue` to emit per-sample typed arrays. - **CTT config** (`UAReferenceServer.ctt.xml`): - `HA Profile > Arrays` — populated Bool…UInt64 with their `ns=2;s=Scalar_Static_Arrays_*` ids. - `HA Profile > AccessRights` — mapped the six slots to non-historizing `AccessRights_AccessAll_*` nodes. - `NodeManagement > RootNode` — set to `ns=2;s=CTT`. - **New address-space node**: `AccessRights_AccessAll_NoAccess` (`AccessLevel = None`) to back the `AccessLevel_None` access-rights slot, which had no existing counterpart. - **Tests**: added `HistoryReadRawDataForArrayTypeReturnsSeededValuesAsync` covering raw history reads across all historized array types, asserting Good status, seeded values, and array-typed results. ## Related Issues ## Checklist _Put an `x` in the boxes that apply. You can complete these step by step after opening the PR._ - [ ] I have signed the [CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf) and read the [CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md) doc. - [x] I have added tests that prove my fix is effective or that my feature works and increased code coverage. - [ ] I have added all necessary documentation. - [x] I have verified that my changes do not introduce (new) build or analyzer warnings. - [ ] I ran **all** tests locally using the **UA.slnx** solution against at least .net **framework** and .net **10**, and all passed. - [ ] I fixed **all** failing and flaky tests in the CI pipelines and **all** CodeQL warnings. - [ ] I have addressed **all** PR feedback received. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: romanett <romanett98@gmail.com>
|
|
There was a problem hiding this comment.
Pull request overview
This PR is a CTT-driven conformance follow-up that hardens history aggregate behavior, multi-dimensional Variant (matrix) encoding/decoding across codecs, and AddNodes validation/routing, with accompanying regression tests and updated CTT project/documentation artifacts.
Changes:
- Fix Variant matrix copying and enforce consistent matrix-dimension validation/BadEncodingError+BadDecodingError handling across Binary/JSON/XML codecs.
- Treat
BadBoundNotFoundas a synthetic placeholder (not aggregate input) and add direct + live-historian regression tests. - Tighten AddNodes routing/status codes and reference NodeClass validation; expand ReferenceServer historized nodes and update CTT findings/config.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Opc.Ua.Types.Tests/Encoders/MatrixVariantCodecValidationTests.cs | New targeted tests for matrix-dimension validation behavior across codecs. |
| Tests/Opc.Ua.Types.Tests/BuiltIn/VariantCoverageTests.cs | Regression test ensuring Variant.Copy() preserves MatrixOf<Variant> shape/content. |
| Tests/Opc.Ua.Server.Tests/ReferenceServerTest.cs | Batched Read regression ensuring a Variant matrix doesn’t break neighboring DataValues during binary encoding. |
| Tests/Opc.Ua.Server.Tests/NodeManager/MasterNodeManagerNodeManagementTests.cs | AddNodes routing/validation regression coverage for requested NodeIds and reference constraints. |
| Tests/Opc.Ua.Server.Tests/NodeManager/AsyncCustomNodeManagerNodeManagementTests.cs | Validates requested NodeId behavior when using an explicit namespace URI. |
| Tests/Opc.Ua.Server.Tests/AggregateRun14ResidualOracleTests.cs | Adds oracle tests asserting BadBoundNotFound markers don’t affect key aggregates. |
| Tests/Opc.Ua.History.Tests/HistoricalAccessTests.cs | Expands raw-history coverage to arrays/matrices/structures and validates mixed-quality seeding. |
| Tests/Opc.Ua.Core.Encoders.Tests/VariantMatrixConformanceTests.cs | New cross-codec conformance tests for valid/empty/null/invalid matrix encodings. |
| Stack/Opc.Ua.Types/Encoders/XmlParser.cs | Reject invalid matrix dimensions during XML parsing with BadDecodingError. |
| Stack/Opc.Ua.Types/Encoders/XmlEncoder.cs | Prevent encoding invalid matrix dimensions (fail fast with BadEncodingError). |
| Stack/Opc.Ua.Types/Encoders/XmlDecoder.cs | Enforce matrix-dimension validation and normalize invalid payloads to BadDecodingError. |
| Stack/Opc.Ua.Types/Encoders/JsonEncoder.cs | Prevent encoding invalid matrix dimensions in UA JSON. |
| Stack/Opc.Ua.Types/Encoders/JsonDecoder.cs | Validate matrix dimensions and normalize malformed matrices to BadDecodingError. |
| Stack/Opc.Ua.Types/Encoders/BinaryEncoder.cs | Add matrix-dimension validation for Variant encoding (not raw-value encoding). |
| Stack/Opc.Ua.Types/Encoders/BinaryDecoder.cs | Validate Variant matrix dimensions during binary decoding and reject malformed payloads. |
| Stack/Opc.Ua.Types/BuiltIn/Variant.cs | Fix Variant.Copy() for Variant/Number/Integer/UInteger matrices to preserve matrix payload. |
| Stack/Opc.Ua.Types/BuiltIn/MatrixOf.cs | Introduce shared IsValidMatrix helper for dimension validation. |
| plans/ctt-issues.md | Update findings to reflect corrected root cause and reclassify remaining items pending rerun/evidence. |
| Libraries/Opc.Ua.Server/NodeManager/MasterNodeManager.cs | Return BadNodeIdRejected for disallowed requested NodeIds; validate reference/nodeclass constraints; adjust owner selection. |
| Libraries/Opc.Ua.Server/Aggregates/AggregateCalculator.cs | Ignore BadBoundNotFound placeholders when queuing aggregate raw input. |
| Applications/UAReferenceServer.ctt.xml | Populate missing HA/access-rights node ids and RootNode slot for CTT project. |
| Applications/Quickstarts.Servers/ReferenceServer/ReferenceNodeManager.cs | Historize array/matrix/structure nodes and seed deterministic mixed-quality history values. |
Make NumericRange parsing conform to the no-whitespace grammar and add HistoryRead regressions for invalid and out-of-range index ranges. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…pilot/ctt-run16-fixes
…pilot/ctt-run16-fixes
…ixes # Conflicts: # tests/Opc.Ua.Core.Encoders.Tests/VariantMatrixConformanceTests.cs # tests/Opc.Ua.Types.Tests/Encoders/MatrixVariantCodecValidationTests.cs
…pilot/ctt-run16-fixes # Conflicts: # plans/ctt-issues.md
Description
Follow-up to #3978 based on the latest OPC UA CTT aggregate, matrix, Historical Access, Attribute, and Node Management runs.
Aggregate run 16
BadBoundNotFoundraw-bound markers when feeding aggregate calculators.Multi-dimensional Variant matrices
Variant.Copy()so rank-2 Variant matrices preserve their payload and dimensions.BadEncodingError; decoders returnBadDecodingErrorfor malformed matrix dimensions.Scalar_Static_Arrays2D_Variantserver encoding poisoned the batched CTT Read.Node Management AddNodes
BadNodeIdRejectedfor unsupported requested-NodeId namespaces.Historical Access and Attribute Services run 18
NumericRangesyntax withBadIndexRangeInvalid.BadIndexRangeNoData.012.jsexpectsBadIndexRangeNoDataat the operation level instead of on returned DataValues;Err-012.jsuses a non-historizing node for an access-denied test;Base Information model validation run 19
sysadminover Basic256Sha256 SignAndEncrypt so SecurityAdmin RolePermissions and EncryptionRequired restrictions are both satisfied without weakening the server model.ConformanceUnitsscalar/array mismatch.Related Issues
Checklist
Latest CTT full run and A&C run 20
036.js: an ambiguousDataValue(StatusCode)call encodedBadIndexRangeNoDataas a Good value.042.jsscript defects.CertificateExpired/TrustListOutOfDatealarm roots and descendants, restore standard type declarations and ModellingRules, and expose the cross-node-manager references.LocalizedTextvalues consistently across Binary, JSON, and XML and align Acknowledge/Confirm comment behavior and tests.013, PolicyId scope, A&C, durable subscriptions, and Subscription Minimum events.Base synchronization
Merged
masterthrough007cfaf90(#4010, repository layout consolidation) and retained the matrix regression tests at their newtests/locations.Latest validation
Opc.Ua.ServerandQuickstarts.ServersRelease builds complete with 0 warnings and 0 errors on net10 and net48.DisableEnableViaTypeAndInstanceMethodNoEventsDuringDisabledAsynctiming test took its documented inconclusive timeout path after the layout merge; no test failure was reported.