engine

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package engine is the supervisor: it owns run creation, subprocess execution, the auto-execution of run_command operations, response acceptance, and terminal handling. Every state change goes through the run log; every refusal goes through the guard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	SkillDir string
	RunsDir  string
	// Stderr receives subprocess diagnostics (compile errors etc.).
	Stderr *os.File
}

Engine binds a skill directory to a runs directory.

func New

func New(skillDir string) (*Engine, error)

New creates an engine rooted at the skill directory; run logs live in <skillDir>/.yield/runs.

func (*Engine) ListRuns

func (e *Engine) ListRuns() ([]string, error)

ListRuns returns known run IDs, newest last.

func (*Engine) Log

func (e *Engine) Log(runID string) (*runlog.Log, error)

Log opens a run's log for inspection.

func (*Engine) Replay

func (e *Engine) Replay(runID string) (*Progress, error)

Replay re-executes the program against the full journal and verifies it reproduces the run's recorded frontier — the determinism check.

func (*Engine) Resume

func (e *Engine) Resume(runID string, respBytes []byte, migrate bool) (*Progress, error)

Resume validates and accepts a response for the pending operation, then advances. migrate=true explicitly rebinds the run to the current skill digest (the migrate_digest mechanism; divergence detection remains the safety net).

func (*Engine) StartRun

func (e *Engine) StartRun(input json.RawMessage) (*Progress, error)

StartRun creates a run bound to the current skill digest and advances to the first agent-facing operation or terminal.

type Progress

type Progress struct {
	RunID    string
	Envelope *protocol.RequestEnvelope
	Terminal *protocol.TerminalOutcome
}

Advance's result: either the next operation for the agent, or a terminal status.

Jump to

Keyboard shortcuts

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