orchestration

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UseMission   = "mission"
	UseWorkspace = "workspace"
	UseVerify    = "verify"
	UseReview    = "review"
	UseApply     = "apply"
)
View Source
const MaxWaveWidth = 4

MaxWaveWidth is the scheduler fan-out cap: a wave wider than this blocks before any of its nodes run.

View Source
const ToolName = "jacu_flow_run"

Variables

This section is empty.

Functions

func FanIn

func FanIn(ctx context.Context, git *gitx.Git, target, baseSHA string, worktrees []string) (bool, error)

FanIn applies patches captured from agent worktrees to an owned target. A content collision returns (false, nil) after resetting the target to base; that is a governance escalation, not a mechanical failure. The caller owns the target and decides whether to preserve the source worktrees.

func RegisterTool

func RegisterTool(server *mcp.Server, root string, manager *verify.TaskManager)

func RenderPanelMarkdown

func RenderPanelMarkdown(opinions []Opinion) string

func RouteNode added in v0.4.0

func RouteNode(ctx context.Context, panel Panel, node Node) (modelcontrol.HostProfile, error)

func Run added in v0.4.0

func RunWithManager added in v0.4.0

func RunWithManager(ctx context.Context, root string, in Input, manager *verify.TaskManager) capabilityruntime.Result

func ScheduleWaves

func ScheduleWaves(flow Flow) ([][]string, error)

ScheduleWaves is the inherited deterministic scheduler. It intentionally accepts duplicate node ids and keeps the first occurrence: validation is the submit-time contract, while this pure helper preserves the migrated behavior and remains useful to callers that already linted elsewhere.

func SetPanel added in v0.4.0

func SetPanel(panel Panel)

Types

type Edge

type Edge struct {
	From string `json:"from"`
	To   string `json:"to"`
	When string `json:"when"`
}

type Finding

type Finding struct {
	Level   string `json:"level"`
	Rule    string `json:"rule"`
	Message string `json:"message"`
	NodeID  string `json:"node_id,omitempty"`
	Field   string `json:"field,omitempty"`
}

type Flow

type Flow struct {
	Nodes []Node `json:"nodes"`
	Edges []Edge `json:"edges"`
}

Flow is the declarative graph submitted to jacu_flow_run.

type FlowResult

type FlowResult struct {
	Status        string       `json:"status"`
	Summary       string       `json:"summary"`
	Waves         [][]string   `json:"waves"`
	Trace         []TraceEvent `json:"trace"`
	PanelMarkdown string       `json:"panel_markdown,omitempty"`
	Findings      []Finding    `json:"findings,omitempty"`
}

func Execute

func Execute(ctx context.Context, flow Flow, initial map[string]any, executor NodeExecutor) (FlowResult, error)

type Input

type Input struct {
	Flow    Flow           `json:"flow"`
	Context map[string]any `json:"context,omitempty"`
	RunID   string         `json:"run_id,omitempty"`
	Async   bool           `json:"async,omitempty"`
}

type Node

type Node struct {
	ID           string         `json:"id"`
	Uses         string         `json:"uses"`
	Lane         string         `json:"lane,omitempty"`
	With         map[string]any `json:"with,omitempty"`
	AllowedPaths []string       `json:"allowed_paths,omitempty"`
	MaxVisits    int            `json:"max_visits,omitempty"`
}

type NodeExecutor

type NodeExecutor func(context.Context, Node, map[string]NodeResult) (NodeResult, error)

NodeExecutor is the only effectful seam of the graph engine. The MCP tool supplies the capability-backed implementation; tests can supply a fake and prove path selection without processes or filesystem state.

type NodeResult

type NodeResult struct {
	Status   string         `json:"status"`
	Verdict  string         `json:"verdict,omitempty"`
	Policy   string         `json:"policy,omitempty"`
	Output   map[string]any `json:"output,omitempty"`
	Opinions []Opinion      `json:"opinions,omitempty"`
}

type Opinion

type Opinion struct {
	SessionID string `json:"session_id"`
	Model     string `json:"model"`
	Verdict   string `json:"verdict"`
	Reason    string `json:"reason,omitempty"`
}

Opinion is structured untrusted review data. It never creates an apply receipt; it is only rendered into the flow trace.

type Panel added in v0.4.0

type Panel struct {
	Profiles []modelcontrol.HostProfile
	Verifier modelcontrol.SignatureVerifier
	Breaker  *modelcontrol.CircuitBreaker
	Metrics  []modelcontrol.ModelMetric
	Now      time.Time
}

Panel is the injected host-profile catalogue. Empty panel skips routing unless a node declares lane.

type ScheduleError

type ScheduleError struct {
	Kind string
	From string
	To   string
	Node string
}

func (*ScheduleError) Error

func (e *ScheduleError) Error() string

type ToolData

type ToolData struct {
	Task *verify.TaskInfo `json:"task,omitempty"`
	Flow *FlowResult      `json:"flow,omitempty"`
}

type TraceEvent

type TraceEvent struct {
	NodeID   string `json:"node_id"`
	Uses     string `json:"uses"`
	Wave     int    `json:"wave"`
	Visit    int    `json:"visit"`
	Status   string `json:"status"`
	Verdict  string `json:"verdict,omitempty"`
	Policy   string `json:"policy,omitempty"`
	Decision string `json:"decision"`
	Reason   string `json:"reason,omitempty"`
}

type Validation

type Validation struct {
	Findings []Finding `json:"findings"`
}

func Validate

func Validate(flow Flow) Validation

Validate performs the submit-time, side-effect-free flow lint.

func (Validation) Blocked

func (v Validation) Blocked() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL