runner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package runner contains the bounded, provider-specific process adapter used by the headless E2 command. It deliberately has no shell or credential store.

Index

Constants

View Source
const (
	CheckStatusPending = "pending"
	CheckStatusPassed  = "passed"
	CheckStatusFailed  = "failed"
	CheckStatusTimeout = "timed_out"
)
View Source
const (
	PermissionReadOnly = "read-only"
	PermissionWorktree = "workspace-write"
	StatusCompleted    = "completed"
	StatusFailed       = "failed"
	StatusTimedOut     = "timed_out"
	StatusCancelled    = "cancelled"
	StatusBlocked      = "blocked"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckAnnotation

type CheckAnnotation struct {
	Path            string `json:"path"`
	StartLine       int    `json:"start_line"`
	EndLine         int    `json:"end_line"`
	AnnotationLevel string `json:"annotation_level"`
	Title           string `json:"title"`
	Message         string `json:"message"`
}

type CheckEvidence

type CheckEvidence struct {
	PullRequest string
	Status      string
	Checks      []CheckRun
	Failures    []CheckFailureEvidence
	Warnings    []string
	Digest      string
}

func CollectCheckEvidence

func CollectCheckEvidence(ctx context.Context, request CheckEvidenceRequest) (CheckEvidence, error)

CollectCheckEvidence is the trusted host-side GitHub adapter. It invokes only gh with fixed subcommands; providers never receive these credentials or raw GitHub output.

func WatchCheckEvidence

func WatchCheckEvidence(ctx context.Context, request CheckEvidenceRequest) (CheckEvidence, error)

WatchCheckEvidence polls a PR until all checks are terminal or the bounded watch context expires. A pending check is never classified as a failure.

type CheckEvidenceRequest

type CheckEvidenceRequest struct {
	PullRequest  string
	Directory    string
	Timeout      time.Duration
	TailBytes    int
	PollInterval time.Duration
}

CheckEvidenceRequest identifies one already-created PR. PullRequest accepts a numeric PR number or a validated branch/ref understood by gh.

type CheckFailureEvidence

type CheckFailureEvidence struct {
	Check          CheckRun
	Repository     string
	RunID          string
	JobID          string
	LogTail        string
	LogTruncated   bool
	LogDigest      string
	Annotations    []CheckAnnotation
	EvidenceDigest string
}

type CheckRun

type CheckRun struct {
	Bucket   string `json:"bucket"`
	Link     string `json:"link"`
	Name     string `json:"name"`
	State    string `json:"state"`
	Workflow string `json:"workflow"`
}

type HarnessProcess

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

HarnessProcess owns one bounded provider process. Keeping the request on this value makes the spawn boundary explicit and gives future providers one lifecycle owner instead of one-off exec.Command call sites.

func NewHarnessProcess

func NewHarnessProcess(request Request) HarnessProcess

func (HarnessProcess) Run

func (process HarnessProcess) Run(ctx context.Context) Result

type Provider

type Provider string
const (
	ProviderClaude Provider = "claude"
	ProviderCodex  Provider = "codex"
)

type Request

type Request struct {
	ProjectID  string
	Provider   Provider
	Worktree   string
	Objective  string
	Model      string
	Permission string
	Timeout    time.Duration
	TailBytes  int
	CLI        modelcontrol.SignedCLI
	Verifier   modelcontrol.SignatureVerifier
}

type Result

type Result struct {
	Provider   Provider `json:"provider"`
	Status     string   `json:"status"`
	ExitCode   *int     `json:"exit_code,omitempty"`
	DurationMs int64    `json:"duration_ms"`
	StdoutTail string   `json:"stdout_tail"`
	StderrTail string   `json:"stderr_tail"`
	Truncated  bool     `json:"truncated"`
	BytesOut   int64    `json:"bytes_out"`
	Digest     string   `json:"digest"`
	Reason     string   `json:"reason,omitempty"`
}

func Run

func Run(ctx context.Context, request Request) Result

Run executes one provider invocation. It returns a typed result for all expected outcomes, including validation refusal, so callers never infer governance from an error string or child stderr.

Jump to

Keyboard shortcuts

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