docs(req-106): verify ImportError 핫픽스 change-req + postmortem
51cc3cc(make_broker→_build_broker) 거버넌스 기록 — 증상·근본원인·검증(운영 재검증 OK)· 테스트 갭 postmortem·롤백. main 직접푸시 사후추인 노트 포함. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
This commit is contained in:
@@ -44,6 +44,37 @@
|
||||
|
||||
## Change Log
|
||||
|
||||
### CHG-20260630-01
|
||||
- Date: 2026-06-30
|
||||
- Author: 팀장(Claude) — change-req (라이브 릴리즈 핫픽스 + postmortem)
|
||||
|
||||
#### Change Summary
|
||||
- **REL-010 STEP2 배포 스모크서 `trex-core verify` ImportError 핫픽스.** Status `Implemented` 유지(구현 결함 수정, AC 불변).
|
||||
|
||||
#### Intent / 증상·근본원인 (핫픽스 예외 경로)
|
||||
- **증상**: 운영 배포(`ababf80`) 후 `trex-core verify --config ... --portfolio-id ...` 실행 시 `ImportError: cannot import name 'make_broker' from 'trex_core.adapters.broker'`.
|
||||
- **근본원인**: `runtime/cli.py` `_cmd_verify()`가 **코드베이스에 존재하지 않는** `trex_core.adapters.broker.make_broker`를 import(정의 0건, 참조는 verify 한 곳뿐). 형제 명령 `_cmd_sync()`는 올바르게 `trex_core.runtime.daemon._build_broker`를 사용. → verify 경로에만 잘못된 import가 박혀 있었음.
|
||||
- **수정**: `_cmd_verify`를 `from trex_core.runtime.daemon import _build_broker` / `_build_broker(cfg)`로 교체(sync와 동일, 검증된 경로). 커밋 `51cc3cc`.
|
||||
|
||||
#### Acceptance Criteria Delta
|
||||
- Added/Updated/Removed: 없음 (기존 AC 동일 — 깨진 구현을 정정)
|
||||
|
||||
#### Delivery Trace Delta
|
||||
- 핫픽스 커밋 `51cc3cc`(main 직접, fast-path). 회귀 테스트 2종 추가(`tests/runtime/test_cli_operator.py`): `test_verify_cmd_broker_import_does_not_raise`(paper config+DB stub로 verify 경로 import 통과 검증), `test_verify_cmd_uses_build_broker_not_make_broker`(make_broker 심볼 부재 구조검증).
|
||||
|
||||
#### Verification
|
||||
- 전체 스위트 747 passed / 47 skipped / 0 failed(회귀 0). **운영 재검증(2026-06-30, `51cc3cc`)**: verify OK(slot already cleared) · sync --dry-run OK(broker_qty_zero guard SKIP) · report OK.
|
||||
|
||||
#### Postmortem (테스트 갭)
|
||||
- **왜 미검출**: BAT-051 verification이 verify의 **broker import 경로를 런타임 실행하지 않음**(import가 함수 내부라 호출 시에만 트리거). 단위 테스트가 verify 명령을 끝까지 돌리지 않아 phantom import가 통과됨.
|
||||
- **재발 방지**: 위 회귀 테스트 2종으로 import 경로를 실제 실행/구조검증. 후속 권고 — operator CLI 명령들의 lazy import를 스모크 수준으로 한 번씩 실행하는 테스트 추가 검토.
|
||||
|
||||
#### Revalidation Impact
|
||||
- Reverification Needed: no (회귀테스트+운영 재검증 완료) / Existing Implementation Invalidated: no
|
||||
- Status Recommendation: implemented
|
||||
- Rollback: `git revert 51cc3cc` (CLI 전용, trading/wire/daemon 무관 — 실행 중 데몬 무영향).
|
||||
- ⚠️ 거버넌스 노트: 라이브 블로커 해소를 위해 **main 직접 푸시**(사전 결재 게이트 절차 생략) — 사장님 사후 추인.
|
||||
|
||||
### CHG-20260626-01
|
||||
- Date: 2026-06-26
|
||||
- Author: trex-core-dev
|
||||
|
||||
Reference in New Issue
Block a user