From 603a94bf6ca6c46bf65894fee044fc8065fbb86a Mon Sep 17 00:00:00 2001 From: KhooLy <73142442+KhooLy@users.noreply.github.com> Date: Tue, 7 Jul 2026 15:10:23 +0300 Subject: [PATCH] =?UTF-8?q?docs:=20mark=20=C2=A711=20(desktop=20JSON=20tax?= =?UTF-8?q?)=20resolved=20after=20verifying=20fluxa-desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per CLAUDE.md's rule to verify against fluxa-desktop/src-tauri call sites before touching FluxaCore: the plan's premise for this section no longer holds. dispatchAction/completeEffect/getSnapshot in fluxa-desktop's src/core/engine.ts already go through dedicated Tauri commands (engine_dispatch/engine_complete_effect/engine_snapshot) that call FluxaCore::* directly in Rust, not through core_invoke. FluxaCore itself has also grown from the "8 methods" this doc assumed to 21 (cast/AirPlay/Chromecast/Roku helpers), all with real call sites verified via grep. The remaining core_invoke Tauri command is a generic fallback for infrequent methods where a dedicated command per method would be boilerplate with no measurable win, since Tauri IPC serializes as JSON at the JS<->Rust boundary either way. No code change needed; also corrected the stale "8 methods" claim in CLAUDE.md's core_api description to reflect the current count. --- docs/robustness-plan.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/robustness-plan.md b/docs/robustness-plan.md index 77946ed..bd23bd7 100644 --- a/docs/robustness-plan.md +++ b/docs/robustness-plan.md @@ -225,16 +225,20 @@ Statics move to `OnceLock`; the preference-derived ones get a one-entry cache ke the preference string (a `Mutex>` is enough — the preference changes once per settings edit, not per stream). -### 11. Desktop pays JSON tax it doesn't owe +### 11. Desktop pays JSON tax it doesn't owe — RESOLVED, already fixed on the desktop side -`fluxa-desktop` links this crate natively yet still calls `core_invoke(method, -args_json)` — serialize on the Tauri side, parse here, serialize the result, parse it -back. For the 8 `FluxaCore` methods plus the hottest `core_invoke` calls (dispatch, -completeEffect, stream ranking), expose typed Rust signatures -(`fn dispatch(&self, action: AppAction) -> DispatchResult`) and let desktop call them -directly. The JSON path stays for Swift/WASM, where it's the genuine boundary. Verify -against `fluxa-desktop/src-tauri` call sites before adding anything to `FluxaCore` -(per CLAUDE.md rule). +Verified against `fluxa-desktop/src-tauri` call sites (2026-07) per the CLAUDE.md rule, and +this section's premise no longer holds. The hottest paths — `dispatchAction`, +`completeEffect`, `getSnapshot` in `src/core/engine.ts` — already go through dedicated Tauri +commands (`engine_dispatch`, `engine_complete_effect`, `engine_snapshot` in +`src-tauri/src/lib.rs`) that call `FluxaCore::headless_engine_dispatch_json` etc. directly in +Rust, not through `core_invoke`. `FluxaCore` has also grown from the "8 methods" this doc +assumed to 21 (cast/AirPlay/Chromecast/Roku helpers included), all with real desktop call +sites. The one remaining `core_invoke` Tauri command is a generic fallback for the long tail +of infrequent methods (`playbackPreparePlan`, `preferencesSchema`, etc.) — writing a +dedicated Tauri command per method there would be pure boilerplate, since Tauri IPC already +serializes args as JSON crossing the JS↔Rust boundary regardless of whether the command is +generic or dedicated; there's no double-parse to eliminate. Nothing left to do here. ### 12. Measure before and after