Documentation
¶
Overview ¶
Package pipeline implements the pipeline stage engine for task workflow orchestration.
Plane: shared
Index ¶
- type Config
- func (c *Config) HasReviewer(agentName string) bool
- func (c *Config) MatchPipeline(taskTags []string) (string, *Pipeline, error)
- func (c *Config) ReviewerForStage(taskTags []string, assigneeRole string) string
- func (c *Config) ReviewerNotifyTarget(agentName string) NotifyTarget
- func (c *Config) SortedNames() []string
- func (c *Config) Summary() string
- type NotifyTarget
- type Pipeline
- type Stage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config holds all pipeline definitions.
func Load ¶
Load reads pipelines.toml from the ttal config directory. Uses toml.DecodeFile (NOT toml.Unmarshal which does not exist in BurntSushi/toml v1.x). Uses os.IsNotExist for missing file check (same pattern as internal/config/config.go).
func (*Config) HasReviewer ¶ added in v1.8.0
HasReviewer returns true if agentName is configured as a reviewer in any pipeline stage.
func (*Config) MatchPipeline ¶
MatchPipeline returns the pipeline name and definition matching the given task tags. Returns ("", nil, nil) if no pipeline matches. Returns an error if multiple pipelines match (tag overlap).
func (*Config) ReviewerForStage ¶ added in v1.7.1
ReviewerForStage returns the Reviewer field of the first stage whose Assignee matches assigneeRole in the pipeline matching taskTags. Returns "" if no pipeline matches or no stage has the given assignee.
func (*Config) ReviewerNotifyTarget ¶ added in v1.7.1
func (c *Config) ReviewerNotifyTarget(agentName string) NotifyTarget
ReviewerNotifyTarget scans all pipelines to determine what notification target an agent maps to based on the stage type they review. Returns NotifyTargetCoder if the agent is a reviewer for a "coder" stage. Returns NotifyTargetDesigner if the agent is a reviewer for any other stage. Returns NotifyTargetNone if the agent is not a reviewer in any pipeline. If the agent reviews both coder and non-coder stages, NotifyTargetCoder wins.
func (*Config) SortedNames ¶ added in v1.9.0
SortedNames returns pipeline names in alphabetical order.
type NotifyTarget ¶ added in v1.7.1
type NotifyTarget int
NotifyTarget represents the notification counterpart for a reviewer agent.
const ( NotifyTargetNone NotifyTarget = iota NotifyTargetCoder // reviewer reviews coder stages → notify coder NotifyTargetDesigner // reviewer reviews non-coder stages → notify designer )
type Pipeline ¶
type Pipeline struct {
Description string `toml:"description"`
Tags []string `toml:"tags"` // task tags that select this pipeline
Stages []Stage `toml:"stages"`
}
Pipeline defines a named pipeline with tag filters and stages.
func (*Pipeline) CurrentStage ¶
CurrentStage determines which pipeline stage is currently active by looking for monotonic stage tags. Each stage adds +<stagename> on entry and +<stagename>_lgtm on reviewer approval. The active stage is the latest stage tag without a corresponding _lgtm tag.
taskTags is the list of tags on the task.
Returns (stageIndex, *Stage, nil) if a stage is found. Returns (-1, nil, nil) if no stage tag matches — task not started.
func (*Pipeline) StageIndexForRole ¶ added in v1.9.0
StageIndexForRole returns the highest stage index whose Assignee matches the given role. "Highest" is intentional: the guard fires only when all stages for this role are behind the task's current stage. Using the last match ensures a role that spans multiple stages is not rejected until the task has passed every stage it owns. Returns -1 if no stage matches.
type Stage ¶
type Stage struct {
Name string `toml:"name"`
Assignee string `toml:"assignee"` // role from roles.toml (e.g. "designer") or "coder" (special)
Gate string `toml:"gate"` // "human" or "auto"
Reviewer string `toml:"reviewer"` // reviewer agent name (e.g. "plan-review-lead"), optional
Skills []string `toml:"skills"` // skill names loaded via ttal skill get (optional)
}
Stage defines a single stage in a pipeline.
func (*Stage) StageLGTMTag ¶ added in v1.8.0
StageLGTMTag returns the lgtm tag for this stage (<stagename>_lgtm).