feat(ready): exclude pinned issues from bd ready (beads-92u)

Pinned issues are persistent anchors that should not appear in ready
work lists. This adds:

- Pinned bool field to Issue struct
- pinned INTEGER DEFAULT 0 column to schema
- Migration 023 to add pinned column to existing databases
- WHERE i.pinned = 0 filter in GetReadyWork query

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-19 00:47:50 -08:00
parent 9dc34da64a
commit 5aacff4423
12 changed files with 118 additions and 27 deletions

View File

@@ -12,8 +12,11 @@ import (
// GetReadyWork returns issues with no open blockers
// By default, shows both 'open' and 'in_progress' issues so epics/tasks
// ready to close are visible (bd-165)
// Excludes pinned issues which are persistent anchors, not actionable work (bd-92u)
func (s *SQLiteStorage) GetReadyWork(ctx context.Context, filter types.WorkFilter) ([]*types.Issue, error) {
whereClauses := []string{}
whereClauses := []string{
"i.pinned = 0", // Exclude pinned issues (bd-92u)
}
args := []interface{}{}
// Default to open OR in_progress if not specified (bd-165)
@@ -101,7 +104,7 @@ func (s *SQLiteStorage) GetReadyWork(ctx context.Context, filter types.WorkFilte
i.status, i.priority, i.issue_type, i.assignee, i.estimated_minutes,
i.created_at, i.updated_at, i.closed_at, i.external_ref, i.source_repo, i.close_reason,
i.deleted_at, i.deleted_by, i.delete_reason, i.original_type,
i.sender, i.ephemeral
i.sender, i.ephemeral, i.pinned
FROM issues i
WHERE %s
AND NOT EXISTS (