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:
@@ -234,12 +234,10 @@ internal sealed class MqttBrowseSession : IRebirthCapableBrowseSession
|
||||
/// </summary>
|
||||
internal MqttMode Mode { get; }
|
||||
|
||||
// Sparkplug only. A plain-MQTT window has no re-announce action at all — see
|
||||
// RequestRebirthAsync, which refuses one — so the picker must not draw the
|
||||
// affordance for it.
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Sparkplug only. A plain-MQTT window has no re-announce action at all — see
|
||||
/// <see cref="RequestRebirthAsync"/>, which refuses one — so the picker must not draw the
|
||||
/// affordance for it.
|
||||
/// </remarks>
|
||||
public bool RebirthAvailable => Mode == MqttMode.SparkplugB;
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -279,13 +277,11 @@ internal sealed class MqttBrowseSession : IRebirthCapableBrowseSession
|
||||
return Task.FromResult<IReadOnlyList<BrowseNode>>(nodes);
|
||||
}
|
||||
|
||||
// nodeId is the full slash-joined topic path of the node
|
||||
// (e.g. factory/line3/oven) — the same value carried on the BrowseNode
|
||||
// the picker was handed. An unknown path returns empty rather than throwing: the tree grows
|
||||
// while the picker browses it, so a stale id is an ordinary race, not an error.
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// <paramref name="nodeId"/> is the full slash-joined topic path of the node
|
||||
/// (e.g. <c>factory/line3/oven</c>) — the same value carried on the <see cref="BrowseNode"/>
|
||||
/// the picker was handed. An unknown path returns empty rather than throwing: the tree grows
|
||||
/// while the picker browses it, so a stale id is an ordinary race, not an error.
|
||||
/// </remarks>
|
||||
public Task<IReadOnlyList<BrowseNode>> ExpandAsync(string nodeId, CancellationToken cancellationToken)
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(Disposed, this);
|
||||
@@ -296,33 +292,27 @@ internal sealed class MqttBrowseSession : IRebirthCapableBrowseSession
|
||||
return Task.FromResult<IReadOnlyList<BrowseNode>>(children);
|
||||
}
|
||||
|
||||
// Plain mode. A topic has no attribute model — MQTT carries an opaque payload. The
|
||||
// single synthetic attribute returned here exists to help the operator confirm they picked
|
||||
// the right topic: AttributeInfo.DriverDataType carries the type
|
||||
// inferred from the last observed payload (the authored tag's own dataType
|
||||
// remains the authority — inference is the brittle fallback, per design §4), and
|
||||
// AttributeInfo.SecurityClass carries that payload's snippet. The
|
||||
// SecurityClass slot is reused deliberately: it is the picker's free-text descriptor
|
||||
// line (rendered as {DriverDataType} · {SecurityClass}) and MQTT has no security
|
||||
// classes of its own. Returns empty for a synthesised path segment nothing was ever
|
||||
// published to.
|
||||
// Sparkplug mode is purely birth-derived — no payload is ever sniffed. A Sparkplug
|
||||
// metric declares its own type in the birth certificate, so there is nothing to
|
||||
// infer; and the plain path's UTF-8 inference / snippet machinery is not merely redundant
|
||||
// here but actively wrong, because a Sparkplug body is protobuf and would be reported as
|
||||
// (N bytes, binary) for every metric in the plant. This session therefore retains no
|
||||
// payload bytes at all in Sparkplug mode: the attribute carries the metric name, the
|
||||
// DriverDataType the birth declared (element type for an array variant, with
|
||||
// AttributeInfo.IsArray carrying the array bit), and a descriptor built from
|
||||
// the birth. A datatype this driver does not support in v1 is reported as such and
|
||||
// never coerced into a guessed DriverDataType.
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>Plain mode.</b> A topic has no attribute model — MQTT carries an opaque payload. The
|
||||
/// single synthetic attribute returned here exists to help the operator confirm they picked
|
||||
/// the right topic: <see cref="AttributeInfo.DriverDataType"/> carries the type
|
||||
/// <i>inferred</i> from the last observed payload (the authored tag's own <c>dataType</c>
|
||||
/// remains the authority — inference is the brittle fallback, per design §4), and
|
||||
/// <see cref="AttributeInfo.SecurityClass"/> carries that payload's snippet. The
|
||||
/// <c>SecurityClass</c> slot is reused deliberately: it is the picker's free-text descriptor
|
||||
/// line (rendered as <c>{DriverDataType} · {SecurityClass}</c>) and MQTT has no security
|
||||
/// classes of its own. Returns empty for a synthesised path segment nothing was ever
|
||||
/// published to.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Sparkplug mode is purely birth-derived — no payload is ever sniffed.</b> A Sparkplug
|
||||
/// metric <i>declares</i> its own type in the birth certificate, so there is nothing to
|
||||
/// infer; and the plain path's UTF-8 inference / snippet machinery is not merely redundant
|
||||
/// here but actively wrong, because a Sparkplug body is protobuf and would be reported as
|
||||
/// <c>(N bytes, binary)</c> for every metric in the plant. This session therefore retains no
|
||||
/// payload bytes at all in Sparkplug mode: the attribute carries the metric name, the
|
||||
/// <see cref="DriverDataType"/> the birth declared (element type for an array variant, with
|
||||
/// <see cref="AttributeInfo.IsArray"/> carrying the array bit), and a descriptor built from
|
||||
/// the birth. A datatype this driver does not support in v1 is reported as such and
|
||||
/// <b>never</b> coerced into a guessed <see cref="DriverDataType"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public Task<IReadOnlyList<AttributeInfo>> AttributesAsync(string nodeId, CancellationToken cancellationToken)
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(Disposed, this);
|
||||
@@ -620,7 +610,7 @@ internal sealed class MqttBrowseSession : IRebirthCapableBrowseSession
|
||||
continue;
|
||||
}
|
||||
|
||||
// Gitea #515: a Template/DataSet metric contributes its flattened MEMBERS as leaves, never
|
||||
// A Template/DataSet metric contributes its flattened MEMBERS as leaves, never
|
||||
// itself. The parent has no value and no servable datatype, so a leaf for it would offer
|
||||
// the operator an address that can only ever commit a tag which never reads.
|
||||
if (metric.ValueKind == SparkplugValueKind.Structured)
|
||||
@@ -659,7 +649,7 @@ internal sealed class MqttBrowseSession : IRebirthCapableBrowseSession
|
||||
/// <param name="metricName">
|
||||
/// The metric's Sparkplug name — for a flattened structured member, the composed
|
||||
/// <c>{parent}/{memberPath}</c>. It travels intact: it is the binding key, and only the
|
||||
/// <i>display</i> name is later coerced to a legal RawPath segment (Gitea #509).
|
||||
/// <i>display</i> name is later coerced to a legal RawPath segment.
|
||||
/// </param>
|
||||
/// <param name="dataType">The declared datatype, or null.</param>
|
||||
/// <param name="messageType">The birth message type this leaf was seen in.</param>
|
||||
@@ -822,7 +812,7 @@ internal sealed class MqttBrowseSession : IRebirthCapableBrowseSession
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test seam feeding a birth whose metric is a structured <c>Template</c> (Gitea #515).
|
||||
/// Test seam feeding a birth whose metric is a structured <c>Template</c>.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The Sparkplug group id.</param>
|
||||
/// <param name="edgeNodeId">The Sparkplug edge-node id.</param>
|
||||
@@ -878,31 +868,23 @@ internal sealed class MqttBrowseSession : IRebirthCapableBrowseSession
|
||||
Observe(topic, payload.ToByteArray());
|
||||
}
|
||||
|
||||
// The one browse-session member that publishes, and it is never on a browse path.
|
||||
// Only an explicit operator click reaches it — OpenAsync-equivalent setup,
|
||||
// RootAsync, ExpandAsync, AttributesAsync,
|
||||
// Observe and DisposeAsync must never call it, and
|
||||
// PublishCountForTest is what makes that assertable rather than aspirational.
|
||||
// Authorization is the caller's job (BrowserSessionService enforces
|
||||
// DriverOperator): this type holds no user identity.
|
||||
// Scope resolution never re-parses an id string when it does not have to. A scope
|
||||
// that names a node in this session's own tree resolves through the
|
||||
// (group, edgeNode) tuple stamped on that node — so selecting a device or a metric
|
||||
// addresses its owning edge node, which is the only thing an NCMD can address
|
||||
// (Sparkplug has no device-scoped rebirth). A two-segment {group}/{edgeNode} scope
|
||||
// is honoured even when the window has never observed that node: a node that has not
|
||||
// birthed is the prime rebirth target, and refusing it would defeat the feature.
|
||||
// Group scope is bounded and all-or-nothing — see
|
||||
// MaxGroupRebirthNodes.
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>The one browse-session member that publishes, and it is never on a browse path.</b>
|
||||
/// Only an explicit operator click reaches it — <see cref="OpenAsync"/>-equivalent setup,
|
||||
/// <see cref="RootAsync"/>, <see cref="ExpandAsync"/>, <see cref="AttributesAsync"/>,
|
||||
/// <see cref="Observe"/> and <see cref="DisposeAsync"/> must never call it, and
|
||||
/// <see cref="PublishCountForTest"/> is what makes that assertable rather than aspirational.
|
||||
/// Authorization is the caller's job (<c>BrowserSessionService</c> enforces
|
||||
/// <c>DriverOperator</c>): this type holds no user identity.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Scope resolution never re-parses an id string when it does not have to.</b> A scope
|
||||
/// that names a node in this session's own tree resolves through the
|
||||
/// <c>(group, edgeNode)</c> tuple stamped on that node — so selecting a device or a metric
|
||||
/// addresses its <i>owning edge node</i>, which is the only thing an NCMD can address
|
||||
/// (Sparkplug has no device-scoped rebirth). A two-segment <c>{group}/{edgeNode}</c> scope
|
||||
/// is honoured even when the window has never observed that node: a node that has not
|
||||
/// birthed is the <i>prime</i> rebirth target, and refusing it would defeat the feature.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Group scope is bounded and all-or-nothing</b> — see
|
||||
/// <see cref="MaxGroupRebirthNodes"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public async Task<int> RequestRebirthAsync(string scope, CancellationToken cancellationToken)
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(Disposed, this);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser;
|
||||
/// <b>Layering note.</b> This project depends on the shared leaves only — <c>.Contracts</c> for
|
||||
/// the Sparkplug wire schema and codec, <c>.Transport</c> for
|
||||
/// <see cref="MqttClientOptionsFactory"/> — and NOT on the runtime <c>.Driver</c> project, which
|
||||
/// it used to reference under a documented exception (Gitea #512). Reuse of the TLS / CA-pin path
|
||||
/// it used to reference under a documented exception. Reuse of the TLS / CA-pin path
|
||||
/// is what that exception bought, and it is preserved: there is still exactly one copy, now in
|
||||
/// <c>.Transport</c>. Do not fork it. Pinned by <c>MqttBrowserLayeringTests</c>.
|
||||
/// </para>
|
||||
@@ -56,12 +56,10 @@ public sealed class MqttDriverBrowser : IDriverBrowser
|
||||
/// <inheritdoc />
|
||||
public string DriverType => DriverTypeNames.Mqtt;
|
||||
|
||||
// Connects with a browse-only client id, subscribes the wildcard at QoS 0, and hands back a
|
||||
// session that serves whatever the subscription observes. The whole open is bounded by
|
||||
// OpenBudget; nothing here publishes.
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Connects with a browse-only client id, subscribes the wildcard at QoS 0, and hands back a
|
||||
/// session that serves whatever the subscription observes. The whole open is bounded by
|
||||
/// <see cref="OpenBudget"/>; nothing here publishes.
|
||||
/// </remarks>
|
||||
public async Task<IBrowseSession> OpenAsync(string configJson, CancellationToken cancellationToken)
|
||||
{
|
||||
// MqttJson.Options — the ONE shared instance across factory / probe / driver / browser
|
||||
@@ -163,7 +161,7 @@ public sealed class MqttDriverBrowser : IDriverBrowser
|
||||
/// <para>
|
||||
/// ⚠ <b>THE landmine — a Last Will would break the read-only guarantee from outside it.</b>
|
||||
/// <c>MqttDriverOptions</c> (and <c>MqttSparkplugOptions</c>) carry no will, <b>re-verified
|
||||
/// when Task 23 unsealed Sparkplug browse</b>, so there is nothing to strip and the
|
||||
/// since Sparkplug browse was unsealed</b>, so there is nothing to strip and the
|
||||
/// projection stays a single <c>CleanSession</c> override. If a will is ever added — NDEATH
|
||||
/// <i>is</i> a will message — it MUST be cleared here: a will is published by the
|
||||
/// <i>broker</i>, not by us, so it is invisible to
|
||||
|
||||
Reference in New Issue
Block a user