phenotypic.gui.builder._validation.validate#

phenotypic.gui.builder._validation.validate(state: _DagBuilderState) List[Issue][source]#

Run all validation rules across every scope reachable from the root.

Returns issues with scope_path populated so the UI can pan/zoom across container boundaries when an issue badge is clicked.

Parameters:

state (_DagBuilderState) – The current BuilderState. Only the state.root scope (and its transitively nested scopes via BlockNode.nested) is inspected; selected_block_id, breadcrumb, toast_queue etc. are ignored.

Returns:

rules emit in the order missing_input / duplicate_inputforkstubrequired_aux / unknown_classcyclecontainer_modestage_order_hint, and nested-scope issues are appended after the parent scope’s issues. The ordering is stable for snapshot-style tests.

Return type:

A flat list of Issue records in deterministic order

Examples

An empty scope (only the auto-seeded InputImage block) passes every rule and returns an empty issue list. The synth-yeast fixture is loaded only to anchor the example in the project’s microbiology context — validation does not touch image data:

>>> from phenotypic.data import load_synth_yeast_plate
>>> from phenotypic.gui.builder._state import (
...     BuilderScope, BuilderState,
... )
>>> from phenotypic.gui.builder._validation import validate
>>> state = BuilderState(root=BuilderScope())
>>> validate(state)
[]
>>> _ = load_synth_yeast_plate()  # microbiology context anchor