feat: v5.1.0 — add ByteMessageInfo::response_kind, closing the response-classification gap - #138
Merged
Merged
Conversation
…se-classification gap No function anywhere in this crate classified a decoded response header's evt field into TC18 §11.3 Table 15's four response semantics (Acknowledge/Write/Read/Error) -- a gap found during a cross-repo architecture inventory (RELAY docs/RCP-ARCHITECTURE.md) that also found the identical gap in go-RCP and a related, now-fixed bug in c-RCP (rcp_acf_classify_response never checking evt at all). The gap was already partially documented: Evt's own doc comment named the missing piece "REQ-RESP-004" and Evt::sub_opcode's requirement (REQ-EVT-001) cross-referenced it -- but REQ-RESP-004 was never actually added to .fusa-reqs.json, just forward-referenced in prose. This commit lands the real requirement alongside the implementation, matching what was already promised. ByteMessageInfo::response_kind() implements TC18 §11.3.1-§11.3.4: evt[3:0] == 0xF identifies an Acknowledge unconditionally, checked before err/op -- a rejected Acknowledge (err = true) is still an Acknowledge, not a ResponseKind::Error, which is a distinct evt[3:0] < 0x9 case. Matches cpp-RCP's response_kind_of(), the cross-repo reference implementation for this concern. Evt gains raw_nibble() (the ack+sub_opcode -> wire-nibble packing encode_byte_message_info already did inline) as a small shared primitive, now used by both the encoder and the new classifier instead of duplicating the bit arithmetic. Mutation-tested: reverting the evt-first check makes exactly the 3 acknowledge-specific test cases fail, the same failure shape the c-RCP bug had. Additive public API (new pub fn/enum/const, no existing signature changed) -- MINOR bump per this crate's own SEMVER.md. Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
…urface CI's Public API stability check failed: this branch adds pub items (ResponseKind, ByteMessageInfo::response_kind, Evt::raw_nibble, EVT_RESPONSE_ACKNOWLEDGE) without updating the committed snapshot. rustup isn't available in this environment to run `cargo +nightly public-api` directly, so this snapshot was updated by hand from CI's own computed diff (job 91401638000), applied verbatim -- not re-derived or guessed at. Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
No function anywhere in this crate classified a decoded response header's
evtfield into TC18 §11.3 Table 15's four response semantics (Acknowledge/Write/Read/Error) — a gap found during a cross-repo architecture inventory (RELAYdocs/RCP-ARCHITECTURE.md) that also found the identical gap in go-RCP and a related, now-fixed bug in c-RCP (rcp_acf_classify_responsenever checkingevtat all — c-RCP#151).The gap was already partially documented:
Evt's doc comment named the missing pieceREQ-RESP-004andEvt::sub_opcode's own requirement (REQ-EVT-001) cross-referenced it — butREQ-RESP-004was never actually added to.fusa-reqs.json, just forward-referenced in prose. This lands the real requirement alongside the implementation.ByteMessageInfo::response_kind()implements TC18 §11.3.1-§11.3.4:evt[3:0] == 0xFidentifies an Acknowledge unconditionally, checked before err/op — a rejected Acknowledge is still an Acknowledge, not aResponseKind::Error. Matches cpp-RCP'sresponse_kind_of(), the cross-repo reference implementation.Evtgainsraw_nibble()(the ack+sub_opcode → wire-nibble packing the encoder already did inline), now shared between the encoder and the new classifier instead of duplicated bit arithmetic.Additive public API — MINOR bump per this crate's
SEMVER.md.Test plan
cargo build --release,cargo test --all-features(1109+32 tests) all cleancargo fmt --check,cargo clippy --all-targets --all-features -- -D warningscleanbash scripts/fusa-gap-check.sh→ 608/608 (100%), no gaps