feat(payload-passthrough): 0.4.0 — isReservationOrder pass-through + /create/direct fix#3
Merged
Merged
Conversation
… match + ui_arm_capture P6-01.1 진단으로 발견된 두 가지 정합 fix + 진단 헬퍼 1건 박제. 본 task (payload pass-through) Phase 5 supervised live 가 작동하기 위한 endpoint/body 정합 보강. - daemon._run_broker_create: URL /api/v2/wts/trading/order/create → /api/v2/wts/trading/order/create/direct. 토스 web UI click capture 결과 정상 path 가 /create/direct 임을 확인. /create 는 PIN 키보드 응답을 돌려보내 broker reject 됨. - submit.build_order_prepare_payload: body schema 를 토스 web UI 가 송출하는 11 필드 정합으로 재정렬 + neutral default 추가 (orderAmount=0, agreedOver100Million=False, max=False, openPriceSinglePriceYn=False). allowAutoExchange 제거. - daemon.ui_arm_capture / ui_buy_capture / ui_disarm_capture: P6 진단용 임시 헬퍼. context-level request/response listener + file stream JSONL 로 토스 web UI click 결과를 시간 변화 없이 capture. 진단 종결 시 후속 task 에서 제거 예정. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
본 task (toss-bridge-payload-passthrough) Phase 1 첫 commit. wrapper 가 신규 인자 (`is_reservation_order`) 송출 시 구버전 bridge 가 silently False 떨어뜨릴 위험 차단을 위한 minor bump. 이후 Phase 1 P1-02~07 작업 모두 0.4.0 cycle 안. financier-v2 wrapper `MIN_BRIDGE_VERSION` 도 0.4.0 동시 bump 예정 (Phase 2). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- submit.build_order_prepare_payload: keyword-only `is_reservation_order: bool | None = None` 인자 추가. None → 현행 False (backward compat). transport-only — 정책 결정은 wrapper/SKILL 위에서.
- submit.validate_place_order_params: snake_case `is_reservation_order` 키 normalized dict 보존. 타입 = None / bool 만 허용. enum 문자열 (`"on"` 등) 은 wrapper layer 책임이므로 transport 진입 시 MutationValidationError.
- daemon._run_prepare_preflight: `normalized.get("is_reservation_order")` → `build_order_prepare_payload(... is_reservation_order=...)` propagate. `_run_broker_create` 변경 0 (`withOrderKey` 제거 로직이 자동 포함 보장).
- daemon._market_status_issue: 화이트리스트 {ACTIVE, NORMAL, OPEN, TRADING, "N"} → {ACTIVE, NORMAL, OPEN, TRADING}. P6-01.1 capture 결과 "N" 은 KRX 휴장 시 토스 송출 enum (정규장 아님). fallback rule (화이트리스트 외 = market_status_requires_review 비차단 review) 가 미지 enum 안전 분류 보장.
- cli.place_order: `--reservation-mode {auto,on,off}` (default=auto) 추가. auto → params 키 omit, on/off → bool 변환. boolean flag pair 폐기, 3-state enum 통일.
- uv.lock: 0.3.0 → 0.4.0 bump 동기화.
CLAUDE.md "AI Native 설계" 정합 — bridge 안에 시장 상태 → flag 매핑 분기 0 라인. 메인 세션 AI 가 preview `derived.market_status` 보고 결정 후 wrapper 인자로 넘긴다.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…_status_issue 회귀 10건
- build_order_prepare_payload `is_reservation_order` 인자 3 case (None / True / False) — backward compat 보증 + 명시적 양방향 송출 검증.
- validate_place_order_params 4 case (omit / True / False / 잘못된 string enum reject) — wrapper layer 가 enum → bool 변환 책임이고 transport 진입 시점은 bool/None 만 허용한다는 계약 검증.
- _market_status_issue 3 case ("N" → review (비차단), "ACTIVE" → None, "HALT" → blocking) — P6-01.1 capture 결과 "N" 이 KRX 휴장 enum 임을 박제. 화이트리스트 회귀 방지.
CLI argparse 의 `--reservation-mode` parsing 은 P1-08 reinstall 후 dry sanity 1회로 검증 (간단한 argparse 분기).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isReservationOrder./api/v2/wts/trading/order/create/directendpoint fix — KRX 휴장 시 broker create 거절 (HTTP 400 / DC-3850) 결함 해소. 토스 web UI 와 동일 endpoint 호출._market_status_issue화이트리스트 fix — "N" 제거 (휴장 KRX 시 false-positive 우회 차단). 정규장 화이트리스트 ={ACTIVE, NORMAL, OPEN, TRADING}.Changes
submit.pybuild_order_prepare_payload—is_reservation_order: bool | None = Nonekeyword-only arg 추가.isReservationOrderpayload field 외부 인자 그대로 송출 (None → False default).validate_place_order_params— type validation 추가 (bool | None만 수용. enum string 송출 시MutationValidationError).daemon.py_run_prepare_preflight— normalized params 의is_reservation_order를build_order_prepare_payload로 전달._market_status_issue— 화이트리스트{"ACTIVE", "NORMAL", "OPEN", "TRADING"}("N" 제거)./api/v2/wts/trading/order/create/direct(P6-01.1 진단 fix).cli.pyplace-order에--reservation-mode {auto, on, off}인자 추가. enum →Optional[bool]변환은 wrapper layer 까지 (bridge 내부는Optional[bool]).tests/test_submit_runtime.pybuild_order_prepare_payload3 case (None/True/False) +validate_place_order_params4 case (omit/True/False/string reject) +_market_status_issue3 case ("N" → review, "ACTIVE" → None, "HALT" → blocking).Supervised live 검증 결과
financier-v2
tasks/20260505-toss-bridge-payload-passthrough/Phase 5 양쪽 path 통과:P5-01 reservation=on (KRX 휴장 어린이날, 2026-05-05 17:23 KST)
is_reserved: true,code: OK,http_status: 200,order_no: 251199P5-02 reservation=off user_override (NYSE 정규장, 2026-05-05 23:04 KST)
is_reserved: false,code: OK,http_status: 200,order_no: 5OQ-04 자연 capture 핵심 통찰
derived.market_status가 정규장/휴장 모두"N"default — UI 표시용 enum 한계20260505-toss-market-status-time-lookup/)Test plan
env -u TOSS_BRIDGE_PORT -u TOSS_BRIDGE_HOME uv run pytest tests/— 86 passed, 1 skippedis_reservation_order+reservation_decision_source) 정합Task spec
financier-v2/tasks/20260505-toss-bridge-payload-passthrough/financier-v2/tasks/20260430-toss-bridge-live-order/Phase 6 P6-02~04 재개 가능🤖 Generated with Claude Code