config

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: 6 Imported by: 0

Documentation

Overview

Package config handles loading and resolution of team and user configuration.

Package config handles loading and resolution of team and user configuration.

Index

Constants

View Source
const (
	MultiplexerTmux    = "tmux"
	MultiplexerZellij  = "zellij"
	MultiplexerWezterm = "wezterm"
	MultiplexerIterm2  = "iterm2"
	MultiplexerNone    = "none"
)

Multiplexer constants.

Variables

This section is empty.

Functions

func ArchiveDir

func ArchiveDir(tc *TeamConfig) string

ArchiveDir returns the configured archive directory.

func FindTeamConfigPath

func FindTeamConfigPath(startDir string) (string, error)

FindTeamConfigPath searches for spec.config.yaml starting from dir, then up.

func IsValidMultiplexer

func IsValidMultiplexer(m string) bool

IsValidMultiplexer checks if a multiplexer string is valid.

func IsValidRole

func IsValidRole(role string) bool

IsValidRole checks if a role string is valid.

func UserConfigDir

func UserConfigDir() string

UserConfigDir returns the path to the ~/.spec/ directory.

func UserConfigPath

func UserConfigPath() string

UserConfigPath returns the path to ~/.spec/config.yaml.

func ValidMultiplexers

func ValidMultiplexers() []string

ValidMultiplexers returns the valid multiplexer values.

func ValidRoles

func ValidRoles() []string

ValidRoles returns the valid owner roles.

func WriteUserConfig

func WriteUserConfig(path string, cfg *UserConfig) error

WriteUserConfig writes a user config to disk.

Types

type AutoAdvanceConfig

type AutoAdvanceConfig struct {
	// Enabled allows explicitly disabling auto-advance even if When is set.
	Enabled *bool `yaml:"enabled,omitempty"`

	// When is an expression that triggers auto-advance when true.
	// Example: "prs.all_approved and prs.threads_resolved"
	When string `yaml:"when,omitempty"`

	// Notify lists targets to notify on auto-advance.
	// Example: ["author", "next_owner"]
	Notify []string `yaml:"notify,omitempty"`

	// QuietHours prevents auto-advance during specified hours.
	// Format: "HH:MM-HH:MM" in local timezone.
	// Example: "22:00-08:00"
	QuietHours string `yaml:"quiet_hours,omitempty"`

	// RequireApproval requires a specific role to have approved (e.g., "tl").
	RequireApproval string `yaml:"require_approval,omitempty"`

	// ExcludeLabels prevents auto-advance for specs with these labels.
	ExcludeLabels []string `yaml:"exclude_labels,omitempty"`
}

AutoAdvanceConfig configures automatic stage advancement.

func (*AutoAdvanceConfig) IsEnabled

func (a *AutoAdvanceConfig) IsEnabled() bool

IsEnabled returns whether auto-advance is enabled. Defaults to true if When is set and Enabled is not explicitly false.

type DashboardConfig

type DashboardConfig struct {
	StaleThreshold string `yaml:"stale_threshold"`
	RefreshTTL     int    `yaml:"refresh_ttl"`
}

DashboardConfig defines dashboard behaviour.

type DeployConfig

type DeployConfig struct {
	Provider     string        `yaml:"provider"`
	Environments []Environment `yaml:"environments"`
}

DeployConfig holds deployment provider and environments.

type EffectConfig

type EffectConfig struct {
	// Notify sends a notification. Can be a string (target) or NotifyEffect.
	Notify *NotifyEffect `yaml:"notify,omitempty"`

	// Sync triggers document sync ("outbound" or "inbound").
	Sync string `yaml:"sync,omitempty"`

	// UpdatePM updates the PM tool (Jira, Linear, etc.).
	UpdatePM *UpdatePMEffect `yaml:"update_pm,omitempty"`

	// LogDecision adds an entry to the decision log.
	LogDecision string `yaml:"log_decision,omitempty"`

	// Increment increments a frontmatter counter (e.g., "revert_count").
	Increment string `yaml:"increment,omitempty"`

	// Webhook calls an external URL.
	Webhook *WebhookEffect `yaml:"webhook,omitempty"`

	// Archive moves the spec to archive/.
	Archive bool `yaml:"archive,omitempty"`

	// Trigger invokes a named workflow or action.
	Trigger string `yaml:"trigger,omitempty"`

	// When is an expression that must be true for this effect to run.
	When string `yaml:"when,omitempty"`
}

