docs(code-review): re-review 17 changed modules at 1f9de8a2 — 8 new findings

Re-reviewed the modules whose source changed since the last review baseline
(full-review remediation fd618cf1 + InboundAPI Database-helper fixes b3c90143),
focused on whether the fixes are sound and regression-free. 9 of 17 modules
clean; 8 new findings (0 Critical, 0 High, 4 Medium, 4 Low), all code-verified
by the orchestrator before recording:

- DataConnectionLayer-029 (Med): DCL-023's unsubscribe-clears-in-flight reopens a
  double-subscribe window that leaks an orphaned alarm feed; the alarm completion
  handler overwrites the subscription id without the tag-path guard at line 908.
- InboundAPI-031 (Med): WaitForAttribute's 5s grace backstop is tighter than the
  CommunicationService Ask's timeout+IntegrationTimeout (30s) round-trip slack, so
  a slow-but-valid timed-out 'false' arriving in the 5-30s window is cancelled into
  an unhandled OperationCanceledException/500 (contradicts spec 6 + its own comment).
- SiteRuntime-032 (Med): SiteRuntime-029's wasPresent guard skips the deployed-count
  decrement when deleting a DISABLED instance (absent from both maps), drifting the
  health-dashboard tally; self-heals on singleton restart (observational, hence Med).
- StoreAndForward-028 (Med): StoreAndForward-025 resets the register-guard but not
  _bufferedCount, so a same-instance Stop->Start re-seeds the depth gauge to ~2N.
- AuditLog-017, CentralUI-037, ScriptAnalysis-009, SiteRuntime-033 (Low): a
  test-coverage gap plus stale doc-comments/spec following the remediation.

Header commit/date bumped to 1f9de8a2 / 2026-06-24 on all 17 modules; README
regenerated (8 pending / 576 total).
This commit is contained in:
Joseph Doherty
2026-06-24 09:20:03 -04:00
parent 1f9de8a2b5
commit c42bb48585
18 changed files with 635 additions and 66 deletions
+25 -2
View File
@@ -5,9 +5,9 @@
| Module | `src/ZB.MOM.WW.ScadaBridge.Host` |
| Design doc | `docs/requirements/Component-Host.md` |
| Status | Reviewed |
| Last reviewed | 2026-06-20 |
| Last reviewed | 2026-06-24 |
| Reviewer | claude-agent |
| Commit reviewed | `4307c381` |
| Commit reviewed | `1f9de8a2` |
| Open findings | 0 |
## Summary
@@ -1320,3 +1320,26 @@ the matrix, and note KpiHistory's recorder singleton is intentionally absent fro
**Resolution**
Resolved 2026-06-20 (commit `fd618cf1`): added `KpiHistory` and `Transport` rows to the Component Registration Matrix in Component-Host.md (both Central=Yes/Site=No/DI=Yes), reflecting their actual central-only registration.
## Re-review — 2026-06-24 (commit `1f9de8a2`)
Focused re-review of the changes since the prior review — verifying the code-review remediation + feature fixes are sound and regression-free. Reviewed by a per-module workflow agent; findings code-verified by the orchestrator.
**Changes reviewed:** A single new `ProjectReference` to `ZB.MOM.WW.ScadaBridge.KpiHistory.csproj` was added to the Host's `.csproj` (commit fd618cf1, the review-remediation pass). This makes the Host's pre-existing compile-time dependency on KpiHistory (used in `Program.cs` via `AddKpiHistory` and in `AkkaHostedService.cs` via `KpiHistoryOptions` + the `KpiHistoryRecorderActor` cluster singleton) explicit rather than relying on a transitive reference through CentralUI.
**Verdict:** The change is a one-line build-graph fix and it is correct, minimal, and regression-free. The Host directly consumes KpiHistory public types in Program.cs and AkkaHostedService.cs, so the explicit direct reference is necessary (not redundant) and removes the latent fragility of depending on a transitive project reference via CentralUI. There is no duplicate reference, the KpiHistory project is a solution member, and the Host project builds cleanly with 0 warnings under TreatWarningsAsErrors. The actor wiring it enables (kpi-history-recorder singleton, not readiness-gated, with a CoordinatedShutdown drain) matches Component-KpiHistory.md and CLAUDE.md design intent. No issues found in the delta.
| # | Category | Examined | Notes |
|---|----------|----------|-------|
| 1 | Correctness & logic bugs | ☑ | Reference resolves and is required by direct type usage in Program.cs/AkkaHostedService.cs; build succeeds. No issues found. |
| 2 | Akka.NET conventions | ☑ | Enabled wiring (KpiHistoryRecorderActor singleton + proxy + PhaseClusterLeave GracefulStop drain) follows the established singleton pattern; not readiness-gated per design. No issues found. |
| 3 | Concurrency & thread safety | ☑ | csproj change introduces no concurrency surface; actor opens its own per-tick DI scope as documented. No issues found. |
| 4 | Error handling & resilience | ☑ | Graceful-stop drain wraps GracefulStop in try/catch with PoisonPill fallback; unchanged by this diff. No issues found. |
| 5 | Security | ☑ | No secrets, network, or trust-boundary surface in a project reference. No issues found. |
| 6 | Performance & resource management | ☑ | Build-graph-only change; KpiHistory is a lightweight project (Akka + DI/Options). No runtime cost added. No issues found. |
| 7 | Design-document adherence | ☑ | KpiHistory is component #26, central-only, not readiness-gated; the reference and the singleton wiring it enables match Component-KpiHistory.md and CLAUDE.md. No issues found. |
| 8 | Code organization & conventions | ☑ | Reference placed alongside other ScadaBridge ProjectReferences in logical order; no duplicate; KpiHistory is a slnx member. No issues found. |
| 9 | Testing coverage | ☑ | A build-graph fix is exercised by solution compilation and the KpiHistory.Tests project; no Host-specific test is warranted for a csproj reference. No issues found. |
| 10 | Documentation & comments | ☑ | Existing Program.cs/AkkaHostedService.cs comments accurately describe the KPI History wiring this reference supports. No issues found. |
_No new findings — the changes in this module are clean._