@passwerk/rules 0.1.0

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 (92) hide show
  1. package/LICENSE +202 -0
  2. package/PROVENANCE.md +64 -0
  3. package/README.md +59 -0
  4. package/artefacts/aas/3.0.9/aas.json +1522 -0
  5. package/artefacts/aas/3.1.2/aas.json +1532 -0
  6. package/artefacts/batterypass/2025_Battery_Passport_Data_Attributes_V1.2.xlsx +0 -0
  7. package/artefacts/batterypass/samm/CarbonFootprint-1.2.0.ttl +96 -0
  8. package/artefacts/batterypass/samm/Circularity-1.2.0.ttl +280 -0
  9. package/artefacts/batterypass/samm/GeneralProductInformation-1.2.0.ttl +200 -0
  10. package/artefacts/batterypass/samm/Labels-1.2.0.ttl +65 -0
  11. package/artefacts/batterypass/samm/MaterialComposition-1.2.0.ttl +188 -0
  12. package/artefacts/batterypass/samm/Performance-1.2.1.ttl +660 -0
  13. package/artefacts/batterypass/samm/SupplyChainDueDiligence-1.2.0.ttl +45 -0
  14. package/artefacts/ec/2026-08-15_data-points-by-category_v2.0.pdf +0 -0
  15. package/artefacts/idta/02035-1/1.0/template.aasx +0 -0
  16. package/artefacts/idta/02035-1/1.0/template.json +2276 -0
  17. package/artefacts/idta/02035-1/1.0/template.noexamples.json +2263 -0
  18. package/artefacts/idta/02035-2/1.0/template.aasx +0 -0
  19. package/artefacts/idta/02035-2/1.0/template.json +2991 -0
  20. package/artefacts/idta/02035-2/1.0/template.noexamples.json +2990 -0
  21. package/artefacts/idta/02035-3/1.0/template.aasx +0 -0
  22. package/artefacts/idta/02035-3/1.0/template.json +1644 -0
  23. package/artefacts/idta/02035-3/1.0/template.noexamples.json +1643 -0
  24. package/artefacts/idta/02035-4/1.0.1/template.aasx +0 -0
  25. package/artefacts/idta/02035-4/1.0.1/template.json +4248 -0
  26. package/artefacts/idta/02035-4/1.0.1/template.noexamples.json +4219 -0
  27. package/artefacts/idta/02035-5/1.0.2/template.aasx +0 -0
  28. package/artefacts/idta/02035-5/1.0.2/template.json +4185 -0
  29. package/artefacts/idta/02035-6/1.0.1/template.aasx +0 -0
  30. package/artefacts/idta/02035-6/1.0.1/template.json +2167 -0
  31. package/artefacts/idta/02035-6/1.0.1/template.noexamples.json +2160 -0
  32. package/artefacts/idta/02035-7/1.0.1/template.aasx +0 -0
  33. package/artefacts/idta/02035-7/1.0.1/template.json +3296 -0
  34. package/artefacts/idta/02035-7/1.0.1/template.noexamples.json +3296 -0
  35. package/artefacts/manifest.json +417 -0
  36. package/dist/artefacts/aas/3.0.9/aas.json +1522 -0
  37. package/dist/artefacts/aas/3.1.2/aas.json +1532 -0
  38. package/dist/artefacts/idta/02035-1/1.0/template.json +2276 -0
  39. package/dist/artefacts/idta/02035-1/1.0/template.noexamples.json +2263 -0
  40. package/dist/artefacts/idta/02035-2/1.0/template.json +2991 -0
  41. package/dist/artefacts/idta/02035-2/1.0/template.noexamples.json +2990 -0
  42. package/dist/artefacts/idta/02035-3/1.0/template.json +1644 -0
  43. package/dist/artefacts/idta/02035-3/1.0/template.noexamples.json +1643 -0
  44. package/dist/artefacts/idta/02035-4/1.0.1/template.json +4248 -0
  45. package/dist/artefacts/idta/02035-4/1.0.1/template.noexamples.json +4219 -0
  46. package/dist/artefacts/idta/02035-5/1.0.2/template.json +4185 -0
  47. package/dist/artefacts/idta/02035-6/1.0.1/template.json +2167 -0
  48. package/dist/artefacts/idta/02035-6/1.0.1/template.noexamples.json +2160 -0
  49. package/dist/artefacts/idta/02035-7/1.0.1/template.json +3296 -0
  50. package/dist/artefacts/idta/02035-7/1.0.1/template.noexamples.json +3296 -0
  51. package/dist/artefacts/manifest.json +417 -0
  52. package/dist/kb/attributes/01-identifiers.json +483 -0
  53. package/dist/kb/attributes/02-labels-conformity.json +319 -0
  54. package/dist/kb/attributes/03-carbon-footprint.json +421 -0
  55. package/dist/kb/attributes/04-due-diligence.json +163 -0
  56. package/dist/kb/attributes/05-materials.json +264 -0
  57. package/dist/kb/attributes/06-circularity.json +758 -0
  58. package/dist/kb/attributes/07-performance-electrical.json +1118 -0
  59. package/dist/kb/attributes/08-performance-lifetime.json +837 -0
  60. package/dist/kb/carrier.json +44 -0
  61. package/dist/kb/ec-datapoints.json +866 -0
  62. package/dist/kb/generated/batterypass-samm.json +3310 -0
  63. package/dist/kb/generated/din-longlist.json +2610 -0
  64. package/dist/kb/generated/template-catalogue.json +7788 -0
  65. package/dist/kb/rules.json +524 -0
  66. package/dist/kb/timeline.json +422 -0
  67. package/dist/src/index.d.ts +75 -0
  68. package/dist/src/index.d.ts.map +1 -0
  69. package/dist/src/index.js +214 -0
  70. package/dist/src/index.js.map +1 -0
  71. package/dist/src/types.d.ts +298 -0
  72. package/dist/src/types.d.ts.map +1 -0
  73. package/dist/src/types.js +6 -0
  74. package/dist/src/types.js.map +1 -0
  75. package/dist/tsconfig.tsbuildinfo +1 -0
  76. package/kb/attributes/01-identifiers.json +483 -0
  77. package/kb/attributes/02-labels-conformity.json +319 -0
  78. package/kb/attributes/03-carbon-footprint.json +421 -0
  79. package/kb/attributes/04-due-diligence.json +163 -0
  80. package/kb/attributes/05-materials.json +264 -0
  81. package/kb/attributes/06-circularity.json +758 -0
  82. package/kb/attributes/07-performance-electrical.json +1118 -0
  83. package/kb/attributes/08-performance-lifetime.json +837 -0
  84. package/kb/attributes/README.md +74 -0
  85. package/kb/carrier.json +44 -0
  86. package/kb/ec-datapoints.json +866 -0
  87. package/kb/generated/batterypass-samm.json +3310 -0
  88. package/kb/generated/din-longlist.json +2610 -0
  89. package/kb/generated/template-catalogue.json +7788 -0
  90. package/kb/rules.json +524 -0
  91. package/kb/timeline.json +422 -0
  92. package/package.json +59 -0
