/** 승격된 검색 키 — 전부 선택적. 뽑히지 않으면 **빈 문자열이 아니라 undefined**(결측≠빈값). */ export interface TwinEventKeys { action?: string; bizStep?: string; epc?: string; orderId?: string; bizTransaction?: string; locationId?: string; moverId?: string; /** `'actual'`, `'simulated'`, or absent — absent means not declared, which is not `actual`. */ provenance?: string; } /** * bizStep 의 짧은 이름 — 자르는 규칙은 계약의 `bizStepName` 하나다(CBV URN 과 사설 이름공간 URL 둘 다). * 없으면 이벤트 타입에서 유추(`epcis.` 접두 제거). */ export declare function bizStepOf(envelope: any): string | undefined; /** * 품목 식별자 — **전체 값**을 저장한다(끝마디만 저장하지 않는다). * * 표시용 축약은 화면이 하고, 색인은 원본을 갖는다. `search` 는 부분일치(contains)라 * 전체를 저장해 두면 끝마디("402.2")로도 URN 전체로도 찾힌다. 반대로 끝마디만 저장하면 * URN 으로 찾는 경로가 사라진다. */ export declare function epcOf(envelope: any): string | undefined; /** * 오더 식별자 — 운영 델타의 `orderId` 우선, EPCIS 는 `bizTransactionList`. * * ── 실측 (2026-08-24) — 이 컬럼이 **전부 비어 있었다** ────────────────────── * 여기가 찾던 이름이 `d.order` 였다. 그런데 커널이 내는 이름은 **`orderId`** 다 * (`OrderStatusDelta.orderId` · `TaskStatusDelta.orderId`). `d.order` 를 내는 코드는 커널에 **한 곳도 * 없다** — 죽은 가지였다. 그래서 운영 델타는 이 컬럼을 한 번도 채우지 못했다. * * order.status 29,403,565 행 — order_id 비어 있음 29,403,565 (100%) * task.status 191,175 행 — 비어 있음 191,175 (100%) * * 그 결과 색인 `ix_twin_event_4` 가 **자기 주석이 적어 둔 용도**(「이 오더가 어디까지 갔나」)로 쓸 수 * 없었다. 화면은 오더를 눌러도 「연결된 이벤트가 없습니다」를 냈고, 그 답은 질의 결과로는 정직했다 — * 시점을 어디로 옮겨도 0 이었다. * * **과거 행은 채워지지 않는다**(사용자 결정 2026-08-24, `moverId` 때와 같은 방식). 앞으로 들어오는 * 사건부터 조회된다. * * ── 한 칸에 두 낱말이 들어 있었다 (2026-09-05 실측) ──────────────────────── * 위 주석이 이미 알고 있었다 — 「EPCIS 의 `bizTransactionList` 는 **거래**(PO/SO)이고 오더와 같은 * 것이 아닐 수 있다」. 그런데 그 둘을 **같은 칸에** 넣고 있었다. 그래서 이렇게 됐다. * * order.status order-1 내부 오더 id * epcis.TransformationEvent urn:epc:id:gdti:9521321.403.1 GS1 거래 식별자 * epcis.TransactionEvent urn:epc:id:gdti:9521321.403.1 * * 한 오더의 이력이 **색인 안에서 두 쪽으로 갈라진다.** 어느 이름으로 물어도 절반만 나오고, * 오류는 나지 않는다. 실측: 어휘가 섞인 행 10,004개. * * 이것이 실제로 막은 것 — 「이 개체를 어느 레시피로 만들었나」다. 답은 기록되어 있다(오더 사건이 * `recipeKey` 를 든다, 실측 328,021/328,021 = 100%). 변환 사건은 그 오더를 GDTI 로 가리키는데 * 오더 사건은 `order-1` 로 적혀 있어 **색인으로 이을 수가 없었다.** * * 그래서 칸을 갈랐다(사용자 결정 2026-09-05). * * orderId 내부 오더 id — 읽기 모델의 이음쇠 * bizTransaction GS1 거래 식별자 — 표준이 말하는 그 거래 * * 오더 사건은 **둘 다** 든다(`order.status` 의 payload 에 `orderId` 와 `bizTransaction` 이 함께 * 있다). 그래서 EPCIS 사건의 거래 식별자로 오더를 찾을 수 있다 — 이 두 칸이 그 다리다. */ export declare function orderOf(envelope: any): string | undefined; /** * **그 사건이 가리키는 거래** — EPCIS `bizTransactionList` 의 첫 항목, 또는 운영 델타가 직접 든 값. * * 오더가 아니다. 표준이 말하는 거래(PO/SO/생산오더)이고, 한 오더가 여러 거래에 걸릴 수도 있다. * 그 구별을 지키려고 `orderId` 와 갈라 두었다 — 합치면 위 주석의 그 일이 다시 난다. */ export declare function bizTransactionOf(envelope: any): string | undefined; /** * 위치 — EPCIS 는 읽은 지점(readPoint) 우선, 없으면 업무 위치(bizLocation). * 운영 델타(무버 이동 등)는 그 둘이 없고 평범한 `location` 을 쓴다 — 빠뜨리면 설비가 어디서 * 무엇을 했는지가 위치 축에서 통째로 사라진다. */ export declare function locationOf(envelope: any): string | undefined; /** * 설비·무버 — 운영 델타(equipment.status·task.status)가 대상을 가리키는 축. * * EPCIS 어휘가 아니라서 다른 축 어디에도 안 잡힌다. 이게 없으면 "이 지게차가 오늘 무엇을 했나" 를 * 서버에서 물을 방법이 없어, 화면이 저널을 통째로 받아 전수 조회하는 수밖에 없다. */ export declare function equipmentIdOf(envelope: any): string | undefined; /** * EPCIS 행위 — `ADD`·`OBSERVE`·`DELETE`. 세 값이 아니면 `undefined`(원천의 잡값을 색인에 넣지 않는다). * * 이 키는 검색 축이 아니라 **판별식**이다: 되풀어 읽는 스냅샷은 원리적으로 `DELETE` 를 못 낸다. * 그래서 「이 트윈이 반출을 한 번이라도 계산했는가」가 진짜 delta 피드의 증거인데, payload 안에 있는 * 동안에는 5개 드라이버 어디에서도 그 질문을 할 수 없었다. 운영 델타에는 행위가 없다 — 비운다. */ export declare function actionOf(envelope: any): string | undefined; /** * **Whether the sender declared this fact as having actually happened** — the envelope's * `provenance`, promoted to a column. * * ── Why it is an indexed column (2026-09-09) ────────────────────────────── * The journal held 1,134 rows, all of them generator output, and there was nowhere to ask about * it. While the declaration sits inside `payload`, none of the five drivers can answer "count * these without the invented ones" — the same reason `action` was promoted. * * ── Only the two declared values are taken ──────────────────────────────── * Anything that is not `actual` or `simulated` becomes `undefined`. A source's stray value does * not reach the index (the discipline in `actionOf`). * * **`undefined` means "not declared", not "it happened".** A reader has to distinguish three * states — declared simulated, declared actual, not declared. Folding the last two together * means a generator that omits the field has its output counted as production. */ export declare function provenanceOf(envelope: any): string | undefined; /** Every promoted key for one event — the write path calls this function and nothing else. */ export declare function twinEventKeys(envelope: any): TwinEventKeys;