Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionResult ¶
type ActionResult struct {
Action string `json:"action"`
RepoOwner string `json:"repo_owner"`
RepoName string `json:"repo_name"`
EpicNumber int `json:"epic"`
ChildNumber int `json:"child"`
PRNumber int `json:"pr"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
Timestamp time.Time `json:"ts"`
Duration time.Duration `json:"duration_ms"`
Cycle int `json:"cycle"`
}
ActionResult carries the outcome of a handler execution.
type JobHandler ¶
type JobHandler interface {
Name() string
Match(signal *PipelineSignal) bool
Execute(ctx context.Context, signal *PipelineSignal) (*ActionResult, error)
}
JobHandler processes a single pipeline signal.
type JobSource ¶
type JobSource interface {
Name() string
Poll(ctx context.Context) ([]*PipelineSignal, error)
Report(ctx context.Context, result *ActionResult) error
}
JobSource discovers actionable work from an external system.
type Journal ¶
type Journal struct {
// contains filtered or unexported fields
}
Journal writes ActionResult entries to date-partitioned JSONL files.
func NewJournal ¶
NewJournal creates a new Journal rooted at baseDir.
func (*Journal) Append ¶
func (j *Journal) Append(signal *PipelineSignal, result *ActionResult) error
Append writes a journal entry for the given signal and result.
type JournalEntry ¶
type JournalEntry struct {
Timestamp string `json:"ts"`
Epic int `json:"epic"`
Child int `json:"child"`
PR int `json:"pr"`
Repo string `json:"repo"`
Action string `json:"action"`
Signals SignalSnapshot `json:"signals"`
Result ResultSnapshot `json:"result"`
Cycle int `json:"cycle"`
}
JournalEntry is a single line in the JSONL audit log.
type PipelineSignal ¶
type PipelineSignal struct {
EpicNumber int
ChildNumber int
PRNumber int
RepoOwner string
RepoName string
PRState string // OPEN, MERGED, CLOSED
IsDraft bool
Mergeable string // MERGEABLE, CONFLICTING, UNKNOWN
CheckStatus string // SUCCESS, FAILURE, PENDING
ThreadsTotal int
ThreadsResolved int
LastCommitSHA string
LastCommitAt time.Time
LastReviewAt time.Time
}
PipelineSignal is the structural snapshot of a child issue/PR. Never contains comment bodies or free text — structural signals only.
func (*PipelineSignal) HasUnresolvedThreads ¶
func (s *PipelineSignal) HasUnresolvedThreads() bool
HasUnresolvedThreads returns true if there are unresolved review threads.
func (*PipelineSignal) RepoFullName ¶
func (s *PipelineSignal) RepoFullName() string
RepoFullName returns "owner/repo".
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller discovers signals from sources and dispatches them to handlers.
func NewPoller ¶
func NewPoller(cfg PollerConfig) *Poller
NewPoller creates a Poller from the given config.
func (*Poller) AddHandler ¶
func (p *Poller) AddHandler(h JobHandler)
AddHandler appends a handler to the poller.
func (*Poller) Run ¶
Run starts a blocking poll-dispatch loop. It runs one cycle immediately, then repeats on each tick of the configured interval until the context is cancelled.
type PollerConfig ¶
type PollerConfig struct {
Sources []JobSource
Handlers []JobHandler
Journal *Journal
PollInterval time.Duration
DryRun bool
}
PollerConfig configures a Poller.
type ResultSnapshot ¶
type ResultSnapshot struct {
Success bool `json:"success"`
Error string `json:"error,omitempty"`
DurationMs int64 `json:"duration_ms"`
}
ResultSnapshot captures the outcome of an action.
type SignalSnapshot ¶
type SignalSnapshot struct {
PRState string `json:"pr_state"`
IsDraft bool `json:"is_draft"`
CheckStatus string `json:"check_status"`
Mergeable string `json:"mergeable"`
ThreadsTotal int `json:"threads_total"`
ThreadsResolved int `json:"threads_resolved"`
}
SignalSnapshot captures the structural state of a PR at the time of action.