Documentation
¶
Overview ¶
Package control provides the adapters that plug Fort's deterministic components into the control-plane ports (ui.Dispatcher, ui.FlowRunner).
This is the composition seam for "control plane, optionally with execution":
- EngineDispatcher / FlowExecutor wrap the real router + DAG engine (full mode).
- QueueDispatcher boards tasks with no execution plane at all (control-only mode).
cmd/fort picks which adapters to wire; the ui module only ever sees the ports.
Index ¶
- type EngineDispatcher
- type FlowExecutor
- func (f FlowExecutor) Approve(runID, nodeID, edit string) error
- func (f FlowExecutor) Plan(flowID string) []ui.FlowNode
- func (f FlowExecutor) Reject(runID, nodeID, note string) error
- func (f FlowExecutor) ResumeFlow(ctx context.Context, flowID, runID string) (ui.RunResult, error)
- func (f FlowExecutor) StartFlow(ctx context.Context, flowID, runID, payload string) (ui.RunResult, error)
- func (f FlowExecutor) StartPlaybook(ctx context.Context, route ui.RoutePreview, runID, direction string) (ui.PlaybookRunResult, error)
- func (f FlowExecutor) WithPlaybooks(catalog *PlaybookCatalog) FlowExecutor
- type Planner
- type PlaybookCatalog
- func (c *PlaybookCatalog) Duplicate(ctx context.Context, id string) (ui.Playbook, error)
- func (c *PlaybookCatalog) List(ctx context.Context) ([]ui.Playbook, error)
- func (c *PlaybookCatalog) Route(ctx context.Context, request ui.RouteRequest) (ui.RoutePreview, error)
- func (c *PlaybookCatalog) Save(ctx context.Context, definition ui.Playbook) (ui.Playbook, error)
- type QueueDispatcher
- type Roster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EngineDispatcher ¶
type EngineDispatcher struct {
// contains filtered or unexported fields
}
EngineDispatcher routes + dispatches via the deterministic engine.
func NewEngineDispatcher ¶
func NewEngineDispatcher(e *engine.Engine) EngineDispatcher
NewEngineDispatcher adapts an engine to ui.Dispatcher.
type FlowExecutor ¶
type FlowExecutor struct {
// contains filtered or unexported fields
}
FlowExecutor adapts the DAG executor to ui.FlowRunner (id-based).
func NewFlowExecutor ¶
func NewFlowExecutor(x *graph.Executor, flows []graph.Flow) FlowExecutor
NewFlowExecutor adapts a graph executor + flow set to ui.FlowRunner.
func (FlowExecutor) Approve ¶
func (f FlowExecutor) Approve(runID, nodeID, edit string) error
Approve records a gate approval.
func (FlowExecutor) Plan ¶ added in v0.11.0
func (f FlowExecutor) Plan(flowID string) []ui.FlowNode
Plan exposes a flow's node list to the control plane (spec 033).
func (FlowExecutor) Reject ¶
func (f FlowExecutor) Reject(runID, nodeID, note string) error
Reject records a gate rejection with an optional redirect note.
func (FlowExecutor) ResumeFlow ¶
ResumeFlow resumes the named flow.
func (FlowExecutor) StartFlow ¶
func (f FlowExecutor) StartFlow(ctx context.Context, flowID, runID, payload string) (ui.RunResult, error)
StartFlow starts the named flow.
func (FlowExecutor) StartPlaybook ¶ added in v0.12.0
func (f FlowExecutor) StartPlaybook(ctx context.Context, route ui.RoutePreview, runID, direction string) (ui.PlaybookRunResult, error)
StartPlaybook compiles and starts an immutable route preview. The canonical flow id carries every field needed to reconstruct the exact flow after a process restart, while its delivery suffix lets operational views exclude answer-only history.
func (FlowExecutor) WithPlaybooks ¶ added in v0.12.0
func (f FlowExecutor) WithPlaybooks(catalog *PlaybookCatalog) FlowExecutor
WithPlaybooks enables immutable dynamic playbook flows on the same executor value used for static ui.FlowRunner operations.
type Planner ¶ added in v0.8.0
type Planner struct {
// contains filtered or unexported fields
}
Planner implements ui.Planner: it runs a planner agent to decompose a goal into backlog sub-tasks (spec 026). The planner is a normal, visible run; Breakdown returns its id immediately and the sub-tasks are created when the run completes.
func NewPlanner ¶ added in v0.8.0
NewPlanner adapts the engine + store to ui.Planner. defaultAgent is the planner agent used when a breakdown request doesn't specify one (FORT_PLANNER; falls back to "claude").
func (Planner) Breakdown ¶ added in v0.8.0
Breakdown dispatches the planner run and returns its id; a goroutine ingests its output into the backlog once it completes. NOTE (spec 026 crash window): if the process stops between the run finishing and ingest writing items, the sub-tasks are not written — re-run the breakdown.
type PlaybookCatalog ¶ added in v0.12.0
type PlaybookCatalog struct {
// contains filtered or unexported fields
}
PlaybookCatalog adapts immutable store revisions to the UI playbook port. Definitions remain encoded as their UI wire form so display-only fields such as stage descriptions survive validation and round trips unchanged.
func NewPlaybookCatalog ¶ added in v0.12.0
func NewPlaybookCatalog(st *store.Store) *PlaybookCatalog
NewPlaybookCatalog builds the durable playbook catalog and atomically seeds it before any route preview can be served. Routing remains read-only.
func (*PlaybookCatalog) Duplicate ¶ added in v0.12.0
Duplicate appends a disabled, non-default copy with a fresh deterministic slug. A duplicate cannot change automatic routing until explicitly enabled.
func (*PlaybookCatalog) List ¶ added in v0.12.0
List returns the latest immutable revision for every playbook.
func (*PlaybookCatalog) Route ¶ added in v0.12.0
func (c *PlaybookCatalog) Route(ctx context.Context, request ui.RouteRequest) (ui.RoutePreview, error)
Route resolves a pure deterministic preview. An explicit revision loads that exact immutable row; the optional plan gate override only changes the returned execution snapshot and never persists a definition.
type QueueDispatcher ¶
type QueueDispatcher struct {
// contains filtered or unexported fields
}
QueueDispatcher boards a task as a "queued" run with no execution plane.
func NewQueueDispatcher ¶
func NewQueueDispatcher(s *store.Store) QueueDispatcher
NewQueueDispatcher adapts a store to ui.Dispatcher for control-only mode.
type Roster ¶
type Roster struct {
// contains filtered or unexported fields
}
Roster adapts a live machine registry pointer to ui.MachineLister and tracks peer reachability by polling each machine's /health (spec 022). It reads the Live pointer on every call, so a registry installed after construction (e.g. a mesh enrollment) is visible without a restart (spec 024). The local machine is reachable by definition; peers start unreachable until first probed.
func (*Roster) Machines ¶
func (r *Roster) Machines() []ui.MachineStatus
Machines implements ui.MachineLister.