eyeling 1.22.2 → 1.22.4

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.
Files changed (55) hide show
  1. package/examples/arcling/README.md +38 -167
  2. package/package.json +2 -3
  3. package/test/examples.test.js +20 -2
  4. package/examples/arcling/calidor/calidor.data.json +0 -79
  5. package/examples/arcling/calidor/calidor.expected.json +0 -94
  6. package/examples/arcling/calidor/calidor.model.go +0 -612
  7. package/examples/arcling/calidor/calidor.spec.md +0 -166
  8. package/examples/arcling/delfour/delfour.data.json +0 -67
  9. package/examples/arcling/delfour/delfour.expected.json +0 -88
  10. package/examples/arcling/delfour/delfour.model.go +0 -564
  11. package/examples/arcling/delfour/delfour.spec.md +0 -117
  12. package/examples/arcling/flandor/flandor.data.json +0 -106
  13. package/examples/arcling/flandor/flandor.expected.json +0 -98
  14. package/examples/arcling/flandor/flandor.model.go +0 -655
  15. package/examples/arcling/flandor/flandor.spec.md +0 -155
  16. package/examples/arcling/medior/medior.data.json +0 -96
  17. package/examples/arcling/medior/medior.expected.json +0 -100
  18. package/examples/arcling/medior/medior.model.go +0 -652
  19. package/examples/arcling/medior/medior.spec.md +0 -157
  20. package/test/arcling.test.js +0 -191
  21. /package/examples/output/{auroracare.n3 → auroracare.txt} +0 -0
  22. /package/examples/output/{bmi.n3 → bmi.txt} +0 -0
  23. /package/examples/output/{calidor.n3 → calidor.txt} +0 -0
  24. /package/examples/output/{control-system.n3 → control-system.txt} +0 -0
  25. /package/examples/output/{deep-taxonomy-10.n3 → deep-taxonomy-10.txt} +0 -0
  26. /package/examples/output/{deep-taxonomy-100.n3 → deep-taxonomy-100.txt} +0 -0
  27. /package/examples/output/{deep-taxonomy-1000.n3 → deep-taxonomy-1000.txt} +0 -0
  28. /package/examples/output/{deep-taxonomy-10000.n3 → deep-taxonomy-10000.txt} +0 -0
  29. /package/examples/output/{deep-taxonomy-100000.n3 → deep-taxonomy-100000.txt} +0 -0
  30. /package/examples/output/{delfour.n3 → delfour.txt} +0 -0
  31. /package/examples/output/{digital-product-passport.n3 → digital-product-passport.txt} +0 -0
  32. /package/examples/output/{easter.n3 → easter.txt} +0 -0
  33. /package/examples/output/{flandor.n3 → flandor.txt} +0 -0
  34. /package/examples/output/{french-cities.n3 → french-cities.txt} +0 -0
  35. /package/examples/output/{genetic-algorithm-knapsack.n3 → genetic-algorithm-knapsack.txt} +0 -0
  36. /package/examples/output/{genetic-algorithm.n3 → genetic-algorithm.txt} +0 -0
  37. /package/examples/output/{gps.n3 → gps.txt} +0 -0
  38. /package/examples/output/{interop-demo.n3 → interop-demo.txt} +0 -0
  39. /package/examples/output/{matrix-mechanics.n3 → matrix-mechanics.txt} +0 -0
  40. /package/examples/output/{medior.n3 → medior.txt} +0 -0
  41. /package/examples/output/{n3-speaks-for-itself.n3 → n3-speaks-for-itself.txt} +0 -0
  42. /package/examples/output/{odrl-dpv-ehds-risk-ranked.n3 → odrl-dpv-ehds-risk-ranked.txt} +0 -0
  43. /package/examples/output/{odrl-dpv-healthcare-risk-ranked.n3 → odrl-dpv-healthcare-risk-ranked.txt} +0 -0
  44. /package/examples/output/{odrl-dpv-risk-ranked.n3 → odrl-dpv-risk-ranked.txt} +0 -0
  45. /package/examples/output/{odrl-risk-mitigation.n3 → odrl-risk-mitigation.txt} +0 -0
  46. /package/examples/output/{odrl-risk.n3 → odrl-risk.txt} +0 -0
  47. /package/examples/output/{parcellocker.n3 → parcellocker.txt} +0 -0
  48. /package/examples/output/{pn-junction-tunneling.n3 → pn-junction-tunneling.txt} +0 -0
  49. /package/examples/output/{resto.n3 → resto.txt} +0 -0
  50. /package/examples/output/{sqrt2-cauchy.n3 → sqrt2-cauchy.txt} +0 -0
  51. /package/examples/output/{sqrt2-dedekind.n3 → sqrt2-dedekind.txt} +0 -0
  52. /package/examples/output/{sudoku.n3 → sudoku.txt} +0 -0
  53. /package/examples/output/{transcendental-numbers-stretched.n3 → transcendental-numbers-stretched.txt} +0 -0
  54. /package/examples/output/{transistor-switch.n3 → transistor-switch.txt} +0 -0
  55. /package/examples/output/{wind-turbine.n3 → wind-turbine.txt} +0 -0
