runner

package
v0.0.0-...-348835b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package runner orchestrates the full hydra task lifecycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaudeFunc

type ClaudeFunc func(ctx context.Context, cfg ClaudeRunConfig) error

ClaudeFunc is the function signature for invoking claude.

type ClaudeRunConfig

type ClaudeRunConfig struct {
	RepoDir    string
	Document   string
	Model      string
	AutoAccept bool
	PlanMode   bool
	ForceTUI   bool
}

ClaudeRunConfig holds the parameters for a Claude invocation.

type Runner

type Runner struct {
	Config      *config.Config
	Design      *design.Dir
	Claude      ClaudeFunc
	TaskRunner  *taskrun.Commands // loaded from hydra.yml; nil if not present
	BaseDir     string            // working directory for lock file; defaults to "."
	Model       string            // model name override
	AutoAccept  bool              // auto-accept all tool calls
	PlanMode    bool              // start Claude in plan mode
	ForceTUI    bool              // force built-in TUI instead of Claude Code CLI
	Rebase      bool              // rebase onto origin/main before running
	Notify      bool              // send desktop notifications on confirmation
	IssueCloser issues.Closer     // set by merge workflow
}

Runner orchestrates the full hydra run workflow.

func New

func New(cfg *config.Config) (*Runner, error)

New creates a Runner from the given config.

func (*Runner) Clean

func (r *Runner) Clean(taskName string) error

Clean runs the clean command in the task's work directory. Uses the clean command from hydra.yml, or falls back to "make clean" if a Makefile with a clean target exists. The task can be in any state.

func (*Runner) Fix

func (r *Runner) Fix(autoConfirm bool) error

Fix scans the project for issues, reports them, and prompts for confirmation before applying fixes. Duplicate task conflicts are handled interactively before the main scan. If autoConfirm is true, fixes are applied without prompting. Returns an error only if scanning itself fails, not for individual issues.

func (*Runner) GroupList

func (r *Runner) GroupList() error

GroupList prints all unique group names from pending tasks.

func (*Runner) GroupTasks

func (r *Runner) GroupTasks(groupName string) error

GroupTasks prints all tasks in a group across all states.

func (*Runner) Merge

func (r *Runner) Merge(taskName string) error

Merge runs the merge workflow:

  1. Fetch origin, checkout task branch, abort any in-progress rebase
  2. Rebase task branch onto origin/main
  3. If conflicts, invoke Claude to resolve them
  4. Force-push the branch
  5. Checkout main, rebase against origin/main, rebase against feature branch, push

Accepts tasks in review or merge state (merge state for retries).

func (*Runner) MergeEdit

func (r *Runner) MergeEdit(taskName, editor string) error

MergeEdit opens a task in merge state in the editor.

func (*Runner) MergeGroup

func (r *Runner) MergeGroup(groupName string) error

MergeGroup merges all review/merge tasks in a group sequentially.

func (*Runner) MergeList

func (r *Runner) MergeList() error

MergeList prints tasks in review or merge state.

func (*Runner) MergeRemove

func (r *Runner) MergeRemove(taskName string) error

MergeRemove moves a task from merge to abandoned.

func (*Runner) MergeView

func (r *Runner) MergeView(taskName string) error

MergeView prints the content of a task in merge state.

func (*Runner) Reconcile

func (r *Runner) Reconcile() error

Reconcile reads all completed tasks, uses Claude to merge their requirements into functional.md, then deletes the completed task files.

func (*Runner) Review

func (r *Runner) Review(taskName string) error

Review runs an interactive review session on a task in review state. The task stays in review state after the review session.

func (*Runner) ReviewDev

func (r *Runner) ReviewDev(ctx context.Context, taskName string) error

ReviewDev runs the dev command from hydra.yml in the task's work directory. The process runs until it exits or the context is cancelled.

func (*Runner) ReviewDiff

func (r *Runner) ReviewDiff(taskName string) error

ReviewDiff fetches the latest remote and shows the git diff between origin/main and the task's branch.

func (*Runner) ReviewEdit

func (r *Runner) ReviewEdit(taskName, editor string) error

ReviewEdit opens a task in review state in the editor.

func (*Runner) ReviewList

func (r *Runner) ReviewList() error

ReviewList prints tasks in review state.

func (*Runner) ReviewRemove

func (r *Runner) ReviewRemove(taskName string) error

ReviewRemove moves a task from review to abandoned.

func (*Runner) ReviewView

func (r *Runner) ReviewView(taskName string) error

ReviewView prints the content of a task in review state.

func (*Runner) Run

func (r *Runner) Run(taskName string) error

Run executes the full task lifecycle: lock, branch, assemble, claude, test, lint, commit, push, record, move to review.

func (*Runner) RunGroup

func (r *Runner) RunGroup(groupName string) error

RunGroup executes all pending tasks in a group sequentially. Each task gets its own cloned work directory.

func (*Runner) Sync

func (r *Runner) Sync(labels []string) error

Sync imports open issues and cleans up completed tasks. It resolves the issue source from TaskRunner config, syncs issues into the design directory, then deletes remote branches and closes issues for completed/abandoned tasks.

func (*Runner) Test

func (r *Runner) Test(taskName string) error

Test runs a test-focused session on a task in review state. Claude adds missing tests, runs test/lint commands, and fixes any issues. The task stays in review state after the session.

func (*Runner) Verify

func (r *Runner) Verify() error

Verify uses Claude to verify that all items in functional.md are satisfied by the current codebase.

Jump to

Keyboard shortcuts

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