fix(repo): restore multi-TFM compatibility for Release pack - #218
Open
ottobolyos wants to merge 2 commits into
Open
fix(repo): restore multi-TFM compatibility for Release pack#218ottobolyos wants to merge 2 commits into
ottobolyos wants to merge 2 commits into
Conversation
ottobolyos
pushed a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 18, 2026
…tract Three doc surfaces went stale when PR TrakHound#218 split observation/asset validation off from Device-tree validation and added the empty-Result coerce. Refresh each so a reader following the docs learns the actual runtime behaviour. - docs/concepts/agent-validation-events.md: split the validation decision by element kind. The mermaid flowchart now branches on Device-tree vs Observation/Asset before routing into DeviceValidationLevel or InputValidationLevel; the "Wire-up", "Contributor POV — Wiring a new entry", and "See also" sections now name the correct enum per family; the "What happens to the rejected input" section splits into two bullet lists so callers reach for the right knob. Adds a short paragraph on the load-time migration bridge so upgraders who only set inputValidationLevel keep the Device-tree behaviour they had before v7. - docs/cli/agent.md: adds the deviceValidationLevel row to the top-level-keys table, documenting the enum arms, the mirror-from-inputValidationLevel default, and the per-arm agent behaviour (Ignore accepts everything; Warning raises the matching Invalid*Added event; Remove prunes the offending node from the Device tree; Strict rejects the entire Device). - docs/wire-formats/shdr.md: adds a paragraph to the "Line shape" section documenting that a key with no value segment emits an UNAVAILABLE Result rather than being silently dropped, and that the same coerce catches the shape for third-party ingress paths that reach AddObservation with an empty-string Result. Notes the DATA_SET / TABLE / TIME_SERIES / CONDITION exemptions.
ottobolyos
pushed a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 19, 2026
…tract Three doc surfaces went stale when PR TrakHound#218 split observation/asset validation off from Device-tree validation and added the empty-Result coerce. Refresh each so a reader following the docs learns the actual runtime behavior. - docs/concepts/agent-validation-events.md: split the validation decision by element kind. The mermaid flowchart now branches on Device-tree vs Observation/Asset before routing into DeviceValidationLevel or InputValidationLevel; the "Wire-up", "Contributor POV — Wiring a new entry", and "See also" sections now name the correct enum per family; the "What happens to the rejected input" section splits into two bullet lists so callers reach for the right knob. Adds a short paragraph on the load-time migration bridge so upgraders who only set inputValidationLevel keep the Device-tree behavior they had before v7. - docs/cli/agent.md: adds the deviceValidationLevel row to the top-level-keys table, documenting the enum arms, the mirror-from-inputValidationLevel default, and the per-arm agent behavior (Ignore accepts everything; Warning raises the matching Invalid*Added event; Remove prunes the offending node from the Device tree; Strict rejects the entire Device). - docs/wire-formats/shdr.md: adds a paragraph to the "Line shape" section documenting that a key with no value segment emits an UNAVAILABLE Result rather than being silently dropped, and that the same coerce catches the shape for third-party ingress paths that reach AddObservation with an empty-string Result. Notes the DATA_SET / TABLE / TIME_SERIES / CONDITION exemptions.
ottobolyos
force-pushed
the
fix/multi-tfm-compat
branch
from
August 19, 2026 12:12
b71e95c to
b587848
Compare
ottobolyos
added a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 19, 2026
ottobolyos
pushed a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 19, 2026
…tract Three doc surfaces went stale when PR TrakHound#218 split observation/asset validation off from Device-tree validation and added the empty-Result coerce. Refresh each so a reader following the docs learns the actual runtime behavior. - docs/concepts/agent-validation-events.md: split the validation decision by element kind. The mermaid flowchart now branches on Device-tree vs Observation/Asset before routing into DeviceValidationLevel or InputValidationLevel; the "Wire-up", "Contributor POV — Wiring a new entry", and "See also" sections now name the correct enum per family; the "What happens to the rejected input" section splits into two bullet lists so callers reach for the right knob. Adds a short paragraph on the load-time migration bridge so upgraders who only set inputValidationLevel keep the Device-tree behavior they had before v7. - docs/cli/agent.md: adds the deviceValidationLevel row to the top-level-keys table, documenting the enum arms, the mirror-from-inputValidationLevel default, and the per-arm agent behavior (Ignore accepts everything; Warning raises the matching Invalid*Added event; Remove prunes the offending node from the Device tree; Strict rejects the entire Device). - docs/wire-formats/shdr.md: adds a paragraph to the "Line shape" section documenting that a key with no value segment emits an UNAVAILABLE Result rather than being silently dropped, and that the same coerce catches the shape for third-party ingress paths that reach AddObservation with an empty-string Result. Notes the DATA_SET / TABLE / TIME_SERIES / CONDITION exemptions.
ottobolyos
force-pushed
the
fix/multi-tfm-compat
branch
from
August 19, 2026 22:05
b587848 to
1cf02a1
Compare
ottobolyos
added a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 19, 2026
ottobolyos
force-pushed
the
fix/multi-tfm-compat
branch
from
August 20, 2026 12:20
1cf02a1 to
1229132
Compare
ottobolyos
force-pushed
the
fix/multi-tfm-compat
branch
3 times, most recently
from
August 21, 2026 12:03
0d6b1a4 to
09502e3
Compare
ottobolyos
added a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 21, 2026
ottobolyos
force-pushed
the
fix/multi-tfm-compat
branch
from
August 21, 2026 12:09
09502e3 to
ef9ea58
Compare
ottobolyos
added a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 21, 2026
ottobolyos
added a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 21, 2026
Adds a reflection-based fixture under tests/MTConnect.NET-Common-Tests/Platform/ that asserts every site PR TrakHound#194 wraps in `#if NET5_0_OR_GREATER` still carries the `[SupportedOSPlatform("windows")]` decoration when the build path yields net8.0. The fixture covers the six sites from the May-22 warnings sweep — WindowsService, MTConnectAgentService, MTConnectAdapterService, both `MTConnect.Applications.Service` types (agent + adapter), and the `Ceen.Httpd.HttpServer.AppDomainBridge.HandleRequest(SocketInformation,...)` plus `HttpServer.RunClient(SocketInformation,...)` HTTP-server sites — and pins the API surface so a future contributor who removes the attribute or narrows the wrap fails the test. The fixture runs only under net8.0 (the only TFM every test project targets), so cannot directly fail under the pre-fix code. Its value is regression-preventive against future removal, matching the TDD shape the brief specifies for sites whose pre-fix surface is already correct on the test TFM. Extends the test csproj with reflection-only references to MTConnect.NET-Services, MTConnect.NET-HTTP, MTConnect.NET-Applications-Agents, and MTConnect.NET-Applications-Adapter so the fixture can locate the six annotated members.
Restores Release pack-ability across the full TFM matrix (net461..net9.0 + netstandard2.0). Commit dd2eb42 (2026-05-22) landed `[SupportedOSPlatform("windows")]` decorations on six Service / HTTP-server types/methods to silence the CA1416 platform-compatibility analyzer on net8.0. The attribute type ships in System.Runtime on .NET 5.0+ but is absent from net4x and netstandard2.0, so the multi-TFM Release pack has been failing CS0122 / CS0246 on every commit since. The CA1416 analyzer only fires on net5+ too, so the attribute serves no purpose on older TFMs. Wraps each `using System.Runtime.Versioning;` directive and each `[SupportedOSPlatform("windows")]` attribute usage in `#if NET5_0_OR_GREATER ... #endif` so the older TFMs see neither. No runtime behavior change on .NET 5.0+ — the decoration remains in effect — and net4x / netstandard2.0 stop referencing a type that does not ship there. Sites covered: * libraries/MTConnect.NET-Services/WindowsService.cs * libraries/MTConnect.NET-Services/MTConnectAgentService.cs * libraries/MTConnect.NET-Services/MTConnectAdapterService.cs * libraries/MTConnect.NET-HTTP/Ceen/Httpd/HttpServer.cs (two attribute sites — AppDomainBridge.HandleRequest and HttpServer.RunClient overloads that take SocketInformation) * agent/MTConnect.NET-Applications-Agents/Service.cs * adapter/MTConnect.NET-Applications-Adapter/Service.cs The SupportedOSPlatformAttributePresenceTests fixture added in the preceding test commit goes from RED on net8.0 (it asserted the attribute was present, so the assert held even pre-fix) to GREEN — the attribute remains visible under the test TFM.
ottobolyos
force-pushed
the
fix/multi-tfm-compat
branch
from
August 21, 2026 16:04
ef9ea58 to
266887b
Compare
ottobolyos
added a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 21, 2026
ottobolyos
added a commit
to ottobolyos/mtconnect.net
that referenced
this pull request
Aug 21, 2026
ottobolyos
marked this pull request as ready for review
August 21, 2026 20:51
Contributor
Author
|
@PatrickRitchie — #218 is Completed + ready for review. Post-#230 merge, this became the new queue head; rebased on new master Ready when you are. |
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.
Summary
Restores Release-configuration pack-ability across the full TFM matrix. Scoped to one multi-TFM fix + its RED pinning test — 2 commits,
net461→net9.0clean.Behavior change
None at runtime — pure compile-time fix on non-
net8.0TFMs.SupportedOSPlatformAttributecompat. The attribute lives inSystem.Runtime.Versioningon.NET 5.0+but is absent onnet4xandnetstandard2.0. Six Windows-only Service / HTTP-server types decorated bydd2eb424(2026-05-22) failed CS0122 / CS0246 in the Release-pack matrix. This PR wraps each site in#if NET5_0_OR_GREATER. CI runs only Debug /net8.0and never exercises Release multi-TFM, which is how the regression slipped through.The matrix-spanning CI gate ships in PR #219 (already merged as 7626218).
Files touched
adapter/MTConnect.NET-Applications-Adapter/Service.csagent/MTConnect.NET-Applications-Agents/Service.cslibraries/MTConnect.NET-Services/MTConnectAdapterService.cslibraries/MTConnect.NET-Services/MTConnectAgentService.cslibraries/MTConnect.NET-Services/WindowsService.cstests/MTConnect.NET-Common-Tests/MTConnect.NET-Common-Tests.csprojtests/MTConnect.NET-Common-Tests/Platform/SupportedOSPlatformAttributePresenceTests.csDime review cycle 1
Retroactive backfill (2026-08-20). The 6-agent dime review cycle (
code-review,security-audit,simplification,improvement,documentation-audit,test-coverage-audit) was recorded as completed on this PR against head1229132dbefore the ledger section was standardized. Ledger reconstruction from commit history + PR comments:upstream/masterdown to only 4 semantically-correct commits scoped to multi-TFM compat (2xSupportedOSPlatform/LangVersionfix + 2x pinning test). 23 previously-shared commits with fix(common): coerce empty Result to UNAVAILABLE by value class #217 / fix: clean every Release-pack warning and add multi-TFM CI gate #219 were stripped and theDeviceValidationLevelsetter validation + related tests migrated to new PR fix(common): harden DeviceValidationLevel setter + Remove recursion #241 to preserve the code.Rebase-shrink pass (2026-08-21)
Head-priority audit against master + against the current
XsdPreprocessorsource: theLangVersion 8.0bump (2be0e055) was based on a stale premise — master'sXsdPreprocessor.StripXsd11Constructsat line 62 uses the older C# 7.3-compatibleusing (var reader = new StringReader(...))block form, not the C# 8.0using var reader = ...declaration form. No LangVersion bump is required. The pairedtest(xml): pin using-declarations code path(7e3f721c) falls with the same premise.Rebase-interleaved to the minimum-scope 2-commit shape:
test(common): pin SupportedOSPlatform attribute on Service types (RED)— reflection-based pin over the six wrapped sites.fix(common): wrap SupportedOSPlatform in NET5_0_OR_GREATER for multi-TFM— the GREEN wrap.tests/MTConnect.NET-XML-Tests/Xml/UsingDeclarationsTests.csandlibraries/MTConnect.NET-XML/MTConnect.NET-XML.csprojare dropped along with the 2 spurious commits. Commit-body BrE (analyser× 2) rewritten to American Englishanalyzerat the same time.Depends on