fix(cli-common): name native-driver-emitted status codes in SnapshotFormatter
Driver.FOCAS.Cli-005 follow-up: extend the SnapshotFormatter.FormatStatus shortlist with the five Bad* codes the native-protocol mappers (FOCAS, AbCip, AbLegacy) emit but which the shortlist previously left unnamed, so they rendered only as severity-class 'Bad' instead of the documented 'BadDeviceFailure' / 'BadNotWritable' / ... names operators are told to read off probe/write output. Added entries: 0x80020000 BadInternalError 0x803B0000 BadNotWritable 0x803C0000 BadOutOfRange 0x803D0000 BadNotSupported 0x80550000 BadDeviceFailure (BadTimeout 0x800A0000 was already added under Driver.Cli.Common-001.) Tests: SnapshotFormatterTests gains a new [Theory] FormatStatus_names_native_driver_emitted_codes covering the five names, and the existing well-known [Theory] is extended with the same entries to enforce exact '0x... (Name)' rendering. Suite now 47 green (was 42). Flips Driver.FOCAS.Cli-005 from Deferred to Resolved; README regenerated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -187,7 +187,7 @@ the source-level convention against regression.
|
||||
| Severity | Low |
|
||||
| Category | Design-document adherence |
|
||||
| Location | `Commands/WriteCommand.cs:50`, `Commands/ProbeCommand.cs:50` (via `SnapshotFormatter.FormatStatus`) |
|
||||
| Status | Deferred |
|
||||
| Status | Resolved |
|
||||
|
||||
**Description:** `docs/Driver.FOCAS.Cli.md` documents `BadDeviceFailure` and
|
||||
`BadCommunicationError` as the key diagnostic signals an operator reads off
|
||||
@@ -214,14 +214,18 @@ actually emit — at minimum `BadNotWritable`, `BadOutOfRange`, `BadNotSupported
|
||||
because the gap defeats this module documented `probe`/`write` diagnostic
|
||||
workflow; cross-reference the `Driver.Cli.Common` review.
|
||||
|
||||
**Resolution:** Deferred 2026-05-23 — the recommended fix lives in
|
||||
`SnapshotFormatter.FormatStatus` inside the `Driver.Cli.Common` shared module,
|
||||
which is outside this module's edit scope. Driver.Cli.Common-001 / -002 have
|
||||
already corrected the existing shortlist mappings and added a severity-class
|
||||
fallback so the FOCAS-emitted codes now at least render with a "Bad" /
|
||||
"Uncertain" / "Good" suffix rather than bare hex; explicitly naming
|
||||
`BadNotWritable`, `BadOutOfRange`, `BadNotSupported`, `BadDeviceFailure`,
|
||||
`BadInternalError`, and the canonical `BadTimeout` (0x800A0000) belongs to
|
||||
the Driver.Cli.Common review's follow-up (and benefits every driver CLI, not
|
||||
just FOCAS). Re-open here only if Driver.Cli.Common declines to extend the
|
||||
shortlist.
|
||||
**Resolution:** Resolved 2026-05-23 — the cross-CLI fix landed in `Driver.Cli.Common`:
|
||||
`SnapshotFormatter.FormatStatus` now names `BadInternalError` (0x80020000),
|
||||
`BadNotWritable` (0x803B0000), `BadOutOfRange` (0x803C0000), `BadNotSupported`
|
||||
(0x803D0000), and `BadDeviceFailure` (0x80550000) — the five codes the FOCAS /
|
||||
AbCip / AbLegacy native-protocol mappers all emit but the shortlist previously
|
||||
left unnamed (the canonical `BadTimeout` 0x800A0000 was already added under
|
||||
Driver.Cli.Common-001). FOCAS `probe` / `write` against a non-writable parameter,
|
||||
out-of-range address, unsupported function, busy device, or CNC-handle failure
|
||||
now renders with the named status the `docs/Driver.FOCAS.Cli.md` workflow
|
||||
promises, restoring parity between the docs and the shipped behaviour. Regression
|
||||
`[Theory]` `FormatStatus_names_native_driver_emitted_codes` added to
|
||||
`SnapshotFormatterTests` so the five names can't silently drop out of the
|
||||
shortlist again; the existing well-known shortlist `[Theory]` was extended with
|
||||
the same five entries to enforce the exact `0x... (Name)` rendering. Suite now
|
||||
47 green (was 42).
|
||||
|
||||
@@ -327,7 +327,7 @@ Findings with status `Resolved`, `Won't Fix`, or `Deferred`.
|
||||
| Driver.FOCAS.Cli-002 | Low | Resolved | Concurrency & thread safety | `Commands/SubscribeCommand.cs:45-51` |
|
||||
| Driver.FOCAS.Cli-003 | Low | Resolved | Error handling & resilience | `FocasCommandBase.cs:19` (`CncPort`), `FocasCommandBase.cs:27` (`TimeoutMs`), `Commands/SubscribeCommand.cs:23` (`IntervalMs`) |
|
||||
| Driver.FOCAS.Cli-004 | Low | Resolved | Performance & resource management | `Commands/ProbeCommand.cs:37,54`; `Commands/ReadCommand.cs:37,46`; `Commands/WriteCommand.cs:45,54`; `Commands/SubscribeCommand.cs:39,73` |
|
||||
| Driver.FOCAS.Cli-005 | Low | Deferred | Design-document adherence | `Commands/WriteCommand.cs:50`, `Commands/ProbeCommand.cs:50` (via `SnapshotFormatter.FormatStatus`) |
|
||||
| Driver.FOCAS.Cli-005 | Low | Resolved | Design-document adherence | `Commands/WriteCommand.cs:50`, `Commands/ProbeCommand.cs:50` (via `SnapshotFormatter.FormatStatus`) |
|
||||
| Driver.Galaxy-005 | Low | Resolved | OtOpcUa conventions | `Runtime/EventPump.cs:81-88` |
|
||||
| Driver.Galaxy-010 | Low | Resolved | Security | `GalaxyDriver.cs:311-341` |
|
||||
| Driver.Galaxy-012 | Low | Resolved | Performance & resource management | `Runtime/SubscriptionRegistry.cs:65-67`, `GalaxyDriver.cs:538`, `GalaxyDriver.cs:675` |
|
||||
|
||||
Reference in New Issue
Block a user