mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4689] [GUI] npm test deletes the person's model folder: models-folder.test.mjs removes <drive>\Strata #2140
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vsp99h on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4689
Area
[GUI] (the desktop app — the
apps/hosttest suite)Desktop app, Terminal or source?
Source (a checkout,
npm testinapps/host)What happened
I ran the app-host test suite in a checkout that had been used for real work. One test deleted
files from my real model folder,
C:\Strata\Data\models\:The remaining shards,
packs\andmtp\are still on disk (112.9 GB). The model is nowmissing_or_invalidinstrata models list --installed, and the picture reader cannot start.Expected: a test that only plans a models-folder change should not touch the filesystem outside
its own fixture folder.
The test's own failure line names the folder it attacked:
The code,
apps/host/tests/models-folder.test.mjs:71-79(git blame: every line is1d6a04012,2026-10-20, "Settings > Storage: Models folder card … tests"; unchanged since, shipped in every tag
from v0.2.2 to v0.2.8):
f.rootisrealpathSync(mkdtempSync(join(tmpdir(), 'strata-mfolder-'))), so on Windowsrootbecomes the drive root of
%TEMP%—C:\here — andjoin(root, 'Strata')isC:\Strata.That is exactly the path the Storage card produces when a person points Strata at a whole drive,
which is the case this test exists to cover. The fixture only creates
<f.root>\install,\data,\old,\new, andcontrol.planModelsMoveis a stub, so the test never creates anything atthat path: line 78 deletes whatever the person keeps there.
force: truehides the case wherethe folder does not exist, which is why this passes silently on machines whose models live on
another drive or in
Documents\Strata.This is the only such call in the suite. I went through every
rmSync(inapps/host/tests(about a hundred): each one removes a folder made by
mkdtempSyncin the same test, includingline 53 of this very file (
rmSync(root, …), its own fixture). Line 78 is the only place where thepath is derived from something outside the fixture, and it is derived from the drive root.
Two things make it worse than a normal bad test:
AGENTS.md("tests run withnpm testinapps/host") andCONTRIBUTING.mdsend contributorsand CI straight at the command that triggers it.
scripts/test.mjsstates the opposite intent in its header — "Every test file runs againstscratch copies of the per-user places the host writes to (the owner's real profile is never
touched)" — and
535cacb0(2026-10-24) redirectedLOCALAPPDATA,APPDATA,XDG_*,STRATA_COMPONENTS_DIRandSTRATA_SETTINGS_FILEinto a scratch folder. Deriving a drive rootinside the test walks straight past all of that.
On Linux and macOS
rootis/, so the target is/Strata, which normally does not exist andforce: truemakes it a no-op — the damage is effectively Windows-only, where%TEMP%and themodel folder usually share
C:.Smallest steps or command that reproduce it
On a Windows machine where the Strata data folder is
<drive>\Strata(Settings > Storage > a wholedrive) and
%TEMP%is on that same drive:or just the one file:
The run reports the failure
rmSyncgives when it cannot finish, and the files under<drive>\Strataare already gone or marked for deletion by then.Reproduction status
Reproduced locally
Strata version
commit
529b25c3(merge oforigin/main=870aedd9, v0.2.8).apps/host/tests/models-folder.test.mjsin that tree is byte-identical to
origin/main(SHA-256 starts3033925CD34FF67E).Graphics card, memory and system
RTX 5080 16 GB · 93 GB RAM · Windows 11 Pro 10.0.26300
Model, size and settings
Qwen3.8-Flash-Next UD Q4_K_XL · 524 288 context · pictures on · model files in
C:\Strata\DataSuggested fix
The plan creates nothing, so the cleanup line can simply go, and the "whole drive" case can be
faked inside the fixture:
If the real drive root must be kept for fidelity, add a guard that fails loudly instead of
deleting —
assert.ok(join(root, 'Strata').startsWith(f.root))before any removal — or skip thetest when
<drive>\Strataalready exists.Limits of what I verified
rmSyncnamed\\?\C:\Strata, and the two files above disappearedfrom the real folder between a run at 12:14 (folder complete, the model reported ready by
GET /api/native) and 12:56 (folder short of those two files).denies writes outside the workspace. It stopped the recursive walk at the directory level, so the
tree itself survived. The two files that did get removed were the two held open by the running
engine (
strata.exe,--native C:\Strata\Data\models\unsloth-UD-Q4_K_XL\Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf)and by the picture reader (
strata-vision.exe,--mmproj C:\Strata\Data\models\mmproj-Qwen3.8-Flash-Next-BF16.gguf),so Windows kept them as delete-pending and the serving model kept answering.
take the whole
<drive>\Stratatree (weights, packs, mtp). I did not run it unsandboxed and willnot.
Search before filing
I searched the tracker (
gh search issues --repo Niko1221/Strata) formodels-folder,rmSyncand
test deletes model folder:rmSyncand the last query return nothing, and themodels-folderhits are unrelated. The closest in subject are #4089 (deleting a model stops at a read-only folder)
and #3521 (a Terminal discovery test reading the checkout's own run configs) — different problems.
@Niko1221 commented on GitHub (Oct 31, 2026):
Fixed in 0.2.9: that test no longer deletes anything, and it now checks that planning a folder change leaves the disk alone. We're sorry about the files you lost.