Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

test(security): keep snapshot regression descriptor-only

Rahmanab14faa879e9
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 75a50b97..75699b12 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -23,6 +23,10 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
- `security` isolate Convex snapshot staging
+**Tests**
+
+- `security` keep snapshot regression descriptor-only
+
## 2026-09-18
**Added**
diff --git a/lib/infra/convex-cloud-snapshot-security.test.ts b/lib/infra/convex-cloud-snapshot-security.test.ts
index 3e388cb9..406ecfb9 100644
--- a/lib/infra/convex-cloud-snapshot-security.test.ts
+++ b/lib/infra/convex-cloud-snapshot-security.test.ts
@@ -36,9 +36,14 @@ it("stages the checked snapshot from one open descriptor into a private immutabl
/mso-convex-snapshot-[^/\\]+$/,
);
expect((await fs.stat(path.dirname(context.stagedSnapshot))).mode & 0o777).toBe(0o700);
- expect((await fs.stat(context.stagedSnapshot)).mode & 0o777).toBe(0o600);
- await fs.writeFile(snapshot, "changed after validation", { mode: 0o600 });
- expect(await fs.readFile(context.stagedSnapshot)).toEqual(original);
+ const staged = await fs.open(context.stagedSnapshot, "r");
+ try {
+ expect((await staged.stat()).mode & 0o777).toBe(0o600);
+ await fs.writeFile(snapshot, "changed after validation", { mode: 0o600 });
+ expect(await staged.readFile()).toEqual(original);
+ } finally {
+ await staged.close();
+ }
expect(context.sha256).toMatch(/^[a-f0-9]{64}$/);
await context.cleanup();
await expect(fs.stat(context.stagedSnapshot)).rejects.toMatchObject({ code: "ENOENT" });