3.3 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-github-candidates | Filter GitHub cleanup candidates | done | 1 | plan.md |
|
|
|
Task 01: Filter GitHub cleanup candidates
Summary
Filter GitHub cleanup candidates. Implement with TDD and record the regression results.
In scope
Add mixed-state regressions in store_task_cleanup_test.go and
service_review_cleanup_test.go. Name the new tests
TestCleanupCandidateListsExcludeHistoricalTasks and
TestCleanupMergedReviewTasksSkipsHistoricalTasks.
Cover by-watch, global, orphan, and workspace cleanup for reviews and issues.
Assert zero upstream calls for archived and missing tasks. Cover terminal and
nonterminal empty reservations, all policies, engagement, and lifecycle prompts.
Apply the candidate predicate to all four GitHub list methods. Preserve
explicit watch deletion with unfiltered task-ID queries in service_reviews.go
and service_issues.go. Add archived-child deletion assertions to existing
watch deletion tests. Assert deduplication remains present through unfiltered
lookups, not filtered cleanup queries.
Update obsolete missing-task cleanup expectations to zero provider calls and zero deletions. Keep task-not-found race coverage by deleting an initially eligible task after selection.
Out of scope
New policies, UI, schema migrations, and unrelated provider changes.
Acceptance
- Mixed candidate lists and store-backed cleanup satisfy AC 001.1 through 001.4.
- Explicit watch deletion, reset, scope, and deduplication satisfy AC 001.5.
- Regression tests fail before the query changes and pass afterward.
Verification
Run from the repository root.
(cd apps/backend && go test ./internal/github -count=1)
git diff --check
Files likely touched
apps/backend/internal/github/store.goapps/backend/internal/github/service_reviews.goapps/backend/internal/github/service_issues.goapps/backend/internal/github/store_task_cleanup_test.goapps/backend/internal/github/service_review_cleanup_test.goapps/backend/internal/github/service_cleanup_policy_test.goapps/backend/internal/github/store_watch_reset_test.goapps/backend/internal/github/store_watch_disable_test.go
Dependencies
None.
Risks
Preserve task inventory outside cleanup. Seed actual active tasks in fixtures.
Parallelism
sequential
Inputs
- Requirements
- Design
- Existing source and tests listed above.
Results
Implemented the task eligibility predicate for all four GitHub cleanup list queries. Explicit watch deletion keeps its unfiltered task-ID inventory, so archived and missing task rows are preserved for deduplication while active tasks and empty reservations remain cleanup candidates. Added mixed-state store and service regressions, updated active-task fixtures, and retained a post-selection task-not-found race regression.
Verification: go test ./internal/github -count=1 passed.