# Check flow_data connections

Example version: 1.0, 27 September 2026. Python 3.9+, standard library only.
Status: structure check without executing a scenario.

## Result

The script finds duplicate IDs, wires pointing to missing nodes, invalid wires nesting and z references to missing tabs. It prints JSON with `status`, `errors`, `warnings`, `nodes` and `links`. Errors return exit code 1; no errors returns 0.

## Run

In the extracted example directory:

```sh
python3 check_graph.py sample-flow.json
python3 check_example.py
```

The first command matches `expected.json`: three objects including the tab, one connection and no errors. Warnings about machine types remain. Change `result` in `wires` to `missing-node` and repeat the check to see a missing-node error.

## Contents of sample-flow.json

One `type=tab` object and two training nodes with `id`, `type`, `name`, `z`, `x`, `y` and `wires`. `<source-type>` and `<result-type>` are explicit placeholders, not registered ViewLogic blocks. This JSON illustrates a structure and **is not an executable detector**. Do not import it into an operational scenario.

## Check your own graph

1. Export a permitted copy of `flow_data` from your installation's editor.
2. Pass a JSON array or an object whose `flow_data` field contains that array.
3. Repair references in the editor, then export and check again.
4. In a test environment, check the palette, block settings, `flow_settings`, models, inputs/outputs and asset result. Only then assess readiness for publication.

The `id` / `type` / `z` / `wires` structure comes from the public Platform 4.0 / BOX 5.0 scenario guide. The script does not interpret blocks, call an API or modify files. It covers ordinary tabs and direct wires. Subflows and their internal links require separate checks; a subflow's presence is not a platform error. Configuration nodes without `z` or `wires` are allowed. Cycles are not prohibited because some scenarios need them. Nodes outside the executable graph and coordinate consistency are not analyzed.

## Tests

`check_example.py` checks an array and a `flow_data` wrapper, a missing node, a missing tab, the wires type, duplicate IDs and an allowed cycle. Success establishes only the structural integrity of the selected part of the graph. Execution on Platform 4.0 / BOX 5.0 has not been tested.

Guides:
- https://viewlogic.ai/technology/scenario-methodology/#graph-schema
- https://viewlogic.ai/technology/platform-scenario-editor/
- https://viewlogic.ai/technology/sandbox-debugging/
