G
YouTube TikTok Games
Skip to content

fix(IEC-101): one-owner TX/RX evidence, bounded link state and safe Event Trace fallback - #199

Merged
masarray merged 12 commits into
masterfrom
fix/iec101-exchange-ownership-20261113
Nov 13, 2026
Merged

masarray merged 12 commits into
masterfrom
fix/iec101-exchange-ownership-20261113

Conversation

@masarray

Copy link
Copy Markdown
Owner

Milestone: forensic evidence correctness without adding UI bulk

Audited current master after #197/#198; preserve merged Event Journal, validated RX ASDU restoration, Frame Details, Command Panel and release workflows.

Confirmed risk

The previous map retained the last Class 1/2 TX for a physical link until a new TX arrived. Two different RX frames could both claim that same poll as their request within the 45 s time window, and the bounded-Trace fallback skipped intervening secondary replies. That is misleading evidence, especially during IEC-101 FIFO/event drain investigations.

Implementation

  • New bounded EventFrameExchangeTracker: one pending request per (source, link); first physical RX consumes it; FC9/ACK/malformed RX also closes eligibility; same physical RX's sibling IOAs are idempotent and share the one verified TX; new TX supersedes the old poll. Bounded at 256 physical links with deterministic oldest-activity eviction; reset at session clear.
  • TX/RX acceptance requires a validated FT1.2 checksum + length plus primary Class 1/Class 2 function (FC10/FC11) and secondary user data (FC8) respectively. Do not manufacture a pair from malformed/unknown wire.
  • FindLatestObservedPoll can only walk backward from the exact RX still present in the chronological Trace, and stops at any intervening response or nonpoll TX. No timestamp-only inference when the source RX was evicted.
  • Event -> Original Frame retained-context fallback is now restricted to the same physical source and IEC-101 link address: never blend Link A/Link B or other stations in one event investigation.

Regression

New unit cases for one-shot consumption, multi-IOA physical RX fan-out, FC9/FC0 barriers, bad checksum, supersession, dual link separation, passive stream offsets, and bounded tracking. Existing fallback tests strengthened.

Test / merge rule

Normal PR Windows build and all xUnit suites, plus explicit /ci full PR-head Windows GUI smoke and OBS-C screenshot acceptance must pass before merge. This milestone has no installer or release changes; full PR run is correctness evidence only. On real serial hardware, capture provenance still requires field replay.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-13T09:19:23.043003Z
We couldn’t complete this review. Comment @codex review to try again.
3927da8 PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Copy Markdown
Owner Author

/ci full

Copy link
Copy Markdown
Owner Author

/ci full

Copy link
Copy Markdown
Owner Author

/ci full

Comment on lines +58 to +66
foreach (var link in _links)
{
if (!EventFrameExchange.SamePhysicalSource(
link.Key.Source, frame.PhysicalSource)) continue;
link.Value.PendingPoll = null;
link.Value.LastResponse = null;
link.Value.MatchedPoll = null;
link.Value.Touch = ++_nextTouch;
}
@masarray
masarray merged commit 6ac6582 into master Nov 13, 2026
9 checks passed
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.

2 participants