Documentation
¶
Index ¶
Constants ¶
const ( SummarizerRefExecTerminal = "__exec_terminal__" SummarizerRefNextStep = "__next_step__" )
Summarizer chain symbolic references — plancompile rewrites these per-step when cloning the operator-supplied summarizer chain into the compiled plan DAG:
- SummarizerRefExecTerminal: use as a task's InputVar (or Transition.Goto) to refer to the executor's terminal output for the current step. Compile inserts an `exec_done_{N}` noop between the executor's success terminals and the summarizer subgraph, and rewrites this sentinel to that noop's ID.
- SummarizerRefNextStep: use as a Transition.Goto to refer to the next step's seed (or the chain's end for the final step).
Variables ¶
This section is empty.
Functions ¶
func Compile ¶
func Compile( executor *taskengine.TaskChainDefinition, summarizer *taskengine.TaskChainDefinition, outChainID string, p *ParsedPlan, ) (*taskengine.TaskChainDefinition, error)
Compile turns a parsed plan, an executor chain, and a summarizer chain into one linear TaskChainDefinition. For each plan step it emits:
- `seed_step_{N}` (HandleNoop) seeding the prompt template with plan macro vars;
- a full copy of the executor graph with `s{N}__` prefixed task IDs;
- `exec_done_{N}` (HandleNoop) splicing the executor's success terminals into the summarizer;
- a full copy of the summarizer graph with `s{N}__sum__` prefixed IDs, symbolic references (SummarizerRefExecTerminal, SummarizerRefNextStep) rewritten.
Successful summarizer terminals route to `seed_step_{N+1}` when N < last step, or to TermEnd for the final step. Matches the state-machine pattern in enterprise/site/public/images/about/1763497730022.jpeg: every LLM role is a typed node in the graph, not imperative glue in a service.
func ExtractStepChain ¶
func ExtractStepChain(full *taskengine.TaskChainDefinition, stepIndex1Based int) (*taskengine.TaskChainDefinition, error)
ExtractStepChain returns the subgraph for a single plan step from a chain produced by Compile. It includes seed_step_k and all tasks with IDs prefixed s{k}__, and rewrites transitions that jump to seed_step_{k+1} so the subgraph terminates at the end of the step instead.
Types ¶
type ParsedPlan ¶
ParsedPlan is the result of parsing plan Markdown (same shape as planservice.renderMarkdown).
func ParseMarkdown ¶
func ParseMarkdown(md string) (*ParsedPlan, error)
ParseMarkdown extracts goal and ordered step descriptions from rendered plan Markdown. It understands lines like "**Goal:** ...", "## Steps", and checklist items "- [ ] 1. text". Indented lines starting with ">" (execution result excerpts) are skipped.
type PlanShowActive ¶
type PlanShowActive interface {
Show(ctx context.Context) (string, error)
Active(ctx context.Context) (*planstore.Plan, []*planstore.PlanStep, error)
}
PlanShowActive is implemented by planservice.Service for RunActiveCompiled without importing planservice (avoids cycles).
type RunActiveCompiledResult ¶
type RunActiveCompiledResult struct {
Goal string
Steps []string
Chain *taskengine.TaskChainDefinition
Path string
Output any
OutputType taskengine.DataType
State []taskengine.CapturedStateUnit
}
RunActiveCompiledResult is the outcome of compiling the active plan markdown and executing the compiled chain.
func RunActiveCompiled ¶
func RunActiveCompiled( ctx context.Context, planSvc PlanShowActive, chains taskchainservice.Service, exec execservice.TasksEnvService, executorChainID string, summarizerChainID string, compiledChainID string, writePath string, precompiled *taskengine.TaskChainDefinition, eventSink taskengine.TaskEventSink, ) (*RunActiveCompiledResult, error)
RunActiveCompiled loads markdown via planservice.Show, parses and compiles it with the executor chain + summarizer chain, optionally persists the compiled JSON, then runs Execute with the plan goal as string input. precompiled, when non-empty, skips Compile (reuse planservice Next cache or explicit artifact). eventSink publishes plan_run_* events to the same bus/TaskEvent pipeline as task execution (optional; nil disables).