Reconcile GitHub issue states with increment statuses. Fixes drift by closing issues for completed increments and reopening issues for resumed increments.
Fix drift between local increment statuses and GitHub issue states. Use after manual metadata edits or git pulls to automatically close completed issues and reopen resumed ones.
/plugin marketplace add anton-abyzov/specweave/plugin install sw-github@specweaveScan all increments and fix any drift between local metadata.json status and GitHub issue states.
/sw-github:reconcile [options]
--dry-run: Preview changes without making them--verbose: Show detailed output for each issue checkedmetadata=completed + GH=open ā Close the issuemetadata=in-progress + GH=closed ā Reopen the issueRun the reconciliation using the GitHubReconciler:
import { GitHubReconciler } from '../../../src/sync/github-reconciler.js';
const reconciler = new GitHubReconciler({
projectRoot: process.cwd(),
dryRun: args.includes('--dry-run'),
});
const result = await reconciler.reconcile();
// Report results
console.log(`\nReconciliation complete:`);
console.log(` Scanned: ${result.scanned} increments`);
console.log(` Fixed: ${result.closed} closed, ${result.reopened} reopened`);
if (result.errors.length > 0) {
console.log(` Errors: ${result.errors.length}`);
}
š Scanning 5 increment(s) for GitHub state drift...
ā
Issue #765 (0056-plugin-fix/US-001): State matches (open)
ā Issue #771 (0066-import-wizard/US-003): OPEN but should be CLOSED (status=completed)
ā
Closed issue #771
ā Issue #763 (0063-multi-repo/US-001): CLOSED but should be OPEN (status=in-progress)
ā
Reopened issue #763
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š RECONCILIATION SUMMARY
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Increments scanned: 5
Mismatches found: 2
Issues closed: 1
Issues reopened: 1
Errors: 0
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
/sw-github:reconcile --dry-run
Shows what would be changed without making any modifications:
ā Issue #771 (0066-import-wizard/US-003): OPEN but should be CLOSED
[DRY RUN] Would close issue #771
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š RECONCILIATION SUMMARY
ā ļø DRY RUN - No changes were made
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
gh) installed and authenticatedsync.github.enabled = true in config.jsonsync.settings.canUpdateExternalItems = true in config.json/sw-github:status: View sync status for increments/sw-github:sync: Manual sync to GitHub/sw:done: Close increment (triggers auto-close)/sw:resume: Resume increment (now triggers auto-reopen)