@ai-ecoverse/slicc-kernel 1.164.1 → 1.164.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
@@ -427,9 +427,9 @@ The module's default export (or its `main` export) is called with a context and
427
427
  - **What `fn` gets:** a fresh array of V8 CallSites holding only the program's own frames (its modules, `data:` imports, `sync.runScript` scripts and code they `eval`), `node:` frames and native frames. Kernel frames are dropped by script identity, so a script named like a kernel file doesn't let them through, and so are host files. A program's strict frames give `getFunction()` and `getThis()` as `undefined`.
428
428
  - **Fallback:** if `fn` throws or returns a non-string, or an error is formatted while `fn` runs, the default stack is used.
429
429
  - **How it works:** process workers start with `--expose-internals`, so the worker can install the formatter before the lockdown. Host flags a worker refuses are dropped. If the worker still can't start with the flag, the method is absent. Every `internal/*` and `node:internal/*` module stays refused to programs, as do `node:module` and `node:worker_threads`.
430
- - `sync.errorSource(error)` (#1610, slicc-jsh#1082) is Node only, so check it with `typeof ctx.sync.errorSource === 'function'`. It gives `{ sourceLine, lineNumber, startColumn }` (null-prototype and frozen), the source line Node prints over an uncaught error, for an error V8 raised in the program's own code. That includes a direct `eval` of a value that isn't a string literal (`const s = 'null.d'; eval(s)` gives `null.d` and line 1) and a `sync.runScript` script.
430
+ - `sync.errorSource(error)` (#1610, slicc-jsh#1082) is Node only, so check it with `typeof ctx.sync.errorSource === 'function'`. It gives `{ sourceLine, lineNumber, startColumn }` (null-prototype and frozen), the source line Node prints over an uncaught error, for an error in the program's own code. The kernel takes V8's position while the stack is formatted (#1633), so this also works after `.stack` was read, and for a call of a non-function, a ReferenceError, a TDZ error or a thrown `Error`. That includes a direct `eval` of a value that isn't a string literal (`const s = 'null.d'; eval(s)` gives `null.d` and line 1) and a `sync.runScript` script.
431
431
  - **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.
432
- - **`undefined` cases:** kernel-made errors; values that aren't native errors; an error V8 kept no position for (a `new Error()` the program constructs); a script that borrows the kernel worker's name; and an error an own `Error.prepareStackTrace` formats.
432
+ - **`undefined` cases:** kernel-made errors; values that aren't native errors; a script that borrows the kernel worker's name; and an error an own `Error.prepareStackTrace` formats.
433
433
  - **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.
434
434
  - **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 same holds in `CallSite.toString()` and `getScriptNameOrSourceURL()`, which a program's own `Error.prepareStackTrace` gets; `getFileName()` still returns the bundle's file URL. 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.
435
435
  - `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.
@@ -818,6 +818,7 @@ The proxy answers `200` with `Content-Type: application/vnd.slicc.raw-fetch`: a
818
818
  - **Limits:**
819
819
  - A kernel without `/proc/sys/kernel/slicc_rename_acks` (older than #1140) doesn't answer and isn't waited for ([#1309](https://github.com/ai-ecoverse/slicc-kernel/issues/1309)). It can still see a tree mid-move, and a write it has in flight when the rename starts can land in the old copy and be lost.
820
820
  - An open descriptor follows a rename by another process, of its file or of a directory above it ([#1257](https://github.com/ai-ecoverse/slicc-kernel/issues/1257), see "A rename by another process" above), also when the rename was in another tab.
821
+ - While another tab shares the root, an op through a descriptor that finds its name empty waits up to 1 s (100 ms alone) for the other tab's move to arrive, and keeps following moves for up to 2 s, so a file moved back and forth isn't lost ([#1442](https://github.com/ai-ecoverse/slicc-kernel/issues/1442)). A file that was really removed, not moved, so fails with `ENOENT` after up to 1 s instead of 100 ms, or up to about 3 s in a root where other files keep being renamed meanwhile, since any rename seen counts as a move to follow.
821
822
  - A peer's call that is already in flight and then reaches into the renaming tree through a call of its own (a rename removing the name it replaces) waits for the rename, while the rename waits for that peer's answer. After the 10 s cap the rename fails with `EBUSY`, nothing has moved, and the peer's call goes on.
822
823
 
823
824
  A lookup follows at most 40 symlinks, as Linux does: the 41st is `ELOOP`, for WASI programs, JS programs and the kernel API alike, with or without `..` in a link's target. Emscripten programs resolve paths in their glue, which stops one link earlier, at 40.
@@ -8444,7 +8444,7 @@ function satisfies(version, range2) {
8444
8444
  }
8445
8445
 
8446
8446
  // src/version.ts
8447
- var KERNEL_VERSION = true ? "1.164.1" : "0.0.0-dev";
8447
+ var KERNEL_VERSION = true ? "1.164.3" : "0.0.0-dev";
8448
8448
  var OS_RELEASE = "6.0.0-slicc";
8449
8449
  function procVersion() {
8450
8450
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC