From 1d3f172f8394c086ea5c6f7373ef73ae59462b04 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 23 Nov 2026 23:35:41 -0500 Subject: [PATCH] test(grpc-data): H2 smoke asserts the no-grant capabilities shape (review fix 7a) --- scripts/validation/grpc-data/probe/Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/validation/grpc-data/probe/Program.cs b/scripts/validation/grpc-data/probe/Program.cs index f4f968116..70d3cfec4 100644 --- a/scripts/validation/grpc-data/probe/Program.cs +++ b/scripts/validation/grpc-data/probe/Program.cs @@ -219,8 +219,12 @@ try catch (RpcException error) { deniedRpc = error.StatusCode.ToString(); } var otherCaps = await client.GetCapabilitiesAsync(new() { ProtocolMajor = 1, ProtocolMinor = 3 }, With(otherKey, true), deadline()); var identical = denied is not null && Shape(unhist).AsSpan().SequenceEqual(Shape(denied)); + // Review fix 7a: a peer without a HistoryRead grant sees `history` (the origin has a historian) but no aggregates, + // resolution 0 and no bit 32. + var noGrantShape = otherCaps.History is not null && otherCaps.History.Aggregates.Count == 0 + && otherCaps.History.TimestampResolutionTicks == 0 && (otherCaps.Operations & 32) == 0; var deniedOk = deniedExpect == "permission-denied" - ? deniedRpc == "PermissionDenied" + ? deniedRpc == "PermissionDenied" && noGrantShape : denied is not null && denied.StatusCode == 0x80720000u && identical; string? precondition = null; try { await client.HistoryReadAsync(Raw(View(historized), null), With(key, false), deadline()); precondition = "OK"; } @@ -231,7 +235,8 @@ try ["unhistorized"] = new { statusCode = Hex(unhist.StatusCode), unhist.Samples.Count, unhist.HasContinuation, unhist.HasDiagnostic, bytes = Convert.ToHexString(Shape(unhist)) }, ["deniedExpect"] = deniedExpect, ["deniedPrincipal"] = denied is null ? new { rpcStatus = deniedRpc } : (object)new { statusCode = Hex(denied.StatusCode), denied.Samples.Count, denied.HasContinuation, denied.HasDiagnostic, bytes = Convert.ToHexString(Shape(denied)) }, - ["deniedPrincipalCapabilities"] = new { operations = otherCaps.Operations, historyPresent = otherCaps.History is not null }, + ["deniedPrincipalCapabilities"] = new { operations = otherCaps.Operations, historyPresent = otherCaps.History is not null, + history = otherCaps.History?.ToString(), noGrantShape }, ["byteIdentical"] = identical, ["withoutFeatureHeader"] = precondition, }));