runtime

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

Package runtime implements the local pipeline execution engine. It parses pipeline.yaml, traverses the DAG, executes native and local-component steps, and writes a trace file under .cnips/traces/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindTrace

func FindTrace(root, runID string) (string, error)

Types

type RunOptions

type RunOptions struct {
	Root         string
	Pipeline     string // pipeline name
	Payload      string // initial JSON payload (string)
	Environment  string // environment name (e.g. "dev")
	FromStep     string // optional step ID to resume execution from
	TraceRunID   string // optional previous trace used to seed resume context
	AutoApprove  bool
	AutoReject   bool
	Verbose      bool
	LogWriter    io.Writer
	Progress     io.Writer
	ExecutionDir string
	LogPath      string
}

RunOptions controls how the pipeline is executed.

type StepTrace

type StepTrace struct {
	ID         string          `json:"id"`
	Uses       string          `json:"uses"`
	ParentID   string          `json:"parentId,omitempty"`
	LoopIndex  *int            `json:"loopIndex,omitempty"`
	Status     string          `json:"status"` // ok | error | skipped | approval
	DurationMs int64           `json:"durationMs"`
	Input      json.RawMessage `json:"input,omitempty"`
	Output     json.RawMessage `json:"output,omitempty"`
	Error      string          `json:"error,omitempty"`
	Logs       []string        `json:"logs,omitempty"`
	Children   []StepTrace     `json:"children,omitempty"`
}

StepTrace holds execution data for one step.

type Trace

type Trace struct {
	RunID      string      `json:"runId"`
	Pipeline   string      `json:"pipeline"`
	Status     string      `json:"status"`
	StartedAt  time.Time   `json:"startedAt"`
	DurationMs int64       `json:"durationMs"`
	Steps      []StepTrace `json:"steps"`
	Error      string      `json:"error,omitempty"`
	LogPath    string      `json:"logPath,omitempty"`
}

Trace is the full run record written to .cnips/traces/run_<id>.json.

func LoadTrace

func LoadTrace(root, runID string) (*Trace, error)

func Run

func Run(opts RunOptions) (*Trace, error)

Run executes the pipeline and returns the trace.

Jump to

Keyboard shortcuts

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