planning

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package planning handles technical plan creation and review workflows.

Index

Constants

View Source
const (
	StatusPending    = "pending"
	StatusInProgress = "in_progress"
	StatusComplete   = "complete"
	StatusBlocked    = "blocked"
)

StepStatus constants.

View Source
const (
	ReviewPending          = "pending"
	ReviewApproved         = "approved"
	ReviewChangesRequested = "changes_requested"
)

ReviewStatus constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Approval

type Approval struct {
	Reviewer   string
	ApprovedAt time.Time
}

Approval records a single reviewer's approval.

type Plan

type Plan struct {
	SpecID string
	Steps  []Step
	Review *ReviewState
}

Plan represents a technical build plan for a spec.

func FromMeta

func FromMeta(meta *markdown.SpecMeta) *Plan

FromMeta extracts a Plan from a spec's metadata.

func (*Plan) AddStep

func (p *Plan) AddStep(repo, description string)

AddStep appends a new step to the plan.

func (*Plan) AllComplete

func (p *Plan) AllComplete() bool

AllComplete returns true if all steps are complete.

func (*Plan) Approve

func (p *Plan) Approve(reviewer string, minApprovals int) error

Approve records an approval from a reviewer.

func (*Plan) BlockStep

func (p *Plan) BlockStep(index int, reason string) error

BlockStep marks a step as blocked with a reason.

func (*Plan) CompleteStep

func (p *Plan) CompleteStep(index int, prNumber int) error

CompleteStep marks a step as complete and sets its PR number.

func (*Plan) CurrentStep

func (p *Plan) CurrentStep() *Step

CurrentStep returns the first non-complete step, or nil if all done.

func (*Plan) HasSteps

func (p *Plan) HasSteps() bool

HasSteps returns true if the plan has any steps defined.

func (*Plan) IsReviewApproved

func (p *Plan) IsReviewApproved() bool

IsReviewApproved returns true if plan review is approved.

func (*Plan) IsReviewChangesRequested

func (p *Plan) IsReviewChangesRequested() bool

IsReviewChangesRequested returns true if reviewer requested changes.

func (*Plan) IsReviewPending

func (p *Plan) IsReviewPending() bool

IsReviewPending returns true if review is requested but not yet approved.

func (*Plan) NeedsReview

func (p *Plan) NeedsReview() bool

NeedsReview returns true if plan exists but has no review state.

func (*Plan) Progress

func (p *Plan) Progress() (int, int)

Progress returns (completed, total) step counts.

func (*Plan) ProgressString

func (p *Plan) ProgressString() string

ProgressString returns a progress string like "3/7 steps".

func (*Plan) RequestChanges

func (p *Plan) RequestChanges(reviewer string, feedback string) error

RequestChanges marks the review as needing changes.

func (*Plan) RequestReview

func (p *Plan) RequestReview(reviewers []string) error

RequestReview initializes the review state.

func (*Plan) StartStep

func (p *Plan) StartStep(index int, branch string) error

StartStep marks a step as in-progress and sets its branch.

func (*Plan) Summary

func (p *Plan) Summary() string

Summary returns a brief text summary of the plan.

func (*Plan) ToFrontmatter

func (p *Plan) ToFrontmatter() ([]markdown.BuildStep, *markdown.ReviewState)

ToFrontmatter converts a Plan back to frontmatter types.

func (*Plan) UnblockStep

func (p *Plan) UnblockStep(index int) error

UnblockStep removes the blocked status from a step.

func (*Plan) Validate

func (p *Plan) Validate() []string

Validate checks the plan for common issues.

type ReviewState

type ReviewState struct {
	RequestedAt time.Time
	Reviewers   []string
	Approvals   []Approval
	Status      string
	Feedback    string
}

ReviewState tracks plan review status.

type Step

type Step struct {
	Index         int
	Repo          string
	Description   string
	Branch        string
	PR            int // PR number, 0 if not yet created
	Status        string
	BlockedReason string
}

Step represents a single step in a build plan.

Jump to

Keyboard shortcuts

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