feat: the cloud sync engine core (#409) #416
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 300 lines diff across 3 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.341
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #416"
general
weight: 0.35
qwts
Part of #409 (phase 2 of 4). Groundwork only —
bm_sync_enabledis off everywhere and nothing constructs the engine yet, so no user-visible behavior changes and no changeset (docs/tests/internal work may omit one).What
syncEngine.js— one engine over the composite store and a cloud store: every local change pushes up, every remote change applies down. One snapshot (uuid → synced view) is the single source of "what has been said"; both directions are the same diff-and-write move, and the snapshot moves only after the write lands, so a refused write is retried by the next notification and an echo of a landed write finds nothing left to say.syncSetting.js— thebm_sync_enabledflag, off by default, SDK-free so first paint never pulls the Firebase chunks.firebaseStore.putMany— the engine's up-write: full documents keyed by uuid (document id = uuid, so #407's "document id wins" holds by construction), item timestamps preserved, noidfield ever stored.localCompositeStore— honors an explicitupdatedAtin a patch (sync applies keep the moment the change happened) and keepsurlStatusReasonon bookmarks adopted from the cloud.Deliberate limits (later phases)
updatedAtat the initial reconcile, arrival order after; phase 4 adds field-level resolution.Tests
10 engine tests over in-memory doubles mirroring the composite's semantics (echo suppression in both directions, LWW, deletions both ways, legacy-document isolation, refused-push retry, stop, failed start), 2 flag tests, and store tests for
putMany, explicit-updatedAt, and adopted failure reasons.npm run cigreen locally.<!-- agent-bot-write: ghw_e674ab43be367d71 session=acad26a80cec bot=trueline-zcode-agent[bot] -->