fix: reconcile closed backlog issues on heartbeat#452
Conversation
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — escalated (fast_low_confidence)
Review Summary
PR PR 452: fix: reconcile closed backlog issues on heartbeat — APPROVED
Recommendation
This is a targeted bug fix that adds status/backlog to the reconciliation list so closed backlog issues are properly moved to status/done instead of lingering in Dispatch's groom queue indefinitely. The change is minimal, correct, and passes CI validation.
Change-by-Change Findings
File: src/lib/issue-sync.ts
-
Constant renamed:
ACTIVE_STATUS_LABELS→RECONCILABLE_STATUS_LABELS- Rationale: The old name was semantically misleading — backlog issues are not "actively worked on," yet they are eligible for closed-issue reconciliation. The new name accurately describes the constant's purpose.
- The
as constassertion is preserved, maintaining TypeScript type safety.
-
Added
status/backlog: The array now includes all four reconcilable statuses:["status/backlog", "status/ready", "status/in-progress", "status/in-review"]- This directly fixes the reported bug:
reconcileClosedIssues()previously skipped backlog-labeled cached issues, so a closed backlog issue on GitHub would never get its Dispatch label updated tostatus/done.
- This directly fixes the reported bug:
-
Variable renamed:
hasActiveStatus→hasReconcilableStatus- Consistent with the constant rename; no behavioral change.
-
Comments updated: JSDoc and inline comments now describe the reconciliation behavior accurately — "eligible for closed-issue reconciliation" rather than "actively being worked on."
-
Label-filtering logic: The
.filter()+.concat(["status/done"])pattern is unchanged; it correctly removes any reconcilable status label and appendsstatus/done.
Standards Compliance
| Standard | Status |
|---|---|
Label conventions (status/* pattern) |
✅ All four labels (status/backlog, status/ready, status/in-progress, status/in-review, status/done) conform to the documented pattern |
Error handling (error instanceof Error) |
✅ N/A — no new error paths introduced |
| Validation before DB ops | ✅ store.updateIssue() is the existing persistence layer; no new inputs introduced |
| No secrets committed | ✅ N/A |
| Prisma schema | ✅ N/A — no schema changes |
Linked Issue Fit
No linked issue was found in the PR body. The bug described in the PR is self-contained: reconcileClosedIssues() skipped status/backlog because it wasn't in the constant. The fix directly addresses this by adding the label.
Evidence Provider Findings
No evidence providers are configured for this repository.
Tool Harness Findings
No planned requests or harness output was generated. CI completed successfully (Docker Build ✅, Validate ✅), providing authoritative confirmation that lint and typecheck pass.
Unknowns / Needs Verification
None. The diff is minimal (1 file, 8 additions / 7 deletions), the logic is straightforward, the CI is green, and all four affected usages of the constant are within the same file (src/lib/issue-sync.ts), as confirmed by the repository impact scan for active_status_labels returning no other hits.
Bug
reconcileClosedIssues()skipped issues withstatus/backlogbecauseACTIVE_STATUS_LABELSonly containedstatus/ready,status/in-progress, andstatus/in-review. When a backlog issue was closed on GitHub, the reconciliation pass never checked it — so it stayed in Dispatch's backlog forever, clogging up the groom queue with already-closed issues.Fix
"status/backlog"to the list of reconcilable status labelsACTIVE_STATUS_LABELS→RECONCILABLE_STATUS_LABELSsince backlog isn't really "active" — the constant represents statuses eligible for closed-issue reconciliation, not just actively worked-on issueshasActiveStatus→hasReconcilableStatus)All 3 usages were in
src/lib/issue-sync.ts; no other files affected. Tests pass (8/8).