eyeling 1.19.0 → 1.19.1

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/HANDBOOK.md CHANGED
@@ -1820,6 +1820,7 @@ The bundle contains the whole engine. The CLI path is the “canonical behavior
1820
1820
  The current CLI supports a small set of flags (see `lib/cli.js`):
1821
1821
 
1822
1822
  - `-a`, `--ast` — print the parsed AST as JSON and exit.
1823
+ - `--builtin <module.js>` — load a custom builtin module (repeatable).
1823
1824
  - `-d`, `--deterministic-skolem` — make `log:skolem` stable across runs.
1824
1825
  - `-e`, `--enforce-https` — rewrite `http://…` to `https://…` for dereferencing builtins.
1825
1826
  - `-p`, `--proof-comments` — include per-fact proof comment blocks in output.
package/eyeling.js CHANGED
@@ -3670,7 +3670,7 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
3670
3670
  // - subject = GraphTerm: explicit scope, run immediately (no closure gating)
3671
3671
  // - subject = positive integer literal N (>= 1): delay until saturated closure level >= N
3672
3672
  // - subject = Var: treat as priority 1 (do not bind)
3673
- // - any other subject: backward-compatible default priority 1
3673
+ // - any other subject: invalid, so the builtin fails
3674
3674
  if (pv === LOG_NS + 'includes') {
3675
3675
  let scopeFacts = null;
3676
3676
  let scopeBackRules = backRules;
@@ -3698,7 +3698,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
3698
3698
  prio = 1; // do not bind
3699
3699
  } else {
3700
3700
  const p0 = __logNaturalPriorityFromTerm(g.s);
3701
- if (p0 !== null) prio = p0;
3701
+ if (p0 === null) return [];
3702
+ prio = p0;
3702
3703
  }
3703
3704
 
3704
3705
  const snap = facts.__scopedSnapshot || null;
@@ -3781,7 +3782,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
3781
3782
  prio = 1; // do not bind
3782
3783
  } else {
3783
3784
  const p0 = __logNaturalPriorityFromTerm(g.s);
3784
- if (p0 !== null) prio = p0;
3785
+ if (p0 === null) return [];
3786
+ prio = p0;
3785
3787
  }
3786
3788
 
3787
3789
  const snap = facts.__scopedSnapshot || null;
package/lib/builtins.js CHANGED
@@ -3190,7 +3190,7 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
3190
3190
  // - subject = GraphTerm: explicit scope, run immediately (no closure gating)
3191
3191
  // - subject = positive integer literal N (>= 1): delay until saturated closure level >= N
3192
3192
  // - subject = Var: treat as priority 1 (do not bind)
3193
- // - any other subject: backward-compatible default priority 1
3193
+ // - any other subject: invalid, so the builtin fails
3194
3194
  if (pv === LOG_NS + 'includes') {
3195
3195
  let scopeFacts = null;
3196
3196
  let scopeBackRules = backRules;
@@ -3218,7 +3218,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
3218
3218
  prio = 1; // do not bind
3219
3219
  } else {
3220
3220
  const p0 = __logNaturalPriorityFromTerm(g.s);
3221
- if (p0 !== null) prio = p0;
3221
+ if (p0 === null) return [];
3222
+ prio = p0;
3222
3223
  }
3223
3224
 
3224
3225
  const snap = facts.__scopedSnapshot || null;
@@ -3301,7 +3302,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
3301
3302
  prio = 1; // do not bind
3302
3303
  } else {
3303
3304
  const p0 = __logNaturalPriorityFromTerm(g.s);
3304
- if (p0 !== null) prio = p0;
3305
+ if (p0 === null) return [];
3306
+ prio = p0;
3305
3307
  }
3306
3308
 
3307
3309
  const snap = facts.__scopedSnapshot || null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyeling",
3
- "version": "1.19.0",
3
+ "version": "1.19.1",
4
4
  "description": "A minimal Notation3 (N3) reasoner in JavaScript.",
5
5
  "main": "./index.js",
6
6
  "keywords": [
package/test/api.test.js CHANGED
@@ -1462,6 +1462,42 @@ _:x :hates { _:foo :making :mess }.
1462
1462
  notExpect: [/:(?:test)\s+:(?:is)\s+false\s*\./],
1463
1463
  },
1464
1464
 
1465
+ {
1466
+ name: '59b regression: log:includes rejects non-scope literal or term subjects',
1467
+ opt: { proofComments: false },
1468
+ input: `@prefix : <http://example.org/> .
1469
+ @prefix log: <http://www.w3.org/2000/10/swap/log#> .
1470
+ @base <http://example.org/> .
1471
+
1472
+ { false log:includes true. } => { :result :has :fail-literal-1. }.
1473
+ { "foo" log:includes true. } => { :result :has :fail-literal-2. }.
1474
+ { :foo log:includes true. } => { :result :has :fail-literal-3. }.
1475
+ { 0 log:includes true. } => { :result :has :fail-literal-4. }.
1476
+ { 42.3 log:includes true. } => { :result :has :fail-literal-5. }.
1477
+ { (:foo 1 _:x) log:includes true. } => { :result :has :fail-literal-6. }.
1478
+
1479
+ { } => {
1480
+ :test :contains :fail-literal-1, :fail-literal-2, :fail-literal-3, :fail-literal-4, :fail-literal-5, :fail-literal-6.
1481
+ }.
1482
+ `,
1483
+ expect: [
1484
+ /:(?:test)\s+:(?:contains)\s+:(?:fail-literal-1)\s*\./,
1485
+ /:(?:test)\s+:(?:contains)\s+:(?:fail-literal-2)\s*\./,
1486
+ /:(?:test)\s+:(?:contains)\s+:(?:fail-literal-3)\s*\./,
1487
+ /:(?:test)\s+:(?:contains)\s+:(?:fail-literal-4)\s*\./,
1488
+ /:(?:test)\s+:(?:contains)\s+:(?:fail-literal-5)\s*\./,
1489
+ /:(?:test)\s+:(?:contains)\s+:(?:fail-literal-6)\s*\./,
1490
+ ],
1491
+ notExpect: [
1492
+ /:(?:result)\s+:(?:has)\s+:(?:fail-literal-1)\s*\./,
1493
+ /:(?:result)\s+:(?:has)\s+:(?:fail-literal-2)\s*\./,
1494
+ /:(?:result)\s+:(?:has)\s+:(?:fail-literal-3)\s*\./,
1495
+ /:(?:result)\s+:(?:has)\s+:(?:fail-literal-4)\s*\./,
1496
+ /:(?:result)\s+:(?:has)\s+:(?:fail-literal-5)\s*\./,
1497
+ /:(?:result)\s+:(?:has)\s+:(?:fail-literal-6)\s*\./,
1498
+ ],
1499
+ },
1500
+
1465
1501
  {
1466
1502
  name: '60 regression: log:includes must match quoted triples with variable predicates',
1467
1503
  opt: { proofComments: false },