Skip to content

Add evidence-aware Sampled Values profile infrastructure#27

Merged
masarray merged 66 commits into
mainfrom
agent/sv-profile-infrastructure
Jul 12, 2026
Merged

Add evidence-aware Sampled Values profile infrastructure#27
masarray merged 66 commits into
mainfrom
agent/sv-profile-infrastructure

Conversation

@masarray

@masarray masarray commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Purpose

Implement the standards-neutral profile foundation required before adding verified named Sampled Values profiles.

Engine changes

  • Add transport-independent frame observations and observation-window accumulation.
  • Calculate stable fields, measured frame/sample rates, and observed sample-counter wrap.
  • Add evidence-aware profile definitions with sampling, packing, payload, dataset, tolerance, and mandatory source metadata.
  • Add an explainable weighted detector with match, conflict, unknown, score, and confidence output.
  • Require sufficient evaluated evidence plus dataset and sampling matches before a profile may reach Confirmed.
  • Add strict and compatible configuration-versus-wire comparison without blocking receive-side capture or decoding.
  • Keep the built-in catalog limited to a generic SCL-driven Layer-2 fallback; no unverified named-profile constants are introduced.

Tests and coverage

  • Observation rate, stable-field, and counter-wrap behavior.
  • Exact, conflicting, sparse, and insufficient-evidence profile detection.
  • Evidence explanations and generic-catalog boundaries.
  • Strict versus compatible mismatch behavior.
  • Profile-definition source, sampling, and dataset validation.
  • 74 deterministic tests pass.
  • Whole-engine coverage: 13.35% across 16,312 lines; enforced floor raised to 13%.
  • Protocol-core coverage: 70.47% across 2,120 lines; enforced floor raised to 70%.

Public repository language

  • Replace proprietary comparison language with neutral engineering outcomes.
  • Add an automated public terminology-neutrality check to CI and Pages deployment.
  • Retain a validation report artifact for review.
  • Document the profile infrastructure, output contract, evidence intake, and acceptance boundary.

Validation completed

  • Public terminology validation: success.
  • Public-site build and recursive validation: success.
  • Locked restore: success.
  • Publisher and Subscriber warning-free builds: success.
  • Unit tests and raised coverage gates: success.
  • Dependency vulnerability reports: success.
  • Full-solution CodeQL: success.
  • Portable Publisher and Subscriber publication: success.
  • Installer compilation: success.
  • CycloneDX SBOM validation: success.
  • Silent install/uninstall smoke tests: success.
  • SHA-256 checksum generation: success.
  • Public release job on the PR: correctly skipped.

Not included

  • No new public profile-support claim.
  • No frozen 9-2LE or IEC 61869-9 numeric definition.
  • No WPF or live-capture integration yet.
  • No public release.

masarray added 30 commits July 13, 2026 05:19
masarray added 26 commits July 13, 2026 05:34
@masarray
masarray marked this pull request as ready for review July 12, 2026 23:07
@masarray
masarray merged commit 9440f08 into main Jul 12, 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: e6b0823c46

ℹ️ 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 +70 to +71
CompareText("SV_ID", "svID", expected.SvId, observed.SvId, mode, findings);
CompareText("SV_DATASET", "Dataset reference", expected.DataSetReference, observed.DataSetReference, mode, findings);

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 Preserve exact svID and dataset identifiers

When strict comparison checks svID and dataset reference through CompareText, it also uses the MAC-style normalization that strips -/: and compares case-insensitively. In strict preflight this makes different bindings such as MU-01 vs mu01 or LLN0$Phs-A vs LLN0$PhsA look like an exact match, even though those identifier strings are not MAC addresses and should remain significant. Apply separator-insensitive normalization only to the destination MAC field.

Useful? React with 👍 / 👎.

Comment on lines +152 to +155
if (score >= 70 && evaluatedWeight >= MinimumLikelyWeight)
return SvProfileConfidence.Likely;
if (score >= 45 && evaluatedWeight >= MinimumPossibleWeight)
return SvProfileConfidence.Possible;

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 Return Conflict when any evaluated fact contradicts

A low-weight contradiction can be hidden as Likely or Possible here because those thresholds run before the final conflictWeight > 0 check. For example, if all high-weight fields match but nominal frequency conflicts, conflictWeight is less than matchedWeight and the score stays above 70, so the detector reports Likely despite contradictory evidence; the new output contract says to use Conflict when evaluated facts contradict a definition, and consumers sorting/displaying by confidence can otherwise present a conflicting profile as acceptable.

Useful? React with 👍 / 👎.

@masarray masarray mentioned this pull request Jul 13, 2026
13 tasks
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