Skip to content

Commit 952f8f0

Browse files
committed
chore: update progress for US-108
1 parent 30869cd commit 952f8f0

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

scripts/ralph/prd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,7 @@
21062106
"Tests pass"
21072107
],
21082108
"priority": 125,
2109-
"passes": false,
2109+
"passes": true,
21102110
"notes": "Audit H4 (partial gap). US-126 caps FD table and event listeners but not the active-handles.ts map. Spawning thousands of child processes or timers grows the map without bound."
21112111
},
21122112
{

scripts/ralph/progress.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,3 +1596,20 @@ PRD: ralph/kernel-hardening (46 stories)
15961596
- Budget defaults live in isolate-bootstrap.ts alongside other constants; undefined means unlimited for all budget fields
15971597
- The "normal code" test intentionally omits resourceBudgets to exercise the default value path
15981598
---
1599+
1600+
## 2026-03-18 - US-108
1601+
- What was implemented: Added configurable max size cap (default 10000) to the ActiveHandles map, preventing unbounded growth from spawning thousands of child processes, timers, or servers
1602+
- Files changed:
1603+
- packages/secure-exec-core/src/runtime-driver.ts — added `maxHandles` to ResourceBudgets interface
1604+
- packages/secure-exec-core/src/bridge/active-handles.ts — added `_maxHandles` declaration and cap enforcement in `_registerHandle` (skips check for re-registration of existing handle)
1605+
- packages/secure-exec-core/isolate-runtime/src/common/runtime-globals.d.ts — added `_maxHandles` global declaration
1606+
- packages/secure-exec-node/src/isolate-bootstrap.ts — added `maxHandles` to DriverDeps, added DEFAULT_MAX_HANDLES = 10_000
1607+
- packages/secure-exec-node/src/execution-driver.ts — imported DEFAULT_MAX_HANDLES, wired `maxHandles` through to deps
1608+
- packages/secure-exec-node/src/bridge-setup.ts — added `maxHandles` to deps Pick type, injects `_maxHandles` into isolate jail
1609+
- packages/secure-exec/tests/runtime-driver/node/resource-budgets.test.ts — added 2 tests: cap enforcement and slot reuse after removal
1610+
- **Learnings for future iterations:**
1611+
- Active handle cap follows the same pattern as _maxTimers: host injects a number global into the bridge jail, bridge checks synchronously before registering
1612+
- _registerHandle allows re-registration of an existing ID without counting against the cap (idempotent set behavior)
1613+
- Testing handle cap directly via _registerHandle/_unregisterHandle globals from sandbox code is simpler and more reliable than testing through child_process.spawn (which has async lifecycle)
1614+
- The 5 failures in tests/runtime-driver/node/index.test.ts (ECONNREFUSED + upgrade) are pre-existing and unrelated
1615+
---

0 commit comments

Comments
 (0)