command

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: BSD-2-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const IncrementFrontmatterCommandOperation base.CommandOperation = task.IncrementFrontmatterCommandOperation

IncrementFrontmatterCommandOperation is the CQRS command operation name for atomic field increment.

View Source
const TaskResultCommandOperation base.CommandOperation = "update"

TaskResultCommandOperation is the CQRS command operation name for task result updates.

View Source
const UpdateFrontmatterCommandOperation base.CommandOperation = task.UpdateFrontmatterCommandOperation

UpdateFrontmatterCommandOperation is the CQRS command operation name for partial frontmatter update.

Variables

This section is empty.

Functions

func NewCreateTaskExecutor

func NewCreateTaskExecutor(
	gitClient gitclient.GitClient,
	taskDir string,
	vaultName string,
	currentDateTime libtime.CurrentDateTimeGetter,
	k int,
) cdb.CommandObjectExecutorTx

NewCreateTaskExecutor creates a cdb.CommandObjectExecutorTx that materializes a new vault task file for the given task_identifier. If cmd.Title passes validation the file is written at tasks/{title}.md; otherwise it falls back to tasks/{task_identifier}.md. If a file already exists at the resolved path the command returns ErrTaskAlreadyExists (a benign Failure on the result topic — no overwrite, no git write). Frontmatter must include "assignee" and "status"; missing fields return a wrapped validation error. Commands whose effective target vault (cmd.TargetVault or the legacy fallback) does not match vaultName are skipped without side effects (no git write, no error, no result event).

func NewIncrementFrontmatterExecutor

func NewIncrementFrontmatterExecutor(
	gitClient gitclient.GitClient,
	taskDir string,
) cdb.CommandObjectExecutorTx

NewIncrementFrontmatterExecutor creates a cdb.CommandObjectExecutorTx that atomically reads the task file, increments the named frontmatter field by delta, and commits. If trigger_count reaches max_triggers the assignee is cleared and phase is preserved in the same write.

func NewTaskResultExecutor

func NewTaskResultExecutor(
	writer result.ResultWriter,
	retryGate PlanningRetryGate,
) cdb.CommandObjectExecutorTx

NewTaskResultExecutor creates a cdb.CommandObjectExecutorTx for update commands. Uses cdb.CommandObjectExecutorTxFunc adapter — same pattern as trading command handlers.

func NewUpdateFrontmatterExecutor

func NewUpdateFrontmatterExecutor(
	gitClient gitclient.GitClient,
	taskDir string,
) cdb.CommandObjectExecutorTx

NewUpdateFrontmatterExecutor creates a cdb.CommandObjectExecutorTx that atomically reads the task file, merges only the specified key-value pairs, and commits. All other frontmatter keys are left unchanged.

Types

type PlanningRetryGate

type PlanningRetryGate interface {
	Handle(ctx context.Context, req lib.Task) (handled bool, err error)
}

PlanningRetryGate decides whether a failed pr-review planning result should be retried controller-side. Handle inspects the incoming result and the on-disk task state and, when the retry gate matches, performs the retry write (counter bump + ## Progress append + phase reset + fresh task_identifier) and returns handled=true. When the gate does not match (non-pr-review, non-planning, success/skipped, no failure marker, or counter already at cap in this prompt), it returns handled=false and the caller falls through to the default WriteResult path.

func NewPlanningRetryGate

func NewPlanningRetryGate(
	gitClient gitclient.GitClient,
	taskDir string,
	currentDateTime libtime.CurrentDateTimeGetter,
	prCommenter prcomment.PRCommenter,
) PlanningRetryGate

NewPlanningRetryGate constructs the gate.

Jump to

Keyboard shortcuts

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