Documentation
¶
Overview ¶
Package beads is a thin wrapper around the `bd` CLI from github.com/gastownhall/beads. It is used by the PM/TaskRunner to register negotiated task specs as durable issues so multi-session work survives.
All operations are best-effort: if the binary is missing or the command fails, callers should log and continue rather than abort the pipeline.
Index ¶
- func AddDependency(ctx context.Context, root, child, parent string) error
- func Available() bool
- func Claim(ctx context.Context, root, id string) error
- func Close(ctx context.Context, root, id, reason string) error
- func Create(ctx context.Context, root, title, description string, priority int, ...) (string, error)
- func Link(ctx context.Context, root, child, parent, linkType string) error
- func SetMetadata(ctx context.Context, root, id string, kv map[string]string) error
- type Issue
- func ActiveTasks(ctx context.Context, root, label string) ([]Issue, error)
- func Children(ctx context.Context, root, parent string, statuses ...string) ([]Issue, error)
- func ClosedTasks(ctx context.Context, root, label string) ([]Issue, error)
- func Ready(ctx context.Context, root, parent string) ([]Issue, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDependency ¶
AddDependency records that `child` depends on `parent` — parent must be closed before `child` becomes ready. Implemented via `bd dep add <child> <parent>`, which is the standard subcommand of the beads CLI.
func Create ¶
func Create(ctx context.Context, root, title, description string, priority int, labels ...string) (string, error)
Create registers a new issue and returns its ID. Output is parsed from `bd q` (quick capture) which prints only the issue ID. labels are attached at creation time (may be empty).
Types ¶
type Issue ¶
type Issue struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Status string `json:"status"`
Priority int `json:"priority"`
Type string `json:"type"`
}
Issue is the minimal subset of `bd` issue fields DECSR cares about.
func ActiveTasks ¶
ActiveTasks lists top-level decsr task beads that are currently in_progress, i.e. resumable runs. Uses `bd list --no-parent --label decsr-task --status in_progress --json`. Returns nil when bd is unavailable.
func Children ¶
(e.g. "in_progress", "open"). Returns nil when bd is unavailable or parent is empty.
func ClosedTasks ¶
ClosedTasks lists completed top-level decsr task beads (history). Uses `bd list --no-parent --label decsr-task --status closed --json`.
func Ready ¶
Ready returns issues that are unblocked and ready to be picked up. When parent is non-empty, results are scoped to descendants of that bead/epic (`bd ready --parent`). Note: `bd ready` excludes in_progress issues, so an interrupted (claimed-but-open) sub-task will NOT appear here — callers that need to resume such work should use Children(..., "in_progress").