Skip to content

fix(platform-node): use native realpath on Windows - #9489

Merged
tim-smart merged 4 commits into
Effect-TS:mainfrom
changazo:windows-native-realpath
Oct 18, 2026
Merged

tim-smart merged 4 commits into
Effect-TS:mainfrom
changazo:windows-native-realpath

Conversation

@changazo

@changazo changazo commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

FileSystem.realPath can reject a readable Windows AppContainer workspace because
the JavaScript callback implementation inspects an ungranted ancestor. Select
fs.realpath.native on Windows while preserving the existing callback/error
adapters and other platforms' implementation.

The existing filesystem test gains one directory-alias canonicalization assertion.
This is compatibility coverage, not a restricted-AppContainer reproduction.
A patch changeset covers @effect/platform-node-shared.

Author-reported validation on Windows, against the current main/package 4.0.5 source:

  • pnpm lint-fix and the affected package check pass.
  • pnpm test --run packages/platform/node-shared/test/NodeFileSystem.test.ts on
    Node 25.6.0: 62 pass, one recursive-watch failure. Unmodified baseline: 61 pass
    and the same failure. The new canonicalization test passes.
  • Root pnpm check fails TS6133 for an unused Schedule metadata parameter;
    the exact same diagnostic reproduces on the unmodified baseline.
  • Actual current source compiled with Bun 1.4.2: AppContainer physical/alias/
    roundtrip resolution changes from failure to success; missing paths remain
    NotFound, the truly denied root remains EPERM, and owned cleanup passes.

Full-root and cross-platform checks are not green. Related Windows reproduction:
anomalyco/opencode#53508. The separate OpenCode sync
helper needs its own correction; this PR does not claim current-dev ACP coverage.

Tests-only takeover validation (Linux): filesystem suite 63/63 passed;
pnpm lint-fix and root pnpm check passed. Windows AppContainer and Bun
validation have not been independently repeated during that pass.

Independent implementation validation (Linux, Node 26.7.0 / Bun 1.3.13):

  • No implementation refactor needed: the Windows-only callback selection preserves
    both existing error adapters and leaves other platforms unchanged.
  • Both the actual shared service and the native callback with the same adapters
    resolved physical/alias/normalized paths. Missing paths retained ENOENT /
    NotFound; actual mode-denied traversal retained EACCES / PermissionDenied and
    original cause/path/syscall; NUL-containing paths retained BadArgument.
  • Node filesystem suite: 63/63 passed; root pnpm check passed. No tests changed.
  • This host has no Windows/AppContainer execution environment. Linux native-adapter
    probes do not verify Windows selection, junction semantics, restricted-ancestor
    access, or Windows EPERM behavior. Those results remain author-reported.

Closes EFF-2430

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 214745f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
@effect/platform-node-shared Patch
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.09 KB 39.09 KB 0.00 KB (0.00%)
basic.ts 7.02 KB 7.02 KB 0.00 KB (0.00%)
batching.ts 10.82 KB 10.82 KB 0.00 KB (0.00%)
brand.ts 6.71 KB 6.71 KB 0.00 KB (0.00%)
cache.ts 11.33 KB 11.33 KB 0.00 KB (0.00%)
config.ts 22.52 KB 22.52 KB 0.00 KB (0.00%)
differ.ts 21.61 KB 21.61 KB 0.00 KB (0.00%)
http-client.ts 24.00 KB 24.00 KB 0.00 KB (0.00%)
http-router.ts 35.65 KB 35.65 KB 0.00 KB (0.00%)
logger.ts 11.68 KB 11.68 KB 0.00 KB (0.00%)
metric.ts 9.16 KB 9.16 KB 0.00 KB (0.00%)
optic.ts 6.93 KB 6.93 KB 0.00 KB (0.00%)
pubsub.ts 15.77 KB 15.77 KB 0.00 KB (0.00%)
queue.ts 12.59 KB 12.59 KB 0.00 KB (0.00%)
schedule.ts 11.77 KB 11.77 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 13.81 KB 13.81 KB 0.00 KB (0.00%)
schema-binary.ts 40.55 KB 40.55 KB 0.00 KB (0.00%)
schema-class.ts 21.31 KB 21.31 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 32.39 KB 32.39 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 27.59 KB 27.59 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.03 KB 15.03 KB 0.00 KB (0.00%)
schema-string.ts 12.07 KB 12.07 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.29 KB 16.29 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 38.61 KB 38.61 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 25.66 KB 25.66 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 20.54 KB 20.54 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 20.73 KB 20.73 KB 0.00 KB (0.00%)
schema-toFormatter.ts 20.84 KB 20.84 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 25.46 KB 25.46 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 20.83 KB 20.83 KB 0.00 KB (0.00%)
schema.ts 20.50 KB 20.50 KB 0.00 KB (0.00%)
stm.ts 13.87 KB 13.87 KB 0.00 KB (0.00%)
stream.ts 10.11 KB 10.11 KB 0.00 KB (0.00%)

@effect-bot
effect-bot marked this pull request as ready for review October 18, 2026 08:47
effect-janitor[bot]
effect-janitor Bot previously approved these changes Oct 18, 2026
@tim-smart
tim-smart merged commit 41cf29b into Effect-TS:main Oct 18, 2026
10 of 11 checks passed

This branch is waiting to be deployed

1 waiting deployment
fork — 214745f8 Waiting Oct 18, 2026 by effect-bot via approval-gate #20887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants