create-arxo 0.2.4 → 0.2.5

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,37 +1,98 @@
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">
3
+ </p>
4
+
1
5
  # create-arxo
2
6
 
3
- ```
7
+ **A ready TypeScript project that asks a pinned canon one question and prints
8
+ the answer with its proof.** One command, no build step, no account, no
9
+ network after `npm install`: the engine runs locally.
10
+
11
+ [![npm](https://img.shields.io/npm/v/create-arxo?color=0b6e4f)](https://www.npmjs.com/package/create-arxo)
12
+ ![license](https://img.shields.io/npm/l/create-arxo)
13
+
14
+ ## Quick start
15
+
16
+ ```sh
4
17
  npm create arxo@latest my-app
5
- cd my-app && npm install && npm start
18
+ cd my-app && npm install
19
+ npm start
6
20
  ```
7
21
 
8
- ```
9
- de.bgb.fristen@0.1.0 opened (local)
22
+ Node.js 20 or newer. The project asks the German Civil Code (periods,
23
+ §§ 187, 188 BGB): *an event on 6 March 2026 starts a 14-day period — does it
24
+ end on 20 March 2026?* The pinned canon `de.bgb.fristen@0.1.0` comes with
25
+ the npm package `@arxo/canon-bgb-fristen`.
10
26
 
27
+ `npm start` prints, among other lines (a real run, trimmed):
28
+
29
+ <!-- readme:start -->
30
+ ```text
31
+ de.bgb.fristen@0.1.0 opened (local)
11
32
  Does a 14-day period from 2026-03-06 end on 2026-03-20?
12
33
  evaluationStatus COMPUTED
13
34
  truthStatus TRUE_ONLY (established: yes)
14
35
  rules applied TagesfristEnde
15
36
  hashes
16
- program sha256:…
17
- result sha256:…
18
- document … bytes, canonical evaluation document
37
+ result sha256:4c5431514533…
38
+ document 4691 bytes, canonical evaluation document
39
+ The same question without frist_dauer_tage (why not?)
40
+ truthStatus NEITHER (not established either way)
41
+ rule TagesfristEnde needs frist_ereignis, frist_dauer_tage
42
+ To answer, please add:
43
+ - frist_dauer_tage: the length of the period in days, e.g. "14 calendar_day"
19
44
  ```
45
+ <!-- /readme:start -->
20
46
 
21
- The project is TypeScript (`tsx`, no build step): `src/ask.ts` opens the
22
- pinned canon `de.bgb.fristen@0.1.0` (§§ 187, 188 BGB, installed with
23
- `@arxo/canon-bgb-fristen`), asks one `truth` question and prints the
24
- answer — statuses, the rule applied, sources, hashes, the attached
25
- evaluation document. It then asks the same question **without** the
26
- duration and shows how `whyNot` turns into a request for the missing fact.
47
+ Two answers, read top to bottom:
27
48
 
28
- Scripts of the created project:
49
+ 1. **Both facts given.** The engine computed the question (`COMPUTED`) and
50
+ established it (`TRUE_ONLY`) by the rule `TagesfristEnde`. The result hash
51
+ and the attached evaluation document let anyone replay the same answer
52
+ byte for byte.
53
+ 2. **The duration left out.** The engine does not guess: the answer is
54
+ `NEITHER`, the rule names the premises it still needs, and the program
55
+ turns that into a request for the missing fact.
56
+
57
+ ## What you get
58
+
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">
61
+ </p>
29
62
 
30
63
  | Command | What it does |
31
64
  |---|---|
