NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
harness_bench.h
Go to the documentation of this file.
1
19#pragma once
20
21#include <neograph/api.h>
25
26#include <string>
27#include <vector>
28
29namespace neograph::graph {
30
31// ── Feedback mode ────────────────────────────────────────────────────
32
33enum class NEOGRAPH_API FeedbackMode : uint8_t {
34 FULL_DIAGNOSTIC = 0,
37};
38
40NEOGRAPH_API const char* feedback_mode_name(FeedbackMode mode);
41
42// ── Harness task ─────────────────────────────────────────────────────
43
46struct NEOGRAPH_API HarnessTask {
47 std::string name;
48 std::string description;
49 std::string natural_spec;
50
52 int min_nodes = 0;
53 int max_nodes = 100;
54 bool has_conditional_edges = false;
55 bool has_barrier = false;
56 bool has_interrupt = false;
57 bool has_tool_calls = false;
58};
59
61NEOGRAPH_API HarnessTask parse_task(const json& j);
62
63// ── Feedback ─────────────────────────────────────────────────────────
64
66struct NEOGRAPH_API Feedback {
68 std::string prompt;
70 int estimated_tokens = 0;
72 bool converged = false;
73};
74
83 const json& core,
84 const std::string& compile_err,
85 const ValidationReport& validation,
86 FeedbackMode mode,
87 int attempted_routes = -1);
88
89// ── Convergence metrics ──────────────────────────────────────────────
90
92struct NEOGRAPH_API ConvergenceMetrics {
94 std::string task_name;
96 FeedbackMode mode = FeedbackMode::FULL_DIAGNOSTIC;
98 int turns = 0;
100 int total_estimated_tokens = 0;
102 int total_errors = 0;
104 bool converged = false;
106 int final_warnings = 0;
108 bool meets_spec = false;
109
110 json to_json() const;
111};
112
113// ── Benchmark runner (simulation) ────────────────────────────────────
114
125 const HarnessTask& task,
126 const json& seed_harness,
127 FeedbackMode mode,
128 int max_turns = 20,
129 unsigned int seed = 42);
130
132NEOGRAPH_API json generate_report(
133 const std::vector<ConvergenceMetrics>& results);
134
135} // namespace neograph::graph
NEOGRAPH_API export/import macro for shared-library builds.
JSON → declarative topology parsing and runtime node linking.
Graph engine type definitions: channels, edges, nodes, events, and control flow.
enum NEOGRAPH_API FeedbackMode
A: full error + witness (agent-optimized)
enum NEOGRAPH_API RUNTIME_SYMPTOMS
C: runtime symptom simulation.
NEOGRAPH_API HarnessTask parse_task(const json &j)
Parse a HarnessTask from a JSON fixture file.
NEOGRAPH_API json generate_report(const std::vector< ConvergenceMetrics > &results)
Generate a convergence report as JSON.
enum NEOGRAPH_API NEOGRAPH_API const char * feedback_mode_name(FeedbackMode mode)
Human-readable name for each feedback mode.
NEOGRAPH_API ConvergenceMetrics run_simulation(const HarnessTask &task, const json &seed_harness, FeedbackMode mode, int max_turns=20, unsigned int seed=42)
Run a simulated convergence benchmark against a single task.
enum NEOGRAPH_API FAIL_ONLY
B: "failed" only (baseline)
NEOGRAPH_API Feedback format_feedback(const json &core, const std::string &compile_err, const ValidationReport &validation, FeedbackMode mode, int attempted_routes=-1)
Format feedback for a given mode from a compile+validate result.
Metrics for one convergence attempt.
std::string task_name
Task that was being solved.
One round of feedback from the compiler to the LLM.
std::string prompt
The prompt to send to the LLM (varies by FeedbackMode).
A benchmark task: natural language spec converted into a harness.
Static semantic analysis over declarative or compiled topology.