fix: collect nested deps for action Goal/Result/Feedback hashing - #339
Conversation
8cef222 to
c1ee76a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Formatting must be corrected, untested Goal and Feedback branches covered, and the unrelated #158 reference disambiguated.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes RIHS01 action hashing by including transitive message dependencies.
Changes:
- Collects nested dependencies for Goal, Result, and Feedback hashes.
- Adds a real-world GetResult hash regression test.
File summaries
| File | Description |
|---|---|
crates/hiroz-codegen/src/resolver.rs |
Recursively collects action component dependencies. |
crates/hiroz-codegen/tests/action_nested_deps.rs |
Pins the corrected LookupTransform result hash. |
Review details
Suppressed comments (1)
crates/hiroz-codegen/src/resolver.rs:688
- This Feedback path is not exercised with nested dependencies: the new test uses
LookupTransform, whose feedback section is empty, and asserts only the Result service hash. Please add a nested-feedback case (the bundledtest_msgs/NestedMessage.actionfixture covers this shape) and pinfeedback_message_hashso this independent branch cannot regress.
self.collect_nested_deps(&feedback_desc, &mut deps);
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Uses tf2_msgs/LookupTransform, a real fixture already packaged under assets/jazzy, to exercise both hash paths the previous commit fixes: Result (TransformStamped + TF2Error, multi-level nesting) and Goal (builtin_interfaces/Duration, never manually inserted the way Time is). Pinned to the corrected hashes, measured on whippet. Also drops a stray whitespace-only line the previous commit left in resolver.rs (Copilot review on GH#339).
c1ee76a to
da20fba
Compare
|
Hi @sathak93! This PR preserves your original commit (cherry-picked with your authorship intact) on top of a regression test, so the CLA check now needs a signature from both of us. Could you sign the CLA via the link below when you get a chance? https://cla-assistant.io/ZettaScaleLabs/hiroz?pullRequest=339 |
Fixes the nested-dependency-collection defect #334 reported.
A community pull request (#334, draft) from @sathak93 reported a real defect and diagnosed and fixed it correctly, but shipped no test coverage. This preserves their original commit (cherry-picked, authorship intact) and adds the regression test the diagnosis needed on top.
calculate_send_goal_hash,calculate_get_result_hash, andcalculate_feedback_message_hashincrates/hiroz-codegen/src/resolver.rseach insert the action's Goal/Result/FeedbackTypeDescriptioninto thedepsmap used to compute its RIHS01 type hash, but never callcollect_nested_depsto also pull in that type's own nested/referenced message dependencies — unlike plain service hashing, which already does this (resolver.rs:181-182).Before and after
depsomits the nested type; RIHS01 hash is wrongcollect_nested_depspulls in the nested type, matching the plain-service code pathWhat the test does
crates/hiroz-codegen/tests/action_nested_deps.rs(new) usestf2_msgs/LookupTransform's Result (geometry_msgs/TransformStamped transform,tf2_msgs/TF2Error error), a real fixture already packaged underassets/jazzy/— no new asset files needed.TransformStampednestsstd_msgs/Headerandgeometry_msgs/Transform, andTransformitself nestsVector3/Quaternion, so this exercises multi-level recursive nesting, not just a single level.test_lookup_transform_get_result_hash_includes_nested_depsRIHS01_d21f340b...(whippet job 4383)RIHS01_3cd17157...(whippet job 4384), computed over the complete dependency setExisting action-hash coverage (
action_hash_check.rs'sFibonaccitest) could not have caught this —Fibonacci's Result (int32[] sequence) has no nested custom message type.Verified standalone:
cargo test -p hiroz-codegen --lib --tests— all green (whippet 4385).cargo clippy -p hiroz-codegen --all-targets -- -D warnings— clean.Breaking changes
None to the public API. The RIHS01 hash for any action whose Goal/Result/Feedback references a nested custom message type changes — this is the fix, not a regression: the old hash was computed over an incomplete dependency set and would not interoperate with a real
rmw_zenoh_cpppeer using the same action definition.