Skip to content

Unify live and PCAP Sampled Values observation pipeline#38

Merged
masarray merged 12 commits into
mainfrom
agent/p3b-observation-pipeline
Jul 15, 2026
Merged

Unify live and PCAP Sampled Values observation pipeline#38
masarray merged 12 commits into
mainfrom
agent/p3b-observation-pipeline

Conversation

@masarray

@masarray masarray commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Purpose

Complete P3B by routing both live Npcap capture and PCAP replay through one bounded, per-stream observation pipeline before adding profile UI or report presentation.

Completed changes

Shared observation pipeline

  • Added the transport-independent SvStreamObservationManager to ARSVIN.Engine.
  • Added stable stream identity using source MAC, destination MAC, VLAN, APPID, svID, and dataset reference.
  • Deliberately excluded confRev from identity so revision changes remain visible as unstable facts instead of creating artificial streams.
  • Added input provenance for LiveCapture, PcapReplay, or both.
  • Added immutable observation snapshots containing rolling facts, measured rates, counter analysis, SCL binding, provenance, and diagnostics.
  • Added intra-frame consistency diagnostics for mixed svID, dataset, confRev, or payload length.

Subscriber integration

  • Routed live NpcapProcessBusFrameSource traffic and PcapFrames.Read replay through the same manager.
  • Replaced the old Subscriber-local stream-key construction with the shared stable key.
  • Clear operations now reset both runtime visualization state and observation windows.
  • Added observation facts to internal Subscriber snapshots without introducing a large permanent UI panel.
  • Preserved existing waveform, phasor, RMS, payload decoding, and cumulative diagnostics behavior.

SCL and evidence behavior

  • SCL-bound streams contribute ordered dataset signatures with SclDerived provenance.
  • Trusted nominal-frequency context remains separately identified.
  • Unknown or unbound traffic continues to be captured and decoded where possible.
  • No named-profile constants or support claim were added.

Tests and coverage

  • Added deterministic tests for shared live/PCAP windows, input provenance, stable key behavior, confRev changes, dataset separation, SCL signatures, invalid frames, and manager reset.
  • Deterministic suite: 88 tests passed.
  • Whole-engine coverage: 14.61%, 2,423 of 16,582 lines.
  • Whole-engine floor raised to 14.25%.
  • Protocol-core coverage: 72.76%, 1,739 of 2,390 lines.
  • Protocol-core floor raised to 72.5%.
  • README, changelog, build guidance, profile-infrastructure documentation, coverage script, and CI gate are synchronized.

Validation completed

  • Current GPL/commercial-license boundary verification: success.
  • Provenance and public terminology validation: success.
  • GitHub Pages build and validation: success.
  • Locked NuGet restore: success.
  • Publisher warning-free build: success.
  • Subscriber warning-free build: success.
  • 88 tests and raised coverage gates: success.
  • Publisher and Subscriber vulnerability reports: success.
  • Full-solution CodeQL: success.
  • Portable Publisher and Subscriber publication: success.
  • Windows installer compilation: success.
  • CycloneDX SBOM validation: success.
  • Silent installer and uninstaller smoke tests: success.
  • SHA-256 checksum generation: success.
  • Public GitHub Release job on the PR: correctly skipped.

Validated private artifact: ARSVIN-0.0.0-pr.121-windows-x64, digest sha256:73e43809711378b4fcbcad78f0168518d4fd65fe1b6cbe627b965f9639af76f3.

No major WPF redesign and no public release are included.

@masarray
masarray marked this pull request as ready for review July 15, 2026 12:51
@masarray
masarray merged commit 2a8bd5a into main Jul 15, 2026
8 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0f0ad5ff7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

public sealed class SvSubscriberViewModel : ObservableObject, IDisposable
{
private readonly ConcurrentDictionary<string, SvStreamRuntime> _runtimeStreams = new(StringComparer.OrdinalIgnoreCase);
private readonly ConcurrentDictionary<string, SvStreamRuntime> _runtimeStreams = new(StringComparer.Ordinal);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use ordinal row keys for the new stream identity

When the runtime map starts distinguishing stream keys with StringComparer.Ordinal, two SV streams whose svID or dataset reference differs only by case are now separate runtimes, but RefreshUiSnapshots still stores rows and stale-key sets with OrdinalIgnoreCase. In that scenario one row is reused and overwritten for the other stream, so the Subscriber UI hides one of the distinct observed streams; use the same ordinal comparer for _streamRows and the snapshot key set.

Useful? React with 👍 / 👎.

Comment on lines +165 to +166
var signature = profile?.Entries.Select(ToSignature).ToArray()
?? Array.Empty<SvDatasetElementSignature>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate SCL identity before publishing derived facts

When the Subscriber's FindProfile returns its APPID-only fallback for a frame whose dataset reference does not match that SCL stream, this code still converts the profile entries into the observation's DataSetSignature and the state is marked SCL-bound. Since the existing SCL validation does not check DataSetReference, an unexpected dataset can be reported with SCL-derived facts instead of unknown/conflicting facts; require the wire svID and dataset reference to match before setting the signature/bound state.

Useful? React with 👍 / 👎.

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