docs(comments): strip internal task/milestone/bundle bookkeeping from code comments
Remove project bookkeeping citations from shipped code comments across the solution: hyphenated task IDs (WP-14, StoreAndForward-025), milestone/task/ issue refs (M3, Task 4, Audit Log #23, #21), Bundle X task-bundle labels, and C/D/K/S/T phase labels. Comment text only — no code logic, string/log literals, or XML-doc structure changed. Genuine descriptions are preserved (only the citation is stripped), and technical lookalikes are retained (UTF-8, SHA-256, T00:00:00, M365, UTC-5, pre-C4/pre-C5 schema versions). Flagged by the new CommentChecker TaskReferenceInComment / TrackingReferenceInComment checks plus targeted grep passes; full solution builds clean, append-only guard tests pass.
This commit is contained in:
+11
-11
@@ -46,7 +46,7 @@ public class AuditLogRepository : IAuditLogRepository
|
||||
throw new ArgumentNullException(nameof(evt));
|
||||
}
|
||||
|
||||
// C5 (Task 2.5): write the 10 canonical columns DIRECTLY — no Decompose.
|
||||
// Write the 10 canonical columns DIRECTLY — no Decompose.
|
||||
// The five queryability columns (Kind/Status/SourceSiteId/ExecutionId/
|
||||
// ParentExecutionId) plus IngestedAtUtc are PERSISTED computed columns on
|
||||
// dbo.AuditLog; SQL Server derives them from DetailsJson at INSERT, so they
|
||||
@@ -109,7 +109,7 @@ VALUES
|
||||
throw new ArgumentNullException(nameof(paging));
|
||||
}
|
||||
|
||||
// C5 (Task 2.5): the filter predicates bind to the canonical columns and the
|
||||
// The filter predicates bind to the canonical columns and the
|
||||
// persisted computed columns directly — Channel→Category, Kind/Status/
|
||||
// SourceSiteId/ExecutionId/ParentExecutionId are computed columns. The
|
||||
// materialized rows are projected to the canonical record by reading the 10
|
||||
@@ -202,7 +202,7 @@ VALUES
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// C5 (Task 2.5): build the canonical <see cref="AuditEvent"/> DIRECTLY from the
|
||||
/// Build the canonical <see cref="AuditEvent"/> DIRECTLY from the
|
||||
/// 10 canonical columns of a materialized <see cref="AuditLogRow"/> read back from
|
||||
/// <c>dbo.AuditLog</c> — no 24-column <c>Recompose</c>, because the table now holds
|
||||
/// the canonical shape (every ScadaBridge domain field already lives in
|
||||
@@ -236,7 +236,7 @@ VALUES
|
||||
|
||||
// ISO 8601 in UTC — SQL Server's datetime2 literal parser accepts this
|
||||
// unambiguously and the value is round-trip-safe across SET DATEFORMAT
|
||||
// settings. CD-021: use datetime2(7) precision (.fffffff) so a future
|
||||
// settings. Use datetime2(7) precision (.fffffff) so a future
|
||||
// non-midnight or sub-second boundary doesn't silently round to the
|
||||
// wrong partition (today the migration only seeds at T00:00:00 exactly,
|
||||
// but the format string is on the boundary value's own contract — match
|
||||
@@ -264,7 +264,7 @@ VALUES
|
||||
DROP INDEX UX_AuditLog_EventId ON dbo.AuditLog;
|
||||
|
||||
-- 2. Staging table on [PRIMARY] (non-partitioned) with column shapes
|
||||
-- byte-identical to the C5 dbo.AuditLog — INCLUDING the persisted
|
||||
-- byte-identical to the dbo.AuditLog — INCLUDING the persisted
|
||||
-- computed columns, whose definitions must match EXACTLY (same
|
||||
-- expression text + PERSISTED) or ALTER TABLE ... SWITCH PARTITION
|
||||
-- rejects the operation with msg 4904/4948. The ordinal order also
|
||||
@@ -389,7 +389,7 @@ VALUES
|
||||
|
||||
var thresholdUtc = DateTime.SpecifyKind(threshold.ToUniversalTime(), DateTimeKind.Utc);
|
||||
|
||||
// M5.5 (T3) per-channel retention override purge. This is the ONLY DELETE
|
||||
// Per-channel retention override purge. This is the ONLY DELETE
|
||||
// against dbo.AuditLog in the codebase and it runs on the purge/maintenance
|
||||
// path, NOT the append-only writer role (which has INSERT + SELECT only — see
|
||||
// the DENY UPDATE/DENY DELETE grants in CollapseAuditLogToCanonical). The
|
||||
@@ -407,7 +407,7 @@ VALUES
|
||||
// single narrow exemption the append-only CI guard (AuditLogAppendOnlyGuardTests)
|
||||
// recognizes; any other UPDATE/DELETE targeting AuditLog still trips the guard.
|
||||
const string deleteBatchSql =
|
||||
"DELETE TOP (@batch) FROM dbo.AuditLog WHERE Category = @channel AND OccurredAtUtc < @threshold;"; // AUDIT-PURGE-ALLOWED: per-channel retention override (M5.5 T3), maintenance path
|
||||
"DELETE TOP (@batch) FROM dbo.AuditLog WHERE Category = @channel AND OccurredAtUtc < @threshold;"; // AUDIT-PURGE-ALLOWED: per-channel retention override, maintenance path
|
||||
|
||||
long totalDeleted = 0;
|
||||
|
||||
@@ -726,7 +726,7 @@ VALUES
|
||||
SELECT ParentExecutionId FROM Chain
|
||||
WHERE ParentExecutionId IS NOT NULL
|
||||
)
|
||||
-- C5 (Task 2.5): ExecutionId / ParentExecutionId / SourceSiteId
|
||||
-- ExecutionId / ParentExecutionId / SourceSiteId
|
||||
-- are persisted computed columns (same names); Channel is now the
|
||||
-- canonical Category column (Category = channel name, so the
|
||||
-- Channels aggregate still yields channel names); SourceInstanceId
|
||||
@@ -828,10 +828,10 @@ VALUES
|
||||
|
||||
var beforeUtc = DateTime.SpecifyKind(before.ToUniversalTime(), DateTimeKind.Utc);
|
||||
|
||||
// M5.6 (T5) SourceNode sentinel backfill. This is the ONE sanctioned UPDATE
|
||||
// SourceNode sentinel backfill. This is the ONE sanctioned UPDATE
|
||||
// against dbo.AuditLog in the codebase. It touches ONLY rows where
|
||||
// SourceNode IS NULL AND OccurredAtUtc < @before — rows that pre-date the
|
||||
// M5.6 feature and whose node-of-origin is UNKNOWABLE. The sentinel (default
|
||||
// SourceNode feature and whose node-of-origin is UNKNOWABLE. The sentinel (default
|
||||
// "unknown") makes that explicit. ExecutionId/ParentExecutionId are PERSISTED
|
||||
// COMPUTED columns derived from DetailsJson — mutating DetailsJson is forbidden
|
||||
// under the append-only invariant, so those stay NULL on pre-feature rows.
|
||||
@@ -849,7 +849,7 @@ VALUES
|
||||
// single narrow exemption the append-only CI guard (AuditLogAppendOnlyGuardTests)
|
||||
// recognises for an UPDATE; any other UPDATE targeting AuditLog still trips the guard.
|
||||
const string updateBatchSql =
|
||||
"UPDATE TOP (@batch) dbo.AuditLog SET SourceNode = @sentinel WHERE SourceNode IS NULL AND OccurredAtUtc < @before;"; // AUDIT-PURGE-ALLOWED: SourceNode sentinel backfill (M5.6 T5), maintenance path
|
||||
"UPDATE TOP (@batch) dbo.AuditLog SET SourceNode = @sentinel WHERE SourceNode IS NULL AND OccurredAtUtc < @before;"; // AUDIT-PURGE-ALLOWED: SourceNode sentinel backfill, maintenance path
|
||||
|
||||
long totalUpdated = 0;
|
||||
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ public class DeploymentManagerRepository : IDeploymentManagerRepository
|
||||
/// <inheritdoc />
|
||||
public async Task<DeploymentRecord?> GetCurrentDeploymentStatusAsync(int instanceId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// DeploymentManager-026: deployments are insert-only (one row per deploy
|
||||
// Deployments are insert-only (one row per deploy
|
||||
// attempt), so two records for the same instance can tie on DeployedAt when
|
||||
// they are created within the same clock tick (a rapid redeploy, or a
|
||||
// redeploy immediately after a timed-out attempt). SQL Server's choice
|
||||
@@ -95,7 +95,7 @@ public class DeploymentManagerRepository : IDeploymentManagerRepository
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(expectedRowVersion);
|
||||
|
||||
// CD-017: DeploymentRecord carries a SQL Server rowversion concurrency token.
|
||||
// DeploymentRecord carries a SQL Server rowversion concurrency token.
|
||||
// The stub-attach delete path must seed EF's OriginalValues["RowVersion"] with
|
||||
// the caller's last-observed value so the generated SQL becomes
|
||||
// `DELETE ... WHERE Id = @id AND RowVersion = @prior`. Without this seeding a
|
||||
@@ -166,7 +166,7 @@ public class DeploymentManagerRepository : IDeploymentManagerRepository
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
// --- WP-8: DeployedConfigSnapshot ---
|
||||
// --- DeployedConfigSnapshot ---
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<DeployedConfigSnapshot?> GetDeployedSnapshotByInstanceIdAsync(int instanceId, CancellationToken cancellationToken = default)
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ public class ExternalSystemRepository : IExternalSystemRepository
|
||||
=> await _context.Set<ExternalSystemDefinition>().FindAsync(new object[] { id }, cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
// ExternalSystemGateway-011: genuine name-keyed query (server-side WHERE) so the
|
||||
// Genuine name-keyed query (server-side WHERE) so the
|
||||
// gateway's hot-path resolution does not fetch every system and filter in memory.
|
||||
public async Task<ExternalSystemDefinition?> GetExternalSystemByNameAsync(string name, CancellationToken cancellationToken = default)
|
||||
=> await _context.Set<ExternalSystemDefinition>()
|
||||
@@ -52,7 +52,7 @@ public class ExternalSystemRepository : IExternalSystemRepository
|
||||
=> await _context.Set<ExternalSystemMethod>().FindAsync(new object[] { id }, cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
// ExternalSystemGateway-011: genuine name-keyed query scoped to the parent system.
|
||||
// Genuine name-keyed query scoped to the parent system.
|
||||
public async Task<ExternalSystemMethod?> GetMethodByNameAsync(int externalSystemId, string methodName, CancellationToken cancellationToken = default)
|
||||
=> await _context.Set<ExternalSystemMethod>()
|
||||
.FirstOrDefaultAsync(
|
||||
@@ -83,7 +83,7 @@ public class ExternalSystemRepository : IExternalSystemRepository
|
||||
=> await _context.Set<DatabaseConnectionDefinition>().FindAsync(new object[] { id }, cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
// ExternalSystemGateway-011: genuine name-keyed query (server-side WHERE).
|
||||
// Genuine name-keyed query (server-side WHERE).
|
||||
public async Task<DatabaseConnectionDefinition?> GetDatabaseConnectionByNameAsync(string name, CancellationToken cancellationToken = default)
|
||||
=> await _context.Set<DatabaseConnectionDefinition>()
|
||||
.FirstOrDefaultAsync(c => c.Name == name, cancellationToken);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// EF Core implementation of <see cref="IKpiHistoryRepository"/> over the central
|
||||
/// <c>KpiSample</c> table (M6 "KPI History & Trends"). See the interface for the
|
||||
/// <c>KpiSample</c> table ("KPI History & Trends"). See the interface for the
|
||||
/// contract; this class adds notes on the data-access strategy per method.
|
||||
/// </summary>
|
||||
public sealed class KpiHistoryRepository : IKpiHistoryRepository
|
||||
|
||||
+1
-1
@@ -182,7 +182,7 @@ VALUES
|
||||
query = query.Where(n => n.SourceSiteId == filter.SourceSiteId);
|
||||
}
|
||||
|
||||
// Task 16: SourceNode is exact-match like SourceSiteId. Rows with NULL
|
||||
// SourceNode is exact-match like SourceSiteId. Rows with NULL
|
||||
// SourceNode (legacy / unconfigured) are excluded when the filter is set.
|
||||
if (!string.IsNullOrEmpty(filter.SourceNode))
|
||||
{
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// EF Core implementation of <see cref="ISecuredWriteRepository"/> over the central
|
||||
/// <c>PendingSecuredWrites</c> table (M7 OPC UA / MxGateway UX, Task T14b). Mirrors the
|
||||
/// <c>PendingSecuredWrites</c> table. Mirrors the
|
||||
/// <c>SiteCallAuditRepository</c> data-access shape: plain tracked EF reads/writes
|
||||
/// against the shared <see cref="ScadaBridgeDbContext"/>, no raw SQL needed.
|
||||
/// </summary>
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// EF Core implementation of <see cref="ISharedSchemaRepository"/> over the central
|
||||
/// <c>SharedSchemas</c> JSON-Schema library table (M9, Task T32a). Plain tracked EF
|
||||
/// <c>SharedSchemas</c> JSON-Schema library table. Plain tracked EF
|
||||
/// reads/writes against the shared <see cref="ScadaBridgeDbContext"/>, saving on each
|
||||
/// mutating call — mirrors the <c>SecuredWriteRepository</c> data-access shape.
|
||||
/// </summary>
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ public class SiteCallAuditRepository : ISiteCallAuditRepository
|
||||
private const int SqlErrorPrimaryKeyViolation = 2627;
|
||||
|
||||
// Monotonic status ordering. Lower rank wins on tie (same-rank upserts are
|
||||
// no-ops, including terminal-over-terminal). Spec from Bundle B3 plan:
|
||||
// no-ops, including terminal-over-terminal):
|
||||
// Submitted < Forwarded < Attempted == Skipped < Delivered == Failed == Parked == Discarded.
|
||||
private static readonly Dictionary<string, int> StatusRank = new(StringComparer.Ordinal)
|
||||
{
|
||||
@@ -68,7 +68,7 @@ public class SiteCallAuditRepository : ISiteCallAuditRepository
|
||||
// this is check-then-act so a duplicate-key violation may surface under
|
||||
// concurrent inserts on the same id — caught + logged at Debug.
|
||||
//
|
||||
// SourceNode-stamping (Task 14): the column is included in the INSERT
|
||||
// SourceNode-stamping: the column is included in the INSERT
|
||||
// column list / VALUES so a fresh row carries the originating node
|
||||
// name (node-a/node-b for site rows). A null SourceNode (legacy hosts
|
||||
// / unstamped reconciled rows) writes NULL straight through.
|
||||
@@ -100,7 +100,7 @@ VALUES
|
||||
// incoming rank is strictly greater. Same-rank (including
|
||||
// terminal-over-terminal) is a no-op — first-write-wins at each rank.
|
||||
//
|
||||
// SourceNode-stamping (Task 14): SourceNode is updated via
|
||||
// SourceNode-stamping: SourceNode is updated via
|
||||
// COALESCE(@SourceNode, SourceNode). The operator returns @SourceNode
|
||||
// when it is non-null, otherwise the stored value — so the column
|
||||
// behaves protectively: a later packet that carries a null
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class TemplateEngineRepository : ITemplateEngineRepository
|
||||
public async Task<IReadOnlyList<Template>> GetTemplatesWithChildrenAsync(
|
||||
IEnumerable<string> names, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Transport-008: bulk lookup replaces the per-name N+1 in
|
||||
// Bulk lookup replaces the per-name N+1 in
|
||||
// BundleImporter.PreviewAsync. Filter out null / empty / duplicate
|
||||
// names before the query so EF emits a clean, deduplicated IN clause.
|
||||
if (names is null) return Array.Empty<Template>();
|
||||
|
||||
Reference in New Issue
Block a user