@operato/ops-contract 0.9.15 → 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 +69 -0
- package/package.json +1 -1
package/dist/contract.d.ts
CHANGED
|
@@ -31,6 +31,75 @@ export interface CanonicalEnvelope<T = unknown> {
|
|
|
31
31
|
* 표준 자리이고, EPCIS 핵심에는 없어 확장으로 갑니다.
|
|
32
32
|
*/
|
|
33
33
|
description?: string;
|
|
34
|
+
/**
|
|
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.**
|
|
88
|
+
*
|
|
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
|
+
* ```
|
|
97
|
+
*
|
|
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.
|
|
101
|
+
*/
|
|
102
|
+
provenance?: 'actual' | 'simulated';
|
|
34
103
|
data: T;
|
|
35
104
|
}
|
|
36
105
|
/**
|
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",
|