@warlock.js/process 5.39.2 → 5.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog — @warlock.js/process
2
2
 
3
+ ## 5.40.0 - 2026-10-29
4
+
5
+ ### Fixed
6
+
7
+ - Stopping a handle immediately after `spawn()` could fail with `ProcessNotOwnedError` on Linux while the launcher was replacing itself with the workload. The stop now waits out that moment before verifying ownership.
8
+ - Sampling a process that was exiting could report `ProcessNotOwnedError` from a slightly stale process-table snapshot. A mismatch is now re-read fresh first, and a process that is gone counts as exited.
9
+ - Calling `supervisor()` a second time in the same process with the same registry and owner (for example from a second copy of the module after a dev hot reload) now returns the live supervisor instead of failing every launch with "Process registry is already in use". Once `stopAll()` has finished the registry is free and a new supervisor is created. A different owner on the same registry is still refused.
10
+
11
+ ### Added
12
+
13
+ - `observationTimeoutMs` supervisor option: how long the ownership check waits for a guardian reply (and, on Windows, the process helper). Defaults to 2 s on Linux and 15 s on Windows and macOS; the timeout error now names the option.
14
+ - Platform defaults for `pollIntervalMs`: 100 ms on Linux, 500 ms on macOS, 1500 ms on Windows. Explicit values still win.
15
+
16
+ ### Changed
17
+
18
+ - Windows keeps one long-lived PowerShell helper per supervisor instead of starting PowerShell twice per observation. Observations made together share one query, polling reuses a snapshot up to one interval old, the helper restarts if it dies and closes with `stopAll()`.
19
+ - On Windows and macOS the launch gate waits on the guardian's pipe instead of reading the full process identity every 10 ms.
20
+
21
+ ### Fixed
22
+
23
+ - Members failed to start on a busy Windows machine with `Process ownership observation timed out`. The guardian now replies to the resume request before it launches the workload, so a slow program start no longer counts against the client's timeout.
24
+
3
25
  ## 5.34.3 - 2026-10-20
4
26
 
5
27
  ### Changed
package/README.md CHANGED
@@ -33,11 +33,11 @@ Public methods: `spawn`, `spawnPty`, `list`, `stop`, `stopPid`, `recover`,
33
33
  `stopAll`. Handles provide streams, `exited` (reason, exit code, signal, peak
34
34
  memory) and idempotent `stop`. Unowned PIDs throw `ProcessNotOwnedError`.
35
35
 
36
- | Platform | Identity and enforcement |
37
- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
38
- | Linux | `/proc` start ticks + boot ID + environment token; cgroup v2 → inherited rlimit/RSS fallback. |
39
- | macOS | `ps` start time (`LC_ALL=C TZ=UTC`) + environment token; inherited CPU/data rlimits and tree RSS polling. |
40
- | Windows | PowerShell/CIM creation time + environment token; `taskkill /PID <pid> /T /F` and tree working-set polling (`rss-polling`). |
36
+ | Platform | Identity and enforcement |
37
+ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
38
+ | Linux | `/proc` start ticks + boot ID + environment token; cgroup v2 → inherited rlimit/RSS fallback. |
39
+ | macOS | `ps` start time (`LC_ALL=C TZ=UTC`) + environment token; inherited CPU/data rlimits and tree RSS polling. |
40
+ | Windows | CIM creation time (one long-lived PowerShell helper) + environment token; `taskkill /PID <pid> /T /F` and tree working-set polling (`rss-polling`). |
41
41
 
42
42
  macOS and Windows memory caps are softer than Linux cgroups: polling can miss
43
43
  peaks and overshoot. No custom native code or identity-helper setup is required.
@@ -45,7 +45,7 @@ On these platforms the handle PID belongs to a small Node guardian that launches
45
45
  the workload after registry persistence. It proves its inherited environment
46
46
  token through a live local socket/named pipe; polling includes guardian overhead
47
47
  and descendants. Recovery uses the same PID/start-time/token verification.
48
- Windows needs Windows PowerShell with CIM available. `cpuSeconds` is POSIX-only;
48
+ Windows needs Windows PowerShell with CIM available. `pollIntervalMs` defaults to 100 ms on Linux, 500 on macOS and 1500 on Windows; `observationTimeoutMs` to 2 s on Linux and 15 s elsewhere. `cpuSeconds` is POSIX-only;
49
49
  `virtualMemoryBytes` is Linux-only. Timeouts work on all three platforms.
50
50
  Windows stops force the entire PID tree immediately; Job Objects are a future
51
51
  improvement for hard containment and memory caps.