29namespace neograph::program {
50 std::uint32_t max_steps = 32;
51 std::uint32_t max_params_per_step = 16;
52 std::uint32_t max_after_per_step = 8;
53 std::uint32_t max_literal_bytes = 4096;
54 std::uint32_t max_total_literal_bytes = 32768;
55 std::uint32_t max_literal_depth = 6;
56 std::uint32_t max_retry_attempts = 3;
57 std::uint32_t max_violations = 32;
58 std::uint32_t max_document_bytes = 131072;
66 std::string template_id;
75struct StepPlanIntakeOptions {
77 std::string source_id =
"step-plan";
83 std::vector<TaskGraphTemplateContract> template_allowlist;
84 std::vector<StepPlanTemplateInfo> template_info;
97NEOGRAPH_PROGRAM_API std::string_view to_string(StepPlanEnvelope envelope)
noexcept;
99struct StepPlanIntakeResult {
101 std::vector<StepPlanViolation> violations;
102 StepPlanEnvelope envelope = StepPlanEnvelope::None;
104 std::string plan_digest;
106 std::optional<json> proposal;
108 std::optional<std::string> proposal_hash;
110 std::vector<SourceMapEntry> source_map;
112 json report = json::object();
114 bool ok() const noexcept {
return violations.empty() && proposal.has_value(); }
118NEOGRAPH_PROGRAM_API StepPlanIntakeResult
122NEOGRAPH_PROGRAM_API StepPlanIntakeResult
125inline StepPlanIntakeResult intake_step_plan(std::string_view text,
126 const StepPlanIntakeOptions& options) {
130template <
class Document,
131 std::enable_if_t<std::is_same_v<std::remove_cv_t<std::remove_reference_t<Document>>, json>,
133StepPlanIntakeResult intake_step_plan(
const Document& document,
134 const StepPlanIntakeOptions& options) {
135 return intake_step_plan_document(document, options);
142NEOGRAPH_PROGRAM_API std::string
144 std::size_t max_bytes);
151NEOGRAPH_PROGRAM_API json
NEOGRAPH_API export/import macro for shared-library builds.
Deeply owned, immutable Program source values.
NEOGRAPH_PROGRAM_API json 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 i...
NEOGRAPH_PROGRAM_API StepPlanIntakeResult intake_step_plan_document(const json &document, const StepPlanIntakeOptions &options)
Intake of an already parsed document.
NEOGRAPH_PROGRAM_API StepPlanIntakeResult 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 std::string 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 viola...
StepPlanEnvelope
How the JSON object was found in the planner's text.
@ Recovered
The object came from a fenced block, or from text around it.
Ceilings on the size and shape of a submitted plan.
Advisory, host-authored facts about one template.
std::string summary
At most 160 bytes; shown to the planner by catalog views.
std::vector< std::string > required_params
Input names without the leading '/'.
One problem found in a submitted plan.
std::string path
JSON Pointer into the submitted document; "" is the document.
std::string code
Stable code, always STEP_*.
std::string message
One sentence.
std::string hint
One imperative sentence; lists at most five valid names.
json detail
Machine fields: given, expected, choices, and so on.
Finite structural and resource ceilings enforced before a proposal is usable.
Immutable, non-executable TaskGraphProposal-v1 values.