Skip to content

Fix FAT Clock Sync control and immediate TRUE evidence - #150

Merged
masarray merged 4 commits into
mainfrom
fat-clock-sync-evidence-time
Aug 13, 2026
Merged

Fix FAT Clock Sync control and immediate TRUE evidence#150
masarray merged 4 commits into
mainfrom
fat-clock-sync-evidence-time

Conversation

@masarray

Copy link
Copy Markdown
Owner

What changed

  • Adds a real Clock Sync checkbox to the FAT workspace action row.
  • Checkbox defaults ON to preserve v1.6.24 behavior.
  • Unchecking stops the ARSAS SNTP service while leaving IEC 61850 monitoring untouched.
  • Re-checking re-attaches the Clock Sync lifecycle to connected IEDs and resumes the SIPROTEC-compatible SNTP profile.
  • Raises FAT evidence dispatcher priority from Background to DataBind so a TRUE edge is evaluated and its ON evidence is bound before the next UI render instead of being delayed until a later FALSE edge under busy live monitoring.

Audit finding

The transition evaluator already captures ON evidence on the FALSE→TRUE edge. The delay was downstream: the FAT session controller drain was scheduled through WPF at DispatcherPriority.Background, allowing live UI/monitor traffic to postpone evidence processing. The timestamp columns continue to display actual relay timestamps only; this patch does not substitute laptop time for missing relay t values.

Safety invariants

  • Clock Sync OFF never disconnects IEC 61850.
  • ARSAS still does not stop or reconfigure Windows Time.
  • Existing UDP/123 fail-open behavior remains unchanged.
  • SNTP remains SIPROTEC compatibility stratum 2; no GPS/PTP/stratum-1 claim.

@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: dfe3354868

ℹ️ 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 +20 to +22
Devices.CollectionChanged -= ClockSyncDevices_CollectionChanged;
foreach (var device in Devices)
device.PropertyChanged -= ClockSyncDevice_PropertyChanged;

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 Guard queued reconciles when Clock Sync is disabled

If IsConnected changes on a runtime thread just before these handlers are removed, ClockSyncDevice_PropertyChanged may already be enqueuing ScheduleClockSyncReconcile on the dispatcher. While this method awaits StopAsync, that queued reconcile can wait behind _clockSyncIntegrationGate and then restart the SNTP service after the stop completes, because neither scheduling nor EnsureClockSyncForDeviceAsync checks _clockSyncEnabled. In that race, the unchecked control continues serving and broadcasting time; recheck the enabled state after dispatching and after acquiring the gate, or cancel pending reconciles.

Useful? React with 👍 / 👎.

@masarray
masarray merged commit 1e9fdc5 into main Aug 13, 2026
3 checks passed
masarray added a commit that referenced this pull request Aug 13, 2026
…163)

Preserve #150 immediate TRUE-edge evidence priority while retaining P0 bounded 64-snapshot / 4-ms drain yielding. First drain dispatch uses DataBind; backlog continuations yield at Background. Validated on exact current-main integration head with IO FAT, deterministic SV, and full Windows build/test/package gates.
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