plan

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package plan defines types for structured work plans.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbedMarker

func EmbedMarker(body, hash string) string

EmbedMarker appends an HTML-comment marker carrying the identity hash to body. If body already contains a ggvalet:plan-id marker, it is REPLACED (not duplicated). Format: "\n\n<!-- ggvalet:plan-id=<hash> -->\n"

func EpicIdentity

func EpicIdentity(e Epic) string

EpicIdentity returns a deterministic content hash for an epic. Inputs: title.

func ExtractMarker

func ExtractMarker(body string) (string, bool)

ExtractMarker returns the embedded plan-id hash from body, if present. Returns ("", false) if no marker found.

func IssueIdentity

func IssueIdentity(i Issue) string

IssueIdentity returns a deterministic content hash for an issue. Inputs: title, milestone (local plan ID), epic (local plan ID). Note: milestone+epic are PLAN-LOCAL IDs (e.g. "m-q4-2026-w7"), not remote IIDs. This is correct: the marker is computed from plan intent, not remote state.

func MilestoneIdentity

func MilestoneIdentity(m Milestone) string

MilestoneIdentity returns a deterministic content hash for a milestone. Inputs: title (load-bearing), due_date (load-bearing for time-series milestones). Returns lowercase hex sha256.

func Validate

func Validate(p *Plan) error

Types

type Epic

type Epic struct {
	ID          string   `yaml:"id"`
	Title       string   `yaml:"title"`
	Description string   `yaml:"description"`
	Labels      []string `yaml:"labels"`
	Children    []string `yaml:"children"`
	DependsOn   []string `yaml:"depends_on,omitempty"`
}

type Issue

type Issue struct {
	ID          string   `yaml:"id"`
	Title       string   `yaml:"title"`
	Description string   `yaml:"description"`
	Labels      []string `yaml:"labels"`
	Milestone   string   `yaml:"milestone"`
	Epic        string   `yaml:"epic"`
	Weight      int      `yaml:"weight,omitempty"`
	DependsOn   []string `yaml:"depends_on,omitempty"`
}

type Milestone

type Milestone struct {
	ID          string   `yaml:"id"`
	Title       string   `yaml:"title"`
	Description string   `yaml:"description"`
	StartDate   string   `yaml:"start_date,omitempty"`
	DueDate     string   `yaml:"due_date,omitempty"`
	State       string   `yaml:"state"`
	DependsOn   []string `yaml:"depends_on,omitempty"`
}

type Plan

type Plan struct {
	Version    string      `yaml:"version"`
	Target     Target      `yaml:"target"`
	Milestones []Milestone `yaml:"milestones"`
	Epics      []Epic      `yaml:"epics"`
	Issues     []Issue     `yaml:"issues"`
}

func Parse

func Parse(data []byte) (*Plan, error)

func ParseFile

func ParseFile(path string) (*Plan, error)

func ParseJSON

func ParseJSON(data []byte) (*Plan, error)

type Resource

type Resource struct {
	StepID, ID, Kind string
	DependsOn        []string
}

func OrderedResources

func OrderedResources(p *Plan) ([]Resource, error)

type Target

type Target struct {
	Provider  string `yaml:"provider"`
	GroupID   int    `yaml:"group_id"`
	ProjectID int    `yaml:"project_id,omitempty"`
}

Jump to

Keyboard shortcuts

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