changelog

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package changelog implements AI-generated CHANGELOG synthesis from task history. It reads the completed task list and step history from state, builds a prompt, calls the configured provider, and returns a human-readable CHANGELOG in markdown or JSON format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(s *state.ProjectState, sinceStep int, format string) string

BuildPrompt constructs the prompt sent to the AI provider. It injects:

  • the project goal and instructions
  • completed / skipped / failed tasks (filtered by sinceStep)
  • recent step output excerpts
  • milestone groupings if present

format is "markdown" or "json" — tells the AI which output format to use.

func FormatMarkdownFromJSON

func FormatMarkdownFromJSON(r *Result) string

FormatMarkdownFromJSON converts a parsed JSON Result into markdown CHANGELOG format.

func Generate

func Generate(ctx context.Context, p provider.Provider, prompt, model string, timeout time.Duration) (string, error)

Generate calls the provider with the prompt and returns the raw AI output.

func MilestoneTaskIDs

func MilestoneTaskIDs(milestones []*milestone.Milestone) map[string]map[int]bool

MilestoneTaskIDs builds a map from milestone name to its task ID set for quick lookup.

Types

type Entry

type Entry struct {
	// Version or milestone label (e.g. "v0.1", "Sprint 1", "Unreleased").
	Version string `json:"version"`
	// Date of the milestone / release, or zero value when unknown.
	Date time.Time `json:"date,omitempty"`
	// Brief section heading (e.g. "Added", "Fixed", "Changed").
	Section string `json:"section"`
	// Items is the list of bullet-point change descriptions.
	Items []string `json:"items"`
}

Entry is a single changelog item synthesized by the AI.

type Result

type Result struct {
	Goal    string   `json:"goal"`
	Entries []*Entry `json:"entries"`
	Summary string   `json:"summary"`
}

Result holds the full AI-synthesized changelog.

func ParseJSON

func ParseJSON(output string) (*Result, error)

ParseJSON parses the AI JSON response into a Result. It extracts the JSON object even when surrounded by markdown fences.

Jump to

Keyboard shortcuts

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