fix: release archive lock on Windows - #1769
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe archive claim release logic now tolerates ChangesArchive claim release
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to This change fixes stale archive locks on Windows while retaining inode, nonce, and repeated identity checks before cleanup. A bounded risk remains because device identity is optional on the affected platform, so concurrent lock replacement behavior is not fully demonstrated; merge is reasonable with explicit owner awareness and follow-up coverage. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes
openspec archiveleaving.openspec-archive.lockbehind on Windows after a successful archive.On the affected Windows/NTFS setup, Node reports different
devvalues for the same lock file depending on how it is statted:FileHandle.stat({ bigint: true }).devreports the real volume idfs.lstat(path, { bigint: true }).devreports0nThe cleanup check required both
devandinoto match, so it never unlinked the lock file even though the archive had completed successfully. The next archive was then blocked by the stale claim.This change treats
dev: 0nas an unavailable device id while still requiring the inode and lock-file contents to match before deleting the claim.Testing
pnpm exec vitest run test/core/archive.test.tspnpm run lintpnpm run buildnode bin/openspec.js validate fix-windows-archive-claim-release --strictNotes
Generated with Codex using GPT-5.6.
Summary by CodeRabbit