@operato/twin-kernel 0.7.82 → 0.7.83

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.
@@ -554,6 +554,20 @@ export class EmsKernel extends FlowEngine {
554
554
  * 「어느 기간의 값인지 모른다」로 마감하지 못한다.
555
555
  */
556
556
  const kind = obs.accumulation ?? eq.generatedKWhAccumulation;
557
+ /*
558
+ * ── 마감하지 못하면 **손대지 않는다** (2026-08-30, 고침) ─────────────────
559
+ *
560
+ * 종류를 모르면 마감할 수 없다. 그런데 그대로 아래로 내려보내면 관측이 **오늘 것으로 덮인다** —
561
+ * 표본이 왔을 때는 그 재설정이 맞지만(새 관측이니까), 시계로 부를 때는 새 표본이 없다.
562
+ * 덮으면 어제는 영영 마감되지 않는다.
563
+ *
564
+ * 실제로 그렇게 됐다: 밤에 재기동해 종류가 비었고, 시계가 자정을 지날 때마다 어제 관측이
565
+ * 오늘로 밀렸다. 아침 표본이 와도 마감할 어제가 남아 있지 않다.
566
+ */
567
+ if (kind === undefined || kind === 'unknown') {
568
+ this.unclosedGenerationPeriods++;
569
+ continue;
570
+ }
557
571
  /*
558
572
  * 마감은 `applyGenerated` 와 **같은 함수**로 한다 — 규칙을 두 벌 만들면 표본으로 닫은 날과
559
573
  * 시계로 닫은 날이 다른 값을 낸다.
@@ -8183,6 +8183,10 @@ var EmsKernel = class extends FlowEngine {
8183
8183
  const eq = this.equipment.get(id);
8184
8184
  if (!eq) continue;
8185
8185
  const kind = obs.accumulation ?? eq.generatedKWhAccumulation;
8186
+ if (kind === void 0 || kind === "unknown") {
8187
+ this.unclosedGenerationPeriods++;
8188
+ continue;
8189
+ }
8186
8190
  this.closeGenerationPeriod(id, eq, {
8187
8191
  atMs: nowMs,
8188
8192
  kWh: obs.lastKWh,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/twin-kernel",
3
- "version": "0.7.82",
3
+ "version": "0.7.83",
4
4
  "type": "module",
5
5
  "description": "Twin Domain Kernel — framework-agnostic, zero-dep (domain + sim + 3-channel contract). WMS/YMS/MES, EPCIS 2.0 · ISA-95.",
6
6
  "publishConfig": {