908dff4f07db3e09d9dfccaa2a6b7c77204f2380
Adds the core sync engine that maps GitLab events (from lore CLI) to beads tasks. This is the foundational data layer for Mission Control's unified task view. Bridge architecture: - GitLabBeadMap: JSON file storing event -> bead_id mappings - MappingKey: Type-safe keys for MR reviews, issues, and authored MRs - Cursor: Tracks last sync and reconciliation timestamps Crash-safety features: - Write-ahead pattern: pending=true written before bead creation - Atomic file writes via temp file + rename - Recovery on startup: retries pending entries with bead_id=None - flock(2) based single-instance locking (prevents concurrent MC) Two-strike orphan detection: - First miss sets suspect_orphan=true (items may temporarily vanish) - Second miss closes the bead (confirmed deleted/merged) - Reappearance clears the flag (healed) Sync operations: - incremental_sync(): Process since_last_check events - full_reconciliation(): Cross-check all open items - recover_pending(): Handle interrupted syncs Dependencies added: - libc: For flock(2) system call - thiserror: For ergonomic error types Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Description
No description provided
Languages
TypeScript
66%
Rust
33.5%
JavaScript
0.3%
Shell
0.1%