Skip to content

fix: reconcile closed backlog issues on heartbeat#452

Open
itsmiso-ai wants to merge 1 commit into
mainfrom
fix/reconcile-closed-backlog-issues
Open

fix: reconcile closed backlog issues on heartbeat#452
itsmiso-ai wants to merge 1 commit into
mainfrom
fix/reconcile-closed-backlog-issues

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

Bug

reconcileClosedIssues() skipped issues with status/backlog because ACTIVE_STATUS_LABELS only contained status/ready, status/in-progress, and status/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

  • Added "status/backlog" to the list of reconcilable status labels
  • Renamed ACTIVE_STATUS_LABELSRECONCILABLE_STATUS_LABELS since backlog isn't really "active" — the constant represents statuses eligible for closed-issue reconciliation, not just actively worked-on issues
  • Updated associated comments and variable names (hasActiveStatushasReconcilableStatus)

All 3 usages were in src/lib/issue-sync.ts; no other files affected. Tests pass (8/8).

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Constant renamed: ACTIVE_STATUS_LABELSRECONCILABLE_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 const assertion is preserved, maintaining TypeScript type safety.
  2. 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 to status/done.
  3. Variable renamed: hasActiveStatushasReconcilableStatus

    • Consistent with the constant rename; no behavioral change.
  4. Comments updated: JSDoc and inline comments now describe the reconciliation behavior accurately — "eligible for closed-issue reconciliation" rather than "actively being worked on."

  5. Label-filtering logic: The .filter() + .concat(["status/done"]) pattern is unchanged; it correctly removes any reconcilable status label and appends status/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant