Skip to content

refactor(nodes)!: align node initialization signatures#39

Merged
laipz8200 merged 2 commits intomainfrom
align-node-init-patterns
Apr 16, 2026
Merged

refactor(nodes)!: align node initialization signatures#39
laipz8200 merged 2 commits intomainfrom
align-node-init-patterns

Conversation

@laipz8200
Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Search existing issues and pull requests to confirm this change is not a duplicate
  3. Open or identify the issue this pull request resolves or advances
  4. Use a Conventional Commits title for this pull request, and mark breaking changes with !
  5. Remember that the pull request title will become the squash merge commit message
  6. If CLA Assistant prompts you, sign CLA.md in the pull request conversation

Related Issue

Closes #38

Summary

  • normalize Node and concrete node constructors around node_id, typed *NodeData configs, and explicit injected dependencies
  • make ToolNode and HumanInputNode runtime requirements explicit while preserving the node_id public parameter name
  • update direct construction sites in tests and examples to use typed node config objects instead of raw {"id", "data"} wrappers
  • align the base constructor flow so node identity is sourced from node_id and node data validation runs on the typed config payload

This is a breaking API change for downstream callers that construct nodes directly with raw NodeConfigDict payloads or omit required runtime collaborators for tool and human-input nodes. The root cause is that node construction had diverged between the base class, concrete nodes, and direct call sites.

Checklist

  • This pull request links the issue it resolves or advances
  • This pull request title follows Conventional Commits, and any breaking change is marked with !
  • If CLA Assistant prompted me, I signed CLA.md in the pull request conversation

Normalize node constructors around typed node data configs and explicit dependency injection.

Update direct construction sites in tests and examples to match the unified initialization pattern.
Add a discoverable classmethod for converting Python mappings into typed node data without reopening node constructors to raw mapping inputs.
@laipz8200 laipz8200 marked this pull request as ready for review April 15, 2026 12:02
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 15, 2026
@laipz8200 laipz8200 enabled auto-merge (squash) April 15, 2026 15:38
@laipz8200 laipz8200 merged commit d573e3f into main Apr 16, 2026
5 checks passed
@laipz8200 laipz8200 deleted the align-node-init-patterns branch April 16, 2026 09:13
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize node initialization signatures across graphon nodes

2 participants