Skip to content

P3-H P0: centralize Process Bus VLAN invariants - #140

Merged
masarray merged 1 commit into
mainfrom
hardening/smv-p0-standards-invariants
Oct 6, 2026
Merged

masarray merged 1 commit into
mainfrom
hardening/smv-p0-standards-invariants

Conversation

@masarray

@masarray masarray commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Tracks #139. Continues #24 / #33 / #36 from exact main baseline c7238d3a8ff86b30b397164c5fcbed820562b3e0.

Why

The core Ethernet encoder already rejects IEEE 802.1Q VID 4095, but several upstream SV/Studio/embedded gates accepted it. That allowed an invalid profile to survive configuration/deployment validation and fail only when the frame/template reached the encoder. The generic PTP Ethernet builder had the same off-by-one inconsistency.

This PR removes that split authority.

Architecture

  • Ethernet core owns the generic 802.1Q invariant:
    • PCP 0..7
    • VID 0..4094
    • VID 4095 reserved
  • SV compiler, SV frame codec, Studio device bridge and ESP32-P4 runtime consume that authority.
  • Generic PTP Ethernet framing consumes the same Ethernet invariant.
  • PTP runtime policy remains separate and may still intentionally reject VID 0 for its own profile; this PR does not broaden that policy.
  • SV priority-tagged VID 0 remains valid.
  • No change to current 4I+4V packet layout, scheduler, waveform engine, smpCnt policy or synchronization policy.

Regression coverage

  • SCL/SV profile compiler: VID 0 remains valid through the existing 4800 fixture, VID 4094 accepted, VID 4095 rejected before a profile is produced.
  • SV frame codec: VID 0 and 4094 encodable; VID 4095 fails closed.
  • Generic PTP Ethernet builder: VID 0 and 4094 accepted; VID 4095 and PCP 8 rejected.
  • Existing golden SV bytes remain unchanged for valid reference traffic.

Multi-thread / recovery boundary

This is only P0 of #139. Do not fold P0.1 WirePlan, multi-ASDU, IEC 61869-9 profile expansion, scaling, PRP/HSR or admission planning into this PR.

Next node after this PR is accepted: P0.1 deterministic encoder-produced WirePlan/patch metadata, replacing find_fixed_field() without adding a second BER parser.

Merge gate

Keep Draft until exact-head required CI is green. Physical bench evidence is not required for this pure validation invariant change, but no product/release conformance claim is made by this PR.

Use one IEEE 802.1Q wire invariant for VID/PCP validation, reject reserved VID 4095 before deployment/encoding, preserve priority-tagged VID 0 where generic Ethernet permits it, and add SV/SCL/PTP boundary regressions. Tracks #139.
@masarray
masarray marked this pull request as ready for review October 6, 2026 12:43
@masarray
masarray merged commit ea42c68 into main Oct 6, 2026
46 checks passed
@chatgpt-codex-connector

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-06T12:44:46.241978Z a09e031 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