EffectConfig defines a side effect for stage transitions.

type Environment

type Environment struct {
	Name string `yaml:"name"`
	Auto bool   `yaml:"auto"`
	Gate string `yaml:"gate,omitempty"`
}

Environment defines a deployment target.

type FastTrackConfig

type FastTrackConfig struct {
	// Enabled allows fast-track bug fixes. Defaults to false.
	Enabled bool `yaml:"enabled,omitempty"`

	// AllowedRoles lists roles that can create fast-track specs.
	// Defaults to ["engineer", "tl"].
	AllowedRoles []string `yaml:"allowed_roles,omitempty"`

	// MaxDuration is the maximum time before escalation (e.g., "2d", "48h").
	// If exceeded, notifies TL and/or PM.
	MaxDuration string `yaml:"max_duration,omitempty"`

	// RequireLabels requires fast-track specs to have specific labels (e.g., ["bug", "hotfix"]).
	RequireLabels []string `yaml:"require_labels,omitempty"`

	// PipelineVariant is the pipeline variant to use for fast-track specs.
	// If empty, uses a minimal default: build → pr-review → done.
	PipelineVariant string `yaml:"pipeline_variant,omitempty"`

	// ExcludedStages lists stages to skip in fast-track (if not using a variant).
	ExcludedStages []string `yaml:"excluded_stages,omitempty"`
}

FastTrackConfig configures the `spec fix` fast-track workflow.

func (*FastTrackConfig) GetAllowedRoles

func (f *FastTrackConfig) GetAllowedRoles() []string

GetAllowedRoles returns allowed roles or default ["engineer", "tl"].

func (*FastTrackConfig) IsEnabled

func (f *FastTrackConfig) IsEnabled() bool

IsEnabled returns whether fast-track is enabled.

func (*FastTrackConfig) IsRoleAllowed

func (f *FastTrackConfig) IsRoleAllowed(role string) bool

IsRoleAllowed checks if a role can create fast-track specs.

type GateConfig

type GateConfig struct {
	// Simple gate types (mutually exclusive with Expr)
	SectionNotEmpty string          `yaml:"section_not_empty,omitempty"`
	SectionComplete string          `yaml:"section_complete,omitempty"` // Deprecated: use SectionNotEmpty
	PRStackExists   *bool           `yaml:"pr_stack_exists,omitempty"`  // Deprecated: use StepsExists
	StepsExists     *bool           `yaml:"steps_exists,omitempty"`     // Build plan has at least one step
	PRsApproved     *bool           `yaml:"prs_approved,omitempty"`
	ReviewApproved  *bool           `yaml:"review_approved,omitempty"` // Technical plan review is approved
	Duration        string          `yaml:"duration,omitempty"`
	LinkExists      *LinkExistsGate `yaml:"link_exists,omitempty"`

	// Expression gate
	Expr    string `yaml:"expr,omitempty"`
	Message string `yaml:"message,omitempty"`

	// Logical operators (contain nested gates)
	All []GateConfig `yaml:"all,omitempty"`
	Any []GateConfig `yaml:"any,omitempty"`
	Not *GateConfig  `yaml:"not,omitempty"`
}

GateConfig defines a gate condition for stage advancement.

func NewExprGate

func NewExprGate(expr, message string) GateConfig

NewExprGate creates an expression gate with a custom message.

func NewSimpleGate

func NewSimpleGate(gateType, value string) GateConfig

NewSimpleGate creates a simple gate config for common gate types.

func (GateConfig) GetSectionNotEmpty

func (g GateConfig) GetSectionNotEmpty() string

GetSectionNotEmpty returns the section slug for section_not_empty or section_complete gates.

func (GateConfig) HasReviewApproved

func (g GateConfig) HasReviewApproved() bool

HasReviewApproved returns true if ReviewApproved gate is set.

func (GateConfig) HasStepsExists

func (g GateConfig) HasStepsExists() bool