32
- | `npm start` | runs `src/ask.ts` |
33
- | `npm test` | the same question as a `node --test` test |
34
- | `npm run typecheck` | checks predicate names against the canon's declarations |
65
+ | `npm start` | runs `src/ask.ts`: the question, then the same question without a fact |
66
+ | `npm test` | the same question as two `node --test` tests |
67
+ | `npm run typecheck` | `tsc --noEmit`: predicate names are checked against the canon's declarations |
68
+
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">
71
+ </p>
72
+
73
+ ## What to edit next
74
+
75
+ All of it is in `src/ask.ts`:
76
+
77
+ - **Change the facts.** `EVENT_DATE` and `CANDIDATE_END` are the event and
78
+ the date you ask about; `durationFact` holds the length,
79
+ `'14 calendar_day'`. Change a value, run `npm start`, and read the new
80
+ statuses and the new result hash.
81
+ - **Leave a fact out on purpose.** Remove a fact from `caseInput([…])` and the
82
+ answer says which premise is missing instead of inventing one.
83
+ - **Ask another canon.** Install another canon package next to this one, for
84
+ example `@arxo/canon-unidroit-picc` or `@arxo/canon-ogpo-vts`, and open it
85
+ by its name and version; its predicate names come with types.
86
+ - **Keep it honest in CI.** `npm test` asserts the statuses, so a change in
87
+ the canon or in your facts shows up as a failing test.
88
+
89
+ ## Links
90
+
91
+ - [`@arxo/law`](https://www.npmjs.com/package/@arxo/law): the API used by
92
+ `src/ask.ts` (`open`, `truth`, `collect`, `whyNot`, the answer fields)
93
+ - [`@arxo/cli`](https://www.npmjs.com/package/@arxo/cli): the `law` command
94
+ for case and canon packages
95
+ - Guides: [quickstart](https://docs.arxo.io/guide/quickstart/) ·
96
+ [reading an answer](https://docs.arxo.io/guide/reading-an-answer/)
35
97
 
36
- Next: https://docs.arxo.io/guide/quickstart/ and
37
- https://docs.arxo.io/guide/reading-an-answer/.
98
+ Apache-2.0.
@@ -0,0 +1,67 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="860" height="634" viewBox="0 0 860 634" role="img" aria-labelledby="t">
2
+ <title id="t">Terminal: npm create arxo@latest my-app, npm install, npm start — the answer with its status, rule, hash and whyNot</title>
3
+ <style>
4
+ .sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
5
+ .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; }
6
+ </style>
7
+ <style>
8
+ @keyframes l0 { 0%, 2.78% { opacity: 0; } 3.61%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
9
+ #l0 { animation: l0 18s linear infinite; }
10
+ @keyframes l1 { 0%, 10.56% { opacity: 0; } 11.39%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
11
+ #l1 { animation: l1 18s linear infinite; }
12
+ @keyframes l2 { 0%, 12.78% { opacity: 0; } 13.61%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
13
+ #l2 { animation: l2 18s linear infinite; }
14
+ @keyframes l3 { 0%, 20.56% { opacity: 0; } 21.39%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
15
+ #l3 { animation: l3 18s linear infinite; }
16
+ @keyframes l4 { 0%, 22.78% { opacity: 0; } 23.61%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
17
+ #l4 { animation: l4 18s linear infinite; }
18
+ @keyframes l5 { 0%, 30.56% { opacity: 0; } 31.39%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
19
+ #l5 { animation: l5 18s linear infinite; }
20
+ @keyframes l6 { 0%, 32.78% { opacity: 0; } 33.61%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
21
+ #l6 { animation: l6 18s linear infinite; }
22
+ @keyframes l7 { 0%, 35.00% { opacity: 0; } 35.83%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
23
+ #l7 { animation: l7 18s linear infinite; }
24
+ @keyframes l8 { 0%, 37.22% { opacity: 0; } 38.06%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
25
+ #l8 { animation: l8 18s linear infinite; }
26
+ @keyframes l9 { 0%, 39.44% { opacity: 0; } 40.28%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
27
+ #l9 { animation: l9 18s linear infinite; }
28
+ @keyframes l10 { 0%, 41.67% { opacity: 0; } 42.50%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
29
+ #l10 { animation: l10 18s linear infinite; }
30
+ @keyframes l11 { 0%, 43.89% { opacity: 0; } 44.72%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
31
+ #l11 { animation: l11 18s linear infinite; }
32
+ @keyframes l12 { 0%, 46.11% { opacity: 0; } 46.94%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
33
+ #l12 { animation: l12 18s linear infinite; }
34
+ @keyframes l13 { 0%, 48.33% { opacity: 0; } 49.17%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
35
+ #l13 { animation: l13 18s linear infinite; }
36
+ @keyframes l14 { 0%, 50.56% { opacity: 0; } 51.39%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
37
+ #l14 { animation: l14 18s linear infinite; }
38
+ @keyframes l15 { 0%, 52.78% { opacity: 0; } 53.61%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
39
+ #l15 { animation: l15 18s linear infinite; }
40
+ @keyframes l16 { 0%, 55.00% { opacity: 0; } 55.83%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
41
+ #l16 { animation: l16 18s linear infinite; }
42
+ @keyframes l17 { 0%, 57.22% { opacity: 0; } 58.06%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
43
+ #l17 { animation: l17 18s linear infinite; }
44
+ @media (prefers-reduced-motion: reduce) { text[id^="l"] { animation: none !important; } }
45
+ </style>
46
+ <rect width="860" height="634" rx="12" fill="#0d1117"/>
47
+ <circle cx="24" cy="22" r="6" fill="#ff5f57"/><circle cx="44" cy="22" r="6" fill="#febc2e"/><circle cx="64" cy="22" r="6" fill="#28c840"/>
48
+ <text x="430" y="27" class="sans" font-size="12" font-weight="400" fill="#7d8590" text-anchor="middle">create-arxo 0.2.4 — a real run, trimmed</text>
49
+ <text id="l0" x="28" y="74" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"><tspan fill="#7d8590">$ </tspan>npm create arxo@latest my-app</text>
50
+ <text id="l1" x="28" y="104" class="mono" font-size="14.5" font-weight="400" fill="#7ee2a8" xml:space="preserve">created my-app</text>
51
+ <text id="l2" x="28" y="134" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"><tspan fill="#7d8590">$ </tspan>cd my-app &amp;&amp; npm install</text>
52
+ <text id="l3" x="28" y="164" class="mono" font-size="14.5" font-weight="400" fill="#7d8590" xml:space="preserve">added 17 packages, and audited 18 packages</text>
53
+ <text id="l4" x="28" y="194" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"><tspan fill="#7d8590">$ </tspan>npm start</text>
54
+ <text id="l5" x="28" y="224" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve">de.bgb.fristen@0.1.0 opened (local)</text>
55
+ <text id="l6" x="28" y="254" class="mono" font-size="14.5" font-weight="700" fill="#e6edf3" xml:space="preserve">Does a 14-day period from 2026-03-06 end on 2026-03-20?</text>
56
+ <text id="l7" x="28" y="284" class="mono" font-size="14.5" font-weight="700" fill="#7ee2a8" xml:space="preserve"> evaluationStatus COMPUTED</text>
57
+ <text id="l8" x="28" y="314" class="mono" font-size="14.5" font-weight="700" fill="#7ee2a8" xml:space="preserve"> truthStatus TRUE_ONLY (established: yes)</text>
58
+ <text id="l9" x="28" y="344" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"> rules applied TagesfristEnde</text>
59
+ <text id="l10" x="28" y="374" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"> hashes</text>
60
+ <text id="l11" x="28" y="404" class="mono" font-size="14.5" font-weight="400" fill="#e3b341" xml:space="preserve"> result sha256:4c5431514533…</text>
61
+ <text id="l12" x="28" y="434" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"> document 4691 bytes, canonical evaluation document</text>
62
+ <text id="l13" x="28" y="464" class="mono" font-size="14.5" font-weight="700" fill="#e6edf3" xml:space="preserve">The same question without frist_dauer_tage (why not?)</text>
63
+ <text id="l14" x="28" y="494" class="mono" font-size="14.5" font-weight="700" fill="#e3b341" xml:space="preserve"> truthStatus NEITHER (not established either way)</text>
64
+ <text id="l15" x="28" y="524" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"> rule TagesfristEnde needs frist_ereignis, frist_dauer_tage</text>
65
+ <text id="l16" x="28" y="554" class="mono" font-size="14.5" font-weight="700" fill="#e6edf3" xml:space="preserve">To answer, please add:</text>
66
+ <text id="l17" x="28" y="584" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"> - frist_dauer_tage: the length of the period in days, e.g. "14 calendar_day"</text>
67
+ </svg>
@@ -0,0 +1,28 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="860" height="270" viewBox="0 0 860 270" role="img" aria-labelledby="t">
2
+ <title id="t">Terminal: npm test — two node --test tests pass</title>
3
+ <style>
4
+ .sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
5
+ .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; }
6
+ </style>
7
+ <style>
8
+ @keyframes l0 { 0%, 6.25% { opacity: 0; } 8.13%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
9
+ #l0 { animation: l0 8s linear infinite; }
10
+ @keyframes l1 { 0%, 23.75% { opacity: 0; } 25.62%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
11
+ #l1 { animation: l1 8s linear infinite; }
12
+ @keyframes l2 { 0%, 28.75% { opacity: 0; } 30.62%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
13
+ #l2 { animation: l2 8s linear infinite; }
14
+ @keyframes l3 { 0%, 33.75% { opacity: 0; } 35.62%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
15
+ #l3 { animation: l3 8s linear infinite; }
16
+ @keyframes l4 { 0%, 38.75% { opacity: 0; } 40.62%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
17
+ #l4 { animation: l4 8s linear infinite; }
18
+ @media (prefers-reduced-motion: reduce) { text[id^="l"] { animation: none !important; } }
19
+ </style>
20
+ <rect width="860" height="270" rx="12" fill="#0d1117"/>
21
+ <circle cx="24" cy="22" r="6" fill="#ff5f57"/><circle cx="44" cy="22" r="6" fill="#febc2e"/><circle cx="64" cy="22" r="6" fill="#28c840"/>
22
+ <text x="430" y="27" class="sans" font-size="12" font-weight="400" fill="#7d8590" text-anchor="middle">the same question as a test</text>
23
+ <text id="l0" x="28" y="74" class="mono" font-size="14.5" font-weight="400" fill="#e6edf3" xml:space="preserve"><tspan fill="#7d8590">$ </tspan>npm test</text>
24
+ <text id="l1" x="28" y="104" class="mono" font-size="14.5" font-weight="400" fill="#7ee2a8" xml:space="preserve">ok 1 - opens the bundled canon and asks one question</text>
25
+ <text id="l2" x="28" y="134" class="mono" font-size="14.5" font-weight="400" fill="#7ee2a8" xml:space="preserve">ok 2 - without the duration the answer is NEITHER, not a guess</text>
26
+ <text id="l3" x="28" y="164" class="mono" font-size="14.5" font-weight="400" fill="#7d8590" xml:space="preserve"># pass 2</text>
27
+ <text id="l4" x="28" y="194" class="mono" font-size="14.5" font-weight="400" fill="#7d8590" xml:space="preserve"># fail 0</text>
28
+ </svg>
@@ -0,0 +1,28 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="860" height="388" viewBox="0 0 860 388" role="img" aria-labelledby="t">
2
+ <title id="t">Files created by npm create arxo@latest my-app</title>
3
+ <style>
4
+ .sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
5
+ .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; }
6
+ </style>
7
+ <rect width="860" height="388" rx="14" fill="#ffffff"/>
8
+ <rect x="1" y="1" width="858" height="386" rx="14" fill="#ffffff" stroke="#d1d9e0" stroke-width="1.2"/>
9
+ <text x="24" y="34" class="sans" font-size="11" font-weight="700" fill="#59636e" text-anchor="start">WHAT YOU GET</text>
10
+ <text x="24" y="64" class="mono" font-size="15" font-weight="700" fill="#1f2328" text-anchor="start">my-app/</text>
11
+ <text x="24" y="102" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e">├── </tspan><tspan fill="#1f2328" font-weight="500">package.json</tspan></text>
12
+ <text x="300" y="94" class="sans" font-size="12.5" font-weight="400" fill="#59636e" text-anchor="start">scripts start, test, typecheck</text>
13
+ <text x="300" y="110" class="sans" font-size="12.5" font-weight="400" fill="#59636e" text-anchor="start">pins @arxo/law and the canon package</text>
14
+ <text x="24" y="140" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e">├── </tspan><tspan fill="#1f2328" font-weight="500">tsconfig.json</tspan></text>
15
+ <text x="300" y="140" class="sans" font-size="12.5" font-weight="400" fill="#59636e" text-anchor="start">strict TypeScript, no build step</text>
16
+ <text x="24" y="178" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e">├── </tspan><tspan fill="#1f2328" font-weight="500">README.md</tspan></text>
17
+ <text x="300" y="178" class="sans" font-size="12.5" font-weight="400" fill="#59636e" text-anchor="start">the question, the facts and their meaning</text>
18
+ <text x="24" y="216" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e">├── </tspan><tspan fill="#1f2328" font-weight="500">.gitignore</tspan></text>
19
+ <text x="300" y="216" class="sans" font-size="12.5" font-weight="400" fill="#59636e" text-anchor="start">node_modules</text>
20
+ <text x="24" y="254" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e">├── </tspan><tspan fill="#1f2328" font-weight="700">src/</tspan></text>
21
+ <text x="24" y="292" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e">│ └── </tspan><tspan fill="#0b6e4f" font-weight="700">ask.ts</tspan></text>
22
+ <text x="300" y="284" class="sans" font-size="12.5" font-weight="400" fill="#1f2328" text-anchor="start">opens the pinned canon, asks one question,</text>
23
+ <text x="300" y="300" class="sans" font-size="12.5" font-weight="400" fill="#1f2328" text-anchor="start">prints the answer, then asks again without a fact</text>
24
+ <text x="24" y="330" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e">└── </tspan><tspan fill="#1f2328" font-weight="700">test/</tspan></text>
25
+ <text x="24" y="368" class="mono" font-size="15" xml:space="preserve"><tspan fill="#59636e"> └── </tspan><tspan fill="#1f2328" font-weight="500">frist.test.ts</tspan></text>
26
+ <text x="300" y="360" class="sans" font-size="12.5" font-weight="400" fill="#59636e" text-anchor="start">the same question under node --test</text>
27
+ <text x="300" y="376" class="sans" font-size="12.5" font-weight="400" fill="#59636e" text-anchor="start">asserts COMPUTED / TRUE_ONLY and NEITHER</text>
28
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-arxo",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Scaffold an Arxo Law project with one canon and one question",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -10,6 +10,7 @@
10
10
  "files": [
11
11
  "index.js",
12
12
  "template",
13
+ "assets",
13
14
  "README.md",
14
15
  "LICENSE",
15
16
  "NOTICE"
@@ -10,8 +10,8 @@
10
10
  "typecheck": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "@arxo/law": "0.3.2",
14
- "@arxo/canon-bgb-fristen": "0.1.4"
13
+ "@arxo/law": "0.3.3",
14
+ "@arxo/canon-bgb-fristen": "0.1.5"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^20.0.0",