R1.4 GetHistorianInfo: bounded out on 2020 WCF (named-value-only, no struct)

Captured the native HistorianAccess.GetHistorianInfo(out HistorianInfo, out err)
and decoded the wire: over 2020 WCF, GETHI is a named-value query whose only
working key is "HistorianVersion" (response ~30 bytes = the version string).
Probed 7 storage-mode key names -> all ok=False/err. The 518-byte HISTORIAN_INFO
struct + EventStorageMode@514 is the 2023R2 HCAL-native/gRPC model (confirmed
from the decompiled 2023R2 source); on 2020 the native client derives the mode
outside the WCF wire.

Version is already exposed (ProbeAsync/GetRuntimeParameterAsync), so no hollow
GetHistorianInfoAsync is shipped (same disposition as R1.3 timezone). This
completes the reachable 2020-WCF M1 read surface; remaining M1 = config writes
(gated on explicit request) or gRPC/2023R2-only items.

RE aids kept: harness `historian-info` scenario, Capture-HistorianInfo.ps1,
decode-historian-info-capture.py, and StringHandleProbeDiagnosticTests
.GETHI_CandidateInfoNames (asserts the named-value-only finding; gated).
Docs: wcf-historian-info.md (new) + roadmap/matrix/wall-doc updates. 230 tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6mcaT2PjRFKcogzp9UkfC
This commit is contained in:
Joseph Doherty
2026-06-20 23:42:27 -04:00
parent 1a539882d0
commit fbd839077b
8 changed files with 441 additions and 7 deletions
@@ -66,6 +66,80 @@ public sealed class StringHandleProbeDiagnosticTests
});
}
/// <summary>
/// R1.4 probe: GETHI on 2020 WCF is a named-value query (capture showed the native client
/// only ever asks for "HistorianVersion"; the 518-byte struct + EventStorageMode@514 is the
/// 2023R2 HCAL-native/gRPC model). This probes whether the 2020 server exposes any
/// storage-mode / extended info value through GETHI under other parameter names, so we can
/// decide honestly what GetHistorianInfoAsync can return over WCF.
/// </summary>
[Fact]
public void GETHI_CandidateInfoNames_AgainstLocalHistorian()
{
if (!ShouldRun(out string host)) return;
HistorianClientOptions options = new()
{
Host = host,
IntegratedSecurity = true,
Transport = HistorianTransport.LocalPipe
};
string[] candidates =
{
"HistorianVersion", "EventStorageMode", "EventStorageType", "StorageType",
"HistorianEventStorageMode", "EventStorage", "StorageMode", "HistorianInfo",
};
Dictionary<string, (bool ok, int respLen)> results = new();
ProbeOnStatusChannel(options, (channel, handle) =>
{
foreach (string name in candidates)
{
using MemoryStream ms = new();
using (BinaryWriter w = new(ms, Encoding.Unicode, leaveOpen: true))
{
w.Write(new byte[] { 0x53, 0x67, 0x02, 0x00 });
w.Write((uint)name.Length);
w.Write(Encoding.Unicode.GetBytes(name));
}
byte[] req = ms.ToArray();
byte[]? resp = null;
byte[]? err = null;
bool ok;
try
{
ok = channel.GetHistorianInfo(handle, req, out resp, out err);
}
catch (Exception ex)
{
_output.WriteLine($" {name,-26} EXCEPTION {ex.GetType().Name}: {ex.Message}");
results[name] = (false, -1);
continue;
}
string respHex = resp is { Length: > 0 }
? Convert.ToHexString(resp.AsSpan(0, Math.Min(48, resp.Length)))
: "(empty)";
_output.WriteLine($" {name,-26} ok={ok} respLen={resp?.Length ?? 0} errLen={err?.Length ?? 0} resp={respHex}");
results[name] = (ok, resp?.Length ?? 0);
}
});
// Locked finding (2026-06-20): on 2020 WCF, GETHI is a named-value query whose only
// working key is HistorianVersion. No storage-mode key is honored — EventStorageMode is
// not on the 2020 WCF wire (it is the 2023R2 HCAL-native/gRPC 518-byte-struct path).
Assert.True(results["HistorianVersion"].ok);
Assert.True(results["HistorianVersion"].respLen > 0);
foreach (string storageName in new[]
{
"EventStorageMode", "EventStorageType", "StorageType",
"HistorianEventStorageMode", "EventStorage", "StorageMode",
})
{
Assert.False(results[storageName].ok, $"unexpected: GETHI honored '{storageName}'");
}
}
[Fact]
public void ExeC_WithUppercaseStorageGuid_AgainstLocalHistorian()
{