HasStepsExists returns true if either StepsExists or legacy PRStackExists is set.

func (GateConfig) IsSimple

func (g GateConfig) IsSimple() bool

IsSimple returns true if this is a simple (non-logical) gate.

func (GateConfig) Type

func (g GateConfig) Type() string

Type returns the gate type as a string for display.

func (GateConfig) Value

func (g GateConfig) Value() string

Value returns the gate's primary value as a string for display.

type IntakeConfig

type IntakeConfig struct {
	Sources []IntakeSource `yaml:"sources"`
}

IntakeConfig holds intake source definitions.

type IntakeSource

type IntakeSource struct {
	Provider   string `yaml:"provider"`
	AutoCreate bool   `yaml:"auto_create"`
	Filter     string `yaml:"filter,omitempty"`
	Channel    string `yaml:"channel,omitempty"`
	Trigger    string `yaml:"trigger,omitempty"`
	Token      string `yaml:"token,omitempty"`
}

IntakeSource defines an external intake source.

type IntegrationsConfig

type IntegrationsConfig struct {
	Comms  ProviderConfig `yaml:"comms"`
	PM     ProviderConfig `yaml:"pm"`
	Docs   ProviderConfig `yaml:"docs"`
	Repo   ProviderConfig `yaml:"repo"`
	Agent  ProviderConfig `yaml:"agent"`
	AI     ProviderConfig `yaml:"ai"`
	Design ProviderConfig `yaml:"design"`
	Deploy DeployConfig   `yaml:"deploy"`
	Intake IntakeConfig   `yaml:"intake"`
}

IntegrationsConfig holds all integration provider configs.

type LabelVariantMapping

type LabelVariantMapping struct {
	// Label is the spec label to match.
	Label string `yaml:"label,omitempty"`

	// Variant is the variant name to use when the label matches.
	Variant string `yaml:"variant"`

	// Default marks this as the default variant when no labels match.
	Default bool `yaml:"default,omitempty"`
}

LabelVariantMapping maps a spec label to a pipeline variant.

type LinkExistsGate

type LinkExistsGate struct {
	Section string `yaml:"section"`
	Type    string `yaml:"type,omitempty"` // e.g., "figma", "github"
}

LinkExistsGate checks for a link in a specific section.

func (*LinkExistsGate) UnmarshalYAML added in v0.4.1

func (g *LinkExistsGate) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML supports both string and object formats:

link_exists: pr                     # simple string
link_exists: { section: pr }        # object form
link_exists: { section: pr, type: github }

type NotifyEffect

type NotifyEffect struct {
	// Target is who to notify (e.g., "next_owner", "tl", "#channel", "@user").
	Target string `yaml:"target,omitempty"`

	// Targets allows multiple notification targets.
	Targets []string `yaml:"targets,omitempty"`

	// Channel overrides the default channel.
	Channel string `yaml:"channel,omitempty"`

	// Template is the notification template name.
	Template string `yaml:"template,omitempty"`
}

NotifyEffect configures a notification.

func (*NotifyEffect) UnmarshalYAML

func (n *NotifyEffect) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML allows notify to be a string or object.

type Owners

type Owners []string

Owners represents one or more owner roles for a pipeline stage. In YAML, it can be specified as a single string or an array:

owner: pm           # single owner
owner: [pm, tl]     # multiple owners

func (Owners) Contains

func (o Owners) Contains(role string) bool

Contains returns true if role is one of the owners.

func (Owners) IsEmpty

func (o Owners) IsEmpty() bool

IsEmpty returns true if no owners are defined.

func (Owners) String

func (o Owners) String() string

String returns owners as a comma-separated string for display.

func (*Owners) UnmarshalYAML

func (o *Owners) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML allows owner to be a string or array in YAML.

type PassiveAwarenessConfig

type PassiveAwarenessConfig struct {
	// Show whitelists item types to display. If empty, shows all.
	// Valid types: review_requests, spec_owned, mentions, triage, fyi, blocked
	Show []string `yaml:"show,omitempty"`

	// Hide blacklists item types to suppress.
	Hide []string `yaml:"hide,omitempty"`

	// DuringBuild shows awareness during `spec do` and `spec build`.
	// Defaults to false to avoid interrupting flow state.
	DuringBuild bool `yaml:"during_build,omitempty"`

	// DismissDuration is how long dismissed items stay hidden.
	// Defaults to "2h". Valid formats: "30m", "2h", "1d".
	DismissDuration string `yaml:"dismiss_duration,omitempty"`
}

