fix(historian): map Boolean historization to Int2, not degenerate Int1 (#441) #442

Merged
dohertj2 merged 1 commits from fix/441-boolean-historization-int2 into master 2026-07-14 12:38:06 -04:00
Owner

Resolves #441 (response to HistorianGateway #11).

Problem

HistorianTypeMapper mapped DriverDataType.Boolean → HistorianDataType.Int1, but the historian's Int1 analog-tag creation path is server-degenerateEnsureTags(Int1) stores an unusable stub (live-probed on the deployed 2023 R2 historian; root-caused + documented gateway-side in HistorianGateway #11 / PR #16). So Boolean historized tags failed auto-provisioning (the one red case in the R2-06 Category=LiveIntegration run, 5/6).

Fix — option 1 from #441: Boolean → Int2

Map Boolean → Int2 and store 0/1. Int2 is a proven-creatable analog type (type sweep: Int2/UInt2/Int4/UInt4/Float/Double all provision; only Int1 fails). The value-write path already sends every value as a double on WriteLiveValues regardless of tag type, so a Boolean 0.0/1.0 round-trips cleanly into the Int2 tag. Both Float and Int2 are supported, so a pre-existing Float Boolean tag retypes cleanly on its next deploy.

Changes

  • HistorianTypeMapper: Boolean => Int2 (+ remarks explaining why not Int1)
  • Unit pins: HistorianTypeMapperTests, GatewayTagProvisionerTests.Boolean_definition_carries_explicit_Int2_presence
  • Live gate: EnsureTags_boolean_sandbox_provisions_as_Int2 (was _Int1); retype probe reframed Float→Int2 (drops the dead Int1 leg)
  • Docs: docs/Historian.md (new 'Boolean historization maps to Int2' section), CLAUDE.md, archreview STATUS.md (R2-06 live gate → 6/6)

Test

dotnet build clean; gateway driver unit 103/103. Live Category=LiveIntegration leg is operator-gated (VPN) and now expects Int2.

Resolves #441 (response to HistorianGateway #11). ## Problem `HistorianTypeMapper` mapped `DriverDataType.Boolean → HistorianDataType.Int1`, but the historian's **Int1 analog-tag creation path is server-degenerate** — `EnsureTags(Int1)` stores an unusable stub (live-probed on the deployed 2023 R2 historian; root-caused + documented gateway-side in HistorianGateway #11 / PR #16). So Boolean historized tags failed auto-provisioning (the one red case in the R2-06 `Category=LiveIntegration` run, 5/6). ## Fix — option 1 from #441: Boolean → Int2 Map `Boolean → Int2` and store 0/1. Int2 is a proven-creatable analog type (type sweep: Int2/UInt2/Int4/UInt4/Float/Double all provision; only Int1 fails). The value-write path already sends every value as a `double` on `WriteLiveValues` regardless of tag type, so a Boolean `0.0/1.0` round-trips cleanly into the Int2 tag. Both Float and Int2 are supported, so a pre-existing Float Boolean tag retypes cleanly on its next deploy. ## Changes - `HistorianTypeMapper`: `Boolean => Int2` (+ remarks explaining why not Int1) - Unit pins: `HistorianTypeMapperTests`, `GatewayTagProvisionerTests.Boolean_definition_carries_explicit_Int2_presence` - Live gate: `EnsureTags_boolean_sandbox_provisions_as_Int2` (was `_Int1`); retype probe reframed Float→Int2 (drops the dead Int1 leg) - Docs: `docs/Historian.md` (new 'Boolean historization maps to Int2' section), `CLAUDE.md`, archreview `STATUS.md` (R2-06 live gate → 6/6) ## Test `dotnet build` clean; gateway driver unit **103/103**. Live `Category=LiveIntegration` leg is operator-gated (VPN) and now expects Int2.
dohertj2 added 1 commit 2026-07-14 11:57:57 -04:00
fix(historian): map Boolean historization to Int2, not degenerate Int1 (#441)
v2-ci / build (pull_request) Successful in 3m24s
v2-ci / unit-tests (pull_request) Failing after 8m19s
9f62310b49
The historian's Int1 analog-tag creation path is server-degenerate:
EnsureTags(Int1) stores an unusable stub (live-probed on the deployed
2023 R2 historian; root-caused + documented gateway-side in
HistorianGateway #11 / PR #16). HistorianTypeMapper mapped
DriverDataType.Boolean -> HistorianDataType.Int1, so Boolean historized
tags failed auto-provisioning.

Map Boolean -> Int2 instead (store 0/1). Int2 is a proven-creatable
analog type, and the value-write path already sends every value as a
double on WriteLiveValues regardless of tag type, so Boolean 0.0/1.0
round-trips cleanly. Both Float and Int2 are supported, so a
pre-existing Float Boolean tag retypes cleanly on its next deploy.

- HistorianTypeMapper: Boolean => Int2 (+ remarks)
- Unit pins: HistorianTypeMapperTests, GatewayTagProvisionerTests
  (Boolean_definition_carries_explicit_Int2_presence)
- Live gate: EnsureTags_boolean_sandbox_provisions_as_Int2 (was _Int1);
  retype probe reframed Float->Int2 (drops the dead Int1 leg)
- Docs: docs/Historian.md 'Boolean historization maps to Int2', CLAUDE.md,
  archreview STATUS.md (R2-06 live gate -> 6/6)

Resolves #441.
dohertj2 merged commit 38e21df296 into master 2026-07-14 12:38:06 -04:00
Sign in to join this conversation.