feat(reconcile): safely seed canonical cost basis
This commit is contained in:
@@ -383,3 +383,17 @@ pause 후 동작:
|
||||
- `docs/interface-contract.md` — RabbitMQ 토폴로지 + 메시지 payload + reason/actor 어휘
|
||||
- `docs/runtime-flows.md` — 흐름 다이어그램(스냅샷/intent RPC/이벤트/집행 루프/로깅)
|
||||
- `.claude/skills/run-trex-core-daemon/SKILL.md` — AI 에이전트용 실행 레시피(이 런북의 사실 자료 출처)
|
||||
|
||||
|
||||
### `sync` 출력 진단 포맷 (REQ-123)
|
||||
|
||||
`trex-core sync [--dry-run|--live]` 실행 시 `--json` 또는 일반 출력에서 다음 진단 필드로 no-write/fail-closed를 확인한다.
|
||||
|
||||
- `seeded_avg_price`: true면 seed된 avg_price가 반영 대상인지 표시
|
||||
- `cost_basis_source`: `canonical` / `legacy` / `none`
|
||||
- `cost_basis_reason`: `missing`, `invalid`, `http_status_<3-digit>`, `transport`, `invalid_json`, `invalid_payload`, `not_configured`, `diagnostic_exception`, `diagnostic_source_invalid` 또는 유효한 값이 seed되었을 때의 `null`. `http_status_<3-digit>`만 동적 형식이며 provider field name, parser detail, 임의 오류 텍스트는 출력 계약 값이 아니다.
|
||||
- `skip_reason`: `cost_basis_unavailable`, `broker_qty_zero`, `status_in_flight:*` 등
|
||||
- `error`: live fail-closed (`cost_basis_unavailable`) 등 write 중단 사유
|
||||
- `before`/`after`는 write/미리보기 비교에 사용하며, dry-run은 `warning_cleared=False`로 고정
|
||||
|
||||
`sync --dry-run`은 실제 DB 쓰기·warning clear를 하지 않으므로 운영자가 미리보기를 확인한 뒤 직접 승인된 live 실행으로 전환한다.
|
||||
|
||||
Reference in New Issue
Block a user