@ai-ecoverse/slicc-kernel 1.166.1 → 1.166.3

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/README.md CHANGED
@@ -433,7 +433,7 @@ The module's default export (or its `main` export) is called with a context and
433
433
  - **Only the program's own code:** it answers only when the error's top frame is a program frame and the position V8 kept is in that same script and line.
434
434
  - **`undefined` cases:** kernel-made errors; values that aren't native errors; and a script that borrows the kernel worker's name. An error an own `Error.prepareStackTrace` formats answers too (#1631).
435
435
  - **How it works:** it reads V8's message through Node's internal errors binding, which the worker loads at start-up through the same `--expose-internals` as `setStackFormatter`. It prints no warning and needs no inspector.
436
- - **Kernel frames in a program's stacks** (#1583): on the Node entry, the process worker's bundle names itself `slicc-kernel:/node-process-worker.js` (a `sourceURL`), so the kernel's own frames in an error a program sees (its own errors, a failed `ctx` call, `runScript`) show that name and not the host directory the kernel is installed in. The stack formatter, and an own `Error.prepareStackTrace` called through `{ own: true }`, get no kernel CallSites at all (#1612, #1631). Line and column numbers are unchanged, so they still point into `dist/node-process-worker.js`. Don't run an embedder with `--enable-source-maps` if program-visible paths matter: Node then maps the kernel's frames back to the absolute paths of its sources. In a browser the frames keep the bundle's URL, because Chrome ignores `sourceURL` in a module worker loaded by URL.
436
+ - **Kernel frames in a program's stacks** (#1583, #1656): on the Node entry, each process worker compiles its strict CommonJS bundle as a classic script named `slicc-kernel:/node-process-worker.js`. That is V8's script name, not just a `sourceURL`: kernel frames in a program's own errors, failed `ctx` calls and `runScript` use it in `.stack` and in every CallSite path method, including `getFileName()` and `getEvalOrigin()`. The bootstrap keeps its bindings private and uses a virtual base for builtin loading; no host bundle URL enters the worker. Its V8 code cache is made in workers and kept only in host memory, separate from the program module compile cache. The stack formatter, and an own `Error.prepareStackTrace` called through `{ own: true }`, get no kernel CallSites at all (#1612, #1631). Line and column numbers are unchanged, so they point into `dist/node-process-worker.cjs` on the default Node entry. **Documented exception: `--enable-source-maps`** allows Node to map frames back to source paths; don't enable it if program-visible paths matter. In a browser the frames keep the bundle's URL, because Chrome ignores `sourceURL` in a module worker loaded by URL. An explicit `worker` override keeps the embedder's worker script and its naming.
437
437
  - `module` (#1598, slicc-jsh#566) is a frozen `{ path }` with the command module's own path in the kernel's file system (e.g. `/usr/lib/node_modules/jsh/dist/jsh.mjs`), so a program can read its package's other files through `ctx.fs` on first use. It's the path the kernel found the package under, with symlinks left as they are (a pnpm-style `node_modules/<name>` link stays in it), and reads the same files through `ctx.fs`. It's a kernel path, never a host one, and a thread gets the same. It's absent for the kernel's built-in programs (`sudo`, `crontab`) and for a program run from inline source with no file.
438
438
  - `memory()`, synchronous and without a kernel call, measures the calling isolate: each `thread` answers for its own (#1240, slicc-jsh#397). It returns a fresh plain object of numbers in bytes, each field only where it's measured: `heapUsed`, `heapTotal`, `heapLimit` (V8's heap size limit), `external`, `arrayBuffers` and `rss`. On the Node entry they come from V8's heap statistics and Node's memory usage, through functions the worker captured before its lockdown, so nothing reachable from the program leads back to `process` or `v8`. `rss` is the host process's resident set size, as a Node worker thread reports it in `process.memoryUsage().rss`: it isn't per process, but shared by every process and thread of the kernel, and by any other kernel in that host process (#1563, slicc-jsh#539). In a browser `memory()` answers `{}` for now, with no `rss`.
439
439
  - **`thread`, kernel threads of the same process** ([#1094](https://github.com/ai-ecoverse/slicc-kernel/issues/1094)), the base for Node's `worker_threads` (tinypool, piscina, vitest's and jest's thread pools, eslint's concurrency). `thread.spawn({ data, transfer })` resolves with `{ tid, port, exited, terminate() }`.
@@ -8464,7 +8464,7 @@ function satisfies(version, range2) {
8464
8464
  }
8465
8465
 
8466
8466
  // src/version.ts
8467
- var KERNEL_VERSION = true ? "1.166.1" : "0.0.0-dev";
8467
+ var KERNEL_VERSION = true ? "1.166.3" : "0.0.0-dev";
8468
8468
  var OS_RELEASE = "6.0.0-slicc";
8469
8469
  function procVersion() {
8470
8470
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -1612,7 +1612,7 @@ function positionsAt(positions, error, site) {
1612
1612
  }
1613
1613
  }
1614
1614
  function record(positions, error, trace) {
1615
- if (typeof error === "object" && error !== null && trace.length > 0) {
1615
+ if (trace.length > 0 && isNativeError(error)) {
1616
1616
  noteSourceUrls(trace);
1617
1617
  const site = trace[0];
1618
1618
  const next = trace[1];