From f9eb43df47240c8e8cc0b0ea1ae9068658c73309 Mon Sep 17 00:00:00 2001 From: Anurag-Wednesday Date: Fri, 31 Jul 2026 12:39:40 +0530 Subject: [PATCH] feat(pro): Reflect live on Windows Reflect is pure aggregation over observations the capture pipeline already writes - it adds no capture of its own. Replay's port put those observations on Windows, so Reflect needs no Windows implementation, only the gate flip. Audit found zero platform coupling on the whole path: crm/reflect.ts imports only core getDB, ./schema and ./utils; its IPC (crm:day-reflection, crm:week-reflection) is platform-free; ReflectScreen carries no native code. The only native dep on the path is better-sqlite3, already proven on Windows by core. Catalog copy and the screen have no Mac/Cmd/Option strings, so no copy neutralization was needed. The single catalog edit is sufficient for the same reason it was for Replay: nav lock is entitlement-only (locked: !isPro) and the screen gate routes through proFeatureComingSoon, with no core file special-casing the route - so nav, gating and copy all light up from the one source of truth. Tests: WIN_PORTED is parameterized, so adding reflect derives four assertions (live on win32; win32-only and not linux by implication; the "exactly the ported features are win32-supported" invariant; and that proFeatureComingSoon does not gate it). Reflect's own logic keeps its existing 13-case real-DB integration coverage. Verified: npm test 3161 passed; node, web and pro typechecks clean; eslint clean on both touched files. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_015U3TnnNULxfCb4TsjAGjiC --- src/renderer/src/components/pro/proCatalog.ts | 6 +++++- src/renderer/src/lib/__tests__/proCatalog.lookup.test.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/pro/proCatalog.ts b/src/renderer/src/components/pro/proCatalog.ts index 9a670272..62e197c1 100644 --- a/src/renderer/src/components/pro/proCatalog.ts +++ b/src/renderer/src/components/pro/proCatalog.ts @@ -76,7 +76,11 @@ export const PRO_FEATURES: ProFeature[] = [ 'Focus vs. distraction trends', 'All computed locally — never uploaded' ], - platforms: ['darwin'] + // Ported to Windows: Reflect adds no capture of its own — it is pure aggregation + // over observations the capture pipeline already writes, which Replay's port put + // on Windows. The whole path (crm/reflect.ts, its IPC, ReflectScreen) carries no + // platform-native code and reaches SQLite through the same getDB core uses. + platforms: ['darwin', 'win32'] }, { route: 'replay', diff --git a/src/renderer/src/lib/__tests__/proCatalog.lookup.test.ts b/src/renderer/src/lib/__tests__/proCatalog.lookup.test.ts index bb53790b..69db6987 100644 --- a/src/renderer/src/lib/__tests__/proCatalog.lookup.test.ts +++ b/src/renderer/src/lib/__tests__/proCatalog.lookup.test.ts @@ -38,7 +38,7 @@ const winPorted = (route: string): ProFeature => ({ // asserted against the catalog so a flipped `platforms` and this list can't drift. // Module-scoped because both the featureSupportsPlatform and proFeatureComingSoon // describes read it — the gate and the capability check must agree on one list. -const WIN_PORTED = new Set(['vault', 'clipboard', 'replay']) +const WIN_PORTED = new Set(['vault', 'clipboard', 'replay', 'reflect']) describe('getProFeature', () => { it('returns the matching feature for a known route', () => {