engine

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package engine wires the deterministic router to native execution and the state store (backlog AO-015): a submitted task auto-routes, is persisted with its matched rule, and runs natively with zero manual assignment. Run events stream into the append-only event log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine routes and dispatches tasks.

func New

func New(r *router.Router, rt runtime.Runtime, st *store.Store, workRoot string) *Engine

New builds an engine.

func (*Engine) Route

func (e *Engine) Route(t task.Task) router.RouteDecision

Route returns the routing decision for a task without dispatching it (powers `fort route --dry-run`).

func (*Engine) Submit

func (e *Engine) Submit(ctx context.Context, t task.Task) (string, error)

Submit routes and dispatches a task, returning the run id immediately. It satisfies inbox.Submitter; callers that need the resolved machine use SubmitRef.

func (*Engine) SubmitAndWait

func (e *Engine) SubmitAndWait(ctx context.Context, t task.Task) (store.Run, error)

SubmitAndWait submits a task and blocks until its run terminates, returning the final run row.

func (*Engine) SubmitRef

func (e *Engine) SubmitRef(ctx context.Context, t task.Task) (string, string, error)

SubmitRef is Submit that also returns the resolved machine (spec 022). It persists the route decision and a run row, starts native execution, and streams events into the store on a goroutine.

func (*Engine) UsePlacer

func (e *Engine) UsePlacer(p Placer)

UsePlacer enables deterministic machine placement (spec 022). With no placer the engine dispatches to the local runtime exactly as before.

type Placer

type Placer interface {
	Place(agent, pin string) (machine string, err error)
}

Placer chooses the machine that will run an agent (spec 022). Like the router it is a pure, deterministic function of its inputs — zero model calls — so the full dispatch path stays model-free. core/machines.Registry implements it; cmd/fort injects it in multi-machine mode.

Jump to

Keyboard shortcuts

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