You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from PR #2644's (core#2642) second adversarial review, finding #4: packages/daemon/src/services/node_service.rs's ops_error_to_status builds the x-play-rule-rejected gRPC metadata by JSON-serializing {node_id, play_id, rule_id, message} and parsing it as tonic::metadata::MetadataValue<Ascii>, silently dropping the whole payload when parsing fails (if let Ok(val) = ...).
message is author-supplied, free-text rejection text from a playbook rule's reject action (ADR-060 §2) — realistically containing non-ASCII bytes (accents, non-Latin scripts, emoji, curly quotes, em dashes). MetadataValue<Ascii> rejects any non-ASCII byte, so any such message causes the entire structured payload to vanish. The plain gRPC status message text still carries it, but the structured x-play-rule-rejected metadata — which core#2643's planned frontend work would key off to recognize this error type specifically — silently disappears for exactly the messages most likely to need special UI treatment.
Didn't block PR #2644's own merge (nothing consumes the metadata yet), but worth fixing before core#2643 builds directly on this wire contract.
Proposed Solution
Switch to gRPC's binary-metadata convention: a -bin-suffixed key (x-play-rule-rejected-bin) carrying the JSON payload via tonic::metadata::MetadataValue::<Binary>::from_bytes, which is infallible (no byte value can fail to construct it), instead of the fallible MetadataValue<Ascii> parse.
Acceptance Criteria
x-play-rule-rejected (Ascii) metadata replaced with x-play-rule-rejected-bin (Binary)
Regression test proving a non-ASCII rejection message survives the round trip
Existing error_mapping_play_rule_rejected_* tests updated to the new key/encoding
Tests pass (bun run test:all)
Code passes bun run quality:fix
Technical Specifications
Reference Files
packages/daemon/src/services/node_service.rs — ops_error_to_status's OpsError::PlayRuleRejected arm (~line 2468 onward), and its error_mapping_play_rule_rejected_* tests
Dependencies
core#2642 (adds the x-play-rule-rejected metadata this fixes) — merged
Blocks nothing structurally, but core#2643's frontend-facing wiring should land after this, not before, since it will consume this exact metadata key
Superseded by #2647, filed independently for the same finding (non-ASCII x-play-rule-rejected metadata) plus a second, related finding (load_active_plays validation-error log fingerprint collapsing distinct errors). Closing this one to avoid duplicate tracking/PRs; tracking continues on #2647.
Activity
mstomar125 commentedon Sep 16, 2026
Superseded by #2647, filed independently for the same finding (non-ASCII
x-play-rule-rejectedmetadata) plus a second, related finding (load_active_playsvalidation-error log fingerprint collapsing distinct errors). Closing this one to avoid duplicate tracking/PRs; tracking continues on #2647.