run

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Overview

Package run implements the orchestrator for the norma development lifecycle.

Package run implements the orchestrator for the norma development lifecycle.

Package run implements the orchestrator for the norma development lifecycle.

Index

Constants

View Source
const (
	StatusError   = "error"
	StatusFailed  = "failed"
	StatusPassed  = "passed"
	StatusStopped = "stopped"
)

Variables

This section is empty.

Functions

func BuildApplyCommitMessage

func BuildApplyCommitMessage(goal, runID string, stepIndex int, taskID string) string

func CommitTypeForGoal

func CommitTypeForGoal(goal string) string

func Prune

func Prune(ctx context.Context, db *sql.DB, workingDir string) error

Prune removes all runs, their directories, and any associated git worktrees.

Types

type AgentBuild

type AgentBuild struct {
	Agent          agent.Agent
	SessionID      string
	InitialState   map[string]any
	InitialContent *genai.Content
	OnEvent        func(*session.Event)
}

AgentBuild describes an ADK agent build for a task run.

type AgentFactory

type AgentFactory interface {
	Name() string
	Build(ctx context.Context, meta RunMeta, task TaskPayload) (AgentBuild, error)
	Finalize(ctx context.Context, meta RunMeta, task TaskPayload, finalSession session.Session) (AgentOutcome, error)
}

AgentFactory builds and finalizes ADK agents for task runs.

type AgentOutcome

type AgentOutcome struct {
	Status   string
	Verdict  *string
	Decision *string
}

AgentOutcome summarizes the run outcome.

type Lock

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

Lock handles exclusive access to norma loop.

func AcquireRunLock

func AcquireRunLock(normaDir string) (*Lock, error)

AcquireRunLock tries to acquire the run lock.

func TryAcquireRunLock

func TryAcquireRunLock(normaDir string) (*Lock, bool, error)

TryAcquireRunLock tries to acquire the run lock without blocking.

func (*Lock) Release

func (l *Lock) Release() error

Release releases the run lock.

type PruneResult

type PruneResult struct {
	Considered int
	Kept       int
	Deleted    int
	Skipped    int
}

PruneResult summarizes a prune operation.

func PruneRuns

func PruneRuns(ctx context.Context, db *sql.DB, runsDir string, policy RetentionPolicy, dryRun bool) (PruneResult, error)

PruneRuns deletes old run records and their directories.

type Result

type Result struct {
	RunID  string
	Status string
}

Result summarizes a completed run.

type RetentionPolicy

type RetentionPolicy struct {
	KeepLast int
	KeepDays int
}

RetentionPolicy controls run cleanup.

type RunMeta

type RunMeta struct {
	RunID      string
	RunDir     string
	GitRoot    string
	BaseBranch string
}

RunMeta contains shared run metadata.

type Runner

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

Runner executes an ADK agent run for a task.

func NewADKRunner

func NewADKRunner(workingDir string, cfg config.Config, store *db.Store, tracker task.Tracker, factory AgentFactory) (*Runner, error)

NewADKRunner constructs a Runner with an ADK agent factory.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, goal string, ac []task.AcceptanceCriterion, taskID string) (res Result, err error)

Run starts a new run with the given goal and acceptance criteria.

type TaskPayload

type TaskPayload struct {
	ID                 string
	Goal               string
	AcceptanceCriteria []task.AcceptanceCriterion
}

TaskPayload contains task-level input available to factories.

Jump to

Keyboard shortcuts

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