Skip to content

fix(opctreemanager): make the log a technical record - #146

Merged
mrcsin merged 1 commit into
masterfrom
opctreemanager-log-as-technical-record
Sep 22, 2026
Merged

mrcsin merged 1 commit into
masterfrom
opctreemanager-log-as-technical-record

Conversation

@mrcsin

@mrcsin mrcsin commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

The log claimed outcomes it could not observe and hid the ones it could. A run that logged errors still ended with Deferred execution completed successfully, and nothing said which nodes came back unwired: the 119 unresolved links of the 2026-09-22 run were only findable by scripting over tree.json. The deferred pass cannot raise the Failed pin, because the host replaces the FB instance between runtime cycles, so the log is the only channel and every line now states exactly what the code observed.

Type of change

  • fix — bug fix

Changes

  • one rebuild summary carrying the verdict taken from the counters, with an action clause naming what the operator should do
  • a per-node tally at Error: links, resolved, unresolved
  • the snapshot line carries node count, link count and the file's write date
  • the plan is stated before it runs, not after
  • a construction with no links says so instead of passing silently
  • connects report issued and threw. issued is the strongest claim available: connections cannot be read back in-process, see Docs/known_issues/11-opc-pinpout-sibling-and-iconnect-connect.md
  • errors cross the service as errors, with the CausedBy chain flattened into the message instead of the FluentResults wrapper text
  • SourceContext left the log template: it read PlanExecutor on 1231 of 1233 Debug lines

Changes touching FB code

  • XML pin IDs match the const int *PinId constants in the FB class
  • New runtime-only fields carry [NonSerialized]
  • [ComVisible(true)] + [Guid] untouched on existing FBs
  • Read Docs/architecture/masterscada-fb-primer.md and Docs/architecture/architecture.md
  • Checked Docs/known_issues/ — 07 (deferred pass cannot raise pins) and 11 (no read-back) both apply

Tree-modifying FBs only

  • Mutations are queued in UpdateData and executed from a System.Windows.Forms.Timer polling IProjectHlp.InRuntime
  • Results written to the file log
  • No BeginInvoke self-reposting

Testing

  • dotnet build NtoLib.sln — 0 errors, 0 warnings
  • dotnet test NtoLib.sln — 373 passed
  • dotnet format NtoLib.sln --verify-no-changes — exit 0
  • Manual host smoke 2026-09-22: 1363 lines, the per-node tallies reproduce the figures previously derived by script (CBr4 94/94, Water 12/12, GasLine 8/14, Shutters 5/13), and connects issued=1208 + unresolved=119 closes against the snapshot's 1327 links

An unwritable LogFilePath does not disable the FB: WriteTo.File catches the sink construction failure and installs a null sink. OpcLoggerFactoryTests pins that.

The log claimed outcomes it could not observe and hid the ones it could. A run
that logged errors still ended with "Deferred execution completed successfully",
and the operator had no way to see which nodes came back unwired; the 119
unresolved links of the 2026-09-22 run were only findable by scripting over
tree.json.

The deferred pass cannot raise the Failed pin, because the host replaces the FB
instance between runtime cycles, so the log is the only channel and every line
now states exactly what the code observed:

- one rebuild summary with the verdict taken from the counters, and an action
  clause naming what the operator should do
- a per-node tally at Error: links, resolved, unresolved
- the snapshot line carries node count, link count and the file's write date
- the plan is stated before it runs, not after
- a construction with no links says so instead of passing silently
- connects report issued and threw; "issued" is the strongest claim available,
  because connections cannot be read back in-process (known_issues/11)
- errors cross the service as errors, with the CausedBy chain flattened into the
  message instead of the FluentResults wrapper text
- SourceContext left the log template: it read PlanExecutor on 1231 of 1233
  Debug lines
@mrcsin
mrcsin merged commit 9dac9cd into master Sep 22, 2026
1 check passed
@mrcsin
mrcsin deleted the opctreemanager-log-as-technical-record branch September 22, 2026 15:42
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