Documentation
¶
Overview ¶
Package runner orchestrates the full hydra task lifecycle.
Index ¶
- type ClaudeFunc
- type ClaudeRunConfig
- type Runner
- func (r *Runner) Clean(taskName string) error
- func (r *Runner) Fix(autoConfirm bool) error
- func (r *Runner) GroupList() error
- func (r *Runner) GroupTasks(groupName string) error
- func (r *Runner) Merge(taskName string) error
- func (r *Runner) MergeEdit(taskName, editor string) error
- func (r *Runner) MergeGroup(groupName string) error
- func (r *Runner) MergeList() error
- func (r *Runner) MergeRemove(taskName string) error
- func (r *Runner) MergeView(taskName string) error
- func (r *Runner) Reconcile() error
- func (r *Runner) Review(taskName string) error
- func (r *Runner) ReviewDev(ctx context.Context, taskName string) error
- func (r *Runner) ReviewDiff(taskName string) error
- func (r *Runner) ReviewEdit(taskName, editor string) error
- func (r *Runner) ReviewList() error
- func (r *Runner) ReviewRemove(taskName string) error
- func (r *Runner) ReviewView(taskName string) error
- func (r *Runner) Run(taskName string) error
- func (r *Runner) RunGroup(groupName string) error
- func (r *Runner) Sync(labels []string) error
- func (r *Runner) Test(taskName string) error
- func (r *Runner) Verify() error
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 (*Runner) Clean ¶
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 ¶
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) GroupTasks ¶
GroupTasks prints all tasks in a group across all states.
func (*Runner) Merge ¶
Merge runs the merge workflow:
- Fetch origin, checkout task branch, abort any in-progress rebase
- Rebase task branch onto origin/main
- If conflicts, invoke Claude to resolve them
- Force-push the branch
- Checkout main, rebase against origin/main, rebase against feature branch, push
Accepts tasks in review or merge state (merge state for retries).
func (*Runner) MergeGroup ¶
MergeGroup merges all review/merge tasks in a group sequentially.
func (*Runner) MergeRemove ¶
MergeRemove moves a task from merge to abandoned.
func (*Runner) Reconcile ¶
Reconcile reads all completed tasks, uses Claude to merge their requirements into functional.md, then deletes the completed task files.
func (*Runner) Review ¶
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 ¶
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 ¶
ReviewDiff fetches the latest remote and shows the git diff between origin/main and the task's branch.
func (*Runner) ReviewEdit ¶
ReviewEdit opens a task in review state in the editor.
func (*Runner) ReviewList ¶
ReviewList prints tasks in review state.
func (*Runner) ReviewRemove ¶
ReviewRemove moves a task from review to abandoned.
func (*Runner) ReviewView ¶
ReviewView prints the content of a task in review state.
func (*Runner) Run ¶
Run executes the full task lifecycle: lock, branch, assemble, claude, test, lint, commit, push, record, move to review.
func (*Runner) RunGroup ¶
RunGroup executes all pending tasks in a group sequentially. Each task gets its own cloned work directory.
func (*Runner) Sync ¶
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.