Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
docs(ok): align the sidebar count-parity docblock (PRD-8247) (#3811)
Andrew Mikofalvy181fc9b38a8e
diff --git a/packages/app/src/components/ConflictsSection.tsx b/packages/app/src/components/ConflictsSection.tsxindex a01e19218..c93fa6e00 100644--- a/packages/app/src/components/ConflictsSection.tsx+++ b/packages/app/src/components/ConflictsSection.tsx@@ -1,6 +1,6 @@/*** ConflictsSection — pinned section at the top of the left sidebar listing- * every doc whose `.ok/conflicts.json` entry is currently active.+ * every doc whose `.ok/local/conflicts.json` entry is currently active.** Renders nothing when `conflicts.length === 0` (auto-hide at zero;* auto-appears at >0 — no manual collapse / expand state). Rows are@@ -14,8 +14,10 @@* Count parity:* - Section count comes from `useConflicts()` → `/api/sync/conflicts`.* - Topbar `SyncStatusBadge`'s `conflictCount` comes from `/api/sync/status`,- * which itself derives `conflictCount` from the same `.ok/conflicts.json`.- * CC1 `sync-status` invalidates both in lockstep.+ * which is NOT backed identically: it returns a cached scalar the engine+ * refreshes from that same store at discrete points, seeded from+ * `<projectDir>/.ok/local/sync-state.json` on load. CC1 `sync-status`+ * invalidates both in lockstep, so they agree in steady state.* - Tab-badge counts come from per-doc Y.Map `lifecycle.status` (live CRDT),* pushed by the server's file-watcher / reconciliation paths on the same* edges that flip `conflicts.json`. They converge in steady state; adiff --git a/packages/app/tests/integration/conflict-aware-write-surfaces.test.ts b/packages/app/tests/integration/conflict-aware-write-surfaces.test.tsindex 7c22a0556..e36f23987 100644--- a/packages/app/tests/integration/conflict-aware-write-surfaces.test.ts+++ b/packages/app/tests/integration/conflict-aware-write-surfaces.test.ts@@ -394,7 +394,7 @@ describe('FR12: /api/sync/conflicts + /api/sync/status count parity', () => {* SyncEngine.{getConflicts, getStatus} → `/api/sync/conflicts` +* `/api/sync/status`. Those two reads have SEPARATE backing state:* `getConflicts()` lists the live ConflictStore, while `getStatus()`- * returns a cached `conflictCount` scalar persisted in sync-state.json.+ * returns a cached `conflictCount` scalar derived from sync-state.json.* This test pins that the two agree: seed 2 conflicts, assert both* endpoints report 2; resolve 1, assert both report 1.*