Skip to content

[Diagram Editor] Enhance compatibility hint with inference#210

Open
ArizmendiWan wants to merge 16 commits into
open-rmf:mainfrom
ArizmendiWan:compatibility-hint-inference
Open

[Diagram Editor] Enhance compatibility hint with inference#210
ArizmendiWan wants to merge 16 commits into
open-rmf:mainfrom
ArizmendiWan:compatibility-hint-inference

Conversation

@ArizmendiWan

@ArizmendiWan ArizmendiWan commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

This PR targets issue #172 and issue #203.

This PR adds compatibility checks for diagram editor connections while preserving incomplete-diagram editing workflows. The editor now:

  • shows green/red handle hints during drag
  • explains compatibility results in the connection helper
  • filters empty-space add-operation suggestions by compatibility
  • allows provisional connections when inference needs more graph context

Compatibility works in two layers:

  • Frontend shape check
    The editor first rejects impossible connections locally: output-to-output, input-to-input, etc.
  • Rust inference check
    For a valid-looking candidate, the frontend builds an in-memory diagram with the proposed edge added, then calls checkCompatibility. Rust runs editor-only inference on the focused ports for that candidate.
  • Rust returns:
    • compatible: the editor may allow the connection.
    • incompatible: proven invalid, such as hard compile/layout errors or message type mismatch.
    • unknown: API/system failure or unsafe-to-classify error.
    • provisional: true when inference needs more graph context, for example buffer/listen/join cases where the type cannot be determined yet.
  • If both source and target message types are inferred, Rust compares them using workflow semantics: exact match, registered conversion, JSON serialization/deserialization, or ScriptMessage conversion. If inference cannot determine types only because context is missing, the result becomes provisionally compatible, but final compile/run can still reject it later.
01.mov
02.mov
03.mov

GenAI Use

We follow OSRA's policy on GenAI tools

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Generated-by: Codex

…gram editor.

Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
…onnections between handles of the same type.

Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
ArizmendiWan and others added 6 commits June 20, 2026 22:19
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
@mxgrey mxgrey moved this from Inbox to In Review in PMC Board Jun 30, 2026

@aaronchongth aaronchongth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling this feature! I've left some comments, mostly related to the frontend. Overall I've not seen any issues from the usability side,

Comment thread src/diagram/inference.rs
Comment thread diagram-editor/frontend/utils/compatibility.ts Outdated
Comment thread diagram-editor/frontend/diagram-editor.tsx Outdated
Comment thread diagram-editor/frontend/utils/add-operation-catalog.ts
Comment thread diagram-editor/server/api/executor.rs Outdated
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Signed-off-by: ArizmendiWan <2311602492@qq.com>
Comment thread src/diagram/stream_out_schema.rs Outdated
aaronchongth
aaronchongth previously approved these changes Jul 8, 2026

@aaronchongth aaronchongth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on the changes for the frontend

Should wait till @mxgrey's review has been addressed before merging

Signed-off-by: ArizmendiWan <2311602492@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants