Skip to content

Preserve full UTC-Time precision and wire provenance - #73

Merged
masarray merged 9 commits into
mainfrom
cleanup/utc-time-current-main-20260814
Aug 14, 2026
Merged

Preserve full UTC-Time precision and wire provenance#73
masarray merged 9 commits into
mainfrom
cleanup/utc-time-current-main-20260814

Conversation

@masarray

Copy link
Copy Markdown
Owner

Current-main consolidation of stale draft PRs #56 and #57.

This port is based on ARIEC main 6ac47500cd094b13e2e8b306bf0544c7d92cb874 and applies the old work selectively rather than merging the diverged branches.

  • centralizes UTC-Time formatting at full 7-digit engine precision plus 5-digit engineering views;
  • fixes the structured MMS renderer so UTC-Time no longer falls back to .fff;
  • preserves exact decoded 8-byte UTC-Time wire bytes and reuses them for byte-exact encode round trips;
  • keeps synthetic UTC-Time explicitly without wire provenance;
  • adds typed forensic evidence for the 24-bit fraction, TimeQuality flags/accuracy, UTC/local-offset views;
  • separates IED timestamps, report TimeOfEntry, and client ReceivedAt evidence;
  • only links raw TimeOfEntry evidence on an exact decoded-report display match;
  • ports the deterministic precision and forensic regressions onto current main.

If this current-main port passes full CI and merges, #56/#57 will be closed as superseded rather than merged directly.

@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: 45fef1268c

ℹ️ 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 string Summary =>
$"IED timestamps={IedTimestamps.Count}; TimeOfEntry={(string.IsNullOrWhiteSpace(ReportTimeOfEntryDisplay) ? "-" : ReportTimeOfEntryDisplay)}; ReceivedAt={ReceivedAtUtc}";

public static MmsReportTimestampEvidence FromFrame(MmsReportFrame frame, MmsInformationReport? decodedReport = null)

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 decoded TimeOfEntry in live report frames

For frames returned by either live reporting path, callers cannot provide decodedReport: TryAppendInformationReport discards it after mapping (MmsReportLiveSession.cs:1591-1592), and the persistent monitor does the same (MmsPersistentReportMonitor.cs:600-601). Consequently the default call FromFrame(frame) always returns empty ReportTimeOfEntry evidence, even when the received UTC-Time has preserved wire bytes. Carry the typed TimeOfEntry value/evidence through MmsReportFrame or populate the evidence while mapping.

Useful? React with 👍 / 👎.

public string FullPrecisionLocal { get; init; } = string.Empty;
public string EngineeringLocal { get; init; } = string.Empty;

public bool ClockSynchronized => !ClockFailure && !ClockNotSynchronized;

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 Keep synchronization unknown when decoding fails

When Decode cannot find a UTC-Time, it returns the default evidence object with IsDecoded == false, but this computed property still evaluates to true because both failure flags default to false. Any consumer inspecting the typed field rather than Summary will therefore report unavailable evidence as a synchronized clock; make synchronization nullable or gate it on IsDecoded.

AGENTS.md reference: AGENTS.md:L88-L90

Useful? React with 👍 / 👎.

@masarray
masarray merged commit d04fe94 into main Aug 14, 2026
1 check 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.

1 participant