fix(grpc-data): H4 review 1 — count every projected history answer where its status is set

The consumer reads counter was fed from the gateway's outcomes, so limiter refusals, a spent
deadline, a count mismatch and refusals before the gateway were never counted, and a serve-time
fault after the gateway returned counted Good. The node manager now reports each projected node
once with the status the client sees (IProjectedHistoryAccess.RecordAnswered); a fault that
escapes to the SDK counts every projected node of the request Bad. Variant gains 'modified'.
This commit is contained in:
Joseph Doherty
2026-11-24 08:35:55 -05:00
parent ce648523ab
commit 2f11a9c609
6 changed files with 186 additions and 21 deletions
@@ -151,6 +151,22 @@ public sealed class ProjectedDataAccess : IProjectedDataAccess, IDisposable
DataValueKind.Guid => items.Cast<Guid>().ToArray(), _ => throw new ArgumentException("Unsupported array element kind.")
};
}
/// <summary>
/// H4 diagnostics: the deployed connection a projected node's mapping uses, without authorizing or pinning anything; null
/// when the node no longer resolves. Never an access decision.
/// </summary>
internal string? ConnectionOf(NodeId nodeId)
{
try
{
return _nodes.TryResolve(nodeId, out var definition) && definition is not null
&& _catalog.TryResolveProjected(definition.Realm, definition.LocalIdentifier, out var proof) && proof is not null
&& proof.Metadata.View.MappingId is { } mapping && _connectionForMapping(mapping) is { Length: > 0 } connectionId
? connectionId : null;
}
catch (Exception ex) when (ex is ArgumentException or InvalidOperationException) { return null; }
}
public bool TryAcquire(NodeId nodeId, RoleCarryingUserIdentity caller, DataOperations operation, out IProjectedDemandLease? demand)
{
demand = null;