loopx icon indicating copy to clipboard operation
loopx copied to clipboard

[Bug]: native Windows: 34 control-plane TypeScript tests fail on POSIX-only path handling

Open JasonBuildAI opened this issue 1 month ago • 0 comments

Preflight

  • [x] I searched existing issues and discussions for this behavior.

  • [x] This report is not an unpatched security vulnerability.

  • [x] The report and attachments contain no credentials or private/internal material.

  • Issue origin: Observed or reproduced in a real environment

  • LoopX version or commit: 5c62c5c03

  • Host or runtime surface: Codex CLI

  • LoopX area: Control plane (goals, todos, quota, scheduler, registry, runtime)

Problem

LoopX supports native Windows development (a dedicated windows-powershell CI lane, Windows install and junction tests, and a series of native Windows fixes), but four files in the control-plane TypeScript suite assume POSIX path spelling. On a native Windows checkout, 34 of the suite's tests fail for reasons unrelated to product behavior, so npm run test:control-plane cannot serve as a pass/fail signal on that platform.

Three distinct path assumptions are involved:

  1. new URL(..., import.meta.url).pathname is used instead of fileURLToPath(...). A file URL's pathname is not a filesystem path; on Windows it reads /D:/..., and any consumer turns it into D:\D:\.... Affected: tests/control_plane_ts/content_digest_single_owner.test.ts (7 tests) and tests/control_plane_ts/delegation_preview_bridge.test.ts (4 tests).
  2. The fenced-caller parity comparator compares host-separator paths against a fixture authored with POSIX separators, both inside the printed envelope (lease_path) and in the runtime-relative effect keys. Affected: tests/control_plane_ts/legacy_writer_fence_caller_parity_support.ts (21 parity rows).
  3. Path components are split on "/" only. Affected: tests/control_plane_ts/scheduler_state_store.test.ts (2 tests). schedulerStatePath builds its path with node:path.join, so on Windows the whole path is returned as one "segment".

The same first defect makes the documented runnable example examples/dashboard-reward-append-browser-smoke.mjs derive a non-existent repoRoot (D:\D:\...), which it then uses as cwd and PYTHONPATH.

Minimal reproduction

git clone https://github.com/loopx-project/loopx
cd loopx
npm ci --ignore-scripts
# a Node.js >= 22.22.3 must be first on PATH; the Effect runtime rejects older ones
npm run test:control-plane

Expected behavior

Each test asserts product behavior instead of the host's path spelling: repository files are resolved through fileURLToPath, path components are split on the host separator, and the committed parity fixture is compared after normalizing separators (which is already how the fixture's {runtime_root} placeholder is handled).

Actual behavior

On Windows 11 with Node.js 24.19.0 the run reports # tests 4399 / # fail 68. 34 failures belong to the three assumptions above:

test at tests\control_plane_ts\legacy_writer_fence_caller_parity.test.ts:88:12
✖ fence parity: ts-acquire-engaged
    {
+   lease_path: '{runtime_root}\\goals\\goal-a\\task-leases\\todo_abc.json',
-   lease_path: '{runtime_root}/goals/goal-a/task-leases/todo_abc.json',
test at tests\control_plane_ts\content_digest_single_owner.test.ts:607:21
✖ no second whole-value digest matcher is reachable in the static model, outside recorded exceptions
  Error: ENOENT: no such file or directory, scandir 'D:\D:\App\...\loopx'
test at tests\control_plane_ts\scheduler_state_store.test.ts:208:51
✖ sanitized-equivalent scheduler scopes have distinct bounded paths
    assert.ok(segment.length <= 64)

Sanitized diagnostics

$ node --version
v24.19.0
$ npm run test:control-plane
# tests 4399
# pass 4271
# fail 68
# skipped 60

Additional context

The Python sibling tests/control_plane/test_shadow_fence_caller_parity_e2e.py compares the same fixture and fails on Windows for the same separator reason. Making it pass there also requires the ephemeral lock-holder sidecar behavior tracked in #6128, so that file is left to the owner of that issue rather than changed here.

The remaining 34 failures in the same run need host capabilities a default Windows shell lacks (creating symlinks without Developer Mode, fsync, POSIX signal reporting); they are not part of this report.

JasonBuildAI avatar Oct 10 '26 20:10 JasonBuildAI