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.
@@ -1,117 +0,0 @@
1
- # Delfour — ARC Specification
2
-
3
- ## Status
4
-
5
- This document is the **normative specification** for the Delfour case. The file `delfour.model.go` is the **reference Go implementation** of these clauses. The file `delfour.data.json` is the **instance** evaluated in this bundle. The file `delfour.expected.json` is the **conformance vector** for that instance.
6
-
7
- ## Insight Economy context
8
-
9
- This case is the household-scale 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 a person can share a useful shopping hint without exposing sensitive health details. A phone turns a private condition into a neutral, limited insight such as "prefer lower-sugar products", attaches clear usage rules and an expiry time, and sends it to a store scanner.
10
-
11
- The scanner may use that insight to suggest a better product, but not for unrelated purposes such as marketing. The scanner does not need the diagnosis. It only needs the right shopping conclusion.
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. Household condition** is a private fact local to the phone.
22
-
23
- **V2. Low-sugar need** is a neutral shopping need derived from the household condition.
24
-
25
- **V3. Scanned product** is the product presently under consideration by the store self-scanner.
26
-
27
- **V4. Candidate alternative** is a catalog product considered as a possible substitute.
28
-
29
- **V5. Insight envelope** is the ordered pair `(insight, policy)` together with integrity metadata.
30
-
31
- ## Input instance
32
-
33
- **I1.** The retailer is `Delfour`.
34
-
35
- **I2.** The household condition is `Diabetes`.
36
-
37
- **I3.** The scanned product is `Classic Tea Biscuits`.
38
-
39
- **I4.** The sugar threshold is `10.0` grams per serving.
40
-
41
- **I5.** The catalog contains the four products listed in `delfour.data.json`.
42
-
43
- ## Derivation clauses
44
-
45
- **R1. NeedsLowSugar.** `NeedsLowSugar` holds iff the household condition is `Diabetes`.
46
-
47
- **R2. HighSugarScanned.** `HighSugarScanned` holds iff the scanned product has `sugarPerServing ≥ 10.0`.
48
-
49
- **R3. LowerSugarCandidate(p).** For a product `p`, `LowerSugarCandidate(p)` holds iff `p.sugarTenths < scannedProduct.sugarTenths`.
50
-
51
- **R4. RecommendedAlternative.** `RecommendedAlternative` is the candidate product with minimum `sugarTenths` among all products `p` such that `LowerSugarCandidate(p)` holds.
52
-
53
- **R5. AlternativeLowersSugar.** `AlternativeLowersSugar` holds iff the recommended alternative exists and has strictly lower `sugarTenths` than the scanned product.
54
-
55
- ## Governance clauses
56
-
57
- **G1. AuthorizedUse.** `AuthorizedUse` holds iff:
58
-
59
- 1. the requested action is `odrl:use`;
60
- 2. the requested purpose is `shopping_assist`; and
61
- 3. the authorization time is not later than the expiry time.
62
-
63
- **G2. MarketingProhibited.** `MarketingProhibited` holds iff the policy prohibits distribution for purpose `marketing`.
64
-
65
- **G3. DutyTimely.** `DutyTimely` holds iff the duty-performance time is not later than the expiry time.
66
-
67
- ## Integrity and minimization clauses
68
-
69
- **M1. CanonicalEnvelope.** The canonical envelope string is the JSON serialization of the ordered pair `(insight, policy)` with keys emitted in this exact sequence:
70
-
71
- - insight: `createdAt`, `expiresAt`, `id`, `metric`, `retailer`, `scopeDevice`, `scopeEvent`, `suggestionPolicy`, `threshold`, `type`
72
- - policy: `duty`, `permission`, `profile`, `prohibition`, `type`
73
-
74
- For this case, `threshold` is serialized lexically as `10.0` rather than `10`, because the integrity vector is defined over the exact envelope bytes used by the specialized Delfour driver.
75
-
76
- **M2. PayloadHashMatches.** `PayloadHashMatches` holds iff `SHA-256(CanonicalEnvelope) = declaredPayloadHashSHA256`.
77
-
78
- **M3. SignatureVerifies.** `SignatureVerifies` holds iff the declared HMAC verifies under the agreed verification mode.
79
-
80
- **M4. MinimizationRespected.** `MinimizationRespected` holds iff the serialized insight contains none of the forbidden terms: `diabetes`, `medical`.
81
-
82
- **M5. ScopeComplete.** `ScopeComplete` holds iff the insight contains `scopeDevice`, `scopeEvent`, and `expiresAt`.
83
-
84
- ## Output contract
85
-
86
- **O1. Answer.** A conforming renderer shall expose:
87
-
88
- - the main recommendation sentence
89
- - scanned product
90
- - suggested alternative
91
- - payload hash
92
- - envelope HMAC
93
-
94
- **O2. Reason Why.** A conforming renderer shall explain the household-to-insight desensitization and the scoped shopping purpose.
95
-
96
- **O3. Check.** A conforming renderer shall expose a named yes/no or PASS/FAIL outcome for each of:
97
-
98
- - signatureVerifies
99
- - payloadHashMatches
100
- - minimizationRespected
101
- - scopeComplete
102
- - authorizationAllowed
103
- - highSugarBanner
104
- - alternativeLowersSugar
105
- - dutyTimingConsistent
106
- - marketingProhibited
107
-
108
- ## Reference outcome for this instance
109
-
110
- For the supplied instance:
111
-
112
- - `NeedsLowSugar = true`
113
- - `HighSugarScanned = true`
114
- - `RecommendedAlternative = "Low-Sugar Tea Biscuits"`
115
- - `AlternativeLowersSugar = true`
116
-
117
- The expected ARC report and integrity values are recorded in `delfour.expected.json`.
@@ -1,106 +0,0 @@
1
- {
2
- "caseName": "Flandor",
3
- "region": "Flanders",
4
- "question": "Is the Flemish Economic Resilience Board allowed to use a neutral macro-economic insight for regional stabilization, and if so which package should it activate for Flanders?",
5
- "timestamps": {
6
- "createdAt": "2026-04-08T07:00:00+00:00",
7
- "expiresAt": "2026-04-08T19:00:00+00:00",
8
- "authorizedAt": "2026-04-08T09:15:00+00:00",
9
- "dutyPerformedAt": "2026-04-08T18:30:00+00:00"
10
- },
11
- "evaluationContext": {
12
- "scopeDevice": "economic-resilience-board",
13
- "scopeEvent": "budget-prep-window",
14
- "purpose": "regional_stabilization",
15
- "prohibitedReusePurpose": "firm_surveillance"
16
- },
17
- "thresholds": {
18
- "exportOrdersIndexBelow": 90,
19
- "technicalVacancyRatePctAbove": 3.9,
20
- "gridCongestionHoursAbove": 11,
21
- "activeNeedCountAtLeast": 3
22
- },
23
- "signals": {
24
- "clusters": [
25
- {
26
- "id": "cluster:ANT_CHEM",
27
- "name": "Antwerp chemicals",
28
- "exportOrdersIndex": 84,
29
- "energyIntensity": 92
30
- },
31
- {
32
- "id": "cluster:GNT_MFG",
33
- "name": "Ghent manufacturing",
34
- "exportOrdersIndex": 87,
35
- "energyIntensity": 76
36
- }
37
- ],
38
- "labourMarket": {
39
- "technicalVacancyRatePct": 4.6
40
- },
41
- "grid": {
42
- "congestionHours": 19,
43
- "renewableCurtailmentMWh": 240
44
- }
45
- },
46
- "budget": {
47
- "windowName": "Q2 resilience window",
48
- "maxMEUR": 140
49
- },
50
- "packages": [
51
- {
52
- "id": "pkg:TRAIN_070",
53
- "name": "Flanders Skills Sprint",
54
- "costMEUR": 70,
55
- "workerCoverage": 900,
56
- "gridReliefMW": 0,
57
- "coversExportWeakness": false,
58
- "coversSkillsStrain": true,
59
- "coversGridStress": false
60
- },
61
- {
62
- "id": "pkg:PORT_095",
63
- "name": "Schelde Trade Buffer",
64
- "costMEUR": 95,
65
- "workerCoverage": 300,
66
- "gridReliefMW": 10,
67
- "coversExportWeakness": true,
68
- "coversSkillsStrain": false,
69
- "coversGridStress": false
70
- },
71
- {
72
- "id": "pkg:RET_FLEX_120",
73
- "name": "Flandor Retooling Pulse",
74
- "costMEUR": 120,
75
- "workerCoverage": 1200,
76
- "gridReliefMW": 85,
77
- "coversExportWeakness": true,
78
- "coversSkillsStrain": true,
79
- "coversGridStress": true
80
- },
81
- {
82
- "id": "pkg:CORRIDOR_165",
83
- "name": "Full Corridor Shock Shield",
84
- "costMEUR": 165,
85
- "workerCoverage": 1600,
86
- "gridReliefMW": 110,
87
- "coversExportWeakness": true,
88
- "coversSkillsStrain": true,
89
- "coversGridStress": true
90
- }
91
- ],
92
- "insightPolicy": {
93
- "id": "https://example.org/insight/flandor",
94
- "metric": "regional_retooling_priority",
95
- "type": "ins:Insight",
96
- "suggestionPolicy": "lowest_cost_package_covering_all_active_needs",
97
- "policyType": "odrl:Policy",
98
- "policyProfile": "Flandor-Insight-Policy"
99
- },
100
- "integrity": {
101
- "hashAlgorithm": "SHA-256",
102
- "macAlgorithm": "HMAC-SHA-256",
103
- "secret": "flandor-demo-shared-secret",
104
- "verificationMode": "trustedPrecomputedInput"
105
- }
106
- }
@@ -1,98 +0,0 @@
1
- {
2
- "caseName": "Flandor",
3
- "derived": {
4
- "exportWeakness": true,
5
- "skillsStrain": true,
6
- "gridStress": true,
7
- "activeNeedCount": 3,
8
- "needsRetoolingPulse": true,
9
- "eligiblePackageIds": ["pkg:RET_FLEX_120"],
10
- "recommendedPackageId": "pkg:RET_FLEX_120",
11
- "recommendedPackageName": "Flandor Retooling Pulse"
12
- },
13
- "envelope": {
14
- "insight": {
15
- "createdAt": "2026-04-08T07:00:00+00:00",
16
- "expiresAt": "2026-04-08T19:00:00+00:00",
17
- "id": "https://example.org/insight/flandor",
18
- "metric": "regional_retooling_priority",
19
- "region": "Flanders",
20
- "scopeDevice": "economic-resilience-board",
21
- "scopeEvent": "budget-prep-window",
22
- "suggestionPolicy": "lowest_cost_package_covering_all_active_needs",
23
- "threshold": 3,
24
- "type": "ins:Insight"
25
- },
26
- "policy": {
27
- "duty": {
28
- "action": "odrl:delete",
29
- "constraint": {
30
- "leftOperand": "odrl:dateTime",
31
- "operator": "odrl:eq",
32
- "rightOperand": "2026-04-08T19:00:00+00:00"
33
- }
34
- },
35
- "permission": {
36
- "action": "odrl:use",
37
- "constraint": {
38
- "leftOperand": "odrl:purpose",
39
- "operator": "odrl:eq",
40
- "rightOperand": "regional_stabilization"
41
- },
42
- "target": "https://example.org/insight/flandor"
43
- },
44
- "profile": "Flandor-Insight-Policy",
45
- "prohibition": {
46
- "action": "odrl:distribute",
47
- "constraint": {
48
- "leftOperand": "odrl:purpose",
49
- "operator": "odrl:eq",
50
- "rightOperand": "firm_surveillance"
51
- },
52
- "target": "https://example.org/insight/flandor"
53
- },
54
- "type": "odrl:Policy"
55
- }
56
- },
57
- "integrity": {
58
- "canonicalEnvelope": "{\"insight\":{\"createdAt\":\"2026-04-08T07:00:00+00:00\",\"expiresAt\":\"2026-04-08T19:00:00+00:00\",\"id\":\"https://example.org/insight/flandor\",\"metric\":\"regional_retooling_priority\",\"region\":\"Flanders\",\"scopeDevice\":\"economic-resilience-board\",\"scopeEvent\":\"budget-prep-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-08T19:00:00+00:00\"}},\"permission\":{\"action\":\"odrl:use\",\"constraint\":{\"leftOperand\":\"odrl:purpose\",\"operator\":\"odrl:eq\",\"rightOperand\":\"regional_stabilization\"},\"target\":\"https://example.org/insight/flandor\"},\"profile\":\"Flandor-Insight-Policy\",\"prohibition\":{\"action\":\"odrl:distribute\",\"constraint\":{\"leftOperand\":\"odrl:purpose\",\"operator\":\"odrl:eq\",\"rightOperand\":\"firm_surveillance\"},\"target\":\"https://example.org/insight/flandor\"},\"type\":\"odrl:Policy\"}}",
59
- "payloadHashSHA256": "78d840cbc98e98d07d97498e8bc1bab716df0fc0c7c221aeaa86644157cfcfb8",
60
- "envelopeHmacSHA256": "a907547046c46af6550635d786c1ea82c05e8c119c0c302c132eb799710df96e",
61
- "verificationMode": "trustedPrecomputedInput"
62
- },
63
- "answer": {
64
- "name": "Flandor",
65
- "region": "Flanders",
66
- "metric": "regional_retooling_priority",
67
- "activeNeedCount": 3,
68
- "threshold": 3,
69
- "recommendedPackage": "Flandor Retooling Pulse",
70
- "budgetCapMEUR": 140,
71
- "packageCostMEUR": 120,
72
- "payloadHashSHA256": "78d840cbc98e98d07d97498e8bc1bab716df0fc0c7c221aeaa86644157cfcfb8",
73
- "envelopeHmacSHA256": "a907547046c46af6550635d786c1ea82c05e8c119c0c302c132eb799710df96e"
74
- },
75
- "reasonWhy": [
76
- "ExportWeakness holds because at least one cluster has exportOrdersIndex < 90 (Antwerp chemicals=84, Ghent manufacturing=87).",
77
- "SkillsStrain holds because the technical vacancy rate is 4.6% and the threshold is > 3.9%.",
78
- "GridStress holds because congestion hours = 19 and the threshold is > 11.",
79
- "The recommendation rule selects the least-cost package that covers every active need and remains within budget.",
80
- "The selected package is \"Flandor Retooling Pulse\" with cost \u20ac120M, workerCoverage=1200, gridReliefMW=85.",
81
- "Use is permitted only for purpose \"regional_stabilization\" and expires at 2026-04-08T19:00:00+00:00."
82
- ],
83
- "checks": {
84
- "payloadHashMatches": true,
85
- "signatureVerifies": true,
86
- "thresholdReached": true,
87
- "scopeComplete": true,
88
- "minimizationRespected": true,
89
- "authorizationAllowed": true,
90
- "dutyTimely": true,
91
- "surveillanceReuseProhibited": true,
92
- "packageWithinBudget": true,
93
- "packageCoversAllActiveNeeds": true,
94
- "lowestCostEligiblePackageChosen": true
95
- },
96
- "allChecksPass": true,
97
- "arcText": "=== Answer ===\nName: Flandor\nRegion: Flanders\nMetric: regional_retooling_priority\nActive need count: 3/3\nRecommended package: Flandor Retooling Pulse\nBudget cap: \u20ac140M\nPackage cost: \u20ac120M\nPayload SHA-256: 78d840cbc98e98d07d97498e8bc1bab716df0fc0c7c221aeaa86644157cfcfb8\nEnvelope HMAC-SHA-256: a907547046c46af6550635d786c1ea82c05e8c119c0c302c132eb799710df96e\n\n=== Reason Why ===\nExportWeakness holds because at least one cluster has exportOrdersIndex < 90 (Antwerp chemicals=84, Ghent manufacturing=87).\nSkillsStrain holds because the technical vacancy rate is 4.6% and the threshold is > 3.9%.\nGridStress holds because congestion hours = 19 and the threshold is > 11.\nThe recommendation rule selects the least-cost package that covers every active need and remains within budget.\nThe selected package is \"Flandor Retooling Pulse\" with cost \u20ac120M, workerCoverage=1200, gridReliefMW=85.\nUse is permitted only for purpose \"regional_stabilization\" and expires at 2026-04-08T19: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: surveillanceReuseProhibited\n- PASS: packageWithinBudget\n- PASS: packageCoversAllActiveNeeds\n- PASS: lowestCostEligiblePackageChosen"
98
- }