@operato/ops-contract 0.9.16 → 0.9.17
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/dist/contract.d.ts +64 -30
- package/package.json +1 -1
package/dist/contract.d.ts
CHANGED
|
@@ -32,38 +32,72 @@ export interface CanonicalEnvelope<T = unknown> {
|
|
|
32
32
|
*/
|
|
33
33
|
description?: string;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* **Whether this fact actually happened** — only the sending side can answer.
|
|
36
|
+
*
|
|
37
|
+
* ── Why this exists (measured 2026-09-09) ─────────────────────────────────
|
|
38
|
+
* The twin's journal held 1,134 rows, every one of them produced by a generator, and nothing
|
|
39
|
+
* in it said so. The screens compute yield and utilisation from those rows and had no way to
|
|
40
|
+
* mention it.
|
|
41
|
+
*
|
|
42
|
+
* The only signal was the sender's naming convention — `SIM-`, `WO-SIM-` — and the column that
|
|
43
|
+
* convention reaches was empty on half the rows: **558 of 1,134 were recognisable.** A
|
|
44
|
+
* convention belongs to whoever writes it, and a receiver that depends on one is wrong the day
|
|
45
|
+
* it changes.
|
|
46
|
+
*
|
|
47
|
+
* ── Why the twin does not judge this itself ───────────────────────────────
|
|
48
|
+
* **It has nothing to judge from.** A generator arrives through the same door, in the same
|
|
49
|
+
* shape, as a real system. What the twin knows is which connection a fact came through;
|
|
50
|
+
* whether that connection reads a factory or invents one is knowable only at that end.
|
|
51
|
+
*
|
|
52
|
+
* So this is a declaration: the side that invents says it invents.
|
|
53
|
+
*
|
|
54
|
+
* ── Absent is not `actual` ────────────────────────────────────────────────
|
|
55
|
+
* Empty means **not declared**, which is not "it happened". Reading the two as the same thing
|
|
56
|
+
* is the defect: a generator that omits the field has its output counted as production, and
|
|
57
|
+
* nothing says so.
|
|
58
|
+
*
|
|
59
|
+
* Nor is every real source required to declare `actual` — that adds a line to each connector
|
|
60
|
+
* and makes the ones that forget look fabricated. **Only the exception is declared**, and a
|
|
61
|
+
* reader distinguishes three states: declared simulated, declared actual, not declared.
|
|
62
|
+
*
|
|
63
|
+
* ── The kernel does not decide anything on this ───────────────────────────
|
|
64
|
+
* It carries it. Whether performance figures exclude simulated facts is **the reader's**
|
|
65
|
+
* decision; excluding them in the kernel would erase the answer of whoever ran a simulation
|
|
66
|
+
* to predict something.
|
|
67
|
+
*
|
|
68
|
+
* ── Why the envelope ──────────────────────────────────────────────────────
|
|
69
|
+
* The same reason as `description` — it is a fact **about a past event**, not about current
|
|
70
|
+
* state. And it does not go inside the EPCIS event: the standard has no such field, and
|
|
71
|
+
* inventing a name in there would take that event outside the standard. The envelope is ours,
|
|
72
|
+
* and the journal keeps the envelope as it arrived.
|
|
73
|
+
*
|
|
74
|
+
* ── ⚠ Do not put lineage in this field ───────────────────────────────────
|
|
75
|
+
* `provenance` normally means a chain. In art it is the record of ownership; in computing it
|
|
76
|
+
* is the record of **who, which system, and which activity produced a piece of data**
|
|
77
|
+
* (W3C PROV). The word was chosen because its purpose matches this one: telling the genuine
|
|
78
|
+
* from the forged.
|
|
79
|
+
*
|
|
80
|
+
* **But this field is one bit of that chain** — it answers "did it happen" and nothing else.
|
|
81
|
+
* The name promises a chain and hands over a flag, which leaves exactly one risk: that someone
|
|
82
|
+
* later reasons "it is called provenance, so the lineage goes here". Then this field becomes
|
|
83
|
+
* the home of a different concept, and code already splitting performance figures on it
|
|
84
|
+
* receives a value whose shape changed (ADR-0041 — a name fitting is not the same as a place
|
|
85
|
+
* fitting).
|
|
86
|
+
*
|
|
87
|
+
* So do not widen it. **Open a new place.**
|
|
36
88
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* ── 왜 트윈이 스스로 판정하지 않나 ────────────────────────────────────────
|
|
46
|
-
* **판정할 근거가 없다.** 발생기는 실 시스템과 같은 문으로, 같은 모양으로 보낸다. 트윈이 아는 것은
|
|
47
|
-
* 「어느 연결로 들어왔나」까지이고, 그 연결이 실 공장을 읽는지 지어내는지는 그쪽만 안다.
|
|
48
|
-
*
|
|
49
|
-
* 그래서 이 값은 **선언**이다. 지어내는 쪽이 지어낸다고 말한다.
|
|
50
|
-
*
|
|
51
|
-
* ── 없음은 `actual` 이 아니다 ─────────────────────────────────────────────
|
|
52
|
-
* 비어 있으면 **선언되지 않았다**는 뜻이고, 「실제로 일어났다」가 아니다. 둘을 같게 읽으면 발생기가
|
|
53
|
-
* 이 칸을 잊는 순간 그 수가 실적으로 계산되고, 아무것도 그렇다고 말하지 않는다.
|
|
54
|
-
*
|
|
55
|
-
* 모든 실 원본에 `actual` 을 요구하지도 않는다 — 그러면 붙는 쪽마다 한 줄이 늘고, 잊은 곳이
|
|
56
|
-
* 「지어낸 것」으로 보인다. **선언하는 것은 예외뿐**이고, 읽는 쪽은 셋을 구별해 말한다:
|
|
57
|
-
* 지어낸 것 · 실제라고 선언된 것 · 선언되지 않은 것.
|
|
58
|
-
*
|
|
59
|
-
* ── 커널은 이 값으로 판단하지 않는다 ──────────────────────────────────────
|
|
60
|
-
* 나르기만 한다. 성과 계산에서 지어낸 것을 뺄지는 **읽는 쪽의 결정**이고, 커널이 미리 빼면
|
|
61
|
-
* 시뮬레이션으로 무엇을 예측하려던 사람의 답이 사라진다.
|
|
89
|
+
* ```
|
|
90
|
+
* did it happen this field
|
|
91
|
+
* which connection did it arrive on a separate place — none yet; the twin knows this, it is
|
|
92
|
+
* not a declaration
|
|
93
|
+
* when did we learn it (late?) a separate axis — that is backfill, and a backfilled
|
|
94
|
+
* fact is not simulated
|
|
95
|
+
* is the value correct a separate axis — `rejected` and `errors` answer it
|
|
96
|
+
* ```
|
|
62
97
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* 벗어난다. 봉투는 우리 것이고, 지난 기록에는 봉투가 그대로 남는다.
|
|
98
|
+
* Adding a value follows the same discipline. If a third one seems necessary, ask first
|
|
99
|
+
* whether it answers "did it happen" — usually it does not, and then it is one of the rows
|
|
100
|
+
* above.
|
|
67
101
|
*/
|
|
68
102
|
provenance?: 'actual' | 'simulated';
|
|
69
103
|
data: T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/ops-contract",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17",
|
|
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",
|