Skip to content

vfs: add ComposableProvider for layered mounts - #66235

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:vfs-composable-provider
Oct 5, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:vfs-composable-provider

Conversation

@mcollina

Copy link
Copy Markdown
Member

Allow providers to be layered at one mount point. Reads search layers in priority order, while writes copy lower-layer files to the first provider and deletions hide lower copies without changing them.


AI gen, reviewed by me.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. vfs Issues and PRs related to the virtual filesystem subsystem. labels Sep 23, 2026
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.22488% with 137 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.24%. Comparing base (e7d8ab5) to head (11be3bd).
⚠️ Report is 229 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/vfs/providers/composable.js 67.06% 134 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66235      +/-   ##
==========================================
- Coverage   90.30%   90.24%   -0.06%     
==========================================
  Files         789      790       +1     
  Lines      272880   273298     +418     
  Branches    52110    52191      +81     
==========================================
+ Hits       246418   246647     +229     
- Misses      16912    17104     +192     
+ Partials     9550     9547       -3     
Files with missing lines Coverage Δ
lib/vfs.js 100.00% <100.00%> (ø)
lib/internal/vfs/providers/composable.js 67.06% <67.06%> (ø)

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Q16solver added a commit to Esposter/Esposter that referenced this pull request Sep 24, 2026
…t model

vfs 0.5 ("align userland VFS mounts and fs hooks with Node.js") mounts the
way core node:vfs does: mount() takes no path and returns a mount point in a
reserved namespace under os.devNull, so a path is served by one VFS or by
the disk, never both. Core's docs give the reason — no mounted layer may
shadow a real directory — and say VFS is no security boundary.

- FsProvider.mount() returns the mount point; the overlay option goes (0.5
  calls it shim-only, core has none), so the node:vfs swap stays one file.
- runNodeInProcess no longer mounts: it mounted an empty overlay at the cwd
  and never wrote into it, so every read and write already went to disk.
- The provider tests address files under the returned mount point and pin
  that a mounted provider never shadows a real path.
- The vfs hold in renovate.json is dropped; docs describe the mount model and
  core's open layered-mount work (nodejs/node#66235) as the path to a RAM
  overlay of the cwd.
- staleNames: two identifiers the dependency skill cited that no longer exist.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019dwem6ZLsMCyc52v9UbhFV
}

// Providers are ordered from highest priority (and write target) to lowest.
// Removing a file records a whiteout so a lower copy cannot reappear.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: a bit more comment detail on the expected semantics would be helpful but non-blocking.

Allow providers to be layered at one mount point. Reads search layers
in priority order, while writes copy lower-layer files to the first
provider and deletions hide lower copies without changing them.

Assisted-by: pi
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina
mcollina force-pushed the vfs-composable-provider branch from 8a659db to 11be3bd Compare September 24, 2026 21:55
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 3, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 3, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Oct 4, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Oct 4, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 5, 2026
@nodejs-github-bot
nodejs-github-bot merged commit ad55417 into nodejs:main Oct 5, 2026
81 of 82 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in ad55417

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. vfs Issues and PRs related to the virtual filesystem subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants