Skip to content

feat(schema): Validate each component on its own - #886

Merged
jetuk merged 5 commits into
mainfrom
component-checks
Oct 3, 2026
Merged

jetuk merged 5 commits into
mainfrom
component-checks

Conversation

@Batch21

@Batch21 Batch21 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
  • Parameter, Node and VirtualNode gain validate_reference; VirtualNode gains validate_member and members.
  • Node gains validate_edge_from and validate_edge_to.
  • validate() and validate_edge() call them.
  • Node::validate and VirtualNode::validate include their local parameters.
  • New rules: a local parameter name used twice in one node, and a literal in a metric set (MetricSet::validate). Both reject only models that already fail at build.
  • Breaking: four wrapping variants (InvalidMember, InvalidNodeReference, InvalidVirtualNodeReference, InvalidParameterReference) replace ten per-rule NetworkProblem variants. Messages are kept, with minor wording changes.

- Parameter, Node and VirtualNode gain validate_reference.
- VirtualNode gains validate_member and members.
- validate()'s walks call them.
- Four wrapping NetworkProblem variants replace ten per-rule ones.
- Messages are kept, with minor wording changes.
@Batch21
Batch21 requested a review from jetuk October 2, 2026 18:53
- NodeProblem and VirtualNodeProblem gain InvalidLocalParameter.
- Node::validate and VirtualNode::validate report their locals' problems.
- validate() still reports each as InvalidParameter, after its node's own.
- NodeProblem and VirtualNodeProblem gain DuplicateLocalParameterName.
- Node::validate and VirtualNode::validate check their locals' names.
- Such a model already fails at build, as DuplicateParameterName.
- MetricSet::validate reports each literal, by its index.
- validate() reports them as InvalidMetricSet.
- Such a model already fails at build, as LiteralConstantOutputNotSupported.
- Node gains validate_edge_from and validate_edge_to.
- validate_edge calls them, checking each end's flow before its slot.
@Batch21 Batch21 changed the title feat(schema): Add validate_reference and validate_member feat(schema): Validate each component on its own Oct 2, 2026

@jetuk jetuk 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.

Looks good to me.

@jetuk
jetuk merged commit 1892d3a into main Oct 3, 2026
13 checks passed
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.

2 participants