Implement bd restore command and flip ready work sort order

- Add bd restore command to view full history of compacted issues from git
- Command temporarily checks out historical commit, reads JSONL, displays original content
- Read-only operation, no database or git state modification
- Flip ready work sort to created_at ASC (older issues first within priority tier)
- Prevents issue treadmill effect, surfaces old P1s for triage
- Update README.md and AGENTS.md with restore documentation

Closes bd-407, bd-383
This commit is contained in:
Steve Yegge
2025-10-16 18:06:53 -07:00
parent 97e74b8585
commit 2abccb7a88
4 changed files with 264 additions and 2 deletions

View File

@@ -83,7 +83,7 @@ func (s *SQLiteStorage) GetReadyWork(ctx context.Context, filter types.WorkFilte
AND NOT EXISTS (
SELECT 1 FROM blocked_transitively WHERE issue_id = i.id
)
ORDER BY i.priority ASC, i.created_at DESC
ORDER BY i.priority ASC, i.created_at ASC
%s
`, whereSQL, limitSQL)