fix(grpc-data): X0 node-side re-validation tolerates only the reserved bits; runtime logger via init property

P02 GrpcDataArtifactReadTests pins an arbitrary bit (1<<30) as a malformed row that fails closed; keep that and
tolerate only DataOperationSets.Reserved. P07 GrpcDataHotRouteContinuityTests reflects over the runtime constructor
shape, so the logger moves from a ctor parameter to an init property.
This commit is contained in:
Joseph Doherty
2026-11-23 17:52:54 -05:00
parent a5ef7ea6d8
commit 75cf5eb8f7
4 changed files with 31 additions and 11 deletions
@@ -21,9 +21,10 @@ public static class DataConnectionValidator
/// <summary>
/// Node-side re-validation of an already-deployed artifact (artifact parse, origin catalog compile). Identical to
/// <see cref="Validate(DraftSnapshot)"/> except that operation bits this build does not understand are IGNORED
/// rather than rejected (X0 tolerant reader): a newer central may author them, and rejecting would take down every
/// data connection/export on the node. Each consumer of the rows keeps only the bits it understands (fail closed).
/// <see cref="Validate(DraftSnapshot)"/> except that the X0-RESERVED operation bits (<see cref="DataOperationSets.Reserved"/>)
/// are IGNORED rather than rejected: a newer central may author them, and rejecting would take down every data
/// connection/export on the node. Each consumer of the rows keeps only the bits it understands (fail closed). A bit
/// outside both sets is still a malformed row (nothing can author it).
/// </summary>
public static IReadOnlyList<ValidationError> ValidateDeployed(DraftSnapshot draft) => Validate(draft, deployed: true);
@@ -33,8 +34,8 @@ public static class DataConnectionValidator
var errors = new List<ValidationError>();
void Add(string code, string id, string message) => errors.Add(new(code, message, id));
bool Same(string? a, string? b) => Ids.Equals(a, b);
bool ValidOps(DataOperations operations) => operations != DataOperations.None &&
(deployed || (operations & ~KnownOperations) == 0);
var accepted = deployed ? KnownOperations | DataOperationSets.Reserved : KnownOperations;
bool ValidOps(DataOperations operations) => operations != DataOperations.None && (operations & ~accepted) == 0;
DataOperations Understood(DataOperations operations) => deployed ? operations & DataOperationSets.Understood : operations;
bool NodesValid(IEnumerable<string> ids, string owner)
{