@ai-ecoverse/slicc-kernel 1.142.1 → 1.142.2

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
@@ -191,7 +191,7 @@ When the kernel goes away (the page closed or reloaded, `terminate()`), pending
191
191
 
192
192
  `@ai-ecoverse/slicc-kernel/node` runs the same kernel in Node without a browser, so packages built for SLICC can test against it. It is a testing entry, not a supported runtime: there is no OPFS, JS programs get the same guard as in the page but no sandbox (see [JS programs](#js-programs)), and nothing beyond what its tests use is promised.
193
193
 
194
- **Known issue, Node 24** ([#1129](https://github.com/ai-ecoverse/slicc-kernel/issues/1129)): V8 in Node 24 sometimes crashes the whole Node process with a `jit_page` check failure while a process worker starts or is torn down. slicc-cli measured 15 crashes in 1,600 runs on Node 24 and none in 1,600 on Node 26. Use Node 26 where you can. The `Node versions` workflow (nightly, and on demand) runs the suites that start the Node kernel on both versions and counts the crashes in each job's summary, so the `engines` floor can follow the numbers.
194
+ **Node 26 or later** ([#1129](https://github.com/ai-ecoverse/slicc-kernel/issues/1129)): `engines` asks for Node >=26. V8 in Node 24 sometimes crashed the whole Node process with a `jit_page` check failure while a process worker started or was torn down; slicc-cli measured 15 crashes in 1,600 runs on Node 24 and none in 1,600 on Node 26. The kernel's CI and release run on 26, and the nightly `Node versions` workflow keeps running the suites that start the Node kernel and counts any such crash.
195
195
 
196
196
  ```js
197
197
  import { createNodeKernel, nodeTransport } from '@ai-ecoverse/slicc-kernel/node';
@@ -1275,6 +1275,8 @@ var EXECUTABLE = /\/node_modules\/(?:@[^/]+\/)?[^/]+\/bin\//;
1275
1275
  var RENAMES = "/.slicc-renames";
1276
1276
  var RENAME_LOCK = "slicc-rename:";
1277
1277
  var RENAME_ADMIT = "slicc-rename-admit:";
1278
+ var escapeRoot = (name2) => name2.replace(/[%:]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
1279
+ var LEGACY_RENAME_LOCK = /^slicc-rename:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
1278
1280
  var PAIRED = /* @__PURE__ */ new Set(["rename", "link", "copyFile"]);
1279
1281
  var LISTINGS = /* @__PURE__ */ new Set(["readdir", "readdirStat"]);
1280
1282
  var RETRY = /* @__PURE__ */ Symbol("retry");
@@ -1439,6 +1441,7 @@ var OpfsFs = class {
1439
1441
  locks;
1440
1442
  lockPrefix;
1441
1443
  rootName;
1444
+ renamePrefix;
1442
1445
  constructor(root, meta = new MemoryMeta(), channel, options = {}) {
1443
1446
  this.root = root;
1444
1447
  this.meta = sidecar(meta);
@@ -1446,6 +1449,7 @@ var OpfsFs = class {
1446
1449
  this.locks = options.locks === void 0 ? lockManager() : options.locks ?? void 0;
1447
1450
  this.lockPrefix = `slicc-excl:${channel ?? ""}:`;
1448
1451
  this.rootName = channel;
1452
+ this.renamePrefix = `${RENAME_LOCK}${escapeRoot(channel ?? "")}:`;
1449
1453
  this.channel = channel === void 0 ? void 0 : new BroadcastChannel(channel);
1450
1454
  this.remote = channel === void 0 ? void 0 : new RemoteWatch(`${channel}:watch`, { locks: this.locks ?? null });
1451
1455
  if (this.remote) {
@@ -2610,7 +2614,7 @@ var OpfsFs = class {
2610
2614
  try {
2611
2615
  const locks = this.locks;
2612
2616
  if (locks) {
2613
- lock = `${RENAME_LOCK}${crypto.randomUUID()}`;
2617
+ lock = `${this.renameLocks()}${crypto.randomUUID()}`;
2614
2618
  this.ownLocks.add(lock);
2615
2619
  call?.release();
2616
2620
  await this.admitted(locks, lock, source.path, destination, place, hooks);
@@ -2702,6 +2706,13 @@ var OpfsFs = class {
2702
2706
  if (!known.trees.some(([a, b]) => a === tree2[0] && b === tree2[1])) known.trees.push(tree2);
2703
2707
  return known;
2704
2708
  }
2709
+ renameLocks() {
2710
+ return this.renamePrefix;
2711
+ }
2712
+ renameHere(name2) {
2713
+ if (name2 === void 0) return false;
2714
+ return name2.startsWith(this.renameLocks()) || LEGACY_RENAME_LOCK.test(name2);
2715
+ }
2705
2716
  async learnRenames() {
2706
2717
  for (const { rename } of await this.meta.under(RENAMES)) {
2707
2718
  if (rename?.lock === void 0 || this.ownLocks.has(rename.lock)) continue;
@@ -2710,7 +2721,7 @@ var OpfsFs = class {
2710
2721
  }
2711
2722
  async renamingElsewhere() {
2712
2723
  const { held = [] } = await this.locks.query();
2713
- return held.some(({ name: name2 }) => name2?.startsWith(RENAME_LOCK) && !this.ownLocks.has(name2));
2724
+ return held.some(({ name: name2 }) => this.renameHere(name2) && !this.ownLocks.has(name2));
2714
2725
  }
2715
2726
  lookForRenames() {
2716
2727
  const locks = this.locks;
@@ -2722,7 +2733,7 @@ var OpfsFs = class {
2722
2733
  this.queries++;
2723
2734
  const { held = [] } = await locks.query();
2724
2735
  const unknown = () => held.some(
2725
- ({ name: name2 }) => name2?.startsWith(RENAME_LOCK) && !this.ownLocks.has(name2) && !this.peerMoves.has(name2)
2736
+ ({ name: name2 }) => this.renameHere(name2) && !this.ownLocks.has(name2) && !this.peerMoves.has(name2)
2726
2737
  );
2727
2738
  if (unknown()) await this.learnRenames();
2728
2739
  if (!unknown()) {
@@ -7584,7 +7595,7 @@ function satisfies(version, range2) {
7584
7595
  }
7585
7596
 
7586
7597
  // src/version.ts
7587
- var KERNEL_VERSION = true ? "1.142.1" : "0.0.0-dev";
7598
+ var KERNEL_VERSION = true ? "1.142.2" : "0.0.0-dev";
7588
7599
  var OS_RELEASE = "6.0.0-slicc";
7589
7600
  function procVersion() {
7590
7601
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC