docs(plans): record accepted recommendations for open choices in the code-review remediation plan
This commit is contained in:
@@ -12,6 +12,23 @@
|
|||||||
|
|
||||||
**Ordering:** WP1 and WP2 are the urgent ones: a trust-boundary hole, plus data that is being lost or corrupted today. WP3 to WP5 are correctness work that depends on runtime timing. WP6 and WP7 are perf and hygiene. Every WP except WP4 touches its own set of files, so they can run in parallel. WP4 shares `DeploymentService` with WP1 and should start after WP1 merges.
|
**Ordering:** WP1 and WP2 are the urgent ones: a trust-boundary hole, plus data that is being lost or corrupted today. WP3 to WP5 are correctness work that depends on runtime timing. WP6 and WP7 are perf and hygiene. Every WP except WP4 touches its own set of files, so they can run in parallel. WP4 shares `DeploymentService` with WP1 and should start after WP1 merges.
|
||||||
|
|
||||||
|
## Decisions (2026-12-03)
|
||||||
|
|
||||||
|
Where the plan first offered two options, the recommended one was accepted. The task rows say so, with the rejected option:
|
||||||
|
|
||||||
|
- **2.1:** fix `GetListByNameAsync` itself.
|
||||||
|
- **2.8:** preserve-if-null on the server.
|
||||||
|
- **3.1:** a generation-based seed drop.
|
||||||
|
- **3.8:** emit Good, used only to reset the backoff.
|
||||||
|
- **4.9:** `Parked` can be re-opened, end to end.
|
||||||
|
- **6.1:** the InstanceActor `Task.Run`/persist-tail/`PipeTo` pattern.
|
||||||
|
- **6.8 (UI-13):** a split deadline.
|
||||||
|
|
||||||
|
These were already single choices and are confirmed:
|
||||||
|
- **1.5:** bundle export of secrets needs Administrator.
|
||||||
|
- **4.2:** a standby site node refuses stream subscriptions; picking the start node from heartbeats was rejected.
|
||||||
|
- **5.1:** a NoTracking default on the circuit context, not a per-page `Reset()`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## WP1: Trust boundary and audit durability (P0)
|
## WP1: Trust boundary and audit durability (P0)
|
||||||
@@ -31,28 +48,28 @@
|
|||||||
|
|
||||||
| Task | Findings | Change | Verify |
|
| Task | Findings | Change | Verify |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 2.1 | TRN-1 | Add `.Include(Recipients)` to `GetListByNameAsync` (or use the bulk lookup). | Import Overwrite test: the target list {A,B} + bundle {A,C} must end as {A,C}, and stay that way after a re-import. |
|
| 2.1 | TRN-1 | Add `.Include(Recipients)` to `GetListByNameAsync`. **Decided:** fix the repository method, so every caller gets the recipients; don't just switch the importer to the bulk lookup. | Import Overwrite test: the target list {A,B} + bundle {A,C} must end as {A,C}, and stay that way after a re-import. |
|
||||||
| 2.2 | TPL-1, TPL-5 | Resolve alarm on-trigger script references per composition chain, not through the global `scriptCanonicalById`. | A two-slot test and a nested-slot override test. Their revision hashes change by design, so note that in the commit. |
|
| 2.2 | TPL-1, TPL-5 | Resolve alarm on-trigger script references per composition chain, not through the global `scriptCanonicalById`. | A two-slot test and a nested-slot override test. Their revision hashes change by design, so note that in the commit. |
|
||||||
| 2.3 | TPL-2 | A derived script override keeps the base alarm's on-trigger link (resolve by name). | Unit test. |
|
| 2.3 | TPL-2 | A derived script override keeps the base alarm's on-trigger link (resolve by name). | Unit test. |
|
||||||
| 2.4 | TRN-2, TRN-6 | The diff compares the secret-bearing values by hash, which keeps them presence-only to the operator. The instance diff covers the bound connection and drops the never-written field. | Diff tests. |
|
| 2.4 | TRN-2, TRN-6 | The diff compares the secret-bearing values by hash, which keeps them presence-only to the operator. The instance diff covers the bound connection and drops the never-written field. | Diff tests. |
|
||||||
| 2.5 | TRN-3, TRN-7, TRN-8, TRN-9 | Preview applies the name map. Site-scoped lookups are case-insensitive. Areas match by full path. Rename either works for every kind or is rejected where unsupported. | Importer tests. Re-run the reflection round-trip guard. |
|
| 2.5 | TRN-3, TRN-7, TRN-8, TRN-9 | Preview applies the name map. Site-scoped lookups are case-insensitive. Areas match by full path. Rename either works for every kind or is rejected where unsupported. | Importer tests. Re-run the reflection round-trip guard. |
|
||||||
| 2.6 | TRN-4, TRN-5 | Template Overwrite removes compositions that aren't in the bundle. The composition rewire also deletes the slot-owned derived templates. | Importer tests against a real context. |
|
| 2.6 | TRN-4, TRN-5 | Template Overwrite removes compositions that aren't in the bundle. The composition rewire also deletes the slot-owned derived templates. | Importer tests against a real context. |
|
||||||
| 2.7 | TRN-10 | Clamp the manifest KDF iteration count to a sane range. | Unit test. |
|
| 2.7 | TRN-10 | Clamp the manifest KDF iteration count to a sane range. | Unit test. |
|
||||||
| 2.8 | CLI-2 | Update commands only send options that were actually passed. This needs a server-side partial-update path, or the CLI fetches the current entity and merges into it. | CLI tests per update command. |
|
| 2.8 | CLI-2 | Update commands only send options that were actually passed. **Decided:** preserve-if-null on the server. The update command fields become nullable and the handler applies `if (cmd.X is not null)`. Fetch-and-merge in the CLI was rejected: the fetch returns scrubbed secrets, so merging would write the placeholders back, and it races concurrent edits. | CLI tests per update command. |
|
||||||
| 2.9 | DEP-3 | Widen `PerSiteStatus` to `nvarchar(max)`. | **Migration + SQL script.** |
|
| 2.9 | DEP-3 | Widen `PerSiteStatus` to `nvarchar(max)`. | **Migration + SQL script.** |
|
||||||
|
|
||||||
## WP3: Site runtime and data path correctness (P1)
|
## WP3: Site runtime and data path correctness (P1)
|
||||||
|
|
||||||
| Task | Findings | Change | Verify |
|
| Task | Findings | Change | Verify |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 3.1 | DCL-1 | Flag seed values on `TagValueReceived`. Drop a seed for any tag that already delivered a live value in the current subscribe generation, or whose timestamp is older than the last forwarded one. | Actor test with a seed that arrives after a live value. Live check: reconnect on the rig. |
|
| 3.1 | DCL-1 | Flag seed values on `TagValueReceived`. **Decided:** drop a seed for any tag that has already delivered a live value in the current subscribe generation. Comparing timestamps was rejected: it depends on device and server clocks, and on the configured timestamp mode (see DCL-7). | Actor test with a seed that arrives after a live value. Live check: reconnect on the rig. |
|
||||||
| 3.2 | DCL-2, DCL-3, DCL-8 | Retry OPC UA alarm re-subscribe failures. Check the monitored-item create status. Put tags with connection-level failure rows into the retry set. | DCL actor tests. |
|
| 3.2 | DCL-2, DCL-3, DCL-8 | Retry OPC UA alarm re-subscribe failures. Check the monitored-item create status. Put tags with connection-level failure rows into the retry set. | DCL actor tests. |
|
||||||
| 3.3 | DCL-4, DCL-9 | Cancel the re-subscribe loop when its session ends. Make the shared supervisory-advise task independent of the first caller's token. | Tests. |
|
| 3.3 | DCL-4, DCL-9 | Cancel the re-subscribe loop when its session ends. Make the shared supervisory-advise task independent of the first caller's token. | Tests. |
|
||||||
| 3.4 | DCL-5, DCL-6, DCL-7 | Route alarm sources with a separator-aware prefix match. Browse/search reply with an error while disconnected. Reads honour the `Server` timestamp mode. | Tests. |
|
| 3.4 | DCL-5, DCL-6, DCL-7 | Route alarm sources with a separator-aware prefix match. Browse/search reply with an error while disconnected. Reads honour the `Server` timestamp mode. | Tests. |
|
||||||
| 3.5 | SF-1, SF-2 | Keep per-target FIFO: the per-lane order must be by enqueue time, and a lane must not pass a still-pending older row. Classify a storage error after a successful delivery separately, so the delivery isn't repeated. | S&F tests. |
|
| 3.5 | SF-1, SF-2 | Keep per-target FIFO: the per-lane order must be by enqueue time, and a lane must not pass a still-pending older row. Classify a storage error after a successful delivery separately, so the delivery isn't repeated. | S&F tests. |
|
||||||
| 3.6 | SRT-1, SRT-10 | The watchdog detects a wedged run by deadline, not only by a blocked thread. Separate cancellation from timeout in the reported outcome. | Tests. |
|
| 3.6 | SRT-1, SRT-10 | The watchdog detects a wedged run by deadline, not only by a blocked thread. Separate cancellation from timeout in the reported outcome. | Tests. |
|
||||||
| 3.7 | SRT-2, SRT-3, SRT-4 | A failed trigger evaluation keeps the previous state (no coercion to false) and logs a rate-limited event. RateOfChange clears when the value is flat. Start the WhileTrue timer when the condition is adopted from a seed. | Alarm/script actor tests. |
|
| 3.7 | SRT-2, SRT-3, SRT-4 | A failed trigger evaluation keeps the previous state (no coercion to false) and logs a rate-limited event. RateOfChange clears when the value is flat. Start the WhileTrue timer when the condition is adopted from a seed. | Alarm/script actor tests. |
|
||||||
| 3.8 | SRT-6 | Emit `ConnectionQualityChanged(Good)` (or remove the dead reset and document the 45 s ceiling). | Test. |
|
| 3.8 | SRT-6 | **Decided:** the DCL connection actor emits `ConnectionQualityChanged(Good)` when it re-enters Connected. The Instance Actor's Good branch only resets the Lever-1 subscribe backoff. It must **not** stamp bound attributes Good with their last-known values before the device re-reports. | Test. |
|
||||||
| 3.9 | SRT-8, SRT-9, SRT-13 | Script-facing Asks use the remaining deadline. `Notify.Status` checks the site-local store first. Remove the hard-coded 30 s routed-call cap (use the configured timeout). | Tests. |
|
| 3.9 | SRT-8, SRT-9, SRT-13 | Script-facing Asks use the remaining deadline. `Notify.Status` checks the site-local store first. Remove the hard-coded 30 s routed-call cap (use the configured timeout). | Tests. |
|
||||||
| 3.10 | SRT-11, SRT-12 | A static write refreshes the quality/timestamp. The redeploy reset gate covers the full actor start. | Tests. |
|
| 3.10 | SRT-11, SRT-12 | A static write refreshes the quality/timestamp. The redeploy reset gate covers the full actor start. | Tests. |
|
||||||
| 3.11 | CMN-3, CMN-4, CMN-10 | The codec handles non-finite numbers and round-trips DateTime as UTC ISO-8601 with sub-second precision (a compatibility read accepts the old format). JSON null converts to null. | Codec round-trip tests. Additive only, so the wire stays compatible. |
|
| 3.11 | CMN-3, CMN-4, CMN-10 | The codec handles non-finite numbers and round-trips DateTime as UTC ISO-8601 with sub-second precision (a compatibility read accepts the old format). JSON null converts to null. | Codec round-trip tests. Additive only, so the wire stays compatible. |
|
||||||
@@ -69,7 +86,7 @@
|
|||||||
| 4.6 | NTF-2, ESG-1 | Classify SMTP connection drops, OAuth2 token-endpoint outages, and a body-read `IOException`/`HttpRequestException` as transient. | Adapter tests. |
|
| 4.6 | NTF-2, ESG-1 | Classify SMTP connection drops, OAuth2 token-endpoint outages, and a body-read `IOException`/`HttpRequestException` as transient. | Adapter tests. |
|
||||||
| 4.7 | DLM-1 | DelmiaNotifier: a connect failure (no request sent) fails over to the next URL; `OUTCOME_UNKNOWN` only after the send. | Notifier tests. |
|
| 4.7 | DLM-1 | DelmiaNotifier: a connect failure (no request sent) fails over to the next URL; `OUTCOME_UNKNOWN` only after the send. | Notifier tests. |
|
||||||
| 4.8 | AUD-1 | Reconciliation keeps one cursor per (site, node) and pulls from both nodes. | Reconciliation tests. |
|
| 4.8 | AUD-1 | Reconciliation keeps one cursor per (site, node) and pulls from both nodes. | Reconciliation tests. |
|
||||||
| 4.9 | SCA-1 | A central `SiteCalls` row follows the site's post-Retry/Discard status (via the telemetry upsert-on-newer, or a reconcile of parked rows). | Test. Rig: retry a parked call and watch the row clear. |
|
| 4.9 | SCA-1 | **Decided:** `Parked` can be re-opened, end to end. The site tracking store accepts a transition out of `Parked`: Retry clears `TerminalAtUtc`, Discard writes `Discarded`, and both emit telemetry. The central guard accepts `Parked → Attempted/Delivered/Failed/Discarded` when the incoming `UpdatedAtUtc` is newer. A separate reconcile sweep of parked rows was rejected because it adds a second path. | Test. Rig: retry a parked call and watch the row clear. |
|
||||||
| 4.10 | KPI-1 | The backfill plans from its own persisted watermark, not from the periodic fold's. | Recorder test. |
|
| 4.10 | KPI-1 | The backfill plans from its own persisted watermark, not from the periodic fold's. | Recorder test. |
|
||||||
| 4.11 | AUD-6 | The purge/archive covers rows before the first partition boundary. | SQL test against a partitioned test DB. |
|
| 4.11 | AUD-6 | The purge/archive covers rows before the first partition boundary. | SQL test against a partitioned test DB. |
|
||||||
|
|
||||||
@@ -86,14 +103,14 @@
|
|||||||
|
|
||||||
| Task | Findings | Change |
|
| Task | Findings | Change |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| 6.1 | SRT-5 | Move synchronous SQLite work off the Akka dispatcher (PipeTo pattern or the existing single-writer queue). |
|
| 6.1 | SRT-5 | Move synchronous SQLite work off the Akka dispatcher. **Decided:** follow the InstanceActor pattern. The storage call runs in `Task.Run`, flushes chain on a persist-tail task so batches stay ordered, and reads `PipeTo(Self)`. |
|
||||||
| 6.2 | SRT-7, SRT-14, CMN-11 | Index expression triggers by referenced attribute. `EnforceCap` uses a priority structure. Look up the predictor lane in O(1). |
|
| 6.2 | SRT-7, SRT-14, CMN-11 | Index expression triggers by referenced attribute. `EnforceCap` uses a priority structure. Look up the predictor lane in O(1). |
|
||||||
| 6.3 | SF-3 | The sweep selects ids/lanes without payloads, then loads the payloads of the chosen page. Back it with an index. |
|
| 6.3 | SF-3 | The sweep selects ids/lanes without payloads, then loads the payloads of the chosen page. Back it with an index. |
|
||||||
| 6.4 | AUD-2, AUD-3, AUD-4, AUD-7 | Drop `Cache=Shared`. Keyset-page `ReadPendingSinceAsync` on an indexed `(ForwardState, OccurredAt, EventId)`. Add an age-seekable purge index. Batch the tracking reads in the telemetry drain. |
|
| 6.4 | AUD-2, AUD-3, AUD-4, AUD-7 | Drop `Cache=Shared`. Keyset-page `ReadPendingSinceAsync` on an indexed `(ForwardState, OccurredAt, EventId)`. Add an age-seekable purge index. Batch the tracking reads in the telemetry drain. |
|
||||||
| 6.5 | AUD-5, SEL-1 | Add a `(Channel, OccurredAtUtc)` index and bind the channel as `varchar`. Add a site `site_events(instance_id, timestamp)` index. **Migration + SQL script; site schema applied in place.** |
|
| 6.5 | AUD-5, SEL-1 | Add a `(Channel, OccurredAtUtc)` index and bind the channel as `varchar`. Add a site `site_events(instance_id, timestamp)` index. **Migration + SQL script; site schema applied in place.** |
|
||||||
| 6.6 | DEP-4, DEP-5, DEP-6, TPL-4 | Batch the fleet staleness queries with `AsNoTracking`. Detach a failed staging write (like P7-5). Re-check Disabled at Send time. Use targeted single-entity loads. |
|
| 6.6 | DEP-4, DEP-5, DEP-6, TPL-4 | Batch the fleet staleness queries with `AsNoTracking`. Detach a failed staging write (like P7-5). Re-check Disabled at Send time. Use targeted single-entity loads. |
|
||||||
| 6.7 | MGT-5, TRN-11 | Export and import resolve names with one bulk lookup per kind. |
|
| 6.7 | MGT-5, TRN-11 | Export and import resolve names with one bulk lookup per kind. |
|
||||||
| 6.8 | UI-6, UI-12, UI-13 | Save only the overrides that changed (one transaction). Cache the auth/site lookups per poll. Pre-warm a sandbox worker, or raise the first-run deadline. |
|
| 6.8 | UI-6, UI-12, UI-13 | Save only the overrides that changed (one transaction). Cache the auth/site lookups per poll. **Decided (UI-13):** split the deadline. The script deadline starts when the worker reports it is about to run user code, and a separate, generous ceiling covers start-up plus compile. A pre-warmed worker pool was rejected as more moving parts than the problem needs. |
|
||||||
| 6.9 | INB-2, INB-3, INB-4 | Cache resolved `$ref` schemas per method revision. Size the audit buffer to Content-Length (capped). Expire the relay replay cache by time-ordered queue. |
|
| 6.9 | INB-2, INB-3, INB-4 | Cache resolved `$ref` schemas per method revision. Size the audit buffer to Content-Length (capped). Expire the relay replay cache by time-ordered queue. |
|
||||||
| 6.10 | COMM-8, DCL-10 | Run the failback probes in parallel with a bound. Use a static quality map. |
|
| 6.10 | COMM-8, DCL-10 | Run the failback probes in parallel with a bound. Use a static quality map. |
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user