docs: complete XML-doc coverage and strip internal tracking IDs from code comments
ci / java (push) Successful in 5m51s
ci / portable (push) Successful in 6m43s

Resolve all CommentChecker findings across the gateway server, worker, tests,
and .NET client (314 -> 0 real issues): add missing <returns>/<summary>/<param>
on public and test members, convert Stream/interface overrides to <inheritdoc/>,
and remove internal task/issue tracking IDs (SEC-*, IPC-*, WRK-*, GWC-*, TST-*,
Client.Dotnet-*) from shipped code documentation while preserving the design
rationale prose. Shipped comments should not carry internal bookkeeping, and
complete XML docs keep the analyzer/TreatWarningsAsErrors gate and generated API
docs clean. The 6 remaining flags are heuristic false positives (MD5, UTC-4,
capacity-1, near-1601) left intact so real documentation is not corrupted.

Claude-Session: https://claude.ai/code/session_01DMXXvNuPekkkrTEyPNxEkW
This commit is contained in:
Joseph Doherty
2026-07-10 06:15:47 -04:00
parent abb0930359
commit b86c6bb47f
74 changed files with 393 additions and 298 deletions
@@ -12,7 +12,7 @@ public sealed class WorkerFrameProtocolOptions
/// <summary>
/// Upper ceiling the worker will accept for a gateway-negotiated frame maximum
/// (<c>GatewayHello.max_frame_bytes</c>, IPC-02). Matches the gateway's own configuration ceiling
/// (<c>GatewayHello.max_frame_bytes</c>). Matches the gateway's own configuration ceiling
/// so a nonsensical negotiated value is rejected at the handshake rather than driving an absurd
/// per-frame allocation. 256 MiB.
/// </summary>
@@ -109,15 +109,15 @@ public sealed class WorkerFrameProtocolOptions
/// <summary>
/// Gets the maximum worker-frame message size in bytes. Initialized from the constructor and
/// then adopted once from the gateway-negotiated value during the startup handshake
/// (<c>GatewayHello.max_frame_bytes</c>, IPC-02) via <see cref="AdoptNegotiatedMaxMessageBytes"/>,
/// (<c>GatewayHello.max_frame_bytes</c>) via <see cref="AdoptNegotiatedMaxMessageBytes"/>,
/// before the message loop starts. Not mutated afterwards, so the single-threaded handshake write
/// is safe for the reader/writer that share this instance.
/// </summary>
public int MaxMessageBytes { get; private set; }
/// <summary>
/// Adopts the gateway-negotiated frame maximum conveyed in <c>GatewayHello.max_frame_bytes</c>
/// (IPC-02). A value of 0 (an older gateway that never set the field) is ignored and the
/// Adopts the gateway-negotiated frame maximum conveyed in <c>GatewayHello.max_frame_bytes</c>.
/// A value of 0 (an older gateway that never set the field) is ignored and the
/// constructor default is kept. A value above <see cref="MaxNegotiableFrameBytes"/> is rejected.
/// </summary>
/// <param name="negotiatedMaxFrameBytes">The gateway-negotiated maximum, or 0 for "keep default".</param>
@@ -3,9 +3,9 @@ namespace ZB.MOM.WW.MxGateway.Worker.Ipc;
/// <summary>
/// Relative scheduling priority for an outbound worker frame. The single writer task drains all
/// pending <see cref="Control"/> frames before any <see cref="Event"/> frame, so a command reply,
/// fault, heartbeat, or shutdown acknowledgement is not delayed behind a backlog of queued events
/// (WRK-07). Priority only reorders the write; the frame sequence is stamped at actual write time,
/// so the on-wire order and the envelope <c>Sequence</c> always agree (WRK-04).
/// fault, heartbeat, or shutdown acknowledgement is not delayed behind a backlog of queued events.
/// Priority only reorders the write; the frame sequence is stamped at actual write time,
/// so the on-wire order and the envelope <c>Sequence</c> always agree.
/// </summary>
public enum WorkerFrameWritePriority
{
@@ -12,22 +12,26 @@ namespace ZB.MOM.WW.MxGateway.Worker.Ipc;
/// Writes worker frames to a stream with length-prefixed protobuf serialization. Callers enqueue a
/// frame at a <see cref="WorkerFrameWritePriority"/> and then contend for a single write lock; whoever
/// holds the lock drains every queued frame, control frames first, so a reply, fault, or heartbeat is
/// never delayed behind an event backlog (WRK-07). The envelope <c>Sequence</c> is stamped by the
/// never delayed behind an event backlog. The envelope <c>Sequence</c> is stamped by the
/// draining lock-holder at the moment of writing, so the on-wire order and the stamped sequence always
/// agree even under concurrent callers and priority reordering (WRK-04).
/// agree even under concurrent callers and priority reordering.
/// </summary>
public sealed class WorkerFrameWriter
{
private sealed class PendingFrame
{
/// <summary>Initializes a new instance of the PendingFrame class.</summary>
/// <param name="envelope">Worker envelope awaiting write.</param>
public PendingFrame(WorkerEnvelope envelope)
{
Envelope = envelope;
Completion = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
}
/// <summary>Gets the worker envelope awaiting write.</summary>
public WorkerEnvelope Envelope { get; }
/// <summary>Gets the completion source signaled once the frame has been written or has failed.</summary>
public TaskCompletionSource<bool> Completion { get; }
}
@@ -191,7 +195,7 @@ public sealed class WorkerFrameWriter
WorkerEnvelopeValidator.Validate(envelope, _options);
// Stamp the sequence at the actual point of writing, under the write lock, so the wire order
// and the stamped sequence agree regardless of caller concurrency or priority (WRK-04).
// and the stamped sequence agree regardless of caller concurrency or priority.
envelope.Sequence = unchecked(++_nextSequence);
int payloadLength = envelope.CalculateSize();
@@ -20,7 +20,7 @@ public sealed class WorkerPipeSession
// Hard cap on how many events a single DrainEvents diagnostic reply may carry. DrainEvents is a
// non-streaming control command, so an unbounded drain (including the max_events = 0 "as many as
// available" request) could pack the whole queue into one session-killing reply frame (IPC-04).
// available" request) could pack the whole queue into one session-killing reply frame.
// The gateway request validator rejects requests above its public ceiling; this worker-side cap is
// the backstop and defines the effective per-reply maximum. Kept in step with that public ceiling.
private const uint MaxDrainEventsPerReply = 10_000;
@@ -233,7 +233,7 @@ public sealed class WorkerPipeSession
}
// Adopt the gateway-negotiated frame maximum so both ends frame to the same limit instead of
// matched compile-time defaults (IPC-02). Applied here, before the message loop, so every
// matched compile-time defaults. Applied here, before the message loop, so every
// post-handshake frame is validated against the negotiated value; the reader and writer share
// this options instance. The hello frame itself was small and already read under the default.
_options.AdoptNegotiatedMaxMessageBytes(gatewayHello.MaxFrameBytes);
@@ -375,7 +375,7 @@ public sealed class WorkerPipeSession
{
// Events are the low-priority frame class: the writer holds them behind any pending
// control frame (reply, fault, heartbeat, shutdown ack) so those are not delayed
// behind an event backlog (WRK-07).
// behind an event backlog.
await _writer
.WriteAsync(CreateEnvelope(workerEvent), WorkerFrameWritePriority.Event, cancellationToken)
.ConfigureAwait(false);
@@ -543,7 +543,7 @@ public sealed class WorkerPipeSession
if (runtimeSession is not null)
{
// Bound the diagnostic drain so max_events = 0 ("as many as available") or an over-large
// request cannot pack the whole queue into one session-killing reply frame (IPC-04).
// request cannot pack the whole queue into one session-killing reply frame.
uint requested = command.DrainEvents?.MaxEvents ?? 0;
uint maxEvents = requested == 0 || requested > MaxDrainEventsPerReply
? MaxDrainEventsPerReply
@@ -1026,7 +1026,7 @@ public sealed class WorkerPipeSession
{
// Sequence is deliberately left unset here: the frame writer stamps it at the actual point of
// writing, under its single drain task, so the on-wire order and the stamped sequence agree
// even under concurrent producers and priority reordering (WRK-04).
// even under concurrent producers and priority reordering.
return new WorkerEnvelope
{
ProtocolVersion = _options.ProtocolVersion,