eyeling 1.22.1 → 1.22.3
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/examples/arcling/README.md +37 -167
- package/examples/calidor.n3 +500 -0
- package/examples/output/calidor.n3 +29 -0
- package/package.json +2 -3
- package/examples/arcling/delfour/delfour.data.json +0 -67
- package/examples/arcling/delfour/delfour.expected.json +0 -88
- package/examples/arcling/delfour/delfour.model.go +0 -564
- package/examples/arcling/delfour/delfour.spec.md +0 -117
- package/examples/arcling/flandor/flandor.data.json +0 -106
- package/examples/arcling/flandor/flandor.expected.json +0 -98
- package/examples/arcling/flandor/flandor.model.go +0 -655
- package/examples/arcling/flandor/flandor.spec.md +0 -155
- package/examples/arcling/medior/medior.data.json +0 -96
- package/examples/arcling/medior/medior.expected.json +0 -100
- package/examples/arcling/medior/medior.model.go +0 -652
- package/examples/arcling/medior/medior.spec.md +0 -157
- package/test/arcling.test.js +0 -191
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# Flandor — ARC Specification
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
|
|
5
|
-
This document is the **normative specification** for the Flandor case. The file `flandor.model.go` is the **reference Go implementation** of these clauses. The file `flandor.data.json` is the **instance** evaluated in this bundle. The file `flandor.expected.json` is the **conformance vector** for that instance.
|
|
6
|
-
|
|
7
|
-
## Insight Economy context
|
|
8
|
-
|
|
9
|
-
This case is the macro-economic reading of Ruben Verborgh’s [Inside the Insight Economy](https://ruben.verborgh.org/blog/2025/08/12/inside-the-insight-economy/). Its core claim is that nobody has to reveal their books for the region to coordinate. Exporters, training actors, and grid operators each keep their sensitive data local. What crosses the policy boundary is not the underlying evidence, but a narrow, signed, expiring insight: Flanders presently faces enough combined pressure to justify a temporary retooling response.
|
|
10
|
-
|
|
11
|
-
The product being traded is therefore not raw data, and not even a general forecast, but a context-bound permissioned conclusion: a policy-grade insight for regional stabilization, with reuse for firm surveillance explicitly forbidden.
|
|
12
|
-
|
|
13
|
-
## Conventions
|
|
14
|
-
|
|
15
|
-
- “iff” means “if and only if”.
|
|
16
|
-
- A clause identifier such as `R1` or `M3` is normative.
|
|
17
|
-
- A conforming implementation may be written in any language, but it shall produce the same derived values and pass/fail outcomes for the supplied instance.
|
|
18
|
-
|
|
19
|
-
## Vocabulary
|
|
20
|
-
|
|
21
|
-
**V1. Region** is the polity for which a macro-economic insight is derived.
|
|
22
|
-
|
|
23
|
-
**V2. Industrial cluster** is a regional production grouping with an export-orders index.
|
|
24
|
-
|
|
25
|
-
**V3. Labour-market signal** is a regional indicator that includes the technical vacancy rate.
|
|
26
|
-
|
|
27
|
-
**V4. Grid signal** is a regional indicator that includes congestion hours.
|
|
28
|
-
|
|
29
|
-
**V5. Policy package** is an intervention option with cost and coverage properties.
|
|
30
|
-
|
|
31
|
-
**V6. Insight envelope** is the ordered pair `(insight, policy)` together with integrity metadata.
|
|
32
|
-
|
|
33
|
-
## Input instance
|
|
34
|
-
|
|
35
|
-
**I1.** The region is `Flanders`.
|
|
36
|
-
|
|
37
|
-
**I2.** The observed clusters are Antwerp chemicals and Ghent manufacturing.
|
|
38
|
-
|
|
39
|
-
**I3.** The technical vacancy rate is `4.6%`.
|
|
40
|
-
|
|
41
|
-
**I4.** Grid congestion is `19` hours.
|
|
42
|
-
|
|
43
|
-
**I5.** The budget cap is `€140M`.
|
|
44
|
-
|
|
45
|
-
**I6.** The candidate packages are the four packages listed in `flandor.data.json`.
|
|
46
|
-
|
|
47
|
-
## Derivation clauses
|
|
48
|
-
|
|
49
|
-
**R1. ExportWeakness.**
|
|
50
|
-
`ExportWeakness` holds iff there exists a cluster `c` such that `c.exportOrdersIndex < 90`.
|
|
51
|
-
|
|
52
|
-
**R2. SkillsStrain.**
|
|
53
|
-
`SkillsStrain` holds iff `technicalVacancyRatePct > 3.9`.
|
|
54
|
-
|
|
55
|
-
**R3. GridStress.**
|
|
56
|
-
`GridStress` holds iff `congestionHours > 11`.
|
|
57
|
-
|
|
58
|
-
**R4. ActiveNeedCount.**
|
|
59
|
-
`ActiveNeedCount` is the number of true predicates among `ExportWeakness`, `SkillsStrain`, and `GridStress`.
|
|
60
|
-
|
|
61
|
-
**R5. NeedsRetoolingPulse.**
|
|
62
|
-
`NeedsRetoolingPulse` holds iff `ActiveNeedCount ≥ 3`.
|
|
63
|
-
|
|
64
|
-
## Selection clauses
|
|
65
|
-
|
|
66
|
-
**S1. Eligible(p).**
|
|
67
|
-
A package `p` is eligible iff:
|
|
68
|
-
|
|
69
|
-
1. `p.costMEUR ≤ budget.maxMEUR`; and
|
|
70
|
-
2. for every active need, `p` covers that need.
|
|
71
|
-
|
|
72
|
-
**S2. RecommendedPackage.**
|
|
73
|
-
`RecommendedPackage` is the eligible package with minimum `costMEUR`.
|
|
74
|
-
|
|
75
|
-
**S3. No-package fallback.**
|
|
76
|
-
If no eligible package exists, the recommendation is `None`.
|
|
77
|
-
|
|
78
|
-
## Governance clauses
|
|
79
|
-
|
|
80
|
-
**G1. AuthorizedUse.**
|
|
81
|
-
`AuthorizedUse` holds iff:
|
|
82
|
-
|
|
83
|
-
1. the requested action is `odrl:use`;
|
|
84
|
-
2. the requested purpose is `regional_stabilization`; and
|
|
85
|
-
3. the authorization time is not later than the expiry time.
|
|
86
|
-
|
|
87
|
-
**G2. SurveillanceReuseProhibited.**
|
|
88
|
-
`SurveillanceReuseProhibited` holds iff the policy prohibits distribution for purpose `firm_surveillance`.
|
|
89
|
-
|
|
90
|
-
**G3. DutyTimely.**
|
|
91
|
-
`DutyTimely` holds iff the duty-performance time is not later than the expiry time.
|
|
92
|
-
|
|
93
|
-
## Integrity and minimization clauses
|
|
94
|
-
|
|
95
|
-
**M1. CanonicalEnvelope.**
|
|
96
|
-
The canonical envelope string is the stable JSON serialization of the ordered pair `(insight, policy)`, with object keys sorted lexicographically at every level.
|
|
97
|
-
|
|
98
|
-
**M2. PayloadHashMatches.**
|
|
99
|
-
`PayloadHashMatches` holds iff `SHA-256(CanonicalEnvelope) = declaredPayloadHashSHA256`.
|
|
100
|
-
|
|
101
|
-
**M3. SignatureVerifies.**
|
|
102
|
-
`SignatureVerifies` holds iff the declared HMAC verifies under the agreed verification mode.
|
|
103
|
-
|
|
104
|
-
**M4. MinimizationRespected.**
|
|
105
|
-
`MinimizationRespected` holds iff the serialized insight contains none of the forbidden terms: `salary`, `payroll`, `invoice`, `medical`, `firmname`.
|
|
106
|
-
|
|
107
|
-
**M5. ScopeComplete.**
|
|
108
|
-
`ScopeComplete` holds iff the insight contains `scopeDevice`, `scopeEvent`, and `expiresAt`.
|
|
109
|
-
|
|
110
|
-
## Output contract
|
|
111
|
-
|
|
112
|
-
**O1. Answer.**
|
|
113
|
-
A conforming renderer shall expose:
|
|
114
|
-
|
|
115
|
-
- case name
|
|
116
|
-
- region
|
|
117
|
-
- metric
|
|
118
|
-
- active need count
|
|
119
|
-
- threshold
|
|
120
|
-
- recommended package
|
|
121
|
-
- budget cap
|
|
122
|
-
- package cost
|
|
123
|
-
- payload hash
|
|
124
|
-
- envelope HMAC
|
|
125
|
-
|
|
126
|
-
**O2. Reason Why.**
|
|
127
|
-
A conforming renderer shall explain which predicates hold and why the package was selected.
|
|
128
|
-
|
|
129
|
-
**O3. Check.**
|
|
130
|
-
A conforming renderer shall expose a named PASS/FAIL outcome for each of:
|
|
131
|
-
|
|
132
|
-
- payloadHashMatches
|
|
133
|
-
- signatureVerifies
|
|
134
|
-
- thresholdReached
|
|
135
|
-
- scopeComplete
|
|
136
|
-
- minimizationRespected
|
|
137
|
-
- authorizationAllowed
|
|
138
|
-
- dutyTimely
|
|
139
|
-
- surveillanceReuseProhibited
|
|
140
|
-
- packageWithinBudget
|
|
141
|
-
- packageCoversAllActiveNeeds
|
|
142
|
-
- lowestCostEligiblePackageChosen
|
|
143
|
-
|
|
144
|
-
## Reference outcome for this instance
|
|
145
|
-
|
|
146
|
-
For the supplied instance:
|
|
147
|
-
|
|
148
|
-
- `ExportWeakness = true`
|
|
149
|
-
- `SkillsStrain = true`
|
|
150
|
-
- `GridStress = true`
|
|
151
|
-
- `ActiveNeedCount = 3`
|
|
152
|
-
- `NeedsRetoolingPulse = true`
|
|
153
|
-
- `RecommendedPackage = "Flandor Retooling Pulse"`
|
|
154
|
-
|
|
155
|
-
The expected ARC report and integrity values are recorded in `flandor.expected.json`.
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"caseName": "Medior",
|
|
3
|
-
"region": "Flanders",
|
|
4
|
-
"question": "Is the discharge coordination team allowed to use a minimal continuity insight after hospital discharge, and if so which package should it activate?",
|
|
5
|
-
"timestamps": {
|
|
6
|
-
"createdAt": "2026-04-09T08:00:00+00:00",
|
|
7
|
-
"expiresAt": "2026-04-11T08:00:00+00:00",
|
|
8
|
-
"authorizedAt": "2026-04-09T09:15:00+00:00",
|
|
9
|
-
"dutyPerformedAt": "2026-04-10T19:30:00+00:00"
|
|
10
|
-
},
|
|
11
|
-
"evaluationContext": {
|
|
12
|
-
"scopeDevice": "discharge-coordination-team",
|
|
13
|
-
"scopeEvent": "48h-post-discharge-window",
|
|
14
|
-
"purpose": "care_coordination",
|
|
15
|
-
"prohibitedReusePurpose": "insurance_pricing"
|
|
16
|
-
},
|
|
17
|
-
"thresholds": {
|
|
18
|
-
"egfrBelow": 60,
|
|
19
|
-
"activeMedicationCountAtLeast": 8,
|
|
20
|
-
"admissionsLast180DaysAtLeast": 1,
|
|
21
|
-
"hoursSinceDischargeAtMost": 48,
|
|
22
|
-
"activeNeedCountAtLeast": 3
|
|
23
|
-
},
|
|
24
|
-
"signals": {
|
|
25
|
-
"lab": {
|
|
26
|
-
"egfr": 52
|
|
27
|
-
},
|
|
28
|
-
"medications": {
|
|
29
|
-
"activeMedicationCount": 9
|
|
30
|
-
},
|
|
31
|
-
"history": {
|
|
32
|
-
"admissionsLast180Days": 2
|
|
33
|
-
},
|
|
34
|
-
"discharge": {
|
|
35
|
-
"hoursSinceDischarge": 18
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"budget": {
|
|
39
|
-
"windowName": "post-discharge continuity window",
|
|
40
|
-
"maxEUR": 5
|
|
41
|
-
},
|
|
42
|
-
"packages": [
|
|
43
|
-
{
|
|
44
|
-
"id": "pkg:CALL_001",
|
|
45
|
-
"name": "Nurse follow-up call",
|
|
46
|
-
"costEUR": 1,
|
|
47
|
-
"touches": 1,
|
|
48
|
-
"coversRenalSafetyConcern": false,
|
|
49
|
-
"coversPolypharmacyRisk": false,
|
|
50
|
-
"coversReadmissionHistory": false,
|
|
51
|
-
"coversRecentDischargeWindow": true
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"id": "pkg:MEDREC_002",
|
|
55
|
-
"name": "Medication reconciliation bundle",
|
|
56
|
-
"costEUR": 2,
|
|
57
|
-
"touches": 2,
|
|
58
|
-
"coversRenalSafetyConcern": true,
|
|
59
|
-
"coversPolypharmacyRisk": true,
|
|
60
|
-
"coversReadmissionHistory": false,
|
|
61
|
-
"coversRecentDischargeWindow": false
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"id": "pkg:MEDIOR_004",
|
|
65
|
-
"name": "Medior Continuity Pulse",
|
|
66
|
-
"costEUR": 4,
|
|
67
|
-
"touches": 3,
|
|
68
|
-
"coversRenalSafetyConcern": true,
|
|
69
|
-
"coversPolypharmacyRisk": true,
|
|
70
|
-
"coversReadmissionHistory": true,
|
|
71
|
-
"coversRecentDischargeWindow": true
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"id": "pkg:TRANSITION_006",
|
|
75
|
-
"name": "Extended transition program",
|
|
76
|
-
"costEUR": 6,
|
|
77
|
-
"touches": 4,
|
|
78
|
-
"coversRenalSafetyConcern": true,
|
|
79
|
-
"coversPolypharmacyRisk": true,
|
|
80
|
-
"coversReadmissionHistory": true,
|
|
81
|
-
"coversRecentDischargeWindow": true
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
"insightPolicy": {
|
|
85
|
-
"id": "https://example.org/insight/medior",
|
|
86
|
-
"metric": "post_discharge_coordination_priority",
|
|
87
|
-
"suggestionPolicy": "lowest_cost_package_covering_all_active_needs",
|
|
88
|
-
"type": "ins:Insight",
|
|
89
|
-
"policyProfile": "Medior-Insight-Policy",
|
|
90
|
-
"policyType": "odrl:Policy"
|
|
91
|
-
},
|
|
92
|
-
"integrity": {
|
|
93
|
-
"secret": "medior-demo-shared-secret",
|
|
94
|
-
"verificationMode": "trustedPrecomputedInput"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"caseName": "Medior",
|
|
3
|
-
"derived": {
|
|
4
|
-
"renalSafetyConcern": true,
|
|
5
|
-
"polypharmacyRisk": true,
|
|
6
|
-
"readmissionHistory": true,
|
|
7
|
-
"recentDischargeWindow": true,
|
|
8
|
-
"activeNeedCount": 4,
|
|
9
|
-
"needsContinuityBundle": true,
|
|
10
|
-
"eligiblePackageIds": ["pkg:MEDIOR_004"],
|
|
11
|
-
"recommendedPackageId": "pkg:MEDIOR_004",
|
|
12
|
-
"recommendedPackageName": "Medior Continuity Pulse"
|
|
13
|
-
},
|
|
14
|
-
"envelope": {
|
|
15
|
-
"insight": {
|
|
16
|
-
"createdAt": "2026-04-09T08:00:00+00:00",
|
|
17
|
-
"expiresAt": "2026-04-11T08:00:00+00:00",
|
|
18
|
-
"id": "https://example.org/insight/medior",
|
|
19
|
-
"metric": "post_discharge_coordination_priority",
|
|
20
|
-
"region": "Flanders",
|
|
21
|
-
"scopeDevice": "discharge-coordination-team",
|
|
22
|
-
"scopeEvent": "48h-post-discharge-window",
|
|
23
|
-
"suggestionPolicy": "lowest_cost_package_covering_all_active_needs",
|
|
24
|
-
"threshold": 3,
|
|
25
|
-
"type": "ins:Insight"
|
|
26
|
-
},
|
|
27
|
-
"policy": {
|
|
28
|
-
"duty": {
|
|
29
|
-
"action": "odrl:delete",
|
|
30
|
-
"constraint": {
|
|
31
|
-
"leftOperand": "odrl:dateTime",
|
|
32
|
-
"operator": "odrl:eq",
|
|
33
|
-
"rightOperand": "2026-04-11T08:00:00+00:00"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"permission": {
|
|
37
|
-
"action": "odrl:use",
|
|
38
|
-
"constraint": {
|
|
39
|
-
"leftOperand": "odrl:purpose",
|
|
40
|
-
"operator": "odrl:eq",
|
|
41
|
-
"rightOperand": "care_coordination"
|
|
42
|
-
},
|
|
43
|
-
"target": "https://example.org/insight/medior"
|
|
44
|
-
},
|
|
45
|
-
"profile": "Medior-Insight-Policy",
|
|
46
|
-
"prohibition": {
|
|
47
|
-
"action": "odrl:distribute",
|
|
48
|
-
"constraint": {
|
|
49
|
-
"leftOperand": "odrl:purpose",
|
|
50
|
-
"operator": "odrl:eq",
|
|
51
|
-
"rightOperand": "insurance_pricing"
|
|
52
|
-
},
|
|
53
|
-
"target": "https://example.org/insight/medior"
|
|
54
|
-
},
|
|
55
|
-
"type": "odrl:Policy"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"integrity": {
|
|
59
|
-
"canonicalEnvelope": "{\"insight\":{\"createdAt\":\"2026-04-09T08:00:00+00:00\",\"expiresAt\":\"2026-04-11T08:00:00+00:00\",\"id\":\"https://example.org/insight/medior\",\"metric\":\"post_discharge_coordination_priority\",\"region\":\"Flanders\",\"scopeDevice\":\"discharge-coordination-team\",\"scopeEvent\":\"48h-post-discharge-window\",\"suggestionPolicy\":\"lowest_cost_package_covering_all_active_needs\",\"threshold\":3,\"type\":\"ins:Insight\"},\"policy\":{\"duty\":{\"action\":\"odrl:delete\",\"constraint\":{\"leftOperand\":\"odrl:dateTime\",\"operator\":\"odrl:eq\",\"rightOperand\":\"2026-04-11T08:00:00+00:00\"}},\"permission\":{\"action\":\"odrl:use\",\"constraint\":{\"leftOperand\":\"odrl:purpose\",\"operator\":\"odrl:eq\",\"rightOperand\":\"care_coordination\"},\"target\":\"https://example.org/insight/medior\"},\"profile\":\"Medior-Insight-Policy\",\"prohibition\":{\"action\":\"odrl:distribute\",\"constraint\":{\"leftOperand\":\"odrl:purpose\",\"operator\":\"odrl:eq\",\"rightOperand\":\"insurance_pricing\"},\"target\":\"https://example.org/insight/medior\"},\"type\":\"odrl:Policy\"}}",
|
|
60
|
-
"payloadHashSHA256": "b5fec8971d6c5e313a1387f08151f1c3203effce05d6455469c9f63305be05ae",
|
|
61
|
-
"envelopeHmacSHA256": "072f4c2774ce362e660649d145c9d784e5e95d63d24d4057b119a419c6ba34dc",
|
|
62
|
-
"verificationMode": "trustedPrecomputedInput"
|
|
63
|
-
},
|
|
64
|
-
"answer": {
|
|
65
|
-
"name": "Medior",
|
|
66
|
-
"region": "Flanders",
|
|
67
|
-
"metric": "post_discharge_coordination_priority",
|
|
68
|
-
"activeNeedCount": 4,
|
|
69
|
-
"threshold": 3,
|
|
70
|
-
"recommendedPackage": "Medior Continuity Pulse",
|
|
71
|
-
"budgetCapEUR": 5,
|
|
72
|
-
"packageCostEUR": 4,
|
|
73
|
-
"payloadHashSHA256": "b5fec8971d6c5e313a1387f08151f1c3203effce05d6455469c9f63305be05ae",
|
|
74
|
-
"envelopeHmacSHA256": "072f4c2774ce362e660649d145c9d784e5e95d63d24d4057b119a419c6ba34dc"
|
|
75
|
-
},
|
|
76
|
-
"reasonWhy": [
|
|
77
|
-
"RenalSafetyConcern holds because eGFR = 52 and the threshold is < 60.",
|
|
78
|
-
"PolypharmacyRisk holds because the active medication count is 9 and the threshold is ≥ 8.",
|
|
79
|
-
"ReadmissionHistory holds because admissionsLast180Days = 2 and the threshold is ≥ 1.",
|
|
80
|
-
"RecentDischargeWindow holds because hoursSinceDischarge = 18 and the threshold is ≤ 48.",
|
|
81
|
-
"The recommendation rule selects the least-cost package that covers every active need and remains within budget.",
|
|
82
|
-
"The selected package is \"Medior Continuity Pulse\" with cost €4, touches=3.",
|
|
83
|
-
"Use is permitted only for purpose \"care_coordination\" and expires at 2026-04-11T08:00:00+00:00."
|
|
84
|
-
],
|
|
85
|
-
"checks": {
|
|
86
|
-
"payloadHashMatches": true,
|
|
87
|
-
"signatureVerifies": true,
|
|
88
|
-
"thresholdReached": true,
|
|
89
|
-
"scopeComplete": true,
|
|
90
|
-
"minimizationRespected": true,
|
|
91
|
-
"authorizationAllowed": true,
|
|
92
|
-
"dutyTimely": true,
|
|
93
|
-
"insurancePricingProhibited": true,
|
|
94
|
-
"packageWithinBudget": true,
|
|
95
|
-
"packageCoversAllActiveNeeds": true,
|
|
96
|
-
"lowestCostEligiblePackageChosen": true
|
|
97
|
-
},
|
|
98
|
-
"allChecksPass": true,
|
|
99
|
-
"arcText": "=== Answer ===\nName: Medior\nRegion: Flanders\nMetric: post_discharge_coordination_priority\nActive need count: 4/3\nRecommended package: Medior Continuity Pulse\nBudget cap: €5\nPackage cost: €4\nPayload SHA-256: b5fec8971d6c5e313a1387f08151f1c3203effce05d6455469c9f63305be05ae\nEnvelope HMAC-SHA-256: 072f4c2774ce362e660649d145c9d784e5e95d63d24d4057b119a419c6ba34dc\n\n=== Reason Why ===\nRenalSafetyConcern holds because eGFR = 52 and the threshold is < 60.\nPolypharmacyRisk holds because the active medication count is 9 and the threshold is ≥ 8.\nReadmissionHistory holds because admissionsLast180Days = 2 and the threshold is ≥ 1.\nRecentDischargeWindow holds because hoursSinceDischarge = 18 and the threshold is ≤ 48.\nThe recommendation rule selects the least-cost package that covers every active need and remains within budget.\nThe selected package is \"Medior Continuity Pulse\" with cost €4, touches=3.\nUse is permitted only for purpose \"care_coordination\" and expires at 2026-04-11T08:00:00+00:00.\n\n=== Check ===\n- PASS: payloadHashMatches\n- PASS: signatureVerifies\n- PASS: thresholdReached\n- PASS: scopeComplete\n- PASS: minimizationRespected\n- PASS: authorizationAllowed\n- PASS: dutyTimely\n- PASS: insurancePricingProhibited\n- PASS: packageWithinBudget\n- PASS: packageCoversAllActiveNeeds\n- PASS: lowestCostEligiblePackageChosen"
|
|
100
|
-
}
|