feat(slots): additive strategy fields + filter (REQ-116, BAT-055)

trex.slots.req wire 계약 additive 확장 — 기존 소비자(orb/tsl) backward compatible.

- PortfolioItem: strategy_name(Optional[str]) + markets(list) 필드 추가
- hub_read.py: get_portfolios()에서 strategy_name/markets 파싱 추가 (safe default)
- slot_to_dict(): strategy_name/strategy_params/markets 3필드 row에 추가 (SnapshotStore→PortfolioItem 경유)
- make_slots_rpc_handler(): strategy 요청 파라미터 → Python 레벨 후처리 필터 (available_slots 계산 이후, REQ-073 AC-6 불변)
- 테스트: AC-1~8 전수 + hub_read 파싱 + 회귀 갱신 (777 passed, 47 skipped)
- docs/interface-contract.md: 요청 파라미터·응답 행 스키마·소스 테이블·REQ-074 AC-5 주석 갱신

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
This commit is contained in:
2026-07-04 11:10:01 +09:00
co-authored by Claude Fable 5
parent 5267e72efe
commit 690071afad
13 changed files with 714 additions and 12 deletions
+7 -2
View File
@@ -174,15 +174,20 @@ def test_paused_holding_orthogonal_to_filter():
assert resp.payload["slots"][0]["paused"] is True
# REQ-074 AC-5: strategy fields absent from row
# REQ-074 AC-5 (REQ-116 additive 재도입): slot-origin strategy fields absent from row.
# strategy_name / strategy_params / markets (PortfolioItem-origin) are now present
# (REQ-116 BAT-055 additive); slot-origin fields still excluded.
def test_strategy_fields_absent():
_, _, _, _, _, handler = _wire()
resp = handler(_req())
for s in resp.payload["slots"]:
assert "strategy_id" not in s
assert "sell_strategy_id" not in s
assert "strategy_params" not in s
assert "active_strategy_id" not in s
# strategy_params / strategy_name / markets are now present (REQ-116 additive)
assert "strategy_params" in s
assert "strategy_name" in s
assert "markets" in s
# REQ-073 AC-4: spy=True → watchdog NOT updated