@@ -1,186 +1,57 @@
1
- # Arcling
1
+ # ARC-style examples in Eyeling
2
2
 
3
- This directory holds **Arcling** cases.
3
+ This page points to the ARC-style examples that currently live in [`examples/`](../). The files themselves are one level up; this folder exists as a convenient index for readers who want to browse Eyeling examples that follow the same presentation pattern.
4
4
 
5
- An Arcling case sits alongside the declarative N3 cases in `examples/`. Its purpose is to keep the ARC promise visible while making the case easy to read, easy to rerun, and easy to port.
5
+ ## What ARC is
6
6
 
7
- In one line:
7
+ [ARC](https://josd.github.io/arc/) stands for **Answer • Reason Why • Check**. The idea is to make a program do three things at once: give the result, explain the small reason that matters, and include a check that can fail loudly when an assumption is wrong. In practice, ARC turns a runnable example into a small, auditable artifact rather than a black box.
8
8
 
9
- > `examples/arcling/` presents ARC cases in mathematical English with reference Go realizations and JSON test vectors.
9
+ In Eyeling, ARC fits naturally: facts hold the data, rules derive the result, `log:outputString` can render a human-readable report, and `=> false` rules can act as hard validation fuses.
10
10
 
11
- ## Insight Economy context
11
+ ## What the Insight Economy is
12
12
 
13
- The `delfour`, `medior`, `flandor`, and `calidor` cases are concrete Arcling readings of Ruben Verborgh’s [Inside the Insight Economy](https://ruben.verborgh.org/blog/2025/08/12/inside-the-insight-economy/). The central move is the same in all four cases: what gets traded is not risky raw data, but a narrow, expiring, purpose-bound insight that is useful enough to trigger action. In Ruben’s phrasing, the goal is to “don’t exchange raw data” and to prefer “meaningful insights, not risky raw data”.
13
+ Ruben Verborgh’s [Insight Economy](https://ruben.verborgh.org/blog/2025/08/12/inside-the-insight-economy/) argues that raw data is a bad thing to trade directly. Instead of handing over the source data, a system should refine it into a **specific, purpose-limited, time-bound insight** that is useful in one context, loses value when copied, and can be governed more safely.
14
14
 
15
- In this directory, the four cases show that pattern across four settings:
15
+ That makes the examples below especially relevant: Eyeling can derive those narrow insights explicitly, explain why they hold, and check that the resulting decision respects policy, purpose, and consistency constraints.
16
16
 
17
- - **Delfour** keeps a household-level medical condition private and turns it into a neutral shopping insight such as “prefer lower-sugar products” for shopping assistance.
18
- - **Medior** keeps laboratory, medication, and readmission evidence local and turns it into a minimal post-discharge coordination insight that can justify activating a continuity bundle.
19
- - **Flandor** keeps exporter, labour-market, and grid evidence local and turns it into a regional macro-economic insight that justifies a temporary retooling response.
20
- - **Calidor** keeps household heat, vulnerability, and prepaid-energy stress local and turns them into a narrow municipal heatwave-support insight that can justify a priority cooling package.
17
+ ## ARC-style examples in `examples/`
21
18
 
22
- That progression is intentional: `delfour` is the micro case, `medior` is the care-coordination case, `calidor` is the civic-response case, and `flandor` is the macro case. They are easiest to read next to their declarative Eyeling counterparts: `examples/delfour.n3`, `examples/medior.n3`, and `examples/flandor.n3`.
19
+ Each entry links to both the source example and the corresponding generated output in [`examples/output/`](../output/).
23
20
 
24
- ## Why this directory exists
21
+ ### Insight Economy and governed-data cases
25
22
 
26
- Eyeling already has a strong way to present a case in declarative N3. Arcling adds a second presentation layer for cases that benefit from a normative mathematical-English statement plus a compact reference model.
23
+ - [`../auroracare.n3`](../auroracare.n3) · [`../output/auroracare.txt`](../output/auroracare.txt) Purpose-based medical data exchange with explicit allow/deny reasoning and checks around role, purpose, and conditions.
24
+ - [`../calidor.n3`](../calidor.n3) · [`../output/calidor.txt`](../output/calidor.txt) — Heatwave-response case where private household signals become a narrow, expiring cooling-support insight.
25
+ - [`../delfour.n3`](../delfour.n3) · [`../output/delfour.txt`](../output/delfour.txt) — Shopping-assistance case where a private condition becomes a bounded “prefer lower-sugar products” insight.
26
+ - [`../flandor.n3`](../flandor.n3) · [`../output/flandor.txt`](../output/flandor.txt) — Macro-economic coordination case for Flanders that turns sensitive local signals into a regional retooling insight.
27
+ - [`../medior.n3`](../medior.n3) · [`../output/medior.txt`](../output/medior.txt) — Post-discharge care-coordination case that derives a minimal continuity-bundle insight without sharing the full record.
28
+ - [`../parcellocker.n3`](../parcellocker.n3) · [`../output/parcellocker.txt`](../output/parcellocker.txt) — One-time parcel pickup authorization with a clear permit decision, justification, and misuse checks.
27
29
 
28
- Each Arcling case gives you:
30
+ ### Core ARC-style walkthroughs
29
31
 
30
- - a **normative statement** in mathematical English,
31
- - a **reference realization** in Go,
32
- - a **concrete instance** in JSON,
33
- - and an **expected result** for comparison and regression testing.
32
+ - [`../bmi.n3`](../bmi.n3) · [`../output/bmi.txt`](../output/bmi.txt) Body Mass Index calculation with normalization, WHO category assignment, and boundary checks.
33
+ - [`../control-system.n3`](../control-system.n3) · [`../output/control-system.txt`](../output/control-system.txt) Small control-system example that derives actuator commands and explains feedforward and feedback contributions.
34
+ - [`../easter.n3`](../easter.n3) · [`../output/easter.txt`](../output/easter.txt) — Gregorian Easter computus with a readable explanation and date-window checks.
35
+ - [`../french-cities.n3`](../french-cities.n3) · [`../output/french-cities.txt`](../output/french-cities.txt) Graph reachability over French cities with explicit path reasoning.
36
+ - [`../gps.n3`](../gps.n3) · [`../output/gps.txt`](../output/gps.txt) — Tiny route-planning example for western Belgium with route comparison and metric checks.
37
+ - [`../resto.n3`](../resto.n3) · [`../output/resto.txt`](../output/resto.txt) — RESTdesc-style service composition from person and date to a concrete restaurant reservation.
38
+ - [`../sudoku.n3`](../sudoku.n3) · [`../output/sudoku.txt`](../output/sudoku.txt) — Sudoku solver and report generator with consistency checks over the solved grid.
39
+ - [`../wind-turbine.n3`](../wind-turbine.n3) · [`../output/wind-turbine.txt`](../output/wind-turbine.txt) — Predictive-maintenance example that turns sensor readings into an auditable inspection decision.
34
40
 
35
- So Arcling does not replace declarative Eyeling. It complements it.
41
+ ### Technical and scientific ARC demos
36
42
 
37
- ## The ARC part
43
+ - [`../matrix-mechanics.n3`](../matrix-mechanics.n3) · [`../output/matrix-mechanics.txt`](../output/matrix-mechanics.txt) — Small 2×2 matrix example deriving trace, determinant, products, and a non-zero commutator.
44
+ - [`../pn-junction-tunneling.n3`](../pn-junction-tunneling.n3) · [`../output/pn-junction-tunneling.txt`](../output/pn-junction-tunneling.txt) — Semiconductor toy model that explains current-proxy behavior across bias points.
45
+ - [`../transistor-switch.n3`](../transistor-switch.n3) · [`../output/transistor-switch.txt`](../output/transistor-switch.txt) — NPN low-side switch model with exact arithmetic and cutoff-versus-saturation checks.
38
46
 
39
- ARC means:
47
+ ### Deep-classification stress tests
40
48
 
41
- - **Answer**
42
- - **Reason Why**
43
- - **Check**
49
+ - [`../deep-taxonomy-10.n3`](../deep-taxonomy-10.n3) · [`../output/deep-taxonomy-10.txt`](../output/deep-taxonomy-10.txt) — ARC-style deep-taxonomy benchmark at depth 10.
50
+ - [`../deep-taxonomy-100.n3`](../deep-taxonomy-100.n3) · [`../output/deep-taxonomy-100.txt`](../output/deep-taxonomy-100.txt) — ARC-style deep-taxonomy benchmark at depth 100.
51
+ - [`../deep-taxonomy-1000.n3`](../deep-taxonomy-1000.n3) · [`../output/deep-taxonomy-1000.txt`](../output/deep-taxonomy-1000.txt) — ARC-style deep-taxonomy benchmark at depth 1000.
52
+ - [`../deep-taxonomy-10000.n3`](../deep-taxonomy-10000.n3) · [`../output/deep-taxonomy-10000.txt`](../output/deep-taxonomy-10000.txt) — ARC-style deep-taxonomy benchmark at depth 10000.
53
+ - [`../deep-taxonomy-100000.n3`](../deep-taxonomy-100000.n3) · [`../output/deep-taxonomy-100000.txt`](../output/deep-taxonomy-100000.txt) — ARC-style deep-taxonomy benchmark at depth 100000.
44
54
 
45
- A good Arcling case preserves that trust pattern even though it is not written entirely in N3.
55
+ ## Why these examples fit together
46
56
 
47
- That means:
48
-
49
- - the **answer** is clearly identifiable,
50
- - the **reason why** is visible as named clauses or derived predicates,
51
- - and the **check** is real, meaning it could fail for a meaningful reason.
52
-
53
- ## What belongs here
54
-
55
- A case belongs in `examples/arcling/` when:
56
-
57
- - there is a useful ARC-style case in `examples/`,
58
- - there is value in giving the case a direct operational form,
59
- - we want the logic to stay explicit and auditable,
60
- - and we want a specification that can be read independently of the code.
61
-
62
- Typical uses:
63
-
64
- - policy and governance examples,
65
- - privacy-preserving decision examples,
66
- - cases with a stable logical core and a small executable shell,
67
- - cases that benefit from conformance-style testing.
68
-
69
- ## The four files
70
-
71
- Each Arcling case should contain these files.
72
-
73
- ### 1. `name.spec.md`
74
-
75
- The normative case description.
76
-
77
- This file should use **mathematical English**. It should define the vocabulary, the inputs, the derived predicates, the decision rule, the governance rule, the checks, and the output contract.
78
-
79
- The spec should be written so that a careful reader can understand the case without reading the Go source first.
80
-
81
- ### 2. `name.data.json`
82
-
83
- The concrete instance data.
84
-
85
- This file contains the facts for the case: entities, thresholds, observed values, policies, timestamps, candidate actions, and any other case inputs.
86
-
87
- ### 3. `name.model.go`
88
-
89
- The reference Go realization.
90
-
91
- This file should implement the case directly and clearly. A good pattern is to map named clauses in the spec to named functions in the model.
92
-
93
- For example:
94
-
95
- - `clauseR1ExportWeakness`
96
- - `clauseS2RecommendedPackage`
97
- - `clauseG1AuthorizedUse`
98
- - `clauseM2PayloadHash`
99
-
100
- The model is not the normative source. It is the **reference realization** of the normative source.
101
-
102
- Input validation is part of the reference model. A malformed instance should fail before evaluation rather than requiring a separate schema artifact.
103
-
104
- ### 4. `name.expected.json`
105
-
106
- The expected derived result.
107
-
108
- This file is the conformance vector for the case. It should capture the main derived predicates, the selected answer, the visible checks, and any stable integrity values needed for regression testing.
109
-
110
- ## How to read an Arcling case
111
-
112
- A good reading order is:
113
-
114
- 1. start with `name.spec.md`,
115
- 2. inspect `name.data.json`,
116
- 3. run `go run name.model.go --json`,
117
- 4. compare the result with `name.expected.json`,
118
- 5. then relate the case back to its N3 counterpart.
119
-
120
- That order keeps the meaning visible before the operational details.
121
-
122
- ## Relationship to the rest of `examples/`
123
-
124
- A useful mental model is:
125
-
126
- - `examples/` shows ARC cases in **declarative Eyeling form**,
127
- - `examples/arcling/` shows the same kind of cases in **mathematical-English specification plus reference Go form**.
128
-
129
- So the two collections are complementary:
130
-
131
- - **N3** is best for seeing the logic in the open,
132
- - **Arcling** is best for stating the case normatively and running a portable reference model.
133
-
134
- ## Design rules
135
-
136
- When adding a case here, prefer the following.
137
-
138
- ### 1. Keep the spec normative
139
-
140
- The spec should say what the case means. It should not merely paraphrase the code.
141
-
142
- ### 2. Keep the code direct
143
-
144
- The Go model should say what it does and do what it says. Avoid unnecessary framework machinery.
145
-
146
- ### 3. Keep the data separate
147
-
148
- Case facts belong in JSON, not hard-coded into the prose.
149
-
150
- ### 4. Keep checks substantive
151
-
152
- A check should add confidence. It should not only restate the answer.
153
-
154
- ### 5. Keep names aligned
155
-
156
- If a case is called `delfour`, `medior`, `flandor` or `calidor` in `examples/`, the Arcling case should use the same base name.
157
-
158
- ## Suggested workflow for a new case
159
-
160
- 1. Start from a strong ARC-style N3 example.
161
- 2. Write a mathematical-English specification of the case.
162
- 3. Move the concrete instance into JSON.
163
- 4. Implement a small Go reference model.
164
- 5. Capture the expected result in JSON.
165
- 6. Keep the visible output in Answer / Reason Why / Check shape.
166
- 7. Link the Arcling case to its N3 counterpart.
167
-
168
- ## What Arcling is not
169
-
170
- Arcling is not:
171
-
172
- - a replacement for declarative Eyeling,
173
- - a performance collection,
174
- - a general application framework,
175
- - or a place for prose that cannot be tested.
176
-
177
- It exists to make a case simultaneously:
178
-
179
- - readable,
180
- - executable,
181
- - checkable,
182
- - and portable.
183
-
184
- ## In one line
185
-
186
- `examples/arcling/` presents ARC cases in mathematical English with reference Go realizations, JSON instances, and expected results, alongside declarative Eyeling examples.
57
+ These files all present reasoning in a recognizably ARC-like way: they derive an answer, make the reason visible in a compact report, and include checks that are meant to catch real mistakes. Some are classical logic or numeric examples; others show how Eyeling can express policy-aware, insight-oriented decision flows without collapsing everything into opaque application code.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyeling",
3
- "version": "1.22.2",
3
+ "version": "1.22.4",
4
4
  "description": "A minimal Notation3 (N3) reasoner in JavaScript.",
5
5
  "main": "./index.js",
6
6
  "keywords": [
@@ -45,12 +45,11 @@
45
45
  "test:builtins": "node test/builtins.test.js",
46
46
  "test:n3gen": "node test/n3gen.test.js",
47
47
  "test:examples": "node test/examples.test.js",
48
- "test:arcling": "node test/arcling.test.js",
49
48
  "test:manifest": "node test/manifest.test.js",
50
49
  "test:playground": "node test/playground.test.js",
51
50
  "test:package": "node test/package.test.js",
52
51
  "pretest": "npm run build && npm run test:packlist",
53
- "test": "npm run test:api && npm run test:builtins && npm run test:n3gen && npm run test:examples && npm run test:arcling && npm run test:manifest && npm run test:playground",
52
+ "test": "npm run test:api && npm run test:builtins && npm run test:n3gen && npm run test:examples && npm run test:manifest && npm run test:playground",
54
53
  "posttest": "npm run test:package",
55
54
  "preversion": "npm test",
56
55
  "postversion": "git push origin HEAD --follow-tags"
@@ -78,6 +78,24 @@ function showDiff({ examplesDir, expectedPath, generatedPath }) {
78
78
  if (d.stderr) process.stderr.write(d.stderr);
79
79
  }
80
80
 
81
+ function resolveExpectedPath(outputDir, inputFile) {
82
+ const exactPath = path.join(outputDir, inputFile);
83
+ if (fs.existsSync(exactPath)) return exactPath;
84
+
85
+ const stem = path.basename(inputFile, path.extname(inputFile));
86
+ const candidates = fs
87
+ .readdirSync(outputDir)
88
+ .filter((name) => path.basename(name, path.extname(name)) === stem)
89
+ .sort((a, b) => {
90
+ if (path.extname(a) === '.txt' && path.extname(b) !== '.txt') return -1;
91
+ if (path.extname(a) !== '.txt' && path.extname(b) === '.txt') return 1;
92
+ return a.localeCompare(b);
93
+ });
94
+
95
+ if (candidates.length === 0) return null;
96
+ return path.join(outputDir, candidates[0]);
97
+ }
98
+
81
99
  function main() {
82
100
  const suiteStart = Date.now();
83
101
 
@@ -123,7 +141,7 @@ function main() {
123
141
  const start = Date.now();
124
142
 
125
143
  const filePath = path.join(examplesDir, file);
126
- const expectedPath = path.join(outputDir, file);
144
+ const expectedPath = resolveExpectedPath(outputDir, file);
127
145
 
128
146
  let n3Text;
129
147
  try {
@@ -144,7 +162,7 @@ function main() {
144
162
  if (!fs.existsSync(expectedPath)) {
145
163
  const ms = Date.now() - start;
146
164
  fail(`${idx} ${file} ${msTag(ms)}`);
147
- fail(`Missing expected output/${file}`);
165
+ fail(`Missing expected output for ${path.basename(file, path.extname(file))}.*`);
148
166
  failed++;
149
167
  continue;
150
168
  }
@@ -1,79 +0,0 @@
1
- {
2
- "caseName": "Calidor",
3
- "municipality": "Calidor",
4
- "question": "Is the Calidor heat-response system allowed to use a narrow household support insight for heatwave response, and if so which support package should it recommend?",
5
- "timestamps": {
6
- "createdAt": "2026-07-18T09:00:00+00:00",
7
- "expiresAt": "2026-07-18T21:00:00+00:00",
8
- "authorizedAt": "2026-07-18T09:05:00+00:00",
9
- "dutyPerformedAt": "2026-07-18T20:30:00+00:00"
10
- },
11
- "evaluationContext": {
12
- "scopeDevice": "household-gateway",
13
- "scopeEvent": "heat-alert-window",
14
- "purpose": "heatwave_response",
15
- "prohibitedReusePurpose": "tenant_screening",
16
- "requestAction": "odrl:use"
17
- },
18
- "thresholds": {
19
- "alertLevelAtLeast": 3,
20
- "indoorTempCAtLeast": 30.0,
21
- "hoursAtOrAboveThresholdAtLeast": 6,
22
- "energyCreditEurAtMost": 5.0,
23
- "minimumActiveNeedCount": 3
24
- },
25
- "localProfile": {
26
- "vulnerabilityFlags": ["heat_sensitive_condition", "mobility_limitation"]
27
- },
28
- "heatStatus": {
29
- "currentAlertLevel": 4,
30
- "currentIndoorTempC": 31.4,
31
- "hoursAtOrAboveThreshold": 9
32
- },
33
- "energyProfile": {
34
- "remainingPrepaidCreditEur": 3.2
35
- },
36
- "supportCatalog": [
37
- {
38
- "id": "pkg:CHECK",
39
- "name": "Cooling Check Call",
40
- "costEur": 8,
41
- "capabilities": ["welfare_check"]
42
- },
43
- {
44
- "id": "pkg:VOUCHER",
45
- "name": "Cooling Center Transport Voucher",
46
- "costEur": 12,
47
- "capabilities": ["transport", "welfare_check"]
48
- },
49
- {
50
- "id": "pkg:BUNDLE",
51
- "name": "Calidor Priority Cooling Bundle",
52
- "costEur": 18,
53
- "capabilities": ["cooling_kit", "welfare_check", "transport", "bill_credit"]
54
- },
55
- {
56
- "id": "pkg:DELUXE",
57
- "name": "Extended Resilience Package",
58
- "costEur": 28,
59
- "capabilities": ["cooling_kit", "welfare_check", "transport", "bill_credit", "followup_visit"]
60
- }
61
- ],
62
- "budget": {
63
- "maxPackageCostEur": 20
64
- },
65
- "insightPolicy": {
66
- "id": "https://example.org/insight/calidor",
67
- "metric": "active_need_count",
68
- "type": "ins:Insight",
69
- "supportPolicy": "lowest_cost_covering_package",
70
- "policyType": "odrl:Policy",
71
- "policyProfile": "Calidor-Heatwave-Policy"
72
- },
73
- "integrity": {
74
- "hashAlgorithm": "SHA-256",
75
- "macAlgorithm": "HMAC-SHA-256",
76
- "secret": "calidor-heatwave-demo-shared-secret",
77
- "verificationMode": "trustedPrecomputedInput"
78
- }
79
- }
@@ -1,94 +0,0 @@
1
- {
2
- "caseName": "Calidor",
3
- "derived": {
4
- "heatAlertActive": true,
5
- "unsafeIndoorHeat": true,
6
- "vulnerabilityPresent": true,
7
- "energyConstraint": true,
8
- "activeNeedCount": 4,
9
- "priorityCoolingSupportNeeded": true,
10
- "requiredCapabilities": ["bill_credit", "cooling_kit", "transport", "welfare_check"],
11
- "eligiblePackageIds": ["pkg:BUNDLE"],
12
- "recommendedPackageId": "pkg:BUNDLE",
13
- "recommendedPackageName": "Calidor Priority Cooling Bundle"
14
- },
15
- "envelope": {
16
- "insight": {
17
- "createdAt": "2026-07-18T09:00:00+00:00",
18
- "expiresAt": "2026-07-18T21:00:00+00:00",
19
- "id": "https://example.org/insight/calidor",
20
- "metric": "active_need_count",
21
- "municipality": "Calidor",
22
- "scopeDevice": "household-gateway",
23
- "scopeEvent": "heat-alert-window",
24
- "supportPolicy": "lowest_cost_covering_package",
25
- "threshold": 3,
26
- "type": "ins:Insight"
27
- },
28
- "policy": {
29
- "duty": {
30
- "action": "odrl:delete",
31
- "constraint": {
32
- "leftOperand": "odrl:dateTime",
33
- "operator": "odrl:eq",
34
- "rightOperand": "2026-07-18T21:00:00+00:00"
35
- }
36
- },
37
- "permission": {
38
- "action": "odrl:use",
39
- "constraint": {
40
- "leftOperand": "odrl:purpose",
41
- "operator": "odrl:eq",
42
- "rightOperand": "heatwave_response"
43
- },
44
- "target": "https://example.org/insight/calidor"
45
- },
46
- "profile": "Calidor-Heatwave-Policy",
47
- "prohibition": {
48
- "action": "odrl:distribute",
49
- "constraint": {
50
- "leftOperand": "odrl:purpose",
51
- "operator": "odrl:eq",
52
- "rightOperand": "tenant_screening"
53
- },
54
- "target": "https://example.org/insight/calidor"
55
- },
56
- "type": "odrl:Policy"
57
- }
58
- },
59
- "integrity": {
60
- "canonicalEnvelope": "{\"insight\":{\"createdAt\":\"2026-07-18T09:00:00+00:00\",\"expiresAt\":\"2026-07-18T21:00:00+00:00\",\"id\":\"https://example.org/insight/calidor\",\"metric\":\"active_need_count\",\"municipality\":\"Calidor\",\"scopeDevice\":\"household-gateway\",\"scopeEvent\":\"heat-alert-window\",\"supportPolicy\":\"lowest_cost_covering_package\",\"threshold\":3.0,\"type\":\"ins:Insight\"},\"policy\":{\"duty\":{\"action\":\"odrl:delete\",\"constraint\":{\"leftOperand\":\"odrl:dateTime\",\"operator\":\"odrl:eq\",\"rightOperand\":\"2026-07-18T21:00:00+00:00\"}},\"permission\":{\"action\":\"odrl:use\",\"constraint\":{\"leftOperand\":\"odrl:purpose\",\"operator\":\"odrl:eq\",\"rightOperand\":\"heatwave_response\"},\"target\":\"https://example.org/insight/calidor\"},\"profile\":\"Calidor-Heatwave-Policy\",\"prohibition\":{\"action\":\"odrl:distribute\",\"constraint\":{\"leftOperand\":\"odrl:purpose\",\"operator\":\"odrl:eq\",\"rightOperand\":\"tenant_screening\"},\"target\":\"https://example.org/insight/calidor\"},\"type\":\"odrl:Policy\"}}",
61
- "payloadHashSHA256": "1bf53a644fa39f5a1dd324f24872767f04379656e888fd456f4d498e12f1a65c",
62
- "envelopeHmacSHA256": "e635c7c1991742a5c36992fc0da32a7abc80b32aa5777a1142adaab55183681c",
63
- "verificationMode": "trustedPrecomputedInput"
64
- },
65
- "answer": {
66
- "sentence": "The city is allowed to use a narrow heatwave-response insight and recommends Calidor Priority Cooling Bundle for this household.",
67
- "recommendedPackage": "Calidor Priority Cooling Bundle",
68
- "requiredCapabilities": ["bill_credit", "cooling_kit", "transport", "welfare_check"],
69
- "payloadHashSHA256": "1bf53a644fa39f5a1dd324f24872767f04379656e888fd456f4d498e12f1a65c",
70
- "envelopeHmacSHA256": "e635c7c1991742a5c36992fc0da32a7abc80b32aa5777a1142adaab55183681c"
71
- },
72
- "reasonWhy": [
73
- "The household gateway converts local heat, vulnerability, and prepaid-energy stress into an expiring priority-support insight rather than sharing raw household traces or sensitive details.",
74
- "recommended package: Calidor Priority Cooling Bundle",
75
- "required capabilities: bill_credit, cooling_kit, transport, welfare_check",
76
- "payload SHA-256 : 1bf53a644fa39f5a1dd324f24872767f04379656e888fd456f4d498e12f1a65c",
77
- "HMAC-SHA256 : e635c7c1991742a5c36992fc0da32a7abc80b32aa5777a1142adaab55183681c"
78
- ],
79
- "checks": {
80
- "signatureVerifies": true,
81
- "payloadHashMatches": true,
82
- "minimizationRespected": true,
83
- "scopeComplete": true,
84
- "authorizationAllowed": true,
85
- "heatAlertActive": true,
86
- "unsafeIndoorHeat": true,
87
- "priorityCoolingSupportNeeded": true,
88
- "recommendedPackageEligible": true,
89
- "dutyTimingConsistent": true,
90
- "tenantScreeningProhibited": true
91
- },
92
- "allChecksPass": true,
93
- "arcText": "=== Answer ===\nThe city is allowed to use a narrow heatwave-response insight and recommends Calidor Priority Cooling Bundle for this household.\n\n=== Reason Why ===\nThe household gateway converts local heat, vulnerability, and prepaid-energy stress into an expiring priority-support insight rather than sharing raw household traces or sensitive details.\nrecommended package: Calidor Priority Cooling Bundle\nrequired capabilities: bill_credit, cooling_kit, transport, welfare_check\npayload SHA-256 : 1bf53a644fa39f5a1dd324f24872767f04379656e888fd456f4d498e12f1a65c\nHMAC-SHA256 : e635c7c1991742a5c36992fc0da32a7abc80b32aa5777a1142adaab55183681c\n\n=== Check ===\nsignature verifies : yes\npayload hash matches : yes\nminimization strips sensitive terms: yes\nscope complete : yes\nauthorization allowed : yes\nheat-alert active : yes\nunsafe indoor heat : yes\npriority cooling support needed : yes\nrecommended package eligible : yes\nduty timing consistent : yes\ntenant screening prohibited : yes"
94
- }