Documentation
¶
Overview ¶
Package pipeline provides the core pipeline engine for Simili-Bot. It defines the Step interface and Context structure used by all pipeline steps.
Package pipeline provides step registration and preset workflow building.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSkipPipeline = errors.New("skip remaining pipeline steps")
ErrSkipPipeline indicates that the pipeline should stop gracefully. This is not an error condition, just an early exit (e.g., cooldown, disabled repo).
var Presets = map[string][]string{
"issue-triage": {
"gatekeeper",
"vectordb_prep",
"similarity_search",
"transfer_check",
"triage",
"response_builder",
"action_executor",
"pending_action_scheduler",
"indexer",
},
"similarity-only": {
"gatekeeper",
"vectordb_prep",
"similarity_search",
"response_builder",
"action_executor",
"indexer",
},
"index-only": {
"gatekeeper",
"vectordb_prep",
"indexer",
},
}
Presets defines the built-in workflow presets.
Functions ¶
func ResolveSteps ¶
ResolveSteps determines the steps to use based on config. Priority: explicit steps > workflow preset > default
Types ¶
type Context ¶
type Context struct {
// Ctx is the Go context for cancellation and timeouts.
Ctx context.Context
// Issue is the issue being processed.
Issue *Issue
// Config is the loaded configuration.
Config *config.Config
// Result accumulates the processing results.
Result *Result
// SimilarIssues holds similar issues found by the similarity step.
SimilarIssues []SimilarIssue
// TransferTarget is the target repo if a transfer is determined.
TransferTarget string
// Metadata allows steps to pass arbitrary data to subsequent steps.
Metadata map[string]interface{}
}
Context carries data through the pipeline steps.
type Dependencies ¶
type Dependencies struct {
Embedder *gemini.Embedder
LLMClient *gemini.LLMClient
VectorStore qdrant.VectorStore
GitHub *github.Client
DryRun bool
}
Dependencies holds the dependencies that can be injected into steps.
func (*Dependencies) Close ¶
func (d *Dependencies) Close() error
Close releases any resources held by the dependencies. It is safe to call multiple times; subsequent calls will be no-ops once all underlying resources have been closed.
type Issue ¶
type Issue struct {
Org string
Repo string
Number int
Title string
Body string
State string // "open" or "closed"
Labels []string
Author string
URL string
}
Issue represents a GitHub issue being processed.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline executes a sequence of steps.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds registered step factories. Step factories create Step instances, allowing for dependency injection.
func (*Registry) BuildFromNames ¶
func (r *Registry) BuildFromNames(names []string, deps *Dependencies) (*Pipeline, error)
BuildFromNames creates a pipeline from a list of step names.
func (*Registry) Get ¶
func (r *Registry) Get(name string) (StepFactory, bool)
Get retrieves a step factory by name.
func (*Registry) Register ¶
func (r *Registry) Register(name string, factory StepFactory)
Register adds a step factory to the registry.
type Result ¶
type Result struct {
IssueNumber int
Skipped bool
SkipReason string
SimilarFound []SimilarIssue
TransferTarget string
Transferred bool
CommentPosted bool
Indexed bool
SuggestedLabels []string
LabelsApplied []string
Errors []error
}
Result holds the accumulated results from pipeline execution.
type SimilarIssue ¶
SimilarIssue represents an issue found to be similar.
type Step ¶
type Step interface {
// Name returns the unique identifier for this step.
Name() string
// Run executes the step's logic.
// It should return ErrSkipPipeline to stop the pipeline gracefully,
// or any other error to indicate failure.
Run(ctx *Context) error
}
Step defines the interface that all pipeline steps must implement.
type StepFactory ¶
type StepFactory func(deps *Dependencies) (Step, error)
StepFactory is a function that creates a Step. It receives dependencies (like clients, config) as parameters.