docs: fill missing XML docs and strip tracking IDs from src comments

Clears CommentChecker findings in src/ (3,280 -> 209, the remainder being false
positives like PLC-5/IEEE-754/M0.0) by adding missing summaries/params/returns,
normalising inheritdoc usage, and removing Gitea/review tracking IDs while keeping
the rationale they annotated. Comment-only: comment-stripped sources are identical
to the parent commit.
This commit is contained in:
Joseph Doherty
2026-10-15 06:14:58 -04:00
parent ebcbd81fca
commit 826312befe
430 changed files with 4434 additions and 3923 deletions
@@ -9,7 +9,7 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS;
/// <see cref="FocasAreaKind.Fixed"/> (a logical path into the driver's fixed tree —
/// <c>FIXED:Identity/SeriesNumber</c>, <c>FIXED:Axes/X/AbsolutePosition</c>), plus
/// <see cref="FocasAreaKind.Alarm"/> (a selector over the CNC's active alarm list — <c>ALARM:*</c>,
/// <c>ALARM:Servo/401</c>, <c>ALARM:OTHER</c>; see <see cref="FocasAlarmSelector"/>, Gitea #647).
/// <c>ALARM:Servo/401</c>, <c>ALARM:OTHER</c>; see <see cref="FocasAlarmSelector"/>).
/// </summary>
/// <remarks>
/// <para>PMC letters: <c>X/Y</c> (IO), <c>F/G</c> (signals between PMC + CNC), <c>R</c> (internal
@@ -22,12 +22,12 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS;
/// snapshot the driver's own poll loop already maintains (<c>cnc_sysinfo</c>, <c>cnc_rddynamic2</c>,
/// program info, timers, spindle data). It exists because the fixed tree is the only part of the
/// FOCAS surface with no address of its own, and v3 publishes nodes only for authored tags — so
/// without a form to author, the fixed tree could not be published at all (Gitea #540).
/// without a form to author, the fixed tree could not be published at all.
/// </para>
/// <para>
/// <b>The path carries no device.</b> A tag's device comes from its raw-tag Device row, and an
/// address that also named a host would be a second, conflicting routing channel — which is
/// precisely the defect #540 reported: the browse leaf's <c>{host}/{path}</c> full reference was
/// precisely the defect once reported: the browse leaf's <c>{host}/{path}</c> full reference was
/// written into the address field verbatim and then failed to parse, so every browse-committed
/// fixed-tree tag read <c>BadNodeIdUnknown</c> forever.
/// </para>
@@ -43,7 +43,7 @@ public sealed record FocasAddress(
/// <summary>The prefix that introduces a <see cref="FocasAreaKind.Fixed"/> address.</summary>
public const string FixedPrefix = "FIXED:";
/// <summary>The prefix that introduces a <see cref="FocasAreaKind.Alarm"/> address (Gitea #647).</summary>
/// <summary>The prefix that introduces a <see cref="FocasAreaKind.Alarm"/> address.</summary>
public const string AlarmPrefix = "ALARM:";
/// <summary>Gets the canonical string representation of this address.</summary>
@@ -113,7 +113,7 @@ public sealed record FocasAddress(
return path is null ? null : new FocasAddress(FocasAreaKind.Fixed, null, 0, null, path);
}
// Alarm selector (Gitea #647). Tested BEFORE the PMC branch for the same reason as FIXED: — "A" is a
// Alarm selector. Tested BEFORE the PMC branch for the same reason as FIXED: — "A" is a
// valid PMC letter (message display), so ALARM:… must be owned by this rule, not diagnosed as PMC.
if (src.StartsWith(AlarmPrefix, StringComparison.OrdinalIgnoreCase))
{
@@ -213,7 +213,7 @@ public enum FocasAreaKind
/// <summary>
/// A selector over the device's active CNC alarm list (<c>ALARM:*</c>, <c>ALARM:Servo/401-453</c>,
/// <c>ALARM:OTHER</c>) — Gitea #647. Meaningful only on a raw tag that also carries the cross-driver
/// <c>ALARM:OTHER</c>). Meaningful only on a raw tag that also carries the cross-driver
/// <c>alarm</c> object, which makes it ONE Part 9 condition at its RawPath; it has no value to read
/// and nothing to write.
/// </summary>
@@ -2,7 +2,7 @@ using System.Globalization;
namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS;
/// <summary>Which CNC alarms an <c>ALARM:</c> address selects (Gitea #647).</summary>
/// <summary>Which CNC alarms an <c>ALARM:</c> address selects.</summary>
public enum FocasAlarmSelectorKind
{
/// <summary><c>ALARM:*</c> — every active alarm on the tag's device (a device summary condition).</summary>
@@ -20,7 +20,7 @@ public enum FocasAlarmSelectorKind
}
/// <summary>
/// The selector half of an <c>ALARM:</c> FOCAS address (Gitea #647): which entries of the CNC's flat,
/// The selector half of an <c>ALARM:</c> FOCAS address: which entries of the CNC's flat,
/// per-device active-alarm list (<c>cnc_rdalmmsg2</c>) drive the ONE Part 9 condition the raw tag is
/// materialised as.
/// </summary>
@@ -11,8 +11,8 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS;
/// matching type rather than relying on implicit int→short narrowing on the constants).
/// </para>
/// <para>
/// ⚠️ <b>This numbering is the 16i/18i/21i-era table, and it is the ONLY table this driver knows</b>
/// (Gitea #647). The 30i/31i/32i series number <c>alm_type</c> differently, and that table has not
/// ⚠️ <b>This numbering is the 16i/18i/21i-era table, and it is the ONLY table this driver knows</b>.
/// The 30i/31i/32i series number <c>alm_type</c> differently, and that table has not
/// been confirmed against a FOCAS reference, so it is deliberately NOT encoded here — a guessed code
/// would silently route the wrong alarms. On a 30i-series control the names below therefore label
/// the raw type code with its 16i meaning, which may be wrong. Every alarm message the driver
@@ -31,7 +31,7 @@ public sealed class FocasDriverOptions
public FocasHandleRecycleOptions HandleRecycle { get; init; } = new();
/// <summary>Gets the fixed tree options.</summary>
public FocasFixedTreeOptions FixedTree { get; init; } = new();
/// <summary>Gets the PMC range-coalescing options (Gitea #266).</summary>
/// <summary>Gets the PMC range-coalescing options.</summary>
public FocasPmcCoalesceOptions PmcCoalesce { get; init; } = new();
/// <summary>
@@ -44,7 +44,7 @@ public sealed class FocasDriverOptions
}
/// <summary>
/// Merges adjacent / near PMC reads in one poll batch into fewer <c>pmc_rdpmcrng</c> calls (Gitea #266).
/// Merges adjacent / near PMC reads in one poll batch into fewer <c>pmc_rdpmcrng</c> calls.
/// On by default: a batch with a single PMC tag per area is unaffected, and a coalesced read the CNC
/// rejects falls back to per-tag reads, so enabling it cannot make a readable tag unreadable.
/// </summary>
@@ -128,19 +128,19 @@ public sealed class FocasHandleRecycleOptions
/// <summary>
/// Controls the CNC active-alarm polling projection that surfaces FOCAS alarms via
/// <c>IAlarmSource</c> as Part 9 conditions at <c>ALARM:</c> raw tags (Gitea #647).
/// <c>IAlarmSource</c> as Part 9 conditions at <c>ALARM:</c> raw tags.
/// </summary>
/// <remarks>
/// <b>Authoring an <c>ALARM:</c> tag IS the opt-in.</b> The projection polls exactly the devices that own a
/// subscribed alarm tag, so a driver with none issues no <c>cnc_rdalmmsg2</c> traffic whatever
/// <see cref="Enabled"/> says. Before #647, <see cref="Enabled"/> gated the poll and
/// <see cref="Enabled"/> says. Previously <see cref="Enabled"/> gated the poll and
/// <c>SubscribeAlarmsAsync</c> THREW while it was false — so an operator who authored an alarm tag and left
/// the default got a feed that stayed gated with a Warning on every reconnect. It is retained so existing
/// configs still bind, and no longer has any effect.
/// </remarks>
public sealed class FocasAlarmProjectionOptions
{
/// <summary>Retained for config compatibility; has no effect since Gitea #647 (see the class remarks).</summary>
/// <summary>Retained for config compatibility; has no effect (see the class remarks).</summary>
public bool Enabled { get; init; } = false;
/// <summary>Poll cadence. One <c>cnc_rdalmmsg2</c> call per device per tick.</summary>
@@ -204,7 +204,7 @@ public sealed record FocasDeviceOptions(
/// clients can optimise write coalescing for idempotent tags. Defaults to <c>false</c>.
/// </param>
/// <param name="Alarm">
/// The tag's cross-driver <c>alarm</c> object, when it carries one (Gitea #647) — which makes the host
/// The tag's cross-driver <c>alarm</c> object, when it carries one — which makes the host
/// materialise it as a Part 9 condition at its RawPath. Only an <c>ALARM:</c> address can drive one.
/// </param>
public sealed record FocasTagDefinition(
@@ -217,7 +217,7 @@ public sealed record FocasTagDefinition(
FocasTagAlarm? Alarm = null);
/// <summary>
/// What the FOCAS driver reads from a tag's cross-driver <c>alarm</c> object (Gitea #647). The host owns the
/// What the FOCAS driver reads from a tag's cross-driver <c>alarm</c> object. The host owns the
/// rest of it (<c>alarmType</c>, <c>historizeToAveva</c>) through <c>TagConfigIntent</c>.
/// </summary>
/// <param name="Severity">
@@ -50,7 +50,7 @@ public static class FocasTagDefinitionFactory
return false;
var address = addr.GetString();
if (string.IsNullOrWhiteSpace(address)) return false;
// Strict enum read (R2-11 Phase C): a typo'd dataType rejects the tag (→ BadNodeIdUnknown)
// Strict enum read: a typo'd dataType rejects the tag (→ BadNodeIdUnknown)
// instead of silently defaulting to a wrong-width Good.
if (!TagConfigJson.TryReadEnumStrict(root, "dataType", FocasDataType.Int32, out var dataType)) return false;
// FOCAS authored tags carry no `writable` key (writability lives on the Tag entity / node ACL):
@@ -74,7 +74,7 @@ public static class FocasTagDefinitionFactory
}
/// <summary>
/// The tag's cross-driver <c>alarm</c> object (Gitea #647), or <see langword="null"/> when it carries none.
/// The tag's cross-driver <c>alarm</c> object, or <see langword="null"/> when it carries none.
/// Lenient like the host's <c>TagConfigIntent</c>: a non-integer <c>severity</c> is simply absent.
/// </summary>
/// <param name="root">The TagConfig root object.</param>
@@ -116,20 +116,20 @@ public static class FocasTagDefinitionFactory
private const string InspectionRawPath = "(inspect)";
/// <summary>
/// Deploy-time inspection (05/CONV-2, 05/UNDER-1). Two kinds of warning, and the distinction is
/// Deploy-time inspection. Two kinds of warning, and the distinction is
/// load-bearing:
/// <list type="bullet">
/// <item>
/// <b>Rejections</b> — a blob <see cref="FromTagConfig"/> would refuse: an unparseable or
/// non-object document, an absent / non-string / blank <c>address</c>, or a
/// present-but-invalid <c>dataType</c> (the runtime enum read is STRICT since R2-11 Phase C,
/// present-but-invalid <c>dataType</c> (the runtime enum read is STRICT,
/// so a typo rejects the tag). The driver skips such a tag and it reads
/// <c>BadNodeIdUnknown</c> forever. These are diagnosed only when the mapper has actually
/// refused, so this gate can never be stricter than the runtime (Gitea #551).
/// refused, so this gate can never be stricter than the runtime.
/// </item>
/// <item>
/// <b>Advisories</b> — an <em>accepted</em> blob that still will not work: an unparseable
/// FOCAS address (#540; the mapper only requires a non-blank string, the driver's own init
/// FOCAS address (the mapper only requires a non-blank string, the driver's own init
/// then drops it) and an authored <c>writable:true</c> (the FOCAS wire is read-only, so
/// <c>WriteAsync</c> always returns <c>BadNotWritable</c>). These run whether or not the
/// blob parses, which is why FOCAS does not simply return empty on accept.
@@ -138,7 +138,7 @@ public static class FocasTagDefinitionFactory
/// Empty for a clean, accepted blob, for a blank one, or for one that is not an equipment-tag
/// object. Never throws.
/// <para>
/// The distinction is <b>structural</b>, not a matter of wording (Gitea #556 item 2): the two
/// The distinction is <b>structural</b>, not a matter of wording: the two
/// classes accumulate in separate lists, and the catch-all backstop — the only thing that
/// reports a refusal neither <see cref="DescribeRejection"/> branch can name — fires on "no
/// REJECTION was produced", never on "no warning at all". Gated on the total, an advisory
@@ -149,7 +149,7 @@ public static class FocasTagDefinitionFactory
/// <returns>The warnings; empty when clean.</returns>
public static IReadOnlyList<string> Inspect(string reference)
{
// Gitea #556 item 2: the two classes live in SEPARATE lists, and the backstop below gates on the
// The two classes live in SEPARATE lists, and the backstop below gates on the
// REJECTION list alone. Sharing one list meant an advisory (which fires on an accepted blob too)
// could satisfy a `warnings.Count == 0` guard and silently swallow the catch-all rejection message
// — the only thing that reports a refusal neither DescribeRejection branch can name. The split is
@@ -157,7 +157,7 @@ public static class FocasTagDefinitionFactory
var rejections = new List<string>();
var advisories = new List<string>();
// Gitea #556 item 1: the framing check TRIMS FIRST. FromTagConfig hands the blob straight to
// The framing check TRIMS FIRST. FromTagConfig hands the blob straight to
// JsonDocument.Parse, which tolerates leading whitespace — so an untrimmed check let " {…}" be
// read (and possibly REFUSED) by the driver while drawing zero deploy warnings. A reference that
// still does not start with '{' after trimming is not an equipment-tag TagConfig at all and keeps
@@ -247,7 +247,7 @@ public static class FocasTagDefinitionFactory
/// accepted, so they must never reach the rejection list — see <see cref="Inspect"/>'s backstop.</param>
private static void DescribeAdvisories(JsonElement root, List<string> advisories)
{
// Gitea #540: an address the driver cannot parse is skipped at init and reads BadNodeIdUnknown
// An address the driver cannot parse is skipped at init and reads BadNodeIdUnknown
// forever, while driver health stays Healthy with zero errors. The AdminUI modal rejects it
// outright; this covers the paths that never touch the modal (CSV import, the API).
var address = root.TryGetProperty("address", out var addr) && addr.ValueKind == JsonValueKind.String
@@ -265,7 +265,7 @@ public static class FocasTagDefinitionFactory
"this tag at startup and it will read BadNodeIdUnknown.");
}
// Gitea #647: an ALARM: address and the cross-driver alarm object only work together. The object is what
// An ALARM: address and the cross-driver alarm object only work together. The object is what
// makes the host materialise a Part 9 condition; the address is the only thing the driver can drive one
// from. Either one alone is a tag that does nothing.
var hasAlarmObject = root.TryGetProperty("alarm", out var alarm) && alarm.ValueKind == JsonValueKind.Object;