Skip to content

P7.6D #446: retain ARIEC-decoded report OptFlds provenance, without MMS reparse - #487

Draft
masarray wants to merge 2 commits into
feat/446-p7-6c-per-rcb-continuity-snapshotfrom
feat/446-p7-6d-engine-optflds-provenance
Draft

masarray wants to merge 2 commits into
feat/446-p7-6c-per-rcb-continuity-snapshotfrom
feat/446-p7-6d-engine-optflds-provenance

Conversation

@masarray

@masarray masarray commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Exact-head CI / field-test handoff (2026-10-09)

Field root cause — what actually went missing

The operator’s two real IED diagnostics (Open SCD AP J and Discovery IP, same build) both showed 2 BRCB InformationReport frames with SqNum=0→0 (one observed duplicate/replay finding), while the URCB reported one frame with SqNum unavailable and EntryIDPresent=0. Static values 13/13, configured RCB actual routed 2/2 per ingress, zero uncovered, zero cyclic MMS polling, and equal source-neutral parity fingerprint all remain healthy.

Proven root cause of diagnostic ambiguity: pinned ARIEC61850 engine 352c81e6... already parses the actual IEC 61850 InformationReport OptFlds BIT STRING into MmsReportHeader.OptionalFields (RawHex, HasSequenceNumber, HasEntryId, HasBufferOverflow, HasConfRevision). However, NativeIec61850Client dropped that authority when constructing NativeReportFrameMetadata; the consumer inspector could not distinguish omitted by IED from advertised but undecoded from unknown evidence.

Scoped solution — single coherent consumer patch

  • Preserve bounded ARIEC-decoded OptFldsRawHex and nullable four-bit option flags in NativeReportFrameMetadata; nullable null means genuinely unknown, false means wire OptFlds was decoded and that bit was not set.
  • In existing association-local/per-RCB continuity inspector, count OptFldsDecoded/Unknown, SqNum requested/omitted/requestedButUndecoded, EntryID requested/omitted/emptyOrUnprojected. Empty decoded EntryID is explicitly not asserted as a transport or decoder loss.
  • Flag contradiction if actual decoded SqNum/EntryID/BufOvfl/ConfRev is present while a known OptFlds mask omits it, or advertised SqNum is missing. Preserve old conservative 0→0 duplicate/replay warning; do not dismiss it as harmless GI.
  • Copy Diagnostic emits one bounded, escaped line per already bounded RCB snapshot; no raw report payloads or EntryID values included.
  • New xUnit synthetic tests prove omitted vs advertised-but-undecoded vs unknown, real 0→0 anomaly preservation, entryID empty caveat, contradictory metadata and malicious raw mask handling.
  • Existing qualification wording and 1,400-test baseline retained.

Anti-naive / concurrency / CI discipline

Changes limited to Services/NativeIec61850Client.cs adapter mapping, Models/NativeReportMonitorModels.cs immutable frame metadata, existing Iec61850ReportContinuityInspector.cs and DiagnosticReportBuilder.cs, plus one new test file. No changes to engine pin, MMS BER parsing, RCB write/enable/reservation/GI, poll scheduler, report value projection, controls, or WPF. No duplicate parser/state store.

Stacked DRAFT on field-validated diagnostic PR #485 at exact base 8d764128ccf764b20d27d178dfec64ec71581b81; separate sibling native-dialog UX #486 remains untouched. This branch owns the adapter/continuity/diagnostic-only code and must be reconciled with #486 when integrating.

CI thrift: prepared five-file patch and its synthetic tests in memory, created one Git tree/commit and branch once instead of one CI run per file. One immediate wording-compatibility fix followed after review. Final exact HEAD 3f2bc75d9efb3bbe84c0808650b17f64bbda4808 is pending CI. Do not consume earlier intermediate CI results as acceptance. Field reconnection, GI/EntryID/long-term SOE proof remain PhysicalPending. Keep draft; no premature merge or production release.

masarray commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

P7.6E workstream ownership + CI-thrifty evidence correlation

Draft PR #488, exact head d1e6cb9351d8283e99cc8a898dd82531eda96fef, stacked on P7.6D #487 exact 3f2bc75d9efb3bbe84c0808650b17f64bbda4808. No modifications to the independent UX #486.

Field evidence P7.6D real connect/disconnect/reconnect: 13/13 Static DataSet rows, BRCB+URCB 2/2 routed per ingress, zero process polling, both OptFlds decoded. BRCB SqNum requested and decoded (mask 7880), URCB SqNum omitted (mask 3880), EntryID omitted on both; BRCB new-association warning 4→0/5→0 remains unqualified as GI/reset/replay/loss.

Engine-authoritative discovery (pinned ARIEC 352c81e6...): existing StartConfiguredStaticReportMonitorAsync uses true RptEna write, post-enable readback verifier, one-shot GI=true write; returned engine WriteSteps already include attempted/success. MmsReportFrame.Values[].ReasonForInclusion is already decoded by engine. Consumer currently discarded write outcomes and frame GI/integrity reasons. #488 forwards existing data, never re-parses MMS.

#488 maps exact engine static-activation outcomes into per-association per-plan evidence, then into existing per-RCB continuity snapshot; maps decoded GI/integrity reasons only when available, retaining UNKNOWN for missing. Warnings preserve 5→0/4→0, with truthful timestamp/correlation text not asserting harmless reset or no SOE loss. 6 new synthetic tests. Atomic one commit / one CI trigger batch, tests preflighted before branch publish. 7 files: NativeReportMonitorModels.cs, NativeIec61850Client.StaticDataSetReporting.cs, NativeIec61850Client.cs, Iec61850MonitorRuntime.cs, Iec61850ReportContinuityInspector.cs, DiagnosticReportBuilder.cs, ReportActivationCausalityP76ETests.cs. Other threads should not overwrite these without reconciling SHA/PR, and must preserve static reporting authority and UI #486 separately.

CI pending and physical GI/SOE qualification pending. PR draft, no merge/release, no control commands or report/RCB/GI writes added; engine pin unchanged.

This branch has not been deployed

No deployments
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