NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
step_plan.h File Reference

Flat step-plan intake: step-plan/v1 checked and lowered into a TaskGraphProposal. More...

#include <neograph/api.h>
#include <neograph/program/source.h>
#include <neograph/program/task_graph_proposal.h>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>
Include dependency graph for step_plan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  neograph::program::StepPlanLimits
 Ceilings on the size and shape of a submitted plan. More...
 
struct  neograph::program::StepPlanTemplateInfo
 Advisory, host-authored facts about one template. More...
 
struct  neograph::program::StepPlanViolation
 One problem found in a submitted plan. More...
 

Enumerations

enum class  neograph::program::StepPlanEnvelope : std::uint8_t { None , Strict , Recovered }
 How the JSON object was found in the planner's text. More...
 

Functions

NEOGRAPH_PROGRAM_API std::string neograph::program::format_violations_for_model (const std::vector< StepPlanViolation > &violations, std::size_t max_bytes)
 Deterministic text for the planner's next prompt, at most max_bytes long: one numbered line per violation, then a note when some are left out.
 
NEOGRAPH_PROGRAM_API StepPlanIntakeResult neograph::program::intake_step_plan_document (const json &document, const StepPlanIntakeOptions &options)
 Intake of an already parsed document.
 
NEOGRAPH_PROGRAM_API StepPlanIntakeResult neograph::program::intake_step_plan_text (std::string_view text, const StepPlanIntakeOptions &options)
 Intake of the planner's text: the first top-level JSON object, in a fence or after prose.
 
NEOGRAPH_PROGRAM_API json neograph::program::step_plan_json_schema (const std::vector< TaskGraphTemplateContract > &templates, const StepPlanLimits &limits)
 A JSON Schema (2020-12) specialised to a catalog, for providers that enforce structured output: use is an enum of the allowed template ids and params lists each template's input names.
 

Detailed Description

Flat step-plan intake: step-plan/v1 checked and lowered into a TaskGraphProposal.

A language model writes a short ordered list of steps. intake_step_plan is a pure function: it checks the document against a closed schema and the host's template allow-list, reports every problem as a machine-readable violation, and lowers a valid plan, byte for byte deterministically, into the JSON of a schema-2 TaskGraphProposal. The proposal then takes the existing trusted path (TaskGraphProposal::parse, TaskGraphFragmentCompiler::compile, publication); the step plan itself is never executed and carries no authority.

Passing intake means the plan is well formed and inside policy. It does not mean the plan solves the request.

Definition in file step_plan.h.

Enumeration Type Documentation

◆ StepPlanEnvelope

enum class neograph::program::StepPlanEnvelope : std::uint8_t
strong

How the JSON object was found in the planner's text.

Enumerator
None 

The input was a document, or no object was found.

Strict 

The whole text is the object.

Recovered 

The object came from a fenced block, or from text around it.

Definition at line 88 of file step_plan.h.

Function Documentation

◆ intake_step_plan_document()

NEOGRAPH_PROGRAM_API StepPlanIntakeResult neograph::program::intake_step_plan_document ( const json &  document,
const StepPlanIntakeOptions &  options 
)

Intake of an already parsed document.

Duplicate keys cannot be seen here.

References neograph::program::intake_step_plan_document(), and neograph::program::intake_step_plan_text().

Referenced by neograph::program::intake_step_plan_document().

◆ step_plan_json_schema()

NEOGRAPH_PROGRAM_API json neograph::program::step_plan_json_schema ( const std::vector< TaskGraphTemplateContract > &  templates,
const StepPlanLimits &  limits 
)

A JSON Schema (2020-12) specialised to a catalog, for providers that enforce structured output: use is an enum of the allowed template ids and params lists each template's input names.

It is a generated aid; the validator in intake_step_plan stays the authority.

References neograph::program::step_plan_json_schema().

Referenced by neograph::program::step_plan_json_schema().