diff --git a/gitnexus/src/core/embeddings/node-module-compat.ts b/gitnexus/src/core/embeddings/node-module-compat.ts index b32e854e91..8f41c5d22d 100644 --- a/gitnexus/src/core/embeddings/node-module-compat.ts +++ b/gitnexus/src/core/embeddings/node-module-compat.ts @@ -3,8 +3,10 @@ * * `module.registerHooks` — the synchronous ESM/CJS resolution-hook API the * embedding-stack resolvers rely on — was added in Node 22.15.0 (and 23.5.0 on - * the 23.x line). The gitnexus engines floor is `>=22.0.0`, which admits Node - * 22.0–22.14 AND 23.0–23.4, where the export is absent. + * the 23.x line). The gitnexus engines floor is `^22.18.0 || >=24.11.0`, so + * every supported runtime exposes it — but `engines` is advisory (not + * engine-strict), so a below-floor Node (22.0–22.14, or the unsupported + * 23.0–23.4 line) can still run, where the export is absent. * * In this `"type": "module"` package, a *static named* import of a missing * builtin export (`import { registerHooks } from 'node:module'`) is a diff --git a/gitnexus/src/core/embeddings/onnxruntime-common-resolver.ts b/gitnexus/src/core/embeddings/onnxruntime-common-resolver.ts index 2d494f2b71..8fd2ddf175 100644 --- a/gitnexus/src/core/embeddings/onnxruntime-common-resolver.ts +++ b/gitnexus/src/core/embeddings/onnxruntime-common-resolver.ts @@ -52,8 +52,8 @@ * per-resolution cost is a single string comparison. * * `module.registerHooks` is marked `@experimental` and requires Node >= 22.15 - * (the gitnexus engines floor is >= 22.0.0). On older runtimes it is absent and - * this is a graceful no-op: embeddings then resolve onnxruntime-common exactly + * (below the gitnexus engines floor of `^22.18.0 || >=24.11.0`). On below-floor + * runtimes it is absent and this is a graceful no-op: embeddings then resolve onnxruntime-common exactly * as before — fine on hoisted layouts. Any failure during installation is * swallowed. */ @@ -100,9 +100,9 @@ export const ensureOnnxRuntimeCommonResolvable = (): void => { attempted = true; try { - // Node < 22.15 / < 23.5 (the gitnexus engines floor is >= 22.0.0): no - // synchronous hooks API. Degrade gracefully — the import still works on - // hoisted layouts. + // Node < 22.15 / < 23.5 (below the gitnexus engines floor of + // ^22.18.0 || >=24.11.0): no synchronous hooks API. Degrade gracefully — + // the import still works on hoisted layouts. const registerHooks = getRegisterHooks(); if (typeof registerHooks !== 'function') return; diff --git a/gitnexus/src/core/embeddings/onnxruntime-node-resolver.ts b/gitnexus/src/core/embeddings/onnxruntime-node-resolver.ts index 65465eb00d..f630384ca9 100644 --- a/gitnexus/src/core/embeddings/onnxruntime-node-resolver.ts +++ b/gitnexus/src/core/embeddings/onnxruntime-node-resolver.ts @@ -36,8 +36,8 @@ * So CUDA-12 hosts, Windows (DirectML), macOS, and CPU-only hosts are * untouched. Idempotent; any failure is swallowed and leaves the default * resolution exactly as before. `module.registerHooks` requires Node >= 22.15 - * (the gitnexus engines floor is >= 22.0.0); on older runtimes the redirect is - * a no-op, but the default copy's CUDA major is still probed so an + * (below the gitnexus engines floor of `^22.18.0 || >=24.11.0`); on below-floor + * runtimes the redirect is a no-op, but the default copy's CUDA major is still probed so an * already-matching host (e.g. CUDA 12 + transformers' CUDA-12 build) keeps * auto-selecting the GPU. * `npm link` / symlinked local-dev checkouts are a known caveat: `resolveOurOrtNodeDir`/ diff --git a/gitnexus/src/core/embeddings/runtime-install.ts b/gitnexus/src/core/embeddings/runtime-install.ts index b7c054b0b8..e522747467 100644 --- a/gitnexus/src/core/embeddings/runtime-install.ts +++ b/gitnexus/src/core/embeddings/runtime-install.ts @@ -191,7 +191,7 @@ export const ensureEmbeddingStackResolvable = (): void => { hookAttempted = true; try { - // Node < 22.15 / < 23.5 (engines floor is >= 22.0.0): no synchronous hooks + // Node < 22.15 / < 23.5 (below the engines floor of ^22.18.0 || >=24.11.0): no synchronous hooks // API. Degrade gracefully — normally-installed stacks still resolve; only // the runtime-prefix fallback is unavailable. Reachable now that the import // is a namespace access (see node-module-compat.ts) rather than a static diff --git a/gitnexus/test/unit/node-module-compat.test.ts b/gitnexus/test/unit/node-module-compat.test.ts index 6323bd8368..47c5f5ba6e 100644 --- a/gitnexus/test/unit/node-module-compat.test.ts +++ b/gitnexus/test/unit/node-module-compat.test.ts @@ -2,8 +2,9 @@ import { describe, it, expect, vi, afterEach } from 'vitest'; /** * Tests for the #2372 `node:module` compat seam. `module.registerHooks` was - * added in Node 22.15 / 23.5, but the engines floor is >=22.0.0, so on - * 22.0–22.14 and 23.0–23.4 the export is absent. `getRegisterHooks()` must + * added in Node 22.15 / 23.5. The engines floor is ^22.18.0 || >=24.11.0 (all + * >=22.15), but engines is advisory, so a below-floor 22.0–22.14 / 23.0–23.4 + * runtime can still run, where the export is absent. `getRegisterHooks()` must * hand back the real function when present and `undefined` when not — the value * the resolver guards degrade on. `isPrefixRuntimeLoadable()` (exported from * runtime-install.ts so CLI code never imports the compat module) is the