issuemonitor

package
v0.175.0-rc.310 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package issuemonitor keeps issue metadata separate from agent work. It never requests issue bodies or comments. Human triage is required for outsiders.

Index

Constants

This section is empty.

Variables

View Source
var ErrExternal = errors.New("issue author is not an active employee")

Functions

func WithState

func WithState(ctx context.Context, dir string, fn func(*State, func(*State) error) error) error

WithState serializes poll, queue consumption and contributor/report reads.

Types

type Class

type Class string
const (
	Employee    Class = "employee"
	External    Class = "external"
	Bot         Class = "bot"
	TriageLabel       = "beekeeper-triage"
)

func Classify

func Classify(ctx context.Context, gh github.GH, org, author string) Class

Classify deliberately has no cache. Even an unavailable API fails closed.

type Issue

type Issue struct {
	ReopenedAt time.Time `json:"-"`
	Number     int       `json:"number"`
	Title      string    `json:"title"`
	URL        string    `json:"url"`
	State      string    `json:"state"`
	Author     struct {
		Login string
	} `json:"author"`
	Assignees []struct {
		Login string
	} `json:"assignees"`
	Labels []struct {
		Name string
	} `json:"labels"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Issue has only metadata. Title is used solely for delivery to human Slack.

func Read

func Read(ctx context.Context, gh github.GH, repo string, n int) (Issue, error)

type Monitor

type Monitor struct {
	GH     github.GH
	Notify Notify
	Save   func(*State) error
	Now    time.Time
}

func (Monitor) Poll

func (m Monitor) Poll(ctx context.Context, s *State, ownership map[string]string) error

Poll reconciles every open issue in repositories from the ownership record. Each successful external notification is checkpointed before continuing.

type Notify

type Notify func(context.Context, string, string) error

Notify must deliver to the owning team's human channel; it must not expose the message in logs, agent prompts or command output.

type Pointer

type Pointer struct {
	Ref    string `json:"ref"`
	URL    string `json:"url"`
	Source string `json:"source"`
}

Pointer is the entire agent-facing queue entry: no title, body or comments.

type Record

type Record struct {
	ReopenedAt time.Time `json:"reopenedAt,omitempty"`
	State      string    `json:"state"`
	Class      Class     `json:"class"`
	Author     string    `json:"author"`
	Notified   bool      `json:"notified,omitempty"`
	Cleanup    string    `json:"cleanup,omitempty"`
}

type State

type State struct {
	Repositories map[string]string   `json:"repositories"`
	Issues       map[string]Record   `json:"issues"`
	Queue        []Pointer           `json:"queue"`
	Contributors map[string][]string `json:"contributors"`
	Backlog      map[string]bool     `json:"backlog"`
}

func (*State) Enqueue

func (s *State) Enqueue(ctx context.Context, gh github.GH, repo string, n int) error

Enqueue is a trust boundary, not a caller-supplied author assertion. It reads the current issue author itself and checks live membership before admission.

func (*State) Init

func (s *State) Init()

Jump to

Keyboard shortcuts

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