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
{{ message }}
Repository navigation
Prototype ErrorDetail::code vocabulary and validator rule-ID propagation #104
What ErrorDetail::code representation, built-in validator rule-ID vocabulary, and custom-validator propagation hook let RPC servers and CLIs distinguish validation failures (e.g., range Minimum/Maximum vs collection Size<Minimum<1>>) without fragile error-message string matching?
obs-websocket#1: Had to inspect error messages with a "Size validation failed" string-prefix check to map Minimum/Maximum (402) separately from Size<Minimum<1>> (403).
Prototype on:showcase/all-lanes — implement ErrorDetail::code representation, populate codes for built-in validators (Minimum, Maximum, Size, Pattern, OneOf, etc.), and expose a clean hook for custom validators.
Measure against real Showcase Migration: Validate in obs-websocket#1 by deleting the "Size validation failed" string-prefix check and mapping 402 vs 403 purely from ErrorDetail::code / ErrorKind.
Judges & landing: Run Judges (gemini-4-neon + claude-opus-5-5 high via antigravity delegates) on the prototype diff and measurements; if green, hand to coordinator to land on showcase/all-lanes.
Kept sizeof(rfl::Error)unchanged (BuiltinErrorCode : uint8_t packed into ErrorKind's existing tail padding) and preserved zero-detail-allocation (has_allocated_details == false) for all built-in validator leaf errors including Size<...> and CodePoints<...>.
Declarative static constexprcode member (std::string_view / const char* / rfl::internal::StringLiteral) read automatically by Validator, AllOf, Size, and CodePoints when validate() returns an uncoded error or throws std::exception.
Preserved .code on validated map keys via MapReader::make_key (KeyType::from_value(...)) and across wrap_error, wrap_field_error, in_field, at, Error::combine, and attach_source_location.
Fixed a pre-existing bug discovered in rfl::OneOf::validate_impl where .and_then(...).or_else(...) double-caught tail errors when >1 branch passed.
Activity
clockblocker commentedon Nov 27, 2026
Landed Showcase Confirmation (clockblocker/obs-websocket#1,
14aefd0):obs-websocket/src/protocol/RequestCodec.h: mappingRequestFieldOutOfRange (402)(Minimum/Maximum) vsRequestFieldEmpty (403)(Size) still requires matching"Size validation failed"onErrorKind::constraint_violation, directly validating Wave 7error-detail-code.Add ErrorDetail::code and built-in/custom validator rule IDs (#104)
Address Judge nits on #104 (MapReader validator code, null safety, docs)
clockblocker commentedon Nov 27, 2026
Resolved on
showcase/all-lanes(627a4853, Judge polish6966dec6).Summary
std::string ErrorDetail::code = {};andstd::string_view Error::code() const noexcept.sizeof(rfl::Error)unchanged (BuiltinErrorCode : uint8_tpacked intoErrorKind's existing tail padding) and preserved zero-detail-allocation (has_allocated_details == false) for all built-in validator leaf errors includingSize<...>andCodePoints<...>.equal_to,not_equal_to,minimum,exclusive_minimum,maximum,exclusive_maximum,pattern,any_of,one_of,size/size.*,code_points/code_points.*.rfl::error(msg, kind, code)/rfl::error(msg, kind, path, code)(constrained template keeps braced-init{}and{"field"}path overloads unambiguous).static constexprcodemember (std::string_view/const char*/rfl::internal::StringLiteral) read automatically byValidator,AllOf,Size, andCodePointswhenvalidate()returns an uncoded error or throwsstd::exception..codeon validated map keys viaMapReader::make_key(KeyType::from_value(...)) and acrosswrap_error,wrap_field_error,in_field,at,Error::combine, andattach_source_location.rfl::OneOf::validate_implwhere.and_then(...).or_else(...)double-caught tail errors when >1 branch passed.Verification
-Wall -Werror,REFLECTCPP_STRICT_WARNINGS=ON): 463/463 targets, 0 warnings, 1,083/1,083 CTests passing.msg.find("Size validation failed")inRequestCodec.hwithprimary && primary->code == "size.minimum"builds under-Wall -Wextra -Werrorand passes 3/3 CTest / 8/8 suites (789 assertions).APPROVE WITH NITS) + Gemini 4 Neon High (APPROVE WITH NITS); all nits addressed in6966dec6.