Respect Forgejo UI closes during backlog sync #144

Closed
opened 2026-05-30 10:00:15 +00:00 by steve · 0 comments
Owner

Problem

pnpm backlog:sync pushes local open state to Forgejo and reopens issues that were closed manually in the Forgejo UI when the local mirror still has them under .issues/open/.

Goal

During push reconciliation, treat a remote closed issue as authoritative unless the local file records an intentional reopen via ## Reopen Reason (pnpm backlog:reopen).

Scope

  • resolveIssueStateConflict helper and reconcileRemoteIssue behavior in scripts/issue-sync.mjs
  • Unit tests and issues-backlog spec note

Non-goals

  • Changing local-closed → remote-open handling (local backlog:close still closes Forgejo)
  • Auto-closing stale open issues (doctor-fix remains separate)

Acceptance Criteria

  • Sync no longer calls Forgejo reopen when local is open, remote is closed, and there is no ## Reopen Reason
  • Sync still reopens Forgejo when local has ## Reopen Reason from pnpm backlog:reopen
  • Pull after sync moves UI-closed issues into .issues/closed/

Implementation Notes

Push then pull: skip remote reopen on state mismatch; pull writes remote closed state locally.

Suggested Files or Specs To Inspect

  • scripts/issue-sync.mjs (reconcileRemoteIssue)
  • scripts/issue-sync-lib.mjs
  • spec/src/80-maintenance/issues-backlog.md

Validation Commands

  • node --test scripts/issue-sync-lib.test.mjs
  • pnpm check:all

Follow-up Tasks

Implementation Summary

Push reconciliation skips Forgejo reopen when remote is closed unless local has ## Reopen Reason; pull moves UI-closed issues to .issues/closed/. Added resolveIssueStateConflict helper and unit tests; documented sync state policy in issues-backlog spec.

## Problem `pnpm backlog:sync` pushes local open state to Forgejo and reopens issues that were closed manually in the Forgejo UI when the local mirror still has them under `.issues/open/`. ## Goal During push reconciliation, treat a remote closed issue as authoritative unless the local file records an intentional reopen via `## Reopen Reason` (`pnpm backlog:reopen`). ## Scope - `resolveIssueStateConflict` helper and `reconcileRemoteIssue` behavior in `scripts/issue-sync.mjs` - Unit tests and issues-backlog spec note ## Non-goals - Changing local-closed → remote-open handling (local `backlog:close` still closes Forgejo) - Auto-closing stale open issues (doctor-fix remains separate) ## Acceptance Criteria - Sync no longer calls Forgejo reopen when local is open, remote is closed, and there is no `## Reopen Reason` - Sync still reopens Forgejo when local has `## Reopen Reason` from `pnpm backlog:reopen` - Pull after sync moves UI-closed issues into `.issues/closed/` ## Implementation Notes Push then pull: skip remote reopen on state mismatch; pull writes remote closed state locally. ## Suggested Files or Specs To Inspect - `scripts/issue-sync.mjs` (`reconcileRemoteIssue`) - `scripts/issue-sync-lib.mjs` - `spec/src/80-maintenance/issues-backlog.md` ## Validation Commands - `node --test scripts/issue-sync-lib.test.mjs` - `pnpm check:all` ## Follow-up Tasks ## Implementation Summary Push reconciliation skips Forgejo reopen when remote is closed unless local has ## Reopen Reason; pull moves UI-closed issues to .issues/closed/. Added resolveIssueStateConflict helper and unit tests; documented sync state policy in issues-backlog spec. <!-- backlog:task_id=TASK-BACKLOG-014 source_spec=spec/src/80-maintenance/issues-backlog.md -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#144
No description provided.