cmdruntime

package
v0.10.200 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cmdruntime contains shared command runtime contracts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath(opts *root.Options) (string, error)

ConfigPath resolves the active config path from root options.

func MapRunError

func MapRunError(err error) error

MapRunError maps lower-level runtime errors to CLI exit-code wrappers.

func MissingResponderError

func MissingResponderError() error

MissingResponderError reports that a command runtime cannot execute response runs.

func ResolveRepoRoot added in v0.10.200

func ResolveRepoRoot(ctx context.Context) (string, error)

ResolveRepoRoot returns the current invocation worktree root or reporoot.ErrUnavailable when the command is not running inside a Git worktree.

func RetentionPolicyFromConfig

func RetentionPolicyFromConfig(retention config.RetentionConfig) datalifecycle.RetentionPolicy

RetentionPolicyFromConfig maps config retention settings to runtime policy.

Types

type Factory

type Factory func(cmd *cobra.Command, opts *root.Options, cfg config.File, profile config.Profile, runtimeOpts Options) (Runtime, error)

Factory builds the concrete runtime used by review lifecycle commands.

type Options

type Options struct {
	MaxAgents                         int
	MaxConcurrency                    int
	PRRef                             gitprovider.PRRef
	RequireOpinionatedReviewAuthority bool
	Retention                         datalifecycle.RetentionPolicy
	RetentionManualOnly               bool
	ResolveRepoRoot                   func(context.Context) (string, error)
	GitCommand                        func(context.Context, string, ...string) ([]byte, error)
}

Options carries command flags that affect runtime construction.

type ResponseRunner

type ResponseRunner interface {
	Respond(context.Context, threadrespond.Request) (threadrespond.Result, error)
}

ResponseRunner executes response-only thread lifecycle runs.

type Runner

Runner executes the configured review pipeline.

type Runtime

type Runtime struct {
	Runner          Runner
	Responder       ResponseRunner
	PostingIdentity gitprovider.Identity
	Cleanup         func()
}

Runtime contains per-command dependencies that need cleanup after a run.

Jump to

Keyboard shortcuts

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