Skip to content

P3-H P1.1: explicit SV profile-family and transport authority - #143

Merged
masarray merged 6 commits into
mainfrom
hardening/smv-p1-1-profile-family
Oct 6, 2026
Merged

masarray merged 6 commits into
mainfrom
hardening/smv-p1-1-profile-family

Conversation

@masarray

@masarray masarray commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Tracks #139 after merged #140, #141 and #142.

Base: main@67cf57e01e3d53a98c66b10934f73c0eb1381d75
Exact head: 5ded1506ddb58cf8b3f7eb2183abb501d9ab3e24

Purpose

Make Sampled Values transport identity and standards/profile family explicit engineering authority rather than implicit assumptions.

P1 separated sample cadence from Ethernet frame cadence. P1.1 separates:

  • configured multicast/unicast transport;
  • universal SV APPID/MAC invariants;
  • per-stream profile-family resolution;
  • current ESP32-P4 device capability.

Single-authority rules

  • SampledValueControl@multicast survives parse/model/canonical export; omission uses the IEC 61850-6 default true; explicitly malformed values are preserved as invalid provenance and block profile compilation/canonical export.
  • SV APPID is gated to 0x4000..0x7FFF.
  • multicast SV destination is gated to 01-0C-CD-04-00-00..01-0C-CD-04-01-FF.
  • unicast SV requires a nonzero unicast Ethernet destination.
  • profile family is never inferred from vendor, filename, svID, DataSet name or shape.
  • family state is per stream, so resolving one SV stream cannot classify another.
  • fixed 4I+4V semantic matching has one host authority consumed by the ESP capability gate.

Family behavior

  • Unspecified — inspectable Class B; ESP reports needs-profile-family-confirmation.
  • Generic IEC 61850-9-2 — explicit resolved family; proceeds through timing/counter/device gates.
  • Legacy 9-2LE — explicit compatibility target requiring multicast, APPID 0x4000, fixed 4I+4V INT32+Quality, and supported packetization. This is not a formal UCA conformance claim.
  • IEC 61869-9 — represented explicitly but incomplete / non-deployable until scaling and variant rules have their own standards-backed authority.

Engineering surfaces

  • Studio arbitrary SCL starts each stream as unspecified.
  • Studio family selection modifies only the selected stream.
  • the explicitly named built-in 9-2LE reference uses Legacy 9-2LE by construction.
  • CLI schema v3 supports a document default --profile-family FAMILY plus repeatable per-stream --stream-profile-family INDEX:FAMILY overrides.
  • legacy SMV GUI carries a per-stream family map into the same C++ CLI authority.
  • counter confirmation alone cannot promote an unresolved family to Class A.

Regression coverage

  • generic multicast and unicast;
  • invalid APPID / multicast / unicast address rejection;
  • Legacy 9-2LE family gates;
  • IEC 61869-9 stays blocked;
  • unspecified family stays inspectable;
  • explicit false and default-true multicast parsing;
  • malformed explicit multicast fails closed in profile compilation and canonical export;
  • multicast=false canonical export -> reparse preservation;
  • mixed two-stream CLI fixture proves stream 0 may be resolved while stream 1 remains unspecified / Class B;
  • Studio and legacy-GUI family-resolution surfaces.

Non-goals

No IEC 61869-9 scaling implementation, no generic multi-ASDU ESP publisher, no multi-stream realtime scheduler, no PRP/HSR work, and no formal conformance claim.

Next after acceptance: P1.2 IEC 61869-9 variant/scaling authority.

Preserve SampledValueControl multicast intent, centralize IEC SV APPID/MAC rules, require explicit profile-family context for deployment, share the fixed 9-2LE 4I+4V semantic validator, and keep IEC 61869-9 representable but non-deployable until variant/scaling rules are complete. Tracks #139.
Expose profile-family and transport state in Studio/CLI, keep arbitrary SCL unresolved until the engineer selects a family, wire the legacy GUI and its CI to the same CLI authority, retain IEC 61869-9 as non-deployable until its profile rules mature, and regression-test multicast parse/export preservation. Tracks #139.
Keep profile-family context attached to each SV stream instead of the whole document/session. Add per-stream CLI overrides, propagate the same map through the legacy GUI backend, and regression-test mixed resolved/unresolved streams so one selection cannot silently classify another. Tracks #139.
The compact SV fixture contains three streams. Assert the semantic invariant directly: stream 0 may be explicitly resolved while every remaining stream stays unspecified/Class B, without hard-coding the fixture cardinality. Tracks #139.
Preserve whether SampledValueControl@multicast was syntactically valid, reject malformed explicit transport input during profile compilation, and block canonical export from silently normalizing invalid SCL into a deployable configuration. Tracks #139.
Treat malformed multicast provenance as part of modeled Sampled Values semantics so workspace round-trip checks cannot equate invalid engineering input with a valid normalized transport value. Tracks #139.

masarray commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

Standards review note for the strict Legacy 9-2LE family:

Keep the existing APPID == 0x4000 gate for strict 9-2LE compatibility. The broader IEC 61850-9-2 SV allocation remains 0x4000..0x7FFF, and configured APPIDs in that range belong to the generic IEC 61850-9-2 family.

This distinction is intentional:

  • strict 9-2LE interoperability profile -> APPID 0x4000;
  • generic/configured IEC 61850-9-2 -> APPID 0x4000..0x7FFF.

Do not relax the Legacy family rule merely because a vendor/example emits another APPID; classify that behavior under generic/configured 9-2 unless independent profile evidence says otherwise. This preserves profile identity without vendor-specific branches.

@masarray
masarray marked this pull request as ready for review October 6, 2026 22:04
@masarray
masarray merged commit 9755b57 into main Oct 6, 2026
39 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T22:05:14.823030Z 5ded150 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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