@operato/ops-contract 0.9.24 → 0.9.25

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.
@@ -75,6 +75,13 @@ export interface DomainProfileInfo {
75
75
  locationTypes: readonly string[];
76
76
  }
77
77
  export declare const DOMAIN_CATALOG: Record<DomainSystem, DomainProfileInfo>;
78
+ /**
79
+ * 저널이 개체의 이력을 나르는 축 — 컬럼으로 승격돼 있어 그 축으로만 물을 수 있다.
80
+ *
81
+ * 새 문자열을 열지 않는다(ADR-0074). 여기 없는 이름으로 물으면 저널은 거르지 못하고 목록이
82
+ * 조용히 비거나 남의 축이 섞인다.
83
+ */
84
+ export type TwinJournalAxis = 'epc' | 'orderId' | 'locationId' | 'moverId';
78
85
  export interface TwinAxisInfo {
79
86
  /**
80
87
  * 축의 이름 — 화면·관계 선언이 쓰는 키. 최상위 축은 `TwinModelDef` 의 키 **그대로**다
@@ -154,6 +161,34 @@ export interface TwinAxisInfo {
154
161
  kind: 'instance' | 'class' | 'spec';
155
162
  /** 이 축의 항목이 카탈로그 타입을 갖는가 — 있으면 `types` 와 이어진다(자리·설비만). */
156
163
  typeRole?: 'location' | 'equipment';
164
+ /**
165
+ * 이 축의 개체 이력을 **저널의 어느 축으로 묻나.**
166
+ *
167
+ * 선언하지 않으면 「저널이 이 축으로 기록하지 않는다」는 뜻이고, 화면은 그 사실을 말한다
168
+ * (「이력이 없다」가 아니다 — 묻지 않은 것과 없는 것은 다르다). 명세 축(공정 · 레시피 · 라우트)이
169
+ * 그 경우다: 저널은 공정 자체가 아니라 그 공정을 수행한 작업으로 기록된다.
170
+ *
171
+ * ── 왜 계약에 있나 (2026-09-18, ADR-0074) ─────────────────────────────────
172
+ * 이 대응이 앱의 화면 상수에 있었다. 축 이름이 한 세대 바뀌자 표가 따라오지 않았고, 로케이션 ·
173
+ * 오더 · 품목의 360 은 **저널을 묻지도 않은 채** 「이 개념은 이력 축이 없다」를 그렸다. 축이
174
+ * 사는 자리(`path`)와 무엇이 가리키나(`idField`)가 선언인 것과 같은 이유로, 이것도 선언이다.
175
+ *
176
+ * 품목 정의(`materialDefinitions`)가 `epc` 인 것은 개체의 EPC 안에 그 정의가 클래스로 들어 있기
177
+ * 때문이다 — 질의는 그 컬럼 하나에 부분일치로 건다(정확일치로는 클래스를 못 찾는다).
178
+ */
179
+ journalAxis?: TwinJournalAxis;
180
+ /**
181
+ * **무엇이 이 축의 개체를 말하나** — 식별자 말고 사람이 읽는 값들, 보이는 차례대로.
182
+ *
183
+ * 선언하지 않으면 소비처는 `idField` 만 보인다. 없는 이름을 지어내지 않는다.
184
+ *
185
+ * 소비처가 셋이다: 개체 상세의 요약 줄, 관계 그림의 정점 부제, 그리고 AI 가 개체를 한 줄로 말할 때.
186
+ * 셋이 각자 고르면 같은 개체가 화면마다 다른 말로 불린다.
187
+ *
188
+ * 칸 이름이 `summary` 가 아닌 이유(ADR-0074): 이름은 화면의 쓰임이 아니라 사실을 말한다 —
189
+ * `idField` · `source` 와 같은 결이다.
190
+ */
191
+ describedBy?: string[];
157
192
  /**
158
193
  * 이 축이 **어느 종류의 트윈에 있는가** — 선언하지 않으면 **전부**에 있다.
159
194
  *
@@ -32,25 +32,25 @@ export const DOMAIN_CATALOG = {
32
32
  const LOGISTICS = ['wms', 'yms', 'mes'];
33
33
  /** board 축 전체 — 인스펙션의 **개념 목록**이 여기서 나온다(화면은 이 목록을 갖지 않는다). */
34
34
  export const TWIN_AXES = [
35
- { axis: 'locations', path: 'locations', label: 'twin.axis.locations', kind: 'instance', typeRole: 'location',
35
+ { axis: 'locations', path: 'locations', journalAxis: 'locationId', describedBy: ['name', 'type'], label: 'twin.axis.locations', kind: 'instance', typeRole: 'location',
36
36
  standardClass: { epcis: 'SGLN' } },
37
- { axis: 'equipment', path: 'equipment', label: 'twin.axis.equipment', kind: 'instance', typeRole: 'equipment',
37
+ { axis: 'equipment', path: 'equipment', journalAxis: 'moverId', describedBy: ['name', 'kind'], label: 'twin.axis.equipment', kind: 'instance', typeRole: 'equipment',
38
38
  standardClass: { isa95: 'Equipment', iso55000: 'Asset', epcis: 'GIAI' } },
39
39
  { axis: 'persons', path: 'persons', label: 'twin.axis.persons', kind: 'instance',
40
40
  standardClass: { isa95: 'Person' }, systems: LOGISTICS },
41
41
  { axis: 'assets', path: 'assets', label: 'twin.axis.assets', kind: 'instance',
42
42
  standardClass: { isa95: 'PhysicalAsset', iso55000: 'Asset' } },
43
- { axis: 'personnelClasses', path: 'personnelClasses', label: 'twin.axis.personnelClasses', kind: 'class',
43
+ { axis: 'personnelClasses', path: 'personnelClasses', describedBy: ['description'], label: 'twin.axis.personnelClasses', kind: 'class',
44
44
  standardClass: { isa95: 'PersonnelClass' }, systems: LOGISTICS },
45
- { axis: 'equipmentClasses', path: 'equipmentClasses', label: 'twin.axis.equipmentClasses', kind: 'class',
45
+ { axis: 'equipmentClasses', path: 'equipmentClasses', describedBy: ['description'], label: 'twin.axis.equipmentClasses', kind: 'class',
46
46
  standardClass: { isa95: 'EquipmentClass' } },
47
- { axis: 'assetClasses', path: 'assetClasses', label: 'twin.axis.assetClasses', kind: 'class',
47
+ { axis: 'assetClasses', path: 'assetClasses', describedBy: ['description'], label: 'twin.axis.assetClasses', kind: 'class',
48
48
  standardClass: { isa95: 'PhysicalAssetClass' } },
49
- { axis: 'materialDefinitions', path: 'materialDefinitions', label: 'twin.axis.materialDefinitions', kind: 'class',
49
+ { axis: 'materialDefinitions', path: 'materialDefinitions', journalAxis: 'epc', describedBy: ['description', 'uom'], label: 'twin.axis.materialDefinitions', kind: 'class',
50
50
  standardClass: { isa95: 'MaterialDefinition' }, systems: LOGISTICS },
51
- { axis: 'materialClasses', path: 'materialClasses', label: 'twin.axis.materialClasses', kind: 'class',
51
+ { axis: 'materialClasses', path: 'materialClasses', describedBy: ['description'], label: 'twin.axis.materialClasses', kind: 'class',
52
52
  standardClass: { isa95: 'MaterialClass' }, systems: LOGISTICS },
53
- { axis: 'operations', path: 'operations', label: 'twin.axis.operations', kind: 'spec',
53
+ { axis: 'operations', path: 'operations', describedBy: ['label'], label: 'twin.axis.operations', kind: 'spec',
54
54
  standardClass: { isa95: 'OperationsSegment' }, systems: LOGISTICS },
55
55
  { axis: 'productionSpec', path: 'productionSpec', label: 'twin.axis.productionSpec', kind: 'spec',
56
56
  standardClass: { isa95: 'OperationsSegment' }, systems: LOGISTICS },
@@ -60,11 +60,11 @@ export const TWIN_AXES = [
60
60
  * 전자는 도메인 정의의 가벼운 목록(`{key,label}`), 후자는 ISA-95 풍부형이다. 같은 것의 집이
61
61
  * 둘이라는 사실을 **선언이 드러낸다**(감추면 화면이 어느 쪽을 보는지 아무도 모른다).
62
62
  */
63
- { axis: 'recipes', path: 'productionSpec.definition.recipes', label: 'twin.axis.recipes', kind: 'spec',
63
+ { axis: 'recipes', path: 'productionSpec.definition.recipes', describedBy: ['label'], label: 'twin.axis.recipes', kind: 'spec',
64
64
  standardClass: { isa95: 'OperationsSegment' }, systems: LOGISTICS },
65
- { axis: 'routes', path: 'productionSpec.definition.routes', label: 'twin.axis.routes', kind: 'spec',
65
+ { axis: 'routes', path: 'productionSpec.definition.routes', describedBy: ['label'], label: 'twin.axis.routes', kind: 'spec',
66
66
  standardClass: { isa95: 'OperationsSegment' }, systems: LOGISTICS },
67
- { axis: 'materials', path: 'productionSpec.definition.materials', label: 'twin.axis.materials', kind: 'class',
67
+ { axis: 'materials', path: 'productionSpec.definition.materials', describedBy: ['label'], label: 'twin.axis.materials', kind: 'class',
68
68
  standardClass: { isa95: 'MaterialDefinition' }, systems: LOGISTICS },
69
69
  /*
70
70
  * 시험 명세 — **자원 아홉 종류가 가리키는 대상.**
@@ -74,7 +74,7 @@ export const TWIN_AXES = [
74
74
  *
75
75
  * `kind: 'spec'` 이다: 자원도 등급도 아니고 **판정의 정의**다(공정·레시피와 같은 부류).
76
76
  */
77
- { axis: 'testSpecifications', path: 'testSpecifications', label: 'twin.axis.testSpecifications', kind: 'spec',
77
+ { axis: 'testSpecifications', path: 'testSpecifications', describedBy: ['description', 'version'], label: 'twin.axis.testSpecifications', kind: 'spec',
78
78
  standardClass: { isa95: 'TestSpecification' } },
79
79
  /*
80
80
  * ── ISA-95 Part 4 — 일정과 실적 ────────────────────────────────────────────────
@@ -93,9 +93,9 @@ export const TWIN_AXES = [
93
93
  * 것이지만 트윈이 **관측한** 것이다. 투영은 규모에서 성능이 필요해질 때 KPI 폴드와 같은 급의
94
94
  * 별도 결정으로 한다.
95
95
  */
96
- { axis: 'orders', label: 'twin.axis.orders', kind: 'instance', source: 'state', historical: true,
96
+ { axis: 'orders', journalAxis: 'orderId', describedBy: ['kind', 'status'], label: 'twin.axis.orders', kind: 'instance', source: 'state', historical: true,
97
97
  standardClass: { isa95: 'OperationsRequest', epcis: 'TransactionEvent' }, systems: LOGISTICS },
98
- { axis: 'tasks', label: 'twin.axis.tasks', kind: 'instance', source: 'state', historical: true,
98
+ { axis: 'tasks', describedBy: ['kind', 'status'], label: 'twin.axis.tasks', kind: 'instance', source: 'state', historical: true,
99
99
  /*
100
100
  * No single EPCIS projection. A task's event kind follows its operation: a putaway or a pick is
101
101
  * an ObjectEvent, only a transformation (production, kitting) is a TransformationEvent. This used
@@ -120,7 +120,7 @@ export const TWIN_AXES = [
120
120
  * `subLotId ?? epc` 다. 짐작에 맡기면 `gtin` 으로 떨어지고, 그러면 **같은 품목의 물품 전부가 한
121
121
  * 식별자로 뭉친다** — 화면이 2,400개를 몇 개로 보인다.
122
122
  */
123
- { axis: 'items', label: 'twin.axis.items', kind: 'instance', source: 'state', historical: true,
123
+ { axis: 'items', journalAxis: 'epc', describedBy: ['definitionId', 'lot'], label: 'twin.axis.items', kind: 'instance', source: 'state', historical: true,
124
124
  idField: ['subLotId', 'epc'],
125
125
  standardClass: { isa95: 'MaterialLot', epcis: 'ObjectEvent' }, systems: LOGISTICS },
126
126
  /*
@@ -1717,6 +1717,8 @@ var TWIN_AXES = [
1717
1717
  {
1718
1718
  axis: "locations",
1719
1719
  path: "locations",
1720
+ journalAxis: "locationId",
1721
+ describedBy: ["name", "type"],
1720
1722
  label: "twin.axis.locations",
1721
1723
  kind: "instance",
1722
1724
  typeRole: "location",
@@ -1725,6 +1727,8 @@ var TWIN_AXES = [
1725
1727
  {
1726
1728
  axis: "equipment",
1727
1729
  path: "equipment",
1730
+ journalAxis: "moverId",
1731
+ describedBy: ["name", "kind"],
1728
1732
  label: "twin.axis.equipment",
1729
1733
  kind: "instance",
1730
1734
  typeRole: "equipment",
@@ -1748,6 +1752,7 @@ var TWIN_AXES = [
1748
1752
  {
1749
1753
  axis: "personnelClasses",
1750
1754
  path: "personnelClasses",
1755
+ describedBy: ["description"],
1751
1756
  label: "twin.axis.personnelClasses",
1752
1757
  kind: "class",
1753
1758
  standardClass: { isa95: "PersonnelClass" },
@@ -1756,6 +1761,7 @@ var TWIN_AXES = [
1756
1761
  {
1757
1762
  axis: "equipmentClasses",
1758
1763
  path: "equipmentClasses",
1764
+ describedBy: ["description"],
1759
1765
  label: "twin.axis.equipmentClasses",
1760
1766
  kind: "class",
1761
1767
  standardClass: { isa95: "EquipmentClass" }
@@ -1763,6 +1769,7 @@ var TWIN_AXES = [
1763
1769
  {
1764
1770
  axis: "assetClasses",
1765
1771
  path: "assetClasses",
1772
+ describedBy: ["description"],
1766
1773
  label: "twin.axis.assetClasses",
1767
1774
  kind: "class",
1768
1775
  standardClass: { isa95: "PhysicalAssetClass" }
@@ -1770,6 +1777,8 @@ var TWIN_AXES = [
1770
1777
  {
1771
1778
  axis: "materialDefinitions",
1772
1779
  path: "materialDefinitions",
1780
+ journalAxis: "epc",
1781
+ describedBy: ["description", "uom"],
1773
1782
  label: "twin.axis.materialDefinitions",
1774
1783
  kind: "class",
1775
1784
  standardClass: { isa95: "MaterialDefinition" },
@@ -1778,6 +1787,7 @@ var TWIN_AXES = [
1778
1787
  {
1779
1788
  axis: "materialClasses",
1780
1789
  path: "materialClasses",
1790
+ describedBy: ["description"],
1781
1791
  label: "twin.axis.materialClasses",
1782
1792
  kind: "class",
1783
1793
  standardClass: { isa95: "MaterialClass" },
@@ -1786,6 +1796,7 @@ var TWIN_AXES = [
1786
1796
  {
1787
1797
  axis: "operations",
1788
1798
  path: "operations",
1799
+ describedBy: ["label"],
1789
1800
  label: "twin.axis.operations",
1790
1801
  kind: "spec",
1791
1802
  standardClass: { isa95: "OperationsSegment" },
@@ -1808,6 +1819,7 @@ var TWIN_AXES = [
1808
1819
  {
1809
1820
  axis: "recipes",
1810
1821
  path: "productionSpec.definition.recipes",
1822
+ describedBy: ["label"],
1811
1823
  label: "twin.axis.recipes",
1812
1824
  kind: "spec",
1813
1825
  standardClass: { isa95: "OperationsSegment" },
@@ -1816,6 +1828,7 @@ var TWIN_AXES = [
1816
1828
  {
1817
1829
  axis: "routes",
1818
1830
  path: "productionSpec.definition.routes",
1831
+ describedBy: ["label"],
1819
1832
  label: "twin.axis.routes",
1820
1833
  kind: "spec",
1821
1834
  standardClass: { isa95: "OperationsSegment" },
@@ -1824,6 +1837,7 @@ var TWIN_AXES = [
1824
1837
  {
1825
1838
  axis: "materials",
1826
1839
  path: "productionSpec.definition.materials",
1840
+ describedBy: ["label"],
1827
1841
  label: "twin.axis.materials",
1828
1842
  kind: "class",
1829
1843
  standardClass: { isa95: "MaterialDefinition" },
@@ -1840,6 +1854,7 @@ var TWIN_AXES = [
1840
1854
  {
1841
1855
  axis: "testSpecifications",
1842
1856
  path: "testSpecifications",
1857
+ describedBy: ["description", "version"],
1843
1858
  label: "twin.axis.testSpecifications",
1844
1859
  kind: "spec",
1845
1860
  standardClass: { isa95: "TestSpecification" }
@@ -1863,6 +1878,8 @@ var TWIN_AXES = [
1863
1878
  */
1864
1879
  {
1865
1880
  axis: "orders",
1881
+ journalAxis: "orderId",
1882
+ describedBy: ["kind", "status"],
1866
1883
  label: "twin.axis.orders",
1867
1884
  kind: "instance",
1868
1885
  source: "state",
@@ -1872,6 +1889,7 @@ var TWIN_AXES = [
1872
1889
  },
1873
1890
  {
1874
1891
  axis: "tasks",
1892
+ describedBy: ["kind", "status"],
1875
1893
  label: "twin.axis.tasks",
1876
1894
  kind: "instance",
1877
1895
  source: "state",
@@ -1904,6 +1922,8 @@ var TWIN_AXES = [
1904
1922
  */
1905
1923
  {
1906
1924
  axis: "items",
1925
+ journalAxis: "epc",
1926
+ describedBy: ["definitionId", "lot"],
1907
1927
  label: "twin.axis.items",
1908
1928
  kind: "instance",
1909
1929
  source: "state",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/ops-contract",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "Operations domain contract — the standard vocabulary that producers and readers agree on (EPCIS 2.0/GS1, ISA-95, IEC 61850/ISO 50001). Types, guards, validation. No state, no engine.",
5
5
  "type": "module",
6
6
  "main": "./dist-cjs/index.cjs",