@@ -0,0 +1,74 @@
1
+ # Attribute knowledge base
2
+
3
+ One JSON file per DIN DKE SPEC 99100 attribute category. Together the files cover all 93 rows of
4
+ the Battery Pass Data Attribute Longlist v1.2 (`kb/generated/din-longlist.json`) and, through
5
+ `ecDataPoints`, all 71 Commission data points (`kb/ec-datapoints.json`) except the two that the
6
+ Commission marks as repetitions (16 and 25).
7
+
8
+ These files are **authored data**, reviewed by humans. Everything that can be derived from an
9
+ official source is *not* stored here but joined at runtime by `@passwerk/rules`:
10
+
11
+ | Derived at runtime | From |
12
+ |---|---|
13
+ | Legal references | `ecDataPoints[*].legalRef` + longlist `regulationRef` |
14
+ | Applicability per battery category (mandatory / optional / conditional / not_yet_applicable / not_displayed) | `ecDataPoints[0]` (the primary data point), or `applicabilityOverride` when no EC data point exists |
15
+ | semanticId, cardinality, AAS value type, template unit | `templatePaths[*]` looked up in `kb/generated/template-catalogue.json` |
16
+ | DIN chapter, definition, static/dynamic, granularity, access rights | `din.no` looked up in the longlist |
17
+
18
+ Not joined at runtime but checked at review time: `pnpm review-sheet` joins every attribute to the
19
+ Battery Pass SAMM aspect models (`kb/generated/batterypass-samm.json`) by DIN chapter and IDTA
20
+ semanticId name and lists unit, data type, enumeration and range disagreements in
21
+ `docs/KB_REVIEW.md` (ADR D-030). Resolve a finding by changing the JSON here, never the script.
22
+
23
+ ## Entry schema
24
+
25
+ ```jsonc
26
+ {
27
+ "id": "batteryMass", // ^[a-z][A-Za-z0-9]*$, unique across all files
28
+ "din": { "no": 10, "chapter": "6.1.3.6" }, // must match one longlist row exactly
29
+ "ecDataPoints": [10], // Commission data point numbers; [0] is primary
30
+ "part": 4, // IDTA 02035 part carrying the value, or null
31
+ "templatePaths": ["4/GeneralInformation/BatteryMass"], // catalogue paths, all within `part`
32
+ "name": { "en": "Battery mass", "de": "Batteriemasse" },
33
+ "synonyms": { "en": ["weight", "..."], "de": ["Gewicht", "..."] }, // >= 2 each, lower-case, as they appear in supplier documents
34
+ "valueKind": "decimal", // see vocabulary below
35
+ "unit": "kg", // see vocabulary below, or null
36
+ "range": { "min": 0, "max": null }, // plausibility bounds, or null
37
+ "whoTypicallyHasIt": { "en": "...", "de": "..." },
38
+ "explanation": { "en": "...", "de": "..." }, // 1-3 plain sentences for a supplier, not a lawyer
39
+ "applicabilityOverride": null, // only when ecDataPoints is []; see below
40
+ "verify": false, // true = a human must confirm the mapping
41
+ "lastVerified": "2026-09-03"
42
+ }
43
+ ```
44
+
45
+ `valueKind` vocabulary: `identifier`, `text`, `multilingualText`, `decimal`, `integer`,
46
+ `percentage`, `date`, `dateTime`, `boolean`, `enum`, `document`, `uri`, `graphic`, `composite`.
47
+
48
+ `unit` vocabulary: `kg`, `g`, `Ah`, `kWh`, `Wh`, `V`, `W`, `W/Wh`, `%`, `%/month`, `Ohm`,
49
+ `degC`, `min`, `cycles`, `years`, `months`, `kgCO2e/kWh`, `tCO2e`, `C` (C-rate, A/Ah).
50
+
51
+ `applicabilityOverride` is required when `ecDataPoints` is empty (attributes that exist in DIN
52
+ DKE SPEC 99100 but not in the Commission's 71-point matrix):
53
+
54
+ ```jsonc
55
+ "applicabilityOverride": {
56
+ "EV": { "status": "not_displayed", "text": "..." },
57
+ "LMT": { "status": "conditional", "text": "..." },
58
+ "INDUSTRIAL_GT_2KWH": { "status": "conditional", "text": "..." },
59
+ "source": "Battery Pass longlist v1.2 row 7 (x = LMT, stationary); Annex VII Part B (1)"
60
+ }
61
+ ```
62
+
63
+ ## Rules for authors
64
+
65
+ - Never invent a semanticId, legal reference or standard clause. They are joined from the
66
+ generated files; if you cannot find a template element, set `part: null`,
67
+ `templatePaths: []` and `verify: true`.
68
+ - German and English are both required for `name`, `synonyms`, `whoTypicallyHasIt` and
69
+ `explanation`. Use the terminology a Mittelstand supplier uses in a BOM or Lieferantenerklärung,
70
+ not the regulation's wording, for synonyms.
71
+ - `whoTypicallyHasIt` names the role in the supply chain that usually holds the data (cell
72
+ manufacturer, pack assembler, BMS supplier, importer, EHS department, ...).
73
+ - Mark `verify: true` whenever the mapping between DIN row, EC data point and template element is
74
+ a judgement call. `test/attributes.test.ts` enforces the structure; humans review the semantics.
@@ -0,0 +1,44 @@
1
+ {
2
+ "$comment": "Data carrier schemes for the battery passport identifier: the URI patterns and length limits were transcribed from docs/BUILD_PLAN.md (section 3, 'QR / GS1') and the author's recollection of the GS1 General Specifications, not from a bundled artefact. No GS1 or ISO/IEC 15459 document is bundled (PROVENANCE.md). Every entry stays verify: true until a domain expert confirms it against the GS1 Digital Link URI syntax standard.",
3
+ "lastVerified": "2026-09-06",
4
+ "schemes": [
5
+ {
6
+ "id": "gs1-digital-link-gtin-serial",
7
+ "name": {
8
+ "en": "GS1 Digital Link (GTIN + serial number)",
9
+ "de": "GS1 Digital Link (GTIN + Seriennummer)"
10
+ },
11
+ "standard": "GS1 Digital Link URI syntax; GS1 General Specifications, application identifiers 01 and 21",
12
+ "pattern": "https://{resolverBase}/01/{gtin14}/21/{serial}",
13
+ "limits": { "gtinDigits": [8, 12, 13, 14], "serialMaxLength": 20 },
14
+ "explanation": {
15
+ "en": "The battery model's GTIN (padded to 14 digits, mod-10 check digit verified) and the unit's serial number form the path of a resolver URL. Scanning the QR code opens that URL, which the operator's resolver redirects to the passport.",
16
+ "de": "Die GTIN des Batteriemodells (auf 14 Stellen aufgefüllt, Mod-10-Prüfziffer geprüft) und die Seriennummer der Einheit bilden den Pfad einer Resolver-URL. Das Scannen des QR-Codes öffnet diese URL, die der Resolver des Betreibers zum Pass weiterleitet."
17
+ },
18
+ "whoTypicallyHasIt": {
19
+ "en": "The pack manufacturer or importer holds the GTIN (assigned through a GS1 member organisation) and the serial number; the resolver domain belongs to the economic operator placing the battery on the market.",
20
+ "de": "Pack-Hersteller oder Importeur halten die GTIN (über eine GS1-Mitgliedsorganisation vergeben) und die Seriennummer; die Resolver-Domain gehört dem Wirtschaftsakteur, der die Batterie in Verkehr bringt."
21
+ },
22
+ "verify": true
23
+ },
24
+ {
25
+ "id": "gs1-digital-link-giai",
26
+ "name": {
27
+ "en": "GS1 Digital Link (GIAI, individual asset)",
28
+ "de": "GS1 Digital Link (GIAI, einzelnes Anlagegut)"
29
+ },
30
+ "standard": "GS1 Digital Link URI syntax; GS1 General Specifications, application identifier 8004",
31
+ "pattern": "https://{resolverBase}/8004/{giai}",
32
+ "limits": { "giaiMaxLength": 30 },
33
+ "explanation": {
34
+ "en": "A Global Individual Asset Identifier names one physical battery without a product GTIN. It suits industrial batteries tracked as assets rather than as serialised products.",
35
+ "de": "Ein Global Individual Asset Identifier benennt eine einzelne physische Batterie ohne Produkt-GTIN. Er passt zu Industriebatterien, die als Anlagegut statt als serialisiertes Produkt geführt werden."
36
+ },
37
+ "whoTypicallyHasIt": {
38
+ "en": "The asset owner or operator that registered the GIAI with its GS1 company prefix.",
39
+ "de": "Eigentümer oder Betreiber, der die GIAI unter seinem GS1-Basisnummernkreis vergeben hat."
40
+ },
41
+ "verify": true
42
+ }
43
+ ]
44
+ }