|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
Harness evolution loop — compiler as evolutionary oracle (issue #80). More...
#include <neograph/api.h>#include <neograph/graph/types.h>#include <neograph/graph/compiler.h>#include <neograph/graph/validator.h>#include <functional>#include <optional>#include <random>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | neograph::graph::EvolutionConfig |
| Parameters for one evolution generation. More... | |
| struct | neograph::graph::EvolutionResult |
| Result of one evolution run. More... | |
| struct | neograph::graph::Individual |
| One individual in the population. More... | |
| struct | neograph::graph::MutationResult |
| Result of applying a single mutation. More... | |
| struct | neograph::graph::Score |
| Score of a single graph run against a task. More... | |
| struct | neograph::graph::Task |
| A task is a fixed-input → expected-output contract that a compiled graph should satisfy. More... | |
Typedefs | |
| using | neograph::graph::MutationOp = std::function< MutationResult(const json &core, std::mt19937 &rng)> |
| Mutation operator: deterministic function (input core + rng) → result. | |
Enumerations | |
| enum class | neograph::graph::MutationKind : uint8_t { TOGGLE_CONDITIONAL_EDGE = 0 , TOGGLE_BARRIER , ADD_EDGE , REMOVE_EDGE } |
| Catalog of built-in mutation operators, returned by all_operators(). More... | |
Functions | |
| NEOGRAPH_API std::vector< MutationOp > | neograph::graph::all_operators () |
| Return a vector of one operator per MutationKind. | |
| NEOGRAPH_API Score | neograph::graph::evaluate (const json &core, const Task &task, const NodeContext &ctx) |
| Scorer function: compile-gate + run + compare against task. | |
| NEOGRAPH_API EvolutionResult | neograph::graph::evolve (const json &seed_core, const Task &task, const EvolutionConfig &config=EvolutionConfig{}) |
| Run the evolution loop. | |
| NEOGRAPH_API json | neograph::graph::to_json (const EvolutionResult &result) |
| Serialize an EvolutionResult as a JSON lineage document. | |
Harness evolution loop — compiler as evolutionary oracle (issue #80).
Three layers:
Every evolutionary run produces a diffable strict Core JSON lockfile. It is suitable for canonical interchange, git review, and rollback without a separate source-language map.
Definition in file evolution.h.
| using neograph::graph::MutationOp = typedef std::function<MutationResult(const json& core, std::mt19937& rng)> |
Mutation operator: deterministic function (input core + rng) → result.
The operator reads from rng for any stochastic choices; giving the same rng state to the same input produces the same output.
Definition at line 66 of file evolution.h.
|
strong |
Catalog of built-in mutation operators, returned by all_operators().
Definition at line 69 of file evolution.h.
| NEOGRAPH_API std::vector< MutationOp > neograph::graph::all_operators | ( | ) |
Return a vector of one operator per MutationKind.
Each operator is a self-contained MutationOp that reads from the provided rng.
References neograph::graph::all_operators().
Referenced by neograph::graph::all_operators().
| NEOGRAPH_API Score neograph::graph::evaluate | ( | const json & | core, |
| const Task & | task, | ||
| const NodeContext & | ctx | ||
| ) |
Scorer function: compile-gate + run + compare against task.
Returns a Score.
References neograph::graph::evaluate().
Referenced by neograph::graph::evaluate().
| NEOGRAPH_API json neograph::graph::to_json | ( | const EvolutionResult & | result | ) |
Serialize an EvolutionResult as a JSON lineage document.
Contains the full genealogy, compile-gate stats, and best individual.