Skip to content

P0: adaptive multivendor SV measurement foundation#46

Merged
masarray merged 15 commits into
mainfrom
agent/sv-multivendor-p0
Jul 22, 2026
Merged

P0: adaptive multivendor SV measurement foundation#46
masarray merged 15 commits into
mainfrom
agent/sv-multivendor-p0

Conversation

@masarray

@masarray masarray commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Scope

This draft starts the real-device/multivendor Subscriber hardening program using SMU615-style installed-base traffic as the first reference case, without adding vendor-name conditionals to the protocol core.

Implemented in this tranche

  • provenance-aware raw-to-engineering scaling with conservative 9-2LE-style structural gates
  • explicit raw-count fallback when units are not proven
  • 50/60 Hz-neutral timebase resolution (no hidden 50 Hz assumption)
  • robust smpCnt transition tracking for normal wrap, gaps, duplicates, out-of-order traffic, and trusted restarts
  • rolling current stream health separated from cumulative session issue totals
  • waveform/RMS/phasor processing on engineering values when scaling evidence is sufficient
  • raw, scaled value, scaling confidence, timebase source, and reason visibility in the UI
  • dynamic A/V/count waveform units and stable near-zero display scaling
  • header clipping and incorrect green BAD status styling fixes
  • deterministic engine tests for scaling, timebase, and counter behavior

Validation at head 31ded4f

  • CI: passed
  • Publisher warnings-as-errors build: passed
  • Subscriber warnings-as-errors build: passed
  • test and coverage gates: passed
  • dependency vulnerability checks: passed
  • Windows release build: passed
  • CodeQL: passed

Safety boundary

Named vendor identity is not used as a scaling rule. Unknown or conflicting streams remain visible in raw counts. This is an engineering analyzer enhancement, not a conformance or calibrated-test claim.

Still pending after this draft tranche

  • sanitized SMU615 SCL/PCAP golden evidence pack
  • primary/secondary conversion from explicit CT/VT context
  • detailed quality-bit semantic classification
  • local Npcap drop/queue-overrun attribution
  • IEC 61869-9 profile manifests and additional vendor fixtures

@masarray
masarray marked this pull request as ready for review July 22, 2026 07:55
@masarray
masarray merged commit e517ac7 into main Jul 22, 2026
6 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: 31ded4fe9d

ℹ️ 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 +86 to +95
var samplingEvidence = HasProtectionRateEvidence(evidence);
if (!evidence.IsSclBound && !samplingEvidence)
return SvEngineeringScale.RawOnly("The fixed layout is visible, but sampling or SCL evidence is insufficient for engineering scaling.");

var source = evidence.IsSclBound
? SvEngineeringScaleSource.SclBackedLegacy92LeStyle
: SvEngineeringScaleSource.Legacy92LeStyleStructuralInference;
var confidence = evidence.IsSclBound
? SvEngineeringScaleConfidence.SclBacked
: SvEngineeringScaleConfidence.Inferred;

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 Keep SCL binding from certifying a scale

For any SCL-bound stream whose 64-byte 4I+4U payload uses device-specific raw multipliers, this condition accepts the stream without sampling evidence and the resolver then applies the fixed 0.001/0.01 conversions while labelling them SclBacked. In this codebase the SCL payload layout supplies element types and offsets, not a scaling multiplier, so a valid but differently scaled bound stream will display incorrect A/V values as SCL-backed engineering measurements. Require explicit scale/CT/VT context (or keep this path raw/provisional) rather than treating binding alone as scale evidence.

AGENTS.md reference: AGENTS.md:L24-L28

Useful? React with 👍 / 👎.

Comment on lines +191 to +192
if (resolvedTimebase.IsResolved || !_timebase.IsResolved)
_timebase = resolvedTimebase;

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 Discard the old timebase after an unresolved reconfiguration

When an already resolved stream changes confRev, sample rate, or layout and the new evidence cannot resolve a timebase, this guard retains the prior configuration's frequency, samples-per-cycle, and counter wrap indefinitely. The subsequent loop uses that stale wrap to classify smpCnt, and the snapshot continues generating a waveform/phasors using the old cycle length, so a reconfigured live stream can be shown as healthy engineering data or spuriously report gaps rather than reverting to the intended unresolved-timebase state. Reset/replace the cached resolution when the configuration changes or its sampling declarations no longer match.

AGENTS.md reference: AGENTS.md:L7-L7

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