Skip to content

Identify conversion nodes via node macro annotations - #5083

Open
TrueDoctor wants to merge 1 commit into
masterfrom
adapter-node-flag
Open

TrueDoctor wants to merge 1 commit into
masterfrom
adapter-node-flag

Conversation

@TrueDoctor

Copy link
Copy Markdown
Member

No description provided.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 6 files

Confidence score: 3/5

  • In codegen.rs, adapter annotations are recorded but never consumed, so adapter(conversion) and adapter(rank) have no behavioral effect. Wire this metadata into adapter discovery and type resolution.
  • In registry.rs, the comment describes AdapterKind as a boolean, which makes the field’s meaning unclear. Document what None and each Some variant mean, and update the NodeFlags description.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="node-graph/libraries/core-types/src/registry.rs">

<violation number="1" location="node-graph/libraries/core-types/src/registry.rs:32">
P3: This doc comment describes a boolean, but the field is `Option<AdapterKind>`. Document what `None` and the `Some` variants mean instead. The `NodeFlags` doc that says "Boolean node properties" also needs updating.</violation>
</file>

<file name="node-graph/node-macro/src/codegen.rs">

<violation number="1" location="node-graph/node-macro/src/codegen.rs:1062">
P2: This only records the adapter annotation; no type-resolution or registry path reads it, so `adapter(conversion)` and `adapter(rank)` currently have no behavioral effect. Consume this metadata in adapter discovery/type resolution, or remove the flag until that path is wired through.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

forwards_input: #forwards_input,
inject_scope: #inject_scope,
asynchronous: #asynchronous,
adapter: #adapter,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: This only records the adapter annotation; no type-resolution or registry path reads it, so adapter(conversion) and adapter(rank) currently have no behavioral effect. Consume this metadata in adapter discovery/type resolution, or remove the flag until that path is wired through.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At node-graph/node-macro/src/codegen.rs, line 1062:

<comment>This only records the adapter annotation; no type-resolution or registry path reads it, so `adapter(conversion)` and `adapter(rank)` currently have no behavioral effect. Consume this metadata in adapter discovery/type resolution, or remove the flag until that path is wired through.</comment>

<file context>
@@ -1053,6 +1059,7 @@ pub(crate) fn generate_node_code(crate_ident: &CrateIdent, parsed: &ParsedNodeFn
 						forwards_input: #forwards_input,
 						inject_scope: #inject_scope,
 						asynchronous: #asynchronous,
+						adapter: #adapter,
 					},
 					version: #version,
</file context>

pub forwards_input: bool,
pub inject_scope: bool,
pub asynchronous: bool,
/// Whether type resolution may insert this node on an edge, from `#[node_macro::node(adapter(...))]`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: This doc comment describes a boolean, but the field is Option<AdapterKind>. Document what None and the Some variants mean instead. The NodeFlags doc that says "Boolean node properties" also needs updating.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At node-graph/libraries/core-types/src/registry.rs, line 32:

<comment>This doc comment describes a boolean, but the field is `Option<AdapterKind>`. Document what `None` and the `Some` variants mean instead. The `NodeFlags` doc that says "Boolean node properties" also needs updating.</comment>

<file context>
@@ -29,6 +29,17 @@ pub struct NodeFlags {
 	pub forwards_input: bool,
 	pub inject_scope: bool,
 	pub asynchronous: bool,
+	/// Whether type resolution may insert this node on an edge, from `#[node_macro::node(adapter(...))]`.
+	pub adapter: Option<AdapterKind>,
+}
</file context>
Suggested change
/// Whether type resolution may insert this node on an edge, from `#[node_macro::node(adapter(...))]`.
/// The edge-insertion role from `#[node_macro::node(adapter(...))]`, or `None` if type resolution may not insert this node on an edge.

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) — cc1c343b Deployed Dec 5, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant