2.0 KiB
2.0 KiB
id, status
| id | status |
|---|---|
| ac-0019 | active |
원주문 venue와 실제 체결 venue의 durable 분리
Criterion
core는 original order_venue와 broker-authoritative actual execution_venue를 서로 다른 의미로 보존해야 한다. order_venue는 KRX/NXT/SOR이며 submit, ack, slot, restart와 cancel에 사용한다. actual venue는 KRX/NXT 또는 미확정 NULL이며 KIS의 검증된 ORD_EXG_GB와 명시 exchange-id allowlist에서만 결정하여 fill, ledger와 outbox에 기록한다. 완료된 SOR fill의 actual venue가 확인되지 않으면 core는 venue=NULL, order_venue=SOR로 정상 ledger outbox work item을 enqueue해야 한다. SOR, 누락, 미지원 코드 또는 wall-clock time으로 actual venue를 추론해서는 안 된다. historical outbox SOR는 order_venue=SOR, actual NULL로 변환하고 migration replay는 신규 정상 조합을 오염시키지 않아야 한다.
Verification
- 성공 조건: SOR order의 actual KRX/NXT fill은
(order_venue=SOR, venue=KRX|NXT)로 기록되고, actual venue가 확인되지 않은 완료 SOR fill은(order_venue=SOR, venue=NULL)인 durable outbox 1건을 생성해 기존 execution-ID 멱등LedgerWriter경로로 기록된다. cancel/restart는 SOR를 유지하며, historical SOR는(SOR,NULL)이고 정상(order=KRX, actual=NXT)는 migration 반복 후 보존된다. - 실패·경계 조건: actual SOR 저장, unknown code를 KRX/NXT로 추론, actual venue로 slot order venue 덮어쓰기, actual venue가 NULL인 완료 SOR fill의 outbox 미생성·원장 유실, AUTO·NULL order 저장 또는 migration replay 오염은 FAIL이다.
- 검사 방법: KIS parser tests와 KIS daily-ccld SOR fixture의 execution→outbox→
LedgerWriter회귀·replay idempotency,tests/adapters/persistence/test_postgresql_ledger_outbox.py,tests/adapters/persistence/test_migration_and_drift.py를 실행한다. 실제 PostgreSQL에서 historical conversion, replay, round-trip과 check violation을 검증하고 전체 회귀·Ruff 및 독립 read-only QC를 수행한다.