create-arxo 0.2.5 → 0.2.7

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
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://cdn.jsdelivr.net/npm/create-arxo@0.2.5/assets/quickstart.svg" width="760" alt="Terminal: npm create arxo@latest my-app, npm install, npm start prints COMPUTED, TRUE_ONLY, the rule TagesfristEnde, the result hash, then asks again without a fact and names the missing one">
2
+ <img src="https://cdn.jsdelivr.net/npm/create-arxo@0.2.6/assets/quickstart.svg" width="760" alt="Terminal: npm create arxo@latest my-app, npm install, npm start prints COMPUTED, TRUE_ONLY, the rule TagesfristEnde, the result hash, then asks again without a fact and names the missing one">
3
3
  </p>
4
4
 
5
5
  # create-arxo
@@ -57,7 +57,7 @@ Two answers, read top to bottom:
57
57
  ## What you get
58
58
 
59
59
  <p align="center">
60
- <img src="https://cdn.jsdelivr.net/npm/create-arxo@0.2.5/assets/tree.svg" width="760" alt="Files of my-app: package.json, tsconfig.json, README.md, .gitignore, src/ask.ts, test/frist.test.ts">
60
+ <img src="https://cdn.jsdelivr.net/npm/create-arxo@0.2.6/assets/tree.svg" width="760" alt="Files of my-app: package.json, tsconfig.json, README.md, .gitignore, src/ask.ts, test/frist.test.ts">
61
61
  </p>
62
62
 
63
63
  | Command | What it does |
@@ -67,7 +67,7 @@ Two answers, read top to bottom:
67
67
  | `npm run typecheck` | `tsc --noEmit`: predicate names are checked against the canon's declarations |
68
68
 
69
69
  <p align="center">
70
- <img src="https://cdn.jsdelivr.net/npm/create-arxo@0.2.5/assets/test.svg" width="760" alt="Terminal: npm test, ok 1 and ok 2, pass 2, fail 0">
70
+ <img src="https://cdn.jsdelivr.net/npm/create-arxo@0.2.6/assets/test.svg" width="760" alt="Terminal: npm test, ok 1 and ok 2, pass 2, fail 0">
71
71
  </p>
72
72
 
73
73
  ## What to edit next
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-arxo",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Scaffold an Arxo Law project with one canon and one question",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -3,15 +3,15 @@
3
3
  "private": true,
4
4
  "version": "0.1.0",
5
5
  "type": "module",
6
- "description": "One canon, one question: §§ 187, 188 BGB with @arxo/law",
6
+ "description": "One canon, one question: \u00a7\u00a7 187, 188 BGB with @arxo/law",
7
7
  "scripts": {
8
8
  "start": "tsx src/ask.ts",
9
9
  "test": "node --import tsx --test test/frist.test.ts",
10
10
  "typecheck": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "@arxo/law": "0.3.3",
14
- "@arxo/canon-bgb-fristen": "0.1.5"
13
+ "@arxo/law": "0.3.4",
14
+ "@arxo/canon-bgb-fristen": "0.1.6"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^20.0.0",
@@ -72,7 +72,8 @@ function describe(label: string, r: Answer): void {
72
72
 
73
73
  // Reproducibility: the same canon, case and semantics give the same hashes.
74
74
  console.log(' hashes');
75
- for (const [k, v] of Object.entries(r.hashes)) console.log(` ${k.padEnd(8)} ${v}`);
75
+ // Absent hashes (e.g. the focused ones on a full answer) are not printed.
76
+ for (const [k, v] of Object.entries(r.hashes)) if (v !== undefined) console.log(` ${k.padEnd(8)} ${v}`);
76
77
 
77
78
  if (r.via === 'local') {
78
79
  console.log(` document ${r.document.byteLength} bytes, canonical evaluation document`);
@@ -92,15 +93,10 @@ describe(`Does a 14-day period from ${EVENT_DATE} end on ${CANDIDATE_END}?`, ans
92
93
  const partial = await fristen.whyNot(question, ['frist', CANDIDATE_END], caseInput([eventFact]));
93
94
  describe(`The same question without frist_dauer_tage (why not?)`, partial);
94
95
 
95
- console.log(` whyNot ${partial.whyNot && Array.isArray(partial.whyNot) && partial.whyNot.length
96
- ? partial.whyNot.map((w) => `${w.kind}: ${w.description}`).join('; ')
97
- : 'no input requirement raised by the engine — the rule stays undetermined'}`);
98
-
99
- type Blocker = { rule?: string; conjuncts?: Array<{ literal?: { predicate?: string }; trigger?: string }> };
100
- const blockers: Blocker[] =
101
- partial.value && typeof partial.value === 'object' && 'value' in partial.value
102
- ? ((partial.value as { value?: { blockers?: Blocker[] } }).value?.blockers ?? [])
103
- : [];
96
+ // The blocker graph: each candidate rule and the premises it reads.
97
+ // A conjunct's literal is typed as plain JSON; read only the fields used here.
98
+ type Blocker = { rule?: string; conjuncts?: Array<{ literal?: { predicate?: string } }> };
99
+ const blockers = (partial.whyNot ?? []) as unknown as Blocker[];
104
100
  const given = new Set([eventFact].map((f) => f.predicate));
105
101
  // Ask only for what the rules your facts already speak to still need; a
106
102
  // rule none of your facts touch is another route to the same conclusion.