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): inspect organization fixture through one descriptor

Rahman8c15a6d84876
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 205f5189..39cccfb3 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -14,6 +14,10 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
- `browser` diagnose secure viewer failures without losing power state
+**Tests**
+
+- `security` inspect organization fixture through one descriptor
+
## 2026-09-17
**Added**
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index a07d68ae..24dc81c0 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,11 @@
+## 2026-09-18 — Inspect Organization fixture permissions and bytes on one descriptor
+
+The combined release's hosted CodeQL scan identified a filesystem race in the new
+Organization flow test: it inspected a pathname with stat and then opened it separately
+for reading. The fixture now opens once without following a final symlink, checks the
+same descriptor's permissions, reads those bytes and closes in finally. All persistence
+assertions remain; runtime Organization behavior, scanner policies and ignores are unchanged.
+
## 2026-09-18 — Reconcile pending browser and dependency work with Organization main
Preserve the released Organization project-flow implementation while merging the previously
diff --git a/lib/agent/organization-flow.test.ts b/lib/agent/organization-flow.test.ts
index 473c3e63..6dde184d 100644
--- a/lib/agent/organization-flow.test.ts
+++ b/lib/agent/organization-flow.test.ts
@@ -1,5 +1,6 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { mkdtemp, readFile, rm, stat } from "node:fs/promises";
+import { mkdtemp, open, rm } from "node:fs/promises";
+import { constants } from "node:fs";
import os from "node:os";
import path from "node:path";
import { changeOrganizationFlow } from "./organization-flow-mutations";
@@ -27,9 +28,12 @@ describe("organization project flow persistence", () => {
expect(saved.units.find((u) => u.id === "unit-a")?.projectFlow?.notes).toBe("# Source\n\nStill unconfirmed.\n");
expect(saved.units.find((u) => u.id === "unit-b")?.projectFlow).toBeUndefined();
expect(saved.seats).toEqual(chart.seats);
- expect((await stat(api.ORGANIZATION_STORE_PATH)).mode & 0o077).toBe(0);
- const raw = JSON.parse(await readFile(api.ORGANIZATION_STORE_PATH, "utf8"));
- expect(raw.units.find((u: { id: string }) => u.id === "unit-a").projectFlow.title).toBe("Delivery");
+ const handle = await open(api.ORGANIZATION_STORE_PATH, constants.O_RDONLY | constants.O_NOFOLLOW);
+ try {
+ expect((await handle.stat()).mode & 0o077).toBe(0);
+ const raw = JSON.parse(await handle.readFile("utf8"));
+ expect(raw.units.find((u: { id: string }) => u.id === "unit-a").projectFlow.title).toBe("Delivery");
+ } finally { await handle.close(); }
expect((await api.getOrganizationChart()).units).toEqual(saved.units);
});
it("supports node/edge CRUD and position-only patches without dropping notes", async () => {