35namespace neograph::program {
37inline constexpr std::string_view STEP_PLAN_INTAKE_NODE =
"neograph.step_plan_intake/v1";
38inline constexpr std::string_view STEP_PLAN_ROUTE_CONDITION =
"neograph.step_plan_route/v1";
39inline constexpr std::string_view STEP_PLAN_REPORT_NODE =
"neograph.step_plan_report/v1";
50NEOGRAPH_PROGRAM_API std::string_view to_string(StepPlanFeedback feedback)
noexcept;
52struct StepPlanRepairNodeOptions {
55 StepPlanIntakeOptions intake;
57 std::string attestation_id =
"host:step-plan-repair";
59 std::uint32_t max_attempts_ceiling = 5;
61 std::size_t max_feedback_bytes = 2048;
73 const StepPlanRepairNodeOptions& options);
86 std::uint64_t prompt_tokens = 0;
87 std::uint64_t completion_tokens = 0;
90struct PlanRepairOptions {
91 StepPlanIntakeOptions intake;
92 std::uint32_t max_attempts = 3;
94 std::size_t max_feedback_bytes = 2048;
97struct StepPlanRepairResult {
100 json proposal =
nullptr;
101 std::optional<std::string> proposal_hash;
103 json repair = json::object();
104 std::uint32_t attempts = 0;
105 std::uint64_t prompt_tokens = 0;
106 std::uint64_t completion_tokens = 0;
108 std::vector<PlannerMessage> messages;
117NEOGRAPH_PROGRAM_API StepPlanRepairResult
119 std::string_view request,
120 const std::function<
PlannerReply(
const std::vector<PlannerMessage>&)>& planner);
NEOGRAPH_API export/import macro for shared-library builds.
Move-only builder for one sealed, process-local executable registry.
Immutable executable registry snapshots for Program admission.
Flat step-plan intake: step-plan/v1 checked and lowered into a TaskGraphProposal.
NEOGRAPH_PROGRAM_API StepPlanRepairResult repair_step_plan(const PlanRepairOptions &options, std::string_view request, const std::function< PlannerReply(const std::vector< PlannerMessage > &)> &planner)
Run the loop around a planner callback, for hosts that plan before they start a run.
NEOGRAPH_PROGRAM_API void add_step_plan_repair(RegistrySnapshotBuilder &builder, const StepPlanRepairNodeOptions &options)
Register the intake node (neograph.step_plan_intake/v1; configuration max_attempts,...
StepPlanFeedback
How the next prompt is built after a rejected plan.
@ Replace
Rebuild the conversation as [system messages, first user message, the rejected plan,...
@ Append
Keep the whole conversation and add the violations to it.
One message of the planner's conversation.
std::string role
"system", "user" or "assistant"
What a planner call returns; usage is the host's own accounting.