NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::graph::CompiledGraph Struct Reference

Parsed graph definition, ready for the engine to run. More...

#include <compiler.h>

Collaboration diagram for neograph::graph::CompiledGraph:
[legend]

Public Member Functions

NEOGRAPH_API json to_json () const
 Re-emit this compiled graph as topology JSON.
 
NEOGRAPH_API TopologySpec topology () const
 Copy the declarative portion without live GraphNode instances.
 

Public Attributes

json metadata
 Graph metadata (#362), carried so to_json() round-trips; null when absent.
 
std::map< std::string, json > node_defs
 Verbatim copy of each node's JSON definition (config + "type"), minus the "barrier" key (barriers are re-emitted from barrier_specs, so translation validation compares the compiled barrier state — not an input echo).
 
std::map< std::string, NodeRetryPolicySpec > node_retry_policies
 #364 failure routing keys, carried so to_json() round-trips.
 
std::optional< RetryPolicy > retry_policy
 Present iff the JSON defined a top-level "retry_policy" object.
 
int schema_version = 0
 Declared "schema_version" from the topology JSON, or 0 when the document did not carry one.
 
ToolSet tools
 Retains tools referenced by the compiled node instances until link().
 

Detailed Description

Parsed graph definition, ready for the engine to run.

Value type. Contains everything the engine needs from the JSON definition and nothing it needs at runtime — no schedulers, no checkpoint store, no retry-policy overrides (those are set via GraphEngine setters after compilation).

Moved, not copied, into GraphEngine. Each field matches a private member of GraphEngine that previously was populated directly inside GraphEngine::compile().

Definition at line 185 of file compiler.h.

Member Function Documentation

◆ to_json()

NEOGRAPH_API json neograph::graph::CompiledGraph::to_json ( ) const

Re-emit this compiled graph as topology JSON.

Every field is reconstructed from compiled (L2) state where such state exists — channels from channel_defs, edges from edges/conditional_edges, barriers from barrier_specs, interrupts from the sets, retry_policy from the parsed struct. Node configs are the one pass-through: the compiler hands them verbatim to NodeFactory, so they are re-emitted from node_defs.

Contract (translation validation): canon(definition) == canon(compile(definition).to_json()) must hold for every accepted document. A mismatch means the compiler dropped or rewired something silently — exactly the v0.1.0–v0.1.7 conditional_edges regression class.

Member Data Documentation

◆ node_defs

std::map<std::string, json> neograph::graph::CompiledGraph::node_defs

Verbatim copy of each node's JSON definition (config + "type"), minus the "barrier" key (barriers are re-emitted from barrier_specs, so translation validation compares the compiled barrier state — not an input echo).

Backs to_json().

Definition at line 220 of file compiler.h.

◆ retry_policy

std::optional<RetryPolicy> neograph::graph::CompiledGraph::retry_policy

Present iff the JSON defined a top-level "retry_policy" object.

When absent, GraphEngine keeps its RetryPolicy default-constructed.

Definition at line 199 of file compiler.h.

◆ schema_version

int neograph::graph::CompiledGraph::schema_version = 0

Declared "schema_version" from the topology JSON, or 0 when the document did not carry one.

Version >= 1 opts the document into strict compilation (unknown/unconsumed keys are hard errors — see GraphCompiler docs). 0 preserves the historical lenient behavior for existing files.

Definition at line 206 of file compiler.h.


The documentation for this struct was generated from the following file: