report

package
v0.55.0 Latest Latest
Warning

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

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

Documentation

Overview

Package report generates and parses completion reports from prompt execution.

Index

Constants

View Source
const (
	// MarkerStart is the opening delimiter for completion report blocks.
	MarkerStart = "<!-- DARK-FACTORY-REPORT"
	// MarkerEnd is the closing delimiter for completion report blocks.
	MarkerEnd = "DARK-FACTORY-REPORT -->"
)

Variables

This section is empty.

Functions

func ChangelogSuffix added in v0.52.3

func ChangelogSuffix() string

ChangelogSuffix returns instructions for the YOLO agent to write a descriptive changelog entry. It is appended to the prompt only when the project has a CHANGELOG.md.

func Suffix

func Suffix() string

Suffix returns the markdown text that dark-factory appends to every prompt. It instructs the AI agent to output a structured completion report.

func ValidationSuffix added in v0.52.3

func ValidationSuffix(cmd string) string

ValidationSuffix returns the markdown text injected when a project-level validation command is configured. It instructs the agent to treat the command's exit code as the authoritative success/failure signal, overriding any <verification> section in the prompt.

Types

type CompletionReport

type CompletionReport struct {
	Status       string        `json:"status"`                 // "success", "partial", "failed"
	Summary      string        `json:"summary"`                // one-line description of what was done
	Blockers     []string      `json:"blockers"`               // why it's not success (empty on success)
	Verification *Verification `json:"verification,omitempty"` // optional verification command result
}

CompletionReport is the structured output the AI agent must produce at the end of every prompt execution.

func ParseFromLog

func ParseFromLog(ctx context.Context, logFile string) (*CompletionReport, error)

ParseFromLog reads the last N bytes of a log file and extracts the CompletionReport. Returns nil if no report found (graceful — old prompts won't have one).

func (*CompletionReport) ValidateConsistency added in v0.52.3

func (r *CompletionReport) ValidateConsistency() (correctedStatus string, overridden bool)

ValidateConsistency checks if the reported status is consistent with verification results. Returns the corrected status and true if it was overridden.

type Verification added in v0.52.3

type Verification struct {
	Command  string `json:"command"`
	ExitCode int    `json:"exitCode"`
}

Verification records the result of a verification command.

Jump to

Keyboard shortcuts

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