Documentation
¶
Index ¶
- func ClearAssigneeIfHumanReview(merged lib.TaskFrontmatter) string
- func ExtractBody(ctx context.Context, content []byte) (string, error)
- func ExtractFrontmatter(ctx context.Context, content []byte) (string, error)
- func FindTaskFilePath(ctx context.Context, gitClient gitclient.GitClient, taskDir string, ...) (string, lib.TaskFrontmatter, error)
- type ResultWriter
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 ¶
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 ¶
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 ¶
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.