Engineering Journal
Table Formatter
Table Formatter

We Almost Let a Downstream Tool Execute a Graph We Knew Was Broken

2026-07-23

TLDR

Treating exporters as un-validated serializers allows invalid visual configurations to pass to downstream execution engines. Gating graph export processes on fatal validation checks prevents broken graphs from executing silently.
Exporter StrategyValidation ChecksDownstream Execution SafetyWorkflow Flexibility
Un-Validated SerializationNone (Exports everything)Unsafe (Runs corrupted graphs)High (Allows broken files)
Gated Integrity CheckBlocks fatal structural errors100% Guaranteed Execution SafetyAllows unfinished graphs

Serializing un-validated graphs passes fatal configurations to downstream execution engines

Exporters are often designed as neutral serializers that convert UI visual state into JSON or XML formats. However, when serialized outputs feed directly into downstream processing engines, exporting un-validated graphs allows fatal errors to execute silently.

Serializing shorted wiring diagrams or circular node dependencies without validation causes downstream execution steps to fail without clear context.


Gating serialization logic on integrity checks prevents corrupted graphs from executing

We updated our graph exporter to run integrity checks before serializing outputs, blocking exports on fatal structural errors:

   UN-GATED SERIALIZATION (Silent Failure):
   [Graph Editor] ──> (Contains short-circuit) ──> [Export JSON] ──> [Downstream Engine]
                                                                          │
                                                                 (Crashes mid-execution)

GATED INTEGRITY CHECKS (Safe Execution): [Graph Editor] ──> (Contains short-circuit) │ ▼ [Validation Gate] ──> FATAL ERROR DETECTED! │ ▼ (Blocks Export) ──> Alerts User: "Cannot export broken graph."

Here is the implementation for the gated export logic:

// Export visual graph state, gating execution on fatal integrity errors
export function exportGraphState(graphInstance, forceExport = false) {
  const validationIssues = graphInstance.validateIntegrity();
  const fatalErrors = validationIssues.filter(issue => issue.severity === 'fatal');

// Block serialization if fatal errors exist (unless force flag is passed) if (fatalErrors.length > 0 && !forceExport) { throw new Error(Export blocked due to ${fatalErrors.length} fatal structural errors.); }

// Allow non-fatal warning states (e.g., unconnected pins) to export return JSON.stringify(graphInstance.serialize()); }

Differentiating fatal errors (like short circuits) from incomplete states (like un-wired pins) ensures broken graphs are caught while preserving workflow flexibility.

Rule of thumb: Gate graph serialization on fatal integrity checks to prevent broken configurations from executing downstream.
Read this post in the full Engineering Journal →