pack

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package pack manages reusable expert groupings for council reviews.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builtins

func Builtins() map[string]*Pack

Builtins returns the built-in packs, lazily loaded from embedded YAML.

func Delete

func Delete(name string) error

Delete removes a custom pack file.

func Save

func Save(p *Pack) error

Save writes a pack to .council/packs/<name>.yaml.

Types

type ListResult

type ListResult struct {
	Packs    []*Pack
	Warnings []string
}

ListResult contains the result of listing packs, including any warnings.

func ListWithWarnings

func ListWithWarnings() (*ListResult, error)

ListWithWarnings returns all custom packs with any warnings about files that couldn't be loaded.

type Member

type Member struct {
	ID       string `yaml:"id" json:"id"`
	Blocking bool   `yaml:"blocking,omitempty" json:"blocking,omitempty"`
}

Member represents an expert in a pack with their blocking status.

type Pack

type Pack struct {
	Name        string   `yaml:"name" json:"name"`
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Members     []Member `yaml:"members" json:"members"`
	Source      string   `yaml:"-" json:"source,omitempty"` // "builtin" or ""
}

Pack represents a reusable group of experts.

func Get

func Get(name string) (*Pack, error)

Get returns a pack by name, checking custom packs first, then builtins.

func List

func List() ([]*Pack, error)

List returns all custom packs from .council/packs/.

func ListAll

func ListAll() ([]*Pack, error)

ListAll returns all packs: built-in merged with custom, sorted by name. Custom packs override built-in packs with the same name.

func Load

func Load(name string) (*Pack, error)

Load reads a custom pack from .council/packs/<name>.yaml.

func Parse

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

Parse parses a pack from YAML bytes.

func (*Pack) AddMember

func (p *Pack) AddMember(id string, blocking bool) error

AddMember adds an expert to the pack. Returns an error if already present.

func (*Pack) HasMember

func (p *Pack) HasMember(id string) bool

HasMember checks if an expert ID is already in the pack.

func (*Pack) RemoveMember

func (p *Pack) RemoveMember(id string) error

RemoveMember removes an expert from the pack. Returns an error if not found.

func (*Pack) Validate

func (p *Pack) Validate() error

Validate checks that a pack has required fields.

type ResolvedMember

type ResolvedMember struct {
	Expert   *expert.Expert
	Blocking bool
}

ResolvedMember pairs an expert with their blocking status in a pack.

func Resolve

func Resolve(p *Pack, available []*expert.Expert) ([]ResolvedMember, []string)

Resolve matches pack members to available experts and enforces priority: always. Returns resolved members and warnings for any member IDs not found in available experts.

Jump to

Keyboard shortcuts

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