feat(hiroz): graph-settle wait + service-schema discovery (hu stack 3/9)#234
Open
YuanYuYuan wants to merge 3 commits into
Open
feat(hiroz): graph-settle wait + service-schema discovery (hu stack 3/9)#234YuanYuYuan wants to merge 3 commits into
YuanYuYuan wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new graph and schema-discovery primitives that enable one-shot tooling (notably the hu plugin host) to replace fixed sleeps with condition-based waiting and to resolve service Request/Response schemas via live ~get_type_description queries. It also wires built-in parameter services into the type-description service so those schemas become discoverable.
Changes:
- Add
Graph::has_external_entityandGraph::wait_for_external_settledto wait for a genuinely external participant and then graph quiet. - Add
ZNode::discover_service_schemaand extendZNode::create_serviceto auto-register Request/Response schemas with the node’s type-description service. - Register
rcl_interfacesparameter service Request/Response schemas atParameterServicestartup when the type-description service is enabled, and refine FFI service client call reply handling.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/hiroz/src/parameter/wire_types.rs | Adds explicit schema builders + registration for built-in parameter service wire types. |
| crates/hiroz/src/parameter/service.rs | Passes optional type-description service into ParameterService and registers parameter schemas on startup. |
| crates/hiroz/src/node.rs | Adds discover_service_schema and service-side schema auto-registration in create_service. |
| crates/hiroz/src/graph.rs | Adds external-participant detection and a two-phase “external then quiet” wait helper. |
| crates/hiroz/src/ffi/service.rs | Ensures per-call reply isolation for FFI service client calls and maps “no queryable matches” to timeout. |
| crates/hiroz/examples/demo_nodes/add_two_ints_client.rs | Increases demo client call timeout to accommodate longer discovery/interop latencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
YuanYuYuan
force-pushed
the
dev/pr-hu-1b-logger-msgs
branch
from
July 24, 2026 23:39
bd63c02 to
5a43164
Compare
YuanYuYuan
force-pushed
the
dev/pr-hu-1c-core
branch
from
July 24, 2026 23:40
341cc00 to
e00a49e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
crates/hiroz/src/graph.rs:567
- Phase 2 of
wait_for_external_settlednever re-checks that an external entity is still present. If an external participant briefly appears and then disappears before the graph goes quiet, this can still returntrue, contradicting the doc comment that the entity is still present and causing one-shot callers to proceed with an empty/self-only graph.
loop {
let notified = self.change_notify.notified();
tokio::pin!(notified);
let remaining = deadline.saturating_duration_since(tokio::time::Instant::now());
if remaining.is_zero() {
…types Adds the core-library primitives the hu plugin host builds on, none of which change existing behavior: - Graph::has_external_entity / wait_for_external_settled: wait for a genuinely external participant to appear and the graph to go quiet, so one-shot introspection commands can replace blind sleeps with a real condition. - ZNode::discover_service_schema: resolve a service's request/response type names from the graph, mirroring the topic-schema path. - parameter wire-types + service tweaks and an ffi/service.rs adjustment. Also updates the add_two_ints_client demo to the refined node API.
…rror Addresses Copilot review on the core PR: - wait_for_external_settled doc dropped a dangling [wait_settled] link and now states the real return contract (a phase-2 timeout returns true with the entity present but not necessarily a full quiet window). - discover_service_schema now distinguishes 'server present but no node identity' from 'no server found' instead of the misleading blanket message.
The type-description poll loop slept a full poll_interval unconditionally, overshooting the requested timeout by up to 100ms. Clamp the final sleep to the remaining time.
YuanYuYuan
force-pushed
the
dev/pr-hu-1b-logger-msgs
branch
from
July 25, 2026 00:03
5a43164 to
d32b884
Compare
YuanYuYuan
force-pushed
the
dev/pr-hu-1c-core
branch
from
July 25, 2026 00:03
e00a49e to
8622619
Compare
Comment on lines
+440
to
+444
| /// `T::Request` and `T::Response` must implement [`WithTypeInfo`] (enforced by | ||
| /// the trait bounds below). Type information is always populated with this | ||
| /// node's type-description service so schema discovery (e.g. by hiroz-union's | ||
| /// WASM plugin host) can resolve the Request/Response schemas via live | ||
| /// `get_type_description` queries. |
Comment on lines
+1148
to
+1152
| pub async fn discover_service_schema( | ||
| &self, | ||
| service_name: &str, | ||
| request_type_name: &str, | ||
| response_type_name: &str, |
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
Stacked PR 3 of 9 (#231 split). Core-library primitives the hu plugin host builds on:
Graph::has_external_entity/wait_for_external_settled: wait for a genuinely external participant then graph-quiet, so one-shot introspection can replace blind sleeps with a real condition.ZNode::discover_service_schema: resolve a service's request/response type names from the graph.Base:
dev/pr-hu-1b-logger-msgs.Breaking Changes
ZNode::create_servicenow additionally requiresT::Request: WithTypeInfoandT::Response: WithTypeInfo(to auto-register the service schema for discovery). Downstream callers whose request/response types implementServiceTypeInfobut notMessageTypeInfowill need to add it. In practice all generated hiroz message types already implement it. (Correcting the initial 'none' — thanks to the Copilot review for catching this.)