2 months ago
564e14cproc.ts: the process-lifecycle engine (spec §1.7, amendment 4). run() ports the full execFileCompat errorCode contract (TIMEOUT/124, ABORT_ERR/130, ENOENT, MAXBUFFER) but spawns POSIX children detached so timeout/abort/ overflow kill the whole process TREE via kill(-pgid) + SIGKILL escalation; win32 uses taskkill /T /F (no Job Object API in pure Bun — PID-reuse raciness documented). Output decodes via text.decodeChildOutput (the mid-code-point maxBuffer-truncation bug is fixed). spawnStreaming/ChildHandle absorb subprocess.ts. terminateGracefully takes requestShutdown (the JSON-RPC shutdown hook) and falls back to stdin-EOF then killTree. isAlive with the one conservative liveness policy. registerShutdownSignals with opt-in stdin-EOF (headless servers must not exit at boot). 42 tests incl. a live grandchild-heartbeat tree-kill proof. fs.ts: atomic filesystem primitives (spec §1.9, trimmed per critique). writeFileAtomic/replaceFileAtomic/replaceExecutableAtomic (never delete-first, win32 lock-code retry, EXDEV copy+fsync+rename), moveWithFallback (typed FileLockedError), removeWithRetry, acquireLockDir (mkdir-based, dead-owner stale break), symlink (win32 junction fallback + typed SymlinkPrivilegeError), hardenPrivate* (posix mode bits, documented win32 no-op). 56 tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Parentde67a62