feat(sync): add tombstones, field-level conflict merge, and sync-only cleanup (#409) #430
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 333 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #430"
general
weight: 0.35
qwts
Summary
Completes Phase 4 of #409 (multi-device conflicts, deletion tombstones, store-selection cleanup, and documentation):
src/stores/syncTombstones.js):- Tracks deleted bookmark UUIDs in
bm_tombstones(TOMBSTONE_TTL_MS= 30 days) with monotonic timestamp rules (or exactforceoverrides from remote tombstones), pruning, and storage/memory adapters.- Persists the last settled sync baseline in
bm_sync_base(readSyncBase/writeSyncBase/clearSyncBase) and clearsbm_sync_baseon explicit Disconnect while retainingbm_tombstonesacross pauses/disconnects.src/stores/localCompositeStore.js,src/stores/cloudSyncOverlay.js,src/hooks/useCloudSyncOverlay.js):- Captures tombstones on
remove,removeMany,bulkReplace, and direct Chrome Bookmark Manager deletions detected inlist()(withreplacingand empty-list transient guards), clears tombstones on restore/create/bulkAdd, and skips tombstoned docs inadoptLegacyCloudBookmarks.src/stores/syncMerge.js,src/stores/syncEngine.js):- Merges concurrent offline or live field edits against persisted
bm_sync_base(mergeBookmarks), breaking same-field ties with clock-skew-boundedupdatedAt(MAX_CLOCK_SKEW_MS= 5 minutes) and preserving the earliest validcreatedAt.- Validates incoming cloud payloads (
sanitizeIncomingBookmark) for safe HTTP(S) URLs, allowedurlStatus/ normalizedurlStatusReason, and bounded strings/tags/ratings.- Overwrites deleted Firestore docs with content-free
{ uuid, deleted: true, deletedAt, updatedAt }tombstones, supports edit-after-delete resurrection, prunes expired local and cloud tombstones on startup and hourly-gated reconciles, guards against transient empty reads, and commits partial-write outcomes safely.- Removes remaining standalone Firebase store-mode UI fallbacks (
StorageSection,StorageWizard,StorageWizardMergeStep) and unusedquickAdd.signInRequiredcopy.- Updates
README.md,DESIGN.md, andsrc/stores/FIREBASE_SETUP.md, and adds a changeset.Verification
npm run ci </dev/null(version policy0.22.0,THIRD-PARTY-NOTICES.mdcheck, Prettier, ESLint, Vitest143 passed (143)/1722 passed (1722), chunk laziness check, Chrome & Storybook builds).Closes #409
<!-- agent-bot-write: ghw_a2ebe90cc15334a6 session=210bdd5e08f0 bot=trueline-antigravity-agent[bot] conversation_id=e99b26b3-53f9-4d7f-8337-fb33257bb240 conversation_id_source=self-reported -->