Conversation
….)] node macro parameter attributes
There was a problem hiding this comment.
Code Review
This pull request replaces the IntegerCount type alias with u32 across several nodes and updates the node-macro to support both integer and float literals for numeric bound attributes like soft_min and hard_min. It introduces a NumberBound struct to handle these literals and adds validation to prevent float literals from being used on integer-typed fields. The review feedback suggests refining NumberBound::to_tokens to avoid explicit f64 casts, which allows for better type inference, and updating NumberBound::to_f64 to parse integer literals directly as f64 to avoid potential truncation of large integer values.
There was a problem hiding this comment.
1 issue found across 7 files
Confidence score: 3/5
- There is a concrete regression risk in
node-graph/node-macro/src/parsing.rs: narrowing integer bound parsing tou64can silently coerce valid large literals to0.0during min/max validation, which is user-impacting behavior. - Given the issue’s medium-high severity (6/10) and strong confidence (8/10), this lands in a moderate-risk zone rather than a safe-to-merge state.
- Pay close attention to
node-graph/node-macro/src/parsing.rs- integer bound handling may mis-validate large numeric literals due tou64narrowing.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/node-macro/src/parsing.rs">
<violation number="1" location="node-graph/node-macro/src/parsing.rs:144">
P2: Integer bound parsing is narrowed to `u64`, which can silently turn valid large integer literals into `0.0` during min/max validation.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Broken out from #4010.