Merge polecat/Nux: exclude pinned from bd blocked

This commit is contained in:
Steve Yegge
2025-12-19 01:27:41 -08:00
3 changed files with 11 additions and 0 deletions

View File

@@ -258,11 +258,13 @@ func (s *SQLiteStorage) GetStaleIssues(ctx context.Context, filter types.StaleFi
}
// GetBlockedIssues returns issues that are blocked by dependencies or have status=blocked
// Note: Pinned issues are excluded from the output (beads-ei4)
func (s *SQLiteStorage) GetBlockedIssues(ctx context.Context) ([]*types.BlockedIssue, error) {
// Use UNION to combine:
// 1. Issues with open/in_progress/blocked status that have dependency blockers
// 2. Issues with status=blocked (even if they have no dependency blockers)
// Use GROUP_CONCAT to get all blocker IDs in a single query (no N+1)
// Exclude pinned issues (beads-ei4)
rows, err := s.db.QueryContext(ctx, `
SELECT
i.id, i.title, i.description, i.design, i.acceptance_criteria, i.notes,
@@ -279,6 +281,7 @@ func (s *SQLiteStorage) GetBlockedIssues(ctx context.Context) ([]*types.BlockedI
AND blocker.status IN ('open', 'in_progress', 'blocked')
)
WHERE i.status IN ('open', 'in_progress', 'blocked')
AND i.pinned = 0
AND (
i.status = 'blocked'
OR EXISTS (