|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
Parsed graph definition, ready for the engine to run. More...
#include <compiler.h>
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(). | |
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.
| 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.
| 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.
| 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.
| 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.