feat(config): expose paper broker tuning via env (REQ-010 AC-5, BAT-009)

Wire the existing PaperBroker scenario knobs (fill_after_polls /
qty_per_poll / reject_symbols) to daemon env so REQ-011 AC-2 e2e
scenarios (delayed / partial / reject) can be reproduced by a daemon
restart. Unset == prior PaperBroker() behaviour, byte-for-byte (no
regression).

- config.py: PaperBrokerConfig + from_env parsing (TREX_PAPER_*)
- daemon.py: _build_broker injects config.paper into PaperBroker
- .env.example: document the 3 paper tuning keys (paper-only, e2e)
- tests: paper broker defaults + env tuning parsing

SDLC: REQ-010 CHG-20260606-01 (AC-5 added) / -02 (Implemented);
BAT-009 batch-lite release-candidate; REL-001 feedback handoff records
pre-deployment e2e observations incl. event-publisher idle-drop and
paper correlation_id collision (GitHub #4, #5).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 16:49:51 +09:00
co-authored by Claude Opus 4.8
parent f8c5661147
commit 2f57aad7b2
13 changed files with 280 additions and 8 deletions
+6
View File
@@ -14,6 +14,12 @@ TREX_EXECUTION_INTERVAL_SEC=1.0
# 'paper' (deterministic test double, default) | 'kis' (real KIS Open API)
TREX_BROKER=paper
# --- Paper broker tuning (only when TREX_BROKER=paper; for e2e scenarios) ---
# Unset == immediate full fills, no rejects (default production-like behaviour).
# TREX_PAPER_FILL_AFTER_POLLS=0 # polls before fills begin (delayed fill)
# TREX_PAPER_QTY_PER_POLL= # filled qty per poll (partial fill); empty => fill all at once
# TREX_PAPER_REJECT_SYMBOLS= # comma-separated symbols to reject (rollback path)
# --- KIS broker (only when TREX_BROKER=kis) ---
# 모의투자(sandbox): https://openapivts.koreainvestment.com:29443
# 실계좌(live, 실자금): https://openapi.koreainvestment.com:9443 (requires TREX_KIS_ALLOW_LIVE=true)