Repository navigation
[APPS-2945] Update: drop the in-process local execution guard in favor of Node's permission model - #563
Conversation
9ff1de7 to
267c2ee
Compare
267c2ee to
7547a80
Compare
e898bea to
481364f
Compare
7547a80 to
96f4d63
Compare
481364f to
e574841
Compare
f05dc6f to
1bed9e6
Compare
e574841 to
34a9189
Compare
1bed9e6 to
1432b86
Compare
34a9189 to
abf34ad
Compare
2903b26 to
b358421
Compare
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 4b6c911 | Docs | View more details | Give us feedback! |
10d99f9 to
121756b
Compare
abf34ad to
892bda9
Compare
121756b to
e2cb304
Compare
bd21790 to
2352fe9
Compare
e2cb304 to
c862d97
Compare
2352fe9 to
e7d5434
Compare
c862d97 to
4154548
Compare
e7d5434 to
1fa97d9
Compare
4154548 to
7172f41
Compare
e44fe4a to
141d960
Compare
a24b4d7 to
1bc16e4
Compare
7509268 to
eb7a6fb
Compare
1bc16e4 to
55ce6f0
Compare
eb7a6fb to
92afaf2
Compare
55ce6f0 to
8f7e414
Compare
Live Debugger Runtime BenchmarkSDK-loaded dormant-probe runtime overhead, measured against an uninstrumented bundle in the same browser session.
What do the Tiny and Hot workloads represent? Browser Debugger SDK: Full diagnosticsRaw samples are in the |
92afaf2 to
b71e121
Compare
8f7e414 to
0b521ee
Compare
There was a problem hiding this comment.
🟢 Approval recommended
Static review identified no blocking issues; the remaining feedback concerns only non-blocking coding conventions.
No open issues 🎉
What changed in this PR
This PR simplifies the apps plugin’s local backend execution by removing the in-process guard while retaining Node’s permission-model limits where available. Cloud execution, dev:verify, and builds remain unchanged.
Changes:
- Remove the JavaScript guard and allow unrestricted execution on fallback paths, with a one-time warning.
- Add actionable permission-refusal messages pointing to
dev:verify. - Update documentation and tests, and remove the unused
graceful-fsdependency.
| File | Description |
|---|---|
yarn.lock |
Remove the apps workspace’s direct graceful-fs entry. |
packages/tests/src/_jest/fixtures/apps_backend_project/childSandbox.backend.ts |
Add fixtures for permission refusals and lookalike errors. |
packages/plugins/apps/src/vite/probe-dir.fixtures.ts |
Clarify a fixture comment’s terminology. |
packages/plugins/apps/src/vite/network-guard.ts |
Delete the in-process guard. |
packages/plugins/apps/src/vite/network-guard.test.ts |
Delete obsolete guard tests. |
packages/plugins/apps/src/vite/local-execution.ts |
Remove guard installation and guarded execution. |
packages/plugins/apps/src/vite/local-execution.test.ts |
Replace guard assertions with unrestricted execution coverage. |
packages/plugins/apps/src/vite/local-execution-sandbox.ts |
Update the fallback behavior docstring. |
packages/plugins/apps/src/vite/local-execution-protocol.ts |
Remove the guard-installation configuration field. |
packages/plugins/apps/src/vite/local-execution-process.ts |
Warn once when child calls run unrestricted. |
packages/plugins/apps/src/vite/local-execution-process.integration.test.ts |
Cover warnings, refusals, and child-entry imports. |
packages/plugins/apps/src/vite/local-execution-limits.ts |
Define warnings and permission-error hints. |
packages/plugins/apps/src/vite/local-execution-limits.test.ts |
Test hint mapping and unrelated-error preservation. |
packages/plugins/apps/src/vite/local-execution-child.ts |
Remove guards and attach permission hints to failures. |
packages/plugins/apps/src/vite/index.ts |
Replace guard setup with an unrestricted-execution warning. |
packages/plugins/apps/src/vite/index.test.ts |
Update startup and fallback warning coverage. |
packages/plugins/apps/src/vite/dev-server.integration.test.ts |
Remove guard-specific dynamic-import tests. |
packages/plugins/apps/src/index.test.ts |
Remove an obsolete guard-related comment. |
packages/plugins/apps/README.md |
Document unrestricted fallbacks and refusal hints. |
packages/plugins/apps/package.json |
Remove the unused graceful-fs devDependency. |
Review effort: Balanced
b71e121 to
368c9ee
Compare
0b521ee to
8648292
Compare
368c9ee to
67fb3ed
Compare
8648292 to
852a786
Compare
67fb3ed to
539234b
Compare
852a786 to
4421a6b
Compare
539234b to
2c6b514
Compare
4421a6b to
58736e9
Compare
2c6b514 to
acb744e
Compare
|
/merge |
… Node's permission model Local execution's in-process JavaScript guard patched fs, child_process, worker_threads and process.chdir to refuse writes and subprocesses on the paths where a call can't run under Node's permission model. The Node backend runtime itself allows those operations, and comparable local runners don't build a JavaScript file-system guard, so the guard blocked code that runs in production while not being a security boundary. The guard, its tests and its wiring are removed. On a Node without the permission model, or without --allow-inspector while debugging, a call's process runs unrestricted and the dev server warns once that production's limits aren't enforced locally and that dev:verify runs functions on the real runtime. A call's own process under the permission model keeps Node's limits. A refusal from Node's permission model that fails the call is reported with a message naming what was refused, the refused path for a file refusal or Node's own reason for an API it refuses without a scope, such as fs.symlink on Node 24, and the dev:verify hint, keeping the call's own stack frames. The unused graceful-fs devDependency goes with the guard's tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/merge |
|
View all feedbacks in Devflow UI.
Progress updates will be sent here directly.
The expected merge time in
The expected merge time in
The expected merge time in
The expected merge time in
The expected merge time in
It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.
The expected merge time in
⏳ Processing |
Motivation
dev:verifyis the parity check.Architecture
flowchart TD E["/__dd/executeAction"] --> P{"Node's permission model usable?"} P -->|"yes"| C["call's own process under --permission"] C --> H["a refusal fails the call with a dev:verify hint"] P -->|"no, or --inspect without --allow-inspector"| U["call's own process, unrestricted"] U --> W["one warning per dev server"]Changes
8 changes across network-guard.ts, local-execution*.ts, package.json, README.md and tests
src/vite/network-guard.ts,src/vite/network-guard.test.ts(deleted)local-execution-child.tsprocess.permission, which decides whether modules getimport.meta.resolve.local-execution-child.tslocal-execution-process.tslocal-execution-limits.tsgraceful-fsdevDependency.package.jsonREADME.mdmodule.registerHooks.local-execution-limits.test.ts,local-execution-process.integration.test.tsQA Instructions
58736e9f, run 1 also from a scaffold outside/tmp, using the helper scripts from [APPS-2945] Update: switch the apps plugin's static checks to the Node backend runtime #557./var/tmp, Node 20 and 24--inspect--inspect/tmp, Node 20 and 24dev:verifyFixtures, run commands and output
src/guardRefusal.backend.ts:src/guardRun.backend.ts:src/useFetch.backend.ts:src/symlinkRefusal.backend.ts:Blast Radius
Out of Scope / Follow-ups
4 items deferred
/tmpis writable from a call's own process, since the permission model grants/tmpfs.cpSyncdestination or symlink target as a read; everywhere,module.registeras a worker thread), so the hint names that scopeDocumentation
🤖 Generated with Claude Code