PassiveAwarenessConfig controls what pending items are shown in the awareness line on every spec command.

type PipelineConfig

type PipelineConfig struct {
	// Preset is the name of a built-in pipeline preset (e.g., "minimal", "product").
	// If set, the preset's stages are used as the base configuration.
	Preset string `yaml:"preset,omitempty"`

	// Skip lists stage names to remove from the preset.
	// Only meaningful when Preset is set.
	Skip []string `yaml:"skip,omitempty"`

	// Stages defines the pipeline stages. When Preset is set, these override
	// or extend the preset's stages. When Preset is empty, these are the
	// complete stage definitions.
	Stages []StageConfig `yaml:"stages,omitempty"`

	// Variants defines alternative pipelines for different work types.
	Variants map[string]VariantConfig `yaml:"variants,omitempty"`

	// Default is the default variant name when multiple variants exist.
	Default string `yaml:"default,omitempty"`

	// VariantFromLabels maps spec labels to variant names for auto-selection.
	VariantFromLabels []LabelVariantMapping `yaml:"variant_from_labels,omitempty"`
}

PipelineConfig defines the configurable pipeline stages.

func DefaultPipeline

func DefaultPipeline() PipelineConfig

DefaultPipeline returns the default pipeline configuration when none is specified. This is the "product" preset - a full lifecycle pipeline.

func EffectivePipeline

func EffectivePipeline(tc *TeamConfig) PipelineConfig

EffectivePipeline returns the pipeline from team config, or default if empty.

func (PipelineConfig) IsValidReversion

func (p PipelineConfig) IsValidReversion(from, to string) bool

IsValidReversion returns true if reverting from `from` to `to` is valid (i.e., `to` comes before `from` in the pipeline).

func (PipelineConfig) IsValidTransition

func (p PipelineConfig) IsValidTransition(from, to string) bool

IsValidTransition returns true if transitioning from `from` to `to` is valid (i.e., `to` comes after `from` in the pipeline).

func (PipelineConfig) NextStage

func (p PipelineConfig) NextStage(current string) (string, bool)

NextStage returns the next stage after the given one.

func (PipelineConfig) RequiredStages

func (p PipelineConfig) RequiredStages() []StageConfig

RequiredStages returns non-optional stages.

func (PipelineConfig) StageByName

func (p PipelineConfig) StageByName(name string) *StageConfig

StageByName returns the stage config with the given name, or nil.

func (PipelineConfig) StageIndex

func (p PipelineConfig) StageIndex(name string) int

StageIndex returns the index of the stage with the given name, or -1.

func (PipelineConfig) StageNames

func (p PipelineConfig) StageNames() []string

StageNames returns the names of all stages in order.

type PreferencesConfig

type PreferencesConfig struct {
	Editor            string   `yaml:"editor"`
	DashboardSections []string `yaml:"dashboard_sections"`
	StandupAutoPost   bool     `yaml:"standup_auto_post"`
	AIDrafts          *bool    `yaml:"ai_drafts,omitempty"`

	// Theme sets the TUI colour theme.
	// Valid values: auto (default), catppuccin-mocha, catppuccin-latte,
	// catppuccin-macchiato, catppuccin-frappe, gruvbox-dark, dracula,
	// tokyo-night, nord, solarized-dark, solarized-light, rose-pine.
	Theme string `yaml:"theme,omitempty"`

	// RefreshInterval sets the TUI auto-refresh period (e.g. "30s", "1m").
	// Defaults to 30s.
	RefreshInterval string `yaml:"refresh_interval,omitempty"`

	// Mouse enables mouse support in the TUI (click tabs, click items).
	// Defaults to false.
	Mouse bool `yaml:"mouse,omitempty"`

	// Multiplexer specifies the terminal multiplexer for cross-repo navigation.
	// Valid values: tmux, zellij, wezterm, iterm2, none
	// If empty or "none", falls back to manual navigation prompts.
	Multiplexer string `yaml:"multiplexer,omitempty"`

	// AutoPull automatically pulls stale specs when running `spec do`.
	// If false, prompts the user before pulling.
	AutoPull bool `yaml:"auto_pull,omitempty"`

	// AutoNavigate opens a new terminal pane when switching repos.
	// Defaults to true. Set to false for manual navigation.
	AutoNavigate *bool `yaml:"auto_navigate,omitempty"`

	// PassiveAwareness configures the passive awareness line shown on commands.
	PassiveAwareness *PassiveAwarenessConfig `yaml:"passive_awareness,omitempty"`
}

