Documentation
¶
Overview ¶
Package graph is Fort's deterministic DAG engine (backlog AO-021..025).
A Flow is nodes + conditional edges. Node types: task, gate, check, transform, fanout, fanin. Only task nodes invoke the Runtime (inference); every other node type is deterministic. Flows are resumable: node state is persisted to the store and a paused gate continues after a process restart.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckSpec ¶
type CheckSpec struct {
// Command is run; exit 0 => pass, non-zero => fail.
Command []string `yaml:"command" json:"command"`
// FileExists passes when the named path exists.
FileExists string `yaml:"file_exists" json:"file_exists"`
}
CheckSpec is a deterministic predicate (AO-022).
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs flows deterministically. Only task nodes invoke the Runtime.
func NewExecutor ¶
NewExecutor builds an executor.
func (*Executor) Approve ¶
Approve records an approve decision on a waiting gate, optionally editing the payload that flows downstream.
type Flow ¶
type Flow struct {
ID string `yaml:"id" json:"id"`
Name string `yaml:"name" json:"name"`
Start string `yaml:"start" json:"start"`
Nodes []Node `yaml:"nodes" json:"nodes"`
}
Flow is a named DAG.
type Node ¶
type Node struct {
ID string `yaml:"id" json:"id"`
Type NodeType `yaml:"type" json:"type"`
Agent string `yaml:"agent,omitempty" json:"agent,omitempty"` // task
Prompt string `yaml:"prompt,omitempty" json:"prompt,omitempty"` // task
Retry *Retry `yaml:"retry,omitempty" json:"retry,omitempty"` // task
Check *CheckSpec `yaml:"check,omitempty" json:"check,omitempty"` // check
Transform *TransformSpec `yaml:"transform,omitempty" json:"transform,omitempty"` // transform
FaninID string `yaml:"fanin,omitempty" json:"fanin,omitempty"` // fanout -> join node
Edges []Edge `yaml:"edges,omitempty" json:"edges,omitempty"`
}
Node is one DAG node.
type NodeType ¶
type NodeType string
NodeType enumerates the node kinds.
const ( Task NodeType = "task" // invokes the Runtime (the only inference point) Gate NodeType = "gate" // halts for human approve/edit/reject Check NodeType = "check" // deterministic predicate -> pass/fail Transform NodeType = "transform" // deterministic data step, records hash Fanout NodeType = "fanout" // splits into parallel branches Fanin NodeType = "fanin" // joins branches )
type Result ¶
type Result struct {
State string // completed | failed | paused
PausedNode string // gate id when paused
}
Result is the outcome of a Start/Resume call.
type Retry ¶
type Retry struct {
Max int `yaml:"max" json:"max"` // additional attempts after the first
}
Retry configures per-task retry (AO-025).
type TransformSpec ¶
TransformSpec is a deterministic data step (AO-024). Ops: identity, upper, lower, prefix (Arg prepended), suffix (Arg appended).