Documentation
¶
Overview ¶
Package graph is the frozen, read-only-at-run-time node/edge model that internal/sdlc/compile produces from a spec.Workflow. The engine executes only against a Graph: it never sees the authored YAML.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
Name string `json:"name"`
Description string `json:"description"`
Budgets spec.Budgets `json:"budgets"`
Entry string `json:"entry"`
Nodes map[string]*Node `json:"-"`
// Order is the deterministic node order used for hashing and listing:
// authored nodes first (in their spec order), then unrolled copies
// grouped by origin and ordered by UnrollIndex.
Order []string `json:"-"`
SHA256 string `json:"-"`
}
Graph is a compiled, sha256-pinned workflow. It is a pure DAG: compile unrolls every bounded cycle at compile time (see internal/sdlc/compile), so the engine never has to reason about loops at run time.
type Node ¶
type Node struct {
ID string `json:"id"`
Kind string `json:"kind"`
Agent string `json:"agent,omitempty"`
Produces []spec.Artifact `json:"produces,omitempty"`
Consumes []spec.Artifact `json:"consumes,omitempty"`
Objective string `json:"objective,omitempty"`
Next string `json:"next,omitempty"`
QuestionSet string `json:"questionSet,omitempty"`
State *spec.StateSpec `json:"state,omitempty"`
Routes map[string]string `json:"routes,omitempty"`
Default string `json:"default,omitempty"`
TrueRoute string `json:"trueRoute,omitempty"`
Candidates []string `json:"candidates,omitempty"`
AssignTo string `json:"assignTo,omitempty"`
Command string `json:"command,omitempty"`
Prompt string `json:"prompt,omitempty"`
Outcome string `json:"outcome,omitempty"`
// Origin is the authored node id this node was unrolled from, empty for
// a node compiled 1:1 from the spec. UnrollIndex is that copy's ordinal
// (2, 3, ...); the first copy keeps Origin's own id and UnrollIndex 0.
Origin string `json:"origin,omitempty"`
UnrollIndex int `json:"unrollIndex,omitempty"`
}
Node is one compiled, frozen workflow node. Every route target it carries (Next, Default, Routes values) names a Node that exists in the same Graph.
func (*Node) Edges ¶
Edges returns (label, target) for every outgoing edge in a stable order: "next" first (when present), then routes sorted by label, then "default" last. A select node is the one exception: its traversal edge is assignTo (the node that runs under the chosen agent) and its Default names a candidate agent id, not a node id, so Default is never reported as an edge for a select node.