Skip to content

P2: primary secondary measurement context workflow#49

Merged
masarray merged 13 commits into
mainfrom
agent/sv-context-profiles-p2
Jul 22, 2026
Merged

P2: primary secondary measurement context workflow#49
masarray merged 13 commits into
mainfrom
agent/sv-context-profiles-p2

Conversation

@masarray

@masarray masarray commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Scope

This phase turns the P1 primary/secondary conversion API into a user-facing, repeatable engineering workflow.

Implemented

  • CT/VT measurement-context editor for the selected logical SV stream
  • explicit wire-domain and preferred display-domain selection
  • independent current and voltage ratios with evidence source and reference
  • primary/secondary conversion applied to decoded values, waveform, RMS, and phasors
  • conservative per-domain fallback when a ratio is absent
  • context persistence across live UI refreshes and stream rediscovery in the same session
  • versioned measurement-context JSON import/export
  • schema validation, duplicate-key rejection, unit validation, and enum-safe serialization
  • responsive toolbar actions added without changing selected-stream behavior
  • deterministic serializer and ratio-resolution tests
  • engineering workflow documentation

Validation at head 549a7b2

  • CI: passed
  • Publisher warnings-as-errors build: passed
  • Subscriber warnings-as-errors build: passed
  • test and coverage gates: passed
  • dependency vulnerability checks: passed
  • Windows portable and installer build: passed
  • installer silent smoke test: passed
  • SBOM and checksum generation: passed
  • GitHub Pages validation: passed
  • CodeQL: passed

Safety boundary

Context changes presentation only. Raw bytes and protocol-scaled wire values remain preserved. No ratio is inferred from vendor identity, APPID, MAC address, amplitude, or naming.

Pending after this tranche

  • embed measurement context directly into the Subscriber evidence bundle schema
  • automatic ratio extraction from reviewed SCL/device setting sources
  • local Npcap/kernel/queue drop attribution
  • versioned declarative SV profile manifests
  • fixture-backed IEC 61869-9 profiles
  • SMU615 device-observed validation pack

@masarray
masarray marked this pull request as ready for review July 22, 2026 09:12
@masarray
masarray merged commit 7e5a28c into main Jul 22, 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: 549a7b2de3

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

Comment on lines +311 to +314
SvMeasurementValueDomain.PrimaryEngineering when context.DisplayDomain == SvMeasurementValueDomain.SecondaryEquivalent
=> ratio.SecondaryNominal / ratio.PrimaryNominal,
SvMeasurementValueDomain.SecondaryEquivalent when context.DisplayDomain == SvMeasurementValueDomain.PrimaryEngineering
=> ratio.PrimaryNominal / ratio.SecondaryNominal,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move CT/VT conversion into the shared engine

This reimplements the primary/secondary conversion in the WPF view model instead of consuming an engine contract. Decoded rows use SvMeasurementDomainResolver, while waveform and phasor conversion use this separate multiplier; any correction to conversion semantics or validation can therefore make the grid disagree with the plots/RMS output. Centralize this conversion in ARSVIN.Engine and have all Subscriber presentations consume the same typed result.

AGENTS.md reference: AGENTS.md:L14-L16

Useful? React with 👍 / 👎.

Comment on lines +100 to +102
var duplicateKeys = Streams
.Where(item => !string.IsNullOrWhiteSpace(item.StreamKey))
.GroupBy(item => item.StreamKey, 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 Reject null stream arrays during JSON import

A syntactically valid import such as {"streams":null} deserializes with Streams set to null, then this dereference throws NullReferenceException. FromJson only converts JsonException to InvalidDataException, and the UI import handler catches only IO, authorization, and invalid-data exceptions, so importing this malformed-but-valid JSON can escape the handler rather than show the intended validation error.

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