Skip to content

feat(plc): log every reconciliation outcome (#158) - #195

Merged
mrcsin merged 1 commit into
masterfrom
plc-reconcile-logging
Nov 18, 2026
Merged

mrcsin merged 1 commit into
masterfrom
plc-reconcile-logging

Conversation

@mrcsin

@mrcsin mrcsin commented Nov 18, 2026

Copy link
Copy Markdown
Member

Problem

On every sync enable, the PLC reconciliation decides whether the operator is asked to resolve a conflict between the PLC recipe and the local one. It ended at seven exits; three hand the local recipe to the PLC and look identical to "the recipes matched", and one logged nothing. A field log could not say which exit ran when the conflict dialog failed to appear (#158).

What changed

  • Every exit produces a named outcome (PlcReconciliationOutcome), logged once per reconciliation with the local step count and validity, the PLC step count and commit flag where known, and whether a conflict subscriber exists.
  • A begin line at the Connected edge separates "never ran" from "ran and chose X".
  • The PlcLifecycleManager log source is pinned at Information, so these lines appear at the default Warning level. docs/readme.md §5 documents the lines.
  • No behaviour change: every exit does what it did before. This slice does not close Sync flow bug #158; later slices do.
  • Tests assert the outcome, level and logged values (the test logger keeps structured properties), not log wording. Rebased onto the analyzer baseline, the test cleanup and the docs/ rename.

Verification

  • dotnet build SemiStep.slnx: 0 warnings, 0 errors.
  • dotnet test SemiStep/SemiStep.Tests/SemiStep.Tests.csproj: 1434 passed, 0 failed (Area=Reconnect 35, Area=Logging 15).
  • No hardware test belongs to this slice (plan); the reconciliation roadmap's manual gate runs after later slices.

🤖 Generated with Claude Code

On every sync enable, the PLC reconciliation decides whether the
operator is asked to resolve a conflict between the PLC recipe and the
local one. It ended at seven exits, three of which hand the local
recipe to the PLC and look identical to "the recipes matched"; one of
them logged nothing. A field log could not say which exit ran when the
conflict dialog failed to appear, which is what the diagnosis of #158
needs.

Every exit now produces a named outcome, logged once per
reconciliation with the local step count and validity, the PLC step
count and commit flag where known, and whether a conflict subscriber
exists. A begin line at the Connected edge separates "never ran" from
"ran and chose X". The PlcLifecycleManager log source is pinned at
Information, so the lines appear at the default Warning level. No
behaviour changes: every exit does what it did before. Tests assert
the outcome, level and logged values, not log wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrcsin
mrcsin marked this pull request as ready for review November 18, 2026 12:41
@mrcsin
mrcsin merged commit db562c2 into master Nov 18, 2026
1 check passed
@mrcsin
mrcsin deleted the plc-reconcile-logging branch November 18, 2026 12:45
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.

Sync flow bug

1 participant