acceptance

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package acceptance generates formal acceptance criteria for tasks using AI. Supported formats: Gherkin (Given/When/Then) and Checklist (numbered pass/fail items).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(workDir string, s *ProjectState, task *pm.Task, result *Result) (string, error)

Apply persists the acceptance criteria by:

  1. Adding an Annotation to the task in the plan (writes state to disk).
  2. Writing the criteria to .cloop/acceptance/<task-id>.md.

Returns the path of the written markdown file.

func BuildPrompt

func BuildPrompt(task *pm.Task, format Format, artifactOutput string) string

BuildPrompt constructs the AI prompt for acceptance criteria generation.

func ReadArtifactOutput

func ReadArtifactOutput(workDir string, task *pm.Task) string

ReadArtifactOutput is a convenience wrapper around artifact.ReadTaskOutput.

Types

type Format

type Format string

Format controls the output style of the generated acceptance criteria.

const (
	FormatGherkin   Format = "gherkin"
	FormatChecklist Format = "checklist"
)

type ProjectState

type ProjectState = state.ProjectState

ProjectState is an alias to avoid repeating the full package path in signatures.

type Result

type Result struct {
	TaskID    int
	TaskTitle string
	Format    Format
	Criteria  string
}

Result holds the generated acceptance criteria text and metadata.

func Generate

func Generate(ctx context.Context, prov provider.Provider, opts provider.Options, task *pm.Task, format Format, artifactOutput string) (*Result, error)

Generate calls the AI provider to produce acceptance criteria for the task.

Jump to

Keyboard shortcuts

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