Bidirectional sync silently deletes live Studio instances when local sync files are removed

Back to board
### OS Windows ### Node.js version v24.16.0 ### AI client Claude Code ### Plugin / MCP server version MCP 2.9.3 / Plugin 2.9.3 / Studio 0.727.0.7271204 ### Steps to reproduce Config at time of test (from `manage_sync status_current_place` / `directions`): directions = `bidirectional` (all types), apply mode = `auto` (all types), reverseDetector active (snapshot-scanner), fileWatcher active. Empty default baseplate place, placeId 0. 1. Open a place; enable WEPPY sync (defaults above: bidirectional + auto). 2. Create instances in Studio: a Folder with several Parts (e.g. Workspace/Lobby/Part_1..5), plus a Script and a ModuleScript. They forward-sync to disk under `…/weppy-project-sync/place_<id>_<name>/explorer/…` (Studio→files; this step is safe, no wipe). 3. On disk, remove a synced file/folder under the `explorer` tree — e.g. delete one Part's folder, or delete the whole Lobby folder. 4. Watch the live Studio DataModel (no Studio action, no "Push to Studio" click). ### Expected behavior Mirroring a single intentional change in bidirectional mode is fine. But a reverse-apply that DELETES instances from the live DataModel — especially many at once — should not be silent and unguarded. Expected: - A destructive bulk reverse deletion should require confirmation, or have a threshold, or take an automatic backup/snapshot before applying — not auto-apply instantly with no prompt and no undo. - `reverseSyncAvailable` should reflect reality (it should not report `false` while reverse changes are actively being applied). ### Actual behavior Two problems, both observed directly: PROBLEM 1 — destructive bulk reverse deletions are auto-applied with no guard. Removing files on disk triggers an automatic reverse-apply (`{type:"reverseApply", direction:"reverse", source:"local"}`) that deletes the matching instance(s) from the LIVE DataModel — no "Push" click, no confirmation, no threshold, no backup. - Deleting ONE file deletes ONE instance (`applied:1`). - Deleting a whole subtree folder deletes the ENTIRE subtree in a single apply (`applied:5` in my test). There is no per-operation limit or warning, so one incidental local file removal can silently wipe a large part of the live place. - Affects Parts, Scripts and ModuleScripts equally. PROBLEM 2 — the status flag contradicts the behaviour. `status_current_place` reported `reverseSyncAvailable: false` the whole time these reverse-applies were being applied. So the flag says reverse sync is not available exactly while it is deleting live instances. Evidence (each row observed directly). T0 baseline: building these via MCP in Studio forward-synced cleanly to files (`direction:forward, source:studio`), zero deletions — building did NOT wipe anything. Then ONLY local filesystem edits were made (no Studio action, no Push), each producing an automatic reverseApply (`direction: reverse, source: local`, apply mode auto): | # | Local filesystem action | Studio DataModel result | reverseApply details | |---|---|---|---| | T1 | Deleted one Part folder `…/MCP_Part_3` | `MCP_Part_3` removed; other 4 parts intact | `applied:1 failed:0` | | T2 | Edited `MCP_Part_1.props.json` (Size.y 1→9, color red→green) | Studio Part_1 became Size (4,9,4), Color (40,200,30) | `applied:1 failed:0` | | T3 | Renamed folder+propsfile+name `MCP_Part_2`→`MCP_Part_2_RENAMED` | Studio: `MCP_Part_2` gone, `MCP_Part_2_RENAMED` present | `applied:2 failed:0` | | T4 | Deleted Script folder `…/ServerScriptService/MCP_TestScript` | Script removed from Studio (SSS emptied) | `applied:1 failed:0` | | T5 | Deleted ModuleScript folder `…/ReplicatedStorage/MCP_TestModule` | ModuleScript removed from Studio | `applied:1 failed:0` | | T6 | Deleted whole subtree folder `…/Workspace/MCP_SYNC_TEST_Lobby` (Folder + 4 parts) | Entire subtree (5 instances) removed from Studio in one apply | `applied:5 failed:0` | There is currently NO in-mode safeguard — the only way to avoid the silent destruction is to change settings (confirmed mitigations, both tested): - apply mode = `manual`: the reverse deletion is detected and QUEUED (`modifiedFileCount` rises) but NOT auto-applied; the instance survives until a manual apply. (Also: `reverseSyncAvailable` flipped false→true once a change was pending — see Problem 2.) - direction = `forward`: the local deletion is NOT propagated to Studio at all; Studio is treated as source of truth (the forward resync even re-emits the deleted file to disk, as duplicate folders `MCP_ManualPart~1`/`~2`; Studio kept one instance). So the destructive case is specifically direction `bidirectional` (or `reverse`) + apply `auto`, which is the default — and it has no confirmation/threshold/backup. ### Diagnostics ZIP (optional) [weppy-bug-report-2026-06-30T20-52-35-206Z.zip](https://github.com/user-attachments/files/29522978/weppy-bug-report-2026-06-30T20-52-35-206Z.zip)