PreferencesConfig holds personal preferences.

func (PreferencesConfig) AIDraftsEnabled

func (p PreferencesConfig) AIDraftsEnabled() bool

AIDraftsEnabled returns whether AI drafts are enabled. Defaults to true if not explicitly set.

func (PreferencesConfig) AutoNavigateEnabled

func (p PreferencesConfig) AutoNavigateEnabled() bool

AutoNavigateEnabled returns whether auto-navigation to new repos is enabled. Defaults to true if not explicitly set.

func (PreferencesConfig) GetDismissDuration

func (p PreferencesConfig) GetDismissDuration() string

GetDismissDuration returns the dismiss duration or the default "2h".

func (PreferencesConfig) ShowPassiveAwarenessDuringBuild

func (p PreferencesConfig) ShowPassiveAwarenessDuringBuild() bool

ShowPassiveAwarenessDuringBuild returns whether to show awareness during builds.

type ProviderConfig

type ProviderConfig struct {
	Provider string            `yaml:"provider"`
	Extra    map[string]string `yaml:"-"`
	// contains filtered or unexported fields
}

ProviderConfig is a generic integration config with a provider name and extra fields.

func (ProviderConfig) Get

func (p ProviderConfig) Get(key string) string

Get returns an extra config value by key.

func (*ProviderConfig) UnmarshalYAML

func (p *ProviderConfig) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML captures all keys into raw and extracts provider + extras.

type ResolvedConfig

type ResolvedConfig struct {
	Team *TeamConfig
	User *UserConfig

	// TeamConfigPath is the path to the team config file, if found.
	TeamConfigPath string
	// UserConfigPath is the path to the user config file.
	UserConfigPath string

	// SpecsRepoDir is the local path to the specs/ sub-directory within
	// the specs repo clone. All spec, triage, and archive content lives here.
	SpecsRepoDir string
}

ResolvedConfig holds the fully resolved team + user configuration.

func MustResolve

func MustResolve() *ResolvedConfig

MustResolve loads configuration and returns it, panicking on error. Use only in places where config is absolutely required.

func Resolve

func Resolve() (*ResolvedConfig, error)

Resolve loads the full configuration from all sources. Resolution chain: cwd → repo root → specs repo clone → user config.

func (*ResolvedConfig) AIDraftsEnabled

func (r *ResolvedConfig) AIDraftsEnabled() bool

AIDraftsEnabled returns whether AI drafting is enabled for the user.

func (*ResolvedConfig) CycleLabel

func (r *ResolvedConfig) CycleLabel() string

CycleLabel returns the current cycle label.

func (*ResolvedConfig) HasIntegration

func (r *ResolvedConfig) HasIntegration(category string) bool

HasIntegration checks if a specific integration category has a non-empty provider.

func (*ResolvedConfig) OwnerRole

func (r *ResolvedConfig) OwnerRole(override string) string

OwnerRole returns the user's owner role, with optional override.

func (*ResolvedConfig) Pipeline

func (r *ResolvedConfig) Pipeline() PipelineConfig

Pipeline returns the effective pipeline config.

func (*ResolvedConfig) TeamName

func (r *ResolvedConfig) TeamName() string

TeamName returns the team name.

func (*ResolvedConfig) UserHandle

func (r *ResolvedConfig) UserHandle() string

UserHandle returns the configured user handle.

func (*ResolvedConfig) UserName

func (r *ResolvedConfig) UserName() string

UserName returns the configured user name.

type SpecsRepoConfig

type SpecsRepoConfig struct {
	Provider string `yaml:"provider"`
	Owner    string `yaml:"owner"`
	Repo     string `yaml:"repo"`
	Branch   string `yaml:"branch"`
	Token    string `yaml:"token"`
}

SpecsRepoConfig defines the specs repository location.

type StageConfig

type StageConfig struct {
	// Name is the stage identifier (lowercase, underscores allowed).
	Name string `yaml:"name"`

	// Owner is the role(s) that own this stage. Can be a single role
	// or an array of roles in YAML.
	Owner Owners `yaml:"owner,omitempty"`

	// OwnerRole is the legacy field for backward compatibility.
	//
	// Deprecated: Use Owner instead.
	OwnerRole string `yaml:"owner_role,omitempty"`

	// Icon is an emoji displayed in pipeline views.
	Icon string `yaml:"icon,omitempty"`

	// Optional marks the stage as skippable in the pipeline flow.
	Optional bool `yaml:"optional,omitempty"`

	// SkipWhen is an expression that, when true, causes the stage to be
	// automatically skipped during advancement.
	SkipWhen string `yaml:"skip_when,omitempty"`

	// Gates are conditions that must be satisfied to advance from this stage.
	Gates []GateConfig `yaml:"gates,omitempty"`

	// Warnings are time-based alerts that don't block advancement.
	Warnings []WarningConfig `yaml:"warnings,omitempty"`

	// Transitions customizes advance and revert behavior.
	Transitions TransitionsConfig `yaml:"transitions,omitempty"`

	// OnEnter lists effects to execute when entering this stage.
	OnEnter []EffectConfig `yaml:"on_enter,omitempty"`

	// OnExit lists effects to execute when leaving this stage.
	OnExit []EffectConfig `yaml:"on_exit,omitempty"`

	// AutoArchive moves the spec to archive/ when entering this stage.
	AutoArchive bool `yaml:"auto_archive,omitempty"`

	// Review configures plan review requirements for this stage.
	// Used primarily for the engineering stage to require technical plan approval.
	Review *StageReviewConfig `yaml:"review,omitempty"`

	// AutoAdvance configures automatic stage advancement when gates are satisfied.
	AutoAdvance *AutoAdvanceConfig `yaml:"auto_advance,omitempty"`
}

StageConfig defines a single pipeline stage.

func (StageConfig) GetOwner

func (s StageConfig) GetOwner() string

GetOwner returns the effective owner as a display string. For multiple owners, returns comma-separated list. Falls back to legacy OwnerRole if Owner is not set.

func (StageConfig) HasOwner

func (s StageConfig) HasOwner(role string) bool

HasOwner returns true if role is an owner of this stage. Also returns true if no owners are defined (open stage) or if role is empty.

type StageReviewConfig

type StageReviewConfig struct {
	// Required indicates whether review is required to advance.
	// Defaults to true when Review is present.
	Required *bool `yaml:"required,omitempty"`

	// Reviewers lists who can review (roles like "tl" or named users like "@mike").
	// Special value "author" allows self-review.
	Reviewers []string `yaml:"reviewers,omitempty"`

	// MinApprovals is the minimum number of approvals required.
	// Defaults to 1.
	MinApprovals int `yaml:"min_approvals,omitempty"`
}

StageReviewConfig configures plan review requirements.

func (*StageReviewConfig) GetMinApprovals

func (r *StageReviewConfig) GetMinApprovals() int

GetMinApprovals returns the minimum approvals or default of 1.

func (*StageReviewConfig) IsRequired

func (r *StageReviewConfig) IsRequired() bool

IsRequired returns whether review is required. Defaults to true if not explicitly set.

type SyncConfig

type SyncConfig struct {
	OutboundOnAdvance bool   `yaml:"outbound_on_advance"`
	ConflictStrategy  string `yaml:"conflict_strategy"`
}

SyncConfig defines sync behaviour.

type TeamConfig

type TeamConfig struct {
	Version string `yaml:"version"`

	Team struct {
		Name       string `yaml:"name"`
		CycleLabel string `yaml:"cycle_label"`
	} `yaml:"team"`

	SpecsRepo SpecsRepoConfig `yaml:"specs_repo"`

	Integrations IntegrationsConfig `yaml:"integrations"`

	Sync SyncConfig `yaml:"sync"`

	Archive struct {
		Directory string `yaml:"directory"`
	} `yaml:"archive"`

	Dashboard DashboardConfig `yaml:"dashboard"`

	Pipeline PipelineConfig `yaml:"pipeline"`

	// FastTrack configures engineer self-service for small bug fixes.
	FastTrack *FastTrackConfig `yaml:"fast_track,omitempty"`
}

TeamConfig represents the spec.config.yaml file committed to the specs repo.

func LoadTeamConfig

func LoadTeamConfig(path string) (*TeamConfig, error)

LoadTeamConfig reads and parses a spec.config.yaml file.

type TransitionConfig

type TransitionConfig struct {
	// To lists allowed target stages. Empty means default (next for advance,
	// any previous for revert).
	To []string `yaml:"to,omitempty"`

	// Gates are additional conditions for this specific transition.
	Gates []GateConfig `yaml:"gates,omitempty"`

	// Require lists required fields (e.g., ["reason"] for reverts).
	Require []string `yaml:"require,omitempty"`

	// Effects are side effects to execute on transition.
	Effects []EffectConfig `yaml:"effects,omitempty"`
}

TransitionConfig defines behavior for a specific transition type.

type TransitionsConfig

type TransitionsConfig struct {
	Advance TransitionConfig `yaml:"advance,omitempty"`
	Revert  TransitionConfig `yaml:"revert,omitempty"`
}

TransitionsConfig customizes stage transition behavior.

type UpdatePMEffect

type UpdatePMEffect struct {
	Status string `yaml:"status,omitempty"`
}

UpdatePMEffect configures PM tool updates.

type UserConfig

type UserConfig struct {
	User struct {
		OwnerRole string `yaml:"owner_role"`
		Name      string `yaml:"name"`
		Handle    string `yaml:"handle"`
	} `yaml:"user"`

	Preferences PreferencesConfig `yaml:"preferences"`

	// Workspaces maps repo names to local filesystem paths.
	// Used for cross-repo navigation in multi-repo build plans.
	// Example: workspaces: { auth-service: ~/code/auth-service }
	Workspaces map[string]string `yaml:"workspaces,omitempty"`
}

UserConfig represents the ~/.spec/config.yaml personal config file.

func LoadUserConfig

func LoadUserConfig(path string) (*UserConfig, error)

LoadUserConfig reads and parses the user config file.

func LoadUserConfigWithDefaults

func LoadUserConfigWithDefaults() (*UserConfig, string)

LoadUserConfigWithDefaults loads user config or returns defaults if file doesn't exist.

func (*UserConfig) GetWorkspacePath

func (c *UserConfig) GetWorkspacePath(repoName string) string

GetWorkspacePath returns the local path for a repo, or empty string if not configured.

type VariantConfig

type VariantConfig struct {
	// Preset is the base preset for this variant.
	Preset string `yaml:"preset,omitempty"`

	// Skip lists stages to remove from the preset.
	Skip []string `yaml:"skip,omitempty"`

	// Stages defines or overrides stages for this variant.
	Stages []StageConfig `yaml:"stages,omitempty"`
}

VariantConfig defines a pipeline variant for different work types.

type WarningConfig

type WarningConfig struct {
	// After is the duration after which the warning triggers (e.g., "5d", "48h").
	After string `yaml:"after"`

	// Message is displayed when the warning is active.
	Message string `yaml:"message"`

	// Notify is the target to notify (e.g., "tl", "#channel").
	Notify string `yaml:"notify,omitempty"`
}

WarningConfig defines a time-based warning for a stage.

type WebhookEffect

type WebhookEffect struct {
	URL     string            `yaml:"url"`
	Method  string            `yaml:"method,omitempty"` // default: POST
	Headers map[string]string `yaml:"headers,omitempty"`
	Body    map[string]string `yaml:"body,omitempty"`
	Timeout string            `yaml:"timeout,omitempty"` // default: 10s
}

WebhookEffect configures an external webhook call.

Jump to

Keyboard shortcuts

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