eyeprolog 1.6.9 → 1.6.11
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 +1 -0
- package/bin/eyeprolog.js +18 -1
- package/package.json +2 -1
- package/src/platform.js +6 -0
- package/test/regression/cases-documentation-sync.mjs +1 -1
package/README.md
CHANGED
|
@@ -96,6 +96,7 @@ npm test
|
|
|
96
96
|
The npm command list is deliberately small:
|
|
97
97
|
|
|
98
98
|
- `npm test` (or `npm run test`): run the release gate, including live upstream conformity checks (WG17 syntax among them).
|
|
99
|
+
- `npm run neumerkel`: re-fetch the upstream Neumerkel conformity sources and fail if the tracked report no longer matches them. The release gate reports that drift as a warning; this command makes it an error, so it answers "are we still current?" on its own.
|
|
99
100
|
|
|
100
101
|
Use `npm test -- --offline` for a network-free local pass (this also skips the live-discovered WG17 syntax check, since it has no offline snapshot). Focused checks remain available directly, for example `node test/run-regression.mjs docs`; see [test runners](test/README.md). The automatic version hooks rebuild generated library and book files, run the release gate, refresh and stage conformance reports, and push the release. Detailed upstream report maintenance is documented in the [conformance guide](test/conformance/README.md).
|
|
101
102
|
|
package/bin/eyeprolog.js
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import module from 'node:module';
|
|
3
|
+
|
|
4
|
+
// Reuse V8's compilation of the engine between runs. Starting the CLI compiles
|
|
5
|
+
// the whole reasoner before it can answer anything, which dominates the cost of
|
|
6
|
+
// a short query -- the shape most command-line use has. The cache makes that
|
|
7
|
+
// compilation a one-off rather than a per-invocation charge.
|
|
8
|
+
//
|
|
9
|
+
// src/cli.js is imported dynamically on purpose: static imports are evaluated
|
|
10
|
+
// before this module's body runs, so a static one would already have been
|
|
11
|
+
// compiled by the time the cache was enabled.
|
|
12
|
+
//
|
|
13
|
+
// enableCompileCache is Node 22.1+, hence the optional call for the supported
|
|
14
|
+
// Node 18 floor. It reports failure through a return value rather than
|
|
15
|
+
// throwing, and Node honours NODE_DISABLE_COMPILE_CACHE, so an unwritable or
|
|
16
|
+
// unwanted cache directory simply leaves startup as it was.
|
|
17
|
+
module.enableCompileCache?.();
|
|
18
|
+
|
|
19
|
+
const { main } = await import('../src/cli.js');
|
|
3
20
|
|
|
4
21
|
await main(process.argv.slice(2)).catch((error) => {
|
|
5
22
|
console.error(`eyeprolog: ${error && error.message ? error.message : String(error)}`);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.6.
|
|
6
|
+
"version": "1.6.11",
|
|
7
7
|
"description": "EyeProlog turns facts and rules into answers and proofs.",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./index.js",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"test": "node test/run-all.mjs",
|
|
49
|
+
"neumerkel": "node test/run-neumerkel.mjs --verify-report",
|
|
49
50
|
"preversion": "node tools/generate-library-autoload-index.mjs && node tools/generate-predicate-reference.mjs && node tools/extract-book-examples.mjs && npm test && node test/run-neumerkel.mjs --cached --update-report && node test/run-conformance-report.mjs conformance-report.md && git add src/library-autoload-index.js the-art-of-eyeprolog.md examples/book test/conformance/NEUMERKEL-LATEST.md conformance-report.md",
|
|
50
51
|
"postversion": "git push origin HEAD --follow-tags"
|
|
51
52
|
}
|
package/src/platform.js
CHANGED
|
@@ -43,6 +43,12 @@ export function usedHeapSize() {
|
|
|
43
43
|
const oldGeneration = oldGenerationUsedSize();
|
|
44
44
|
if (oldGeneration != null) return oldGeneration;
|
|
45
45
|
}
|
|
46
|
+
// v8.getHeapStatistics().used_heap_size reports the same quantity as
|
|
47
|
+
// process.memoryUsage().heapUsed, but memoryUsage() additionally computes
|
|
48
|
+
// RSS, which costs a syscall, and allocates a result object. The solver
|
|
49
|
+
// polls this on a fixed inference interval, so the cheaper reading is
|
|
50
|
+
// worth preferring; memoryUsage stays as the fallback.
|
|
51
|
+
if (typeof v8?.getHeapStatistics === 'function') return v8.getHeapStatistics().used_heap_size;
|
|
46
52
|
return process.memoryUsage().heapUsed;
|
|
47
53
|
}
|
|
48
54
|
const memory = globalThis.performance?.memory;
|
|
@@ -629,7 +629,7 @@ ${profile}`;
|
|
|
629
629
|
const publishIndex = publishWorkflow.indexOf('run: npm publish');
|
|
630
630
|
assertEqual(testIndex >= 0 && testIndex < publishIndex, true, 'publish workflow test gate');
|
|
631
631
|
assertEqual(packIndex >= 0 && packIndex < publishIndex, true, 'publish workflow package gate');
|
|
632
|
-
assertArrayEqual(Object.keys(pkg.scripts).sort(), ['postversion', 'preversion', 'test'], 'small npm command surface');
|
|
632
|
+
assertArrayEqual(Object.keys(pkg.scripts).sort(), ['neumerkel', 'postversion', 'preversion', 'test'], 'small npm command surface');
|
|
633
633
|
assertEqual(pkg.scripts.test, 'node test/run-all.mjs', 'full release gate');
|
|
634
634
|
const runner = fs.readFileSync(path.join(packageRoot, 'test', 'run-all.mjs'), 'utf8');
|
|
635
635
|
assertIncludes(runner, 'runOpenRuleBenchChecks(reporter)', 'OpenRuleBench remains in release gate');
|