You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: three places assume POSIX and fail on Windows — the executable-bit check, the process-group cascade, and the Mini App owner endpoint #20
Product or interface: Source build or repository tooling Version: source commit main (541bf9b3), Node 24.18.0, pnpm 10.x Platform: Windows OS version and architecture: Windows 11 x64 (10.0.26100) Issue area: Build / CI / source distribution
Summary
Three places in the runtime assume POSIX. On a Windows host each one makes a set of cases fail. Together they are 19 of the 47 failures node scripts/run-vitest-suite.mjs capability reports on a zh-CN Windows host. (The other 30 are the TUI locale, filed separately.)
1. The POSIX branch of the trash check asks for an executable bit (15 cases)
packages/local-runtime/src/infra/ensure-trash-script.ts reads the mode of the seeded POSIX script:
if((statSync(scriptPath).mode&0o111)===0){return{available: false,reason: 'mavis-trash is not executable'};}
Windows has no executable bit. Measured on this host:
after write mode=0o755 -> 666
after chmod 0o755 -> 666
exec bits set? -> false
So every case that simulates a POSIX platform on a Windows host (opts.platform: 'linux' and the like) gets not executable and the permission decision falls to deny. The cases live in packages/local-runtime/test/unit/local-permission-facade.test.ts (142 cases, 15 fail here).
The check is meaningful on POSIX and meaningless on Windows — skipping it where the platform has no such bit would keep the check everywhere else.
2. The stop cascade models a POSIX process group (2 cases)
packages/local-runtime-v2/test/integration/session-stop-cascade.integration.test.ts starts a background shell that publishes its own pid and expects the cascade to kill that process group:
$$ is a POSIX shell variable and sleep is a POSIX command. On Windows the shell is PowerShell, where $$ is the last token of the previous line, so the pid file comes back empty (Unusable pid file: ) and the case times out at 25 seconds. The premise itself does not hold: Windows has no process group, so "kill the group" has no Windows meaning.
3. The Mini App owner endpoint is scoped differently per platform (2 cases)
On POSIX the endpoint is named after the plugin data directory; on Windows it is named after the plugin id alone. Two Mini Apps with the same id in different data directories therefore share one named pipe on Windows, and the second one is locked out — held instead of acquired. The suite asserts the data-directory scoping (packages/local-runtime-v2/test/unit/miniapp/owner-lease.test.ts, 2 cases fail here), so the platform behaviour and the stated contract disagree.
Which one is intended is a product decision: "one owner per Mini App id, across every install" or "one owner per install". The code says the first, the case says the second.
What is needed
Each of the three is small, but they are three different decisions, so they may want three changes. The executable-bit check is the cheapest: one condition.
Correction to this issue's attribution: the 15 failing cases in the test:policy suite are not about the executable bit. They are the POSIX trash boundary of packages/local-runtime/test/unit/local-permission-facade.test.ts — 15 cases in LocalPermissionFacade, most of them in the POSIX host trash boundary describe block.
What actually happens on a Windows host:
The facade's evaluatePosixTrashSafety only runs on darwin/linux, and the test fixture's freshFacade can inject a platform and seed a POSIX trash script (platform, seedPosixTrash options), but these cases pass neither.
So the facade looks for a POSIX-named mavis-trash in the data directory, does not find one on Windows, and returns the deny whose reason is Recoverable deletion is unavailable, so this delete was blocked rather than performed permanently.
The cases then see deny where they expect allow, and an executionPlan that is undefined where they expect a recoverable-delete transform.
The product is not broken on Windows here — the Windows path is a different one (mavis-trash.cjs plus the .cmd launcher, driven host-side), and inspectTrashRuntime(dataDir, 'win32') on a seeded directory reports available.
Two ways to close it, both small:
Have the POSIX cases inject platform: 'linux' and seedPosixTrash: true, so they assert the POSIX contract on any host. This keeps the coverage everywhere.
Or skip them on win32.
The first is the better one: the fixture already offers exactly those two knobs, and the cases are about POSIX behaviour, not about the host they run on.
This is also why the failures are invisible: test:policy runs in no workflow (see #21), so a Windows contributor sees a red suite that no CI run ever reports.
Correction to my previous comment on this issue: I said the 15 failures are not about the executable bit. That was wrong, and the probe says so plainly.
Measured on this Windows host, with the fixture's own seeding path:
Windows has no execute bit, so chmod 0o755 leaves the mode at 666 and the POSIX branch of inspectTrashRuntime can never report available on this host. The facade turns that verdict into the deny whose reason is "Recoverable deletion is unavailable, so this delete was blocked rather than performed permanently" — which is why the failure reads like a missing recovery path rather than like a mode bit.
So the original attribution in this issue stands: the executable-bit check is what fails on Windows. The only thing my previous comment got right was the shape of the fix — the POSIX cases are about POSIX behaviour, not about the host they run on, and the fixture already injects a platform.
Two ways to close it, both small:
Skip the POSIX-only cases on win32 (describe.skipIf(process.platform === 'win32') around the POSIX trash boundary block). macOS and Linux keep the coverage.
Or make the executable-bit check meaningful on a host that has no execute bit — e.g. treat "the file exists and is readable" as the POSIX health condition when the host cannot report one — but that changes what the check means, so it is a product decision rather than a test fix.
Option 1 is the smaller and safer change.
Nothing on the Windows path is affected: inspectTrashRuntime(dataDir, 'win32') on a seeded directory reports available, and both the mavis-trash.cjs script and the mavis-trash.cmd launcher move files into the Recycle Bin here.
Checked the current implementation. On Linux, seeding the real POSIX trash fixture succeeded at mode 0755 and returned mavis-trash is not executable after changing its mode to 0666, reproducing the permission precondition from the Windows report. Calling the real owner endpoint resolver with win32 returned the same pipe for the same plugin ID in two different data directories, while the Linux paths differed. The cascade fixtures still use POSIX echo $$ and sleep. These are targeted checks, not a fresh Windows suite run. The shared runtime and test changes are outside the WebUI package, and switching Windows lease identity between plugin and data-directory scope would change ownership semantics. Leaving this open pending the upstream disposition and the intended lease contract.
Confirmed the fork-owned Mini App case and submitted PR #55. The Windows endpoint is keyed by plugin ID as documented in ADR 0020. The two-app test had reused one ID, and the POSIX endpoint test depended on the host platform. The patch corrects both fixtures and adds explicit Windows resolver assertions. Seven targeted tests pass on Linux, including the Windows resolver branch; native Windows named-pipe execution remains unverified. The other two failures are in shared upstream runtime fixtures (the POSIX trash permission assumption and the POSIX process-group command). Those parts remain for upstream disposition. This fork closure covers the Mini App tests and the routing decision, not a claim that all 19 original Windows failures now pass.
Activity
antianqi commentedon Nov 10, 2026
Correction to this issue's attribution: the 15 failing cases in the
test:policysuite are not about the executable bit. They are the POSIX trash boundary ofpackages/local-runtime/test/unit/local-permission-facade.test.ts— 15 cases inLocalPermissionFacade, most of them in thePOSIX host trash boundarydescribe block.What actually happens on a Windows host:
evaluatePosixTrashSafetyonly runs on darwin/linux, and the test fixture'sfreshFacadecan inject a platform and seed a POSIX trash script (platform,seedPosixTrashoptions), but these cases pass neither.mavis-trashin the data directory, does not find one on Windows, and returns the deny whose reason isRecoverable deletion is unavailable, so this delete was blocked rather than performed permanently.denywhere they expectallow, and anexecutionPlanthat isundefinedwhere they expect arecoverable-deletetransform.The product is not broken on Windows here — the Windows path is a different one (
mavis-trash.cjsplus the.cmdlauncher, driven host-side), andinspectTrashRuntime(dataDir, 'win32')on a seeded directory reports available.Two ways to close it, both small:
platform: 'linux'andseedPosixTrash: true, so they assert the POSIX contract on any host. This keeps the coverage everywhere.The first is the better one: the fixture already offers exactly those two knobs, and the cases are about POSIX behaviour, not about the host they run on.
This is also why the failures are invisible:
test:policyruns in no workflow (see #21), so a Windows contributor sees a red suite that no CI run ever reports.antianqi commentedon Nov 10, 2026
Correction to my previous comment on this issue: I said the 15 failures are not about the executable bit. That was wrong, and the probe says so plainly.
Measured on this Windows host, with the fixture's own seeding path:
Windows has no execute bit, so
chmod 0o755leaves the mode at 666 and the POSIX branch ofinspectTrashRuntimecan never report available on this host. The facade turns that verdict into the deny whose reason is "Recoverable deletion is unavailable, so this delete was blocked rather than performed permanently" — which is why the failure reads like a missing recovery path rather than like a mode bit.So the original attribution in this issue stands: the executable-bit check is what fails on Windows. The only thing my previous comment got right was the shape of the fix — the POSIX cases are about POSIX behaviour, not about the host they run on, and the fixture already injects a platform.
Two ways to close it, both small:
describe.skipIf(process.platform === 'win32')around the POSIX trash boundary block). macOS and Linux keep the coverage.Option 1 is the smaller and safer change.
Nothing on the Windows path is affected:
inspectTrashRuntime(dataDir, 'win32')on a seeded directory reports available, and both themavis-trash.cjsscript and themavis-trash.cmdlauncher move files into the Recycle Bin here.Fectivnfy112357 commentedon Nov 20, 2026
Checked the current implementation. On Linux, seeding the real POSIX trash fixture succeeded at mode 0755 and returned mavis-trash is not executable after changing its mode to 0666, reproducing the permission precondition from the Windows report. Calling the real owner endpoint resolver with win32 returned the same pipe for the same plugin ID in two different data directories, while the Linux paths differed. The cascade fixtures still use POSIX echo $$ and sleep. These are targeted checks, not a fresh Windows suite run. The shared runtime and test changes are outside the WebUI package, and switching Windows lease identity between plugin and data-directory scope would change ownership semantics. Leaving this open pending the upstream disposition and the intended lease contract.
Fectivnfy112357 commentedon Nov 20, 2026
Confirmed the fork-owned Mini App case and submitted PR #55. The Windows endpoint is keyed by plugin ID as documented in ADR 0020. The two-app test had reused one ID, and the POSIX endpoint test depended on the host platform. The patch corrects both fixtures and adds explicit Windows resolver assertions. Seven targeted tests pass on Linux, including the Windows resolver branch; native Windows named-pipe execution remains unverified. The other two failures are in shared upstream runtime fixtures (the POSIX trash permission assumption and the POSIX process-group command). Those parts remain for upstream disposition. This fork closure covers the Mini App tests and the routing decision, not a claim that all 19 original Windows failures now pass.