result

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearAssigneeIfHumanReview

func ClearAssigneeIfHumanReview(merged lib.TaskFrontmatter) string

ClearAssigneeIfHumanReview enforces the spec-039 / spec-042 doctrine: when merged frontmatter has phase == "human_review", clear assignee via clearAssignee (which captures the prior assignee into previous_assignee if non-empty, then sets assignee to ""). Returns the prior assignee name (empty string when no clear happened OR when the prior assignee was already empty). This is the single chokepoint for the human_review assignee-clear invariant; both the result writer and the partial-update executor (spec 042) route through here.

func ExtractBody

func ExtractBody(ctx context.Context, content []byte) (string, error)

ExtractBody returns the file body — the bytes after the closing "---\n" delimiter. Returns an empty string if the body is empty; error if delimiters are missing.

func ExtractFrontmatter

func ExtractFrontmatter(ctx context.Context, content []byte) (string, error)

ExtractFrontmatter returns the YAML frontmatter string between the opening and closing "---" delimiters. Returns an error if delimiters are missing.

func FindTaskFilePath

func FindTaskFilePath(
	ctx context.Context,
	gitClient gitclient.GitClient,
	taskDir string,
	id lib.TaskIdentifier,
) (string, lib.TaskFrontmatter, error)

FindTaskFilePath lists files in taskDir via gitClient and returns the relative path of the .md file whose frontmatter has task_identifier == id, plus the parsed existing frontmatter. Returns ("", nil, nil) when no match is found (not an error).

Types

type ResultWriter

type ResultWriter interface {
	WriteResult(ctx context.Context, req lib.Task) error
}

ResultWriter writes a Task back to the vault task file.

func NewResultWriter

func NewResultWriter(
	gitClient gitclient.GitClient,
	taskDir string,
	currentDateTime libtime.CurrentDateTimeGetter,
	m metrics.Metrics,
) ResultWriter

NewResultWriter creates a ResultWriter that locates task files in the vault and writes the result, committing via gitClient.

Jump to

Keyboard shortcuts

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