Harden STOM RL evidence dashboard and NO-GO research guardrails#327
Open
Py-CI-Park wants to merge 221 commits into
Open
Harden STOM RL evidence dashboard and NO-GO research guardrails#327Py-CI-Park wants to merge 221 commits into
Py-CI-Park wants to merge 221 commits into
Conversation
STOM tick 데이터는 종목별 SQLite table로 나뉘어 있으므로, 종목과 세션을 섞어 붙이지 않고 symbol/session group 단위의 Kronos 호환 OHLCV sequence로 변환하도록 학습 준비 경로를 만들었다. Constraint: 원본 _database SQLite 파일은 읽기 전용이며 commit하지 않는다 Constraint: Kronos 기본 파인튜닝 입력은 STOM 전체 tick column이 아니라 OHLCV 형식이다 Rejected: SQLite를 batch마다 직접 random access 학습 | 반복 DB query가 느리고 병렬화와 재현성이 나쁘다 Confidence: high Scope-risk: moderate Directive: symbol/session grouping을 제거하지 말 것; 종목/일자 간 학습 누수를 막는 핵심 경계다 Tested: python -m pytest tests/test_stom_tick_dataset.py tests/test_stom_training_cli.py tests/test_stom_prediction_eval.py tests/test_stom_dashboard_helpers.py -q Not-tested: 전체 2,425개 주식 table 대상 full GPU 파인튜닝
준비된 STOM OHLCV 데이터에서 예측 평가 산출물까지 이어지는 bounded 검증 경로와 Flask/Plotly 실제값-예측값 대시보드를 추가해, 학습 이후 결과를 사람이 확인할 수 있게 했다. Constraint: CUDA PyTorch와 모델 경로가 준비되기 전에는 full GPU 학습을 막아야 한다 Constraint: Kronos import가 실패해도 대시보드는 열려야 하므로 모델 import는 lazy 처리한다 Rejected: Streamlit 대시보드 | 이미 Flask/Plotly webui가 있으므로 새 framework 의존성을 늘리지 않는다 Rejected: 이 commit에서 all-table 학습 실행 | 당시 torch build는 CPU 전용이고 작업 시간이 길다 Confidence: high Scope-risk: moderate Directive: 생성 prediction CSV는 webui/stom_predictions 아래에서 ignore하고, 코드와 문서만 commit한다 Tested: python -m pytest tests/test_stom_tick_dataset.py tests/test_stom_training_cli.py tests/test_stom_prediction_eval.py tests/test_stom_dashboard_helpers.py -q Tested: python -m compileall -q finetune_csv webui tests docs Tested: Flask test client GET /stom, /api/stom/summary, /api/stom/prediction-files, /api/stom/prediction?file=pilot_predictions.csv Not-tested: browser pixel-level visual QA Not-tested: fine-tuned checkpoint를 사용한 실제 Kronos --mode kronos 예측
파이프라인 helper는 안전한 단계별 명령 출력과 환경 readiness 보고만 필요하므로, review 전에 사용하지 않는 shell=True 실행 함수를 제거해 불필요한 공격면과 검토 잡음을 줄였다. Constraint: 대시보드/학습 helper는 범용 shell 실행 surface를 노출하지 않아야 한다 Rejected: 미래 자동화를 위해 run_command 유지 | 미사용 shell=True helper는 위험과 노이즈만 늘린다 Confidence: high Scope-risk: narrow Directive: 실제 자동 실행이 필요해질 때만 명시적 subprocess list 기반 실행을 추가한다 Tested: python -m pytest tests/test_stom_prediction_eval.py tests/test_stom_dashboard_helpers.py -q Tested: python -m compileall -q finetune_csv webui tests docs Not-tested: full end-to-end GPU 학습
대용량 생성 데이터는 commit하지 않으면서도 각 실행 단계의 현재 상태, 근거, 다음 명령, 남은 작업을 추적할 수 있도록 학습 workflow 진행 ledger를 추가했다. Constraint: STOM export CSV와 prediction output은 크고 재생성 가능하므로 ignore한다 Rejected: pilot CSV commit | 수백 MB 규모이며 DB export 명령으로 재현 가능하다 Confidence: high Scope-risk: narrow Directive: 각 학습/평가 단계 완료 후 docs/stom_training_progress.md를 갱신하고 commit한다 Tested: 100-table pilot CSV export; baseline smoke prediction이 생성 CSV를 읽음 Not-tested: GPU 학습 단계는 아직 실행하지 않음
대규모 학습으로 확대하기 전에, bounded pilot config와 직접 실행 가능한 import 경로로 STOM OHLCV 데이터가 RTX 4080 SUPER에서 파인튜닝되고 checkpoint/loss가 정상 생성되는지 검증했다. Constraint: device, checkpoint, loss 경로가 증명되기 전에는 100-table/full-table 학습을 시작하지 않는다 Rejected: 기본 STOM config로 첫 GPU 실행 | max_samples=null 및 3 epochs라 빠른 검증 루프에 너무 크다 Confidence: high Scope-risk: moderate Directive: finetune_csv/finetuned는 ignore 상태로 유지하고 checkpoint 대신 config/docs/tests만 commit한다 Tested: cuda:0 GPU pilot 학습; train loss 2.4667; validation loss 2.4311; checkpoint saved; compileall passed; pytest 12 passed; pip check passed Not-tested: pilot checkpoint 기반 Kronos prediction CSV 생성은 7단계로 분리
GPU 파일럿 checkpoint로 대시보드에서 읽을 수 있는 prediction artifact를 생성하고, web app이 package import와 script-run fallback 양쪽에서 STOM helper를 불러올 수 있게 했다. Constraint: prediction CSV와 metrics JSON은 생성 산출물이므로 ignore 상태를 유지한다 Rejected: kronos_gpu_pilot_predictions.csv commit | 7단계 명령으로 재현 가능하며 ignored dashboard output에 속한다 Confidence: high Scope-risk: narrow Directive: PowerShell 명령에서 NeoQuasar/Kronos-Tokenizer-base처럼 forward slash HuggingFace ID를 사용한다; backslash는 invalid repo id가 된다 Tested: cuda:0 Kronos prediction generation; 20 windows; 1200 rows; MAE 5.3304; Flask STOM routes 200; compileall passed; pytest 13 passed; pip check passed Not-tested: http://localhost:7070/stom browser-rendered visual inspection은 8단계로 분리
대시보드를 configurable port에서 실행하고 Windows UTF-8 logging redirect를 견디게 하여, Kronos pilot prediction CSV가 HTML/API 대시보드 경로에서 실제로 표시되는 근거를 남겼다. Constraint: 이 워크스테이션에서는 AnyDesk가 7070 port를 사용 중이다 Rejected: 7070에 강제 고정 | 기존 service와 충돌하고 자동 검증이 불안정해진다 Confidence: high Scope-risk: narrow Directive: 7070이 unavailable이면 KRONOS_WEBUI_PORT=7071을 우선 사용하고, screenshot evidence는 .omx 아래에 두며 commit하지 않는다 Tested: 127.0.0.1:7071 web server; /stom 200; prediction files API 200; prediction payload API 200; Chrome headless screenshot non-blank; compileall passed; pytest 13 passed; pip check passed Not-tested: node_repl js tool unavailable로 in-app Browser Use UI 수동 visual review는 수행하지 않음
all-table로 바로 확대하지 않고 300-table config와 evidence ledger를 통해 export, GPU fine-tuning, prediction generation, dashboard API 검증을 한 번에 재현 가능한 scale-up 단계로 만들었다. Constraint: full all-table 학습은 runtime, disk, GPU risk를 줄이기 위해 점진적 scale check를 거친다 Rejected: 100-table pilot에서 2,425개 all-table로 즉시 점프 | 실패 비용과 원인 분석 비용이 커진다 Confidence: high Scope-risk: moderate Directive: 생성 CSV, checkpoint, prediction output, .omx screenshot은 git에 넣지 말고 config/code/test/progress evidence만 commit한다 Tested: 300-table export; 50k-sample GPU training on cuda:0; validation loss 2.3258; 100-window Kronos prediction; dashboard API 200; compileall passed; pytest 13 passed; pip check passed Not-tested: 1,000-table 및 full 2,425-table 학습은 다음 scale-up 단계로 분리
300-table 검증으로 train/predict/visualize 경로가 동작함을 확인했으므로, all-table 전에 1,000-table bounded config와 측정 evidence를 남겨 규모 확대 리스크를 줄였다. Constraint: STOM source DB와 생성 학습/예측 artifact는 대용량 local data이므로 commit하지 않는다 Constraint: Windows 세션에서 OMX explore/sparkshell이 unavailable하여 direct PowerShell fallback으로 검증했다 Rejected: 1,000-table checkpoint 없이 2,425개 all-table로 점프 | runtime/loss/dashboard risk를 숨긴다 Rejected: 생성 CSV/checkpoint/prediction file commit | 너무 크고 재현 가능한 artifact이며 ignore 대상이다 Confidence: high Scope-risk: narrow Directive: 향후 all-table 작업도 먼저 bounded로 진행하고, unbounded 전에는 max_samples 약 500000 수준으로 검증한다 Tested: 1,000-table export exit 0; CUDA training exit 0 with validation loss 2.3030; Kronos prediction exit 0; Flask dashboard/API 200; Chrome headless screenshot; compileall; selected pytest suite; pip check Not-tested: full 2,425-table all-sample training 및 live trading integration
전체 export로 STOM universe 변환 가능성은 확인했지만 9GB CSV 직접 학습이 GPU 작업 전 pandas loading에서 정체되었으므로, 모든 eligible symbol/session group을 유지하면서도 4080 SUPER에서 tractable한 contiguous-row bounded export와 1-epoch GPU 학습 경로를 기록했다. Constraint: full STOM CSV는 122,345,828 rows 및 약 9GB이고 GroupedKlineDataset은 현재 pandas eager read 구조다 Constraint: 생성 CSV, checkpoint, prediction, log, screenshot은 local 재현 artifact라 commit하지 않는다 Rejected: 직접 full CSV 학습 process 계속 대기 | 7시간 이상 checkpoint/progress가 없고 GPU utilization이 0%였다 Rejected: 9C를 작은 table subset으로 축소 | all-table symbol/session coverage를 증명하지 못한다 Rejected: group 내부 row random sampling | contiguous time window와 prediction horizon을 깨뜨린다 Confidence: high Scope-risk: moderate Directive: --max-rows-per-group은 lookback_window + predict_window + 1 이상으로 유지하고, streaming/chunked loader 전에는 unbounded all-table 학습을 쓰지 않는다 Tested: full export exit 0 with 122,345,828 rows and 73,582 groups; bounded export exit 0 with 30,902,629 rows and 73,582 groups; CUDA training completed with validation loss 2.3983; Kronos prediction exit 0 with 300 windows; Flask dashboard/API 200; Chrome headless screenshot; compileall; selected pytest suite; pip check Not-tested: unbounded all-table streaming/chunked loader; live trading integration; score/ranking strategy profitability
all-table bounded model은 예측 window를 생성하지만 raw direction accuracy만으로 매매에 쓰기에는 약하므로, predicted return·path consistency·prediction stability로 live 사용 가능한 score ranking을 만들고 realized return/hit rate는 backtest 진단값으로 분리했다. Constraint: live recommendation workflow에 재사용하려면 score는 미래 실제값에 의존하면 안 된다 Constraint: 생성 prediction CSV와 dashboard screenshot은 local 재현 artifact라 commit하지 않는다 Rejected: pred_return_window만으로 ranking | 불안정한 prediction path와 noisy spike를 무시한다 Rejected: actual_return_window를 score에 포함 | live recommendation score에 미래 정보를 누수한다 Confidence: high Scope-risk: moderate Directive: BUY_CANDIDATE는 독립 매수 신호가 아니라 후보 필터로 취급하고, 조건식/segmented backtest 이후에만 실전 판단한다 Tested: 실제 kronos_all_predictions.csv Top-10 recommendation API avg_score 67.6853 및 hit_rate 0.50; prediction API 200; recommendations API 200; Chrome headless screenshot; compileall; selected pytest suite; pip check Not-tested: profitability, slippage, condition-filter integration, live STOM/Future_Trading adapter behavior
외부 추천 프로그램에 score 결과를 연결하기 전에, 후보 필터와 segment별 성과를 비교하는 diagnostic report를 추가해 어떤 조건식이 개선 가능성이 있는지 확인할 수 있게 했다. Route와 dashboard는 prediction CSV를 read-only로 다루며 실제값은 diagnostic 필드로만 사용한다. Constraint: Score filter 선택은 prediction-time field만 사용하고 actual field는 diagnostic으로만 사용한다 Constraint: 이 단계에는 수수료, 슬리피지, live STOM/Future_Trading adapter가 없다 Rejected: raw hit rate만 사용 | 평균 수익률, profit factor, segment tradeoff를 숨긴다 Rejected: realized MAPE를 live filter 조건에 포함 | 미래 실제값 기반이라 label leakage가 된다 Confidence: high Scope-risk: moderate Directive: fee/slippage와 walk-forward adapter validation 전에는 report의 profit factor를 live profitability로 해석하지 않는다 Tested: python -m pytest tests/test_stom_dashboard_helpers.py -q -> 6 passed, 1 warning Tested: compileall; selected pytest suite -> 16 passed, 1 warning; pip check -> No broken requirements found Tested: Flask test client backtest-report API 200 및 prediction API 200 Tested: Headless dashboard screenshot .omx/specs/stom-score-backtest-stage11/stom_score_backtest_stage11.png Not-tested: live trading execution, production adapter export, fee/slippage simulation
score와 filter diagnostic을 stable adapter export로 노출해 외부 추천 프로그램이 dashboard 내부 구조에 결합하지 않고 후보를 소비할 수 있게 했다. Export는 live selection field를 prediction-only로 유지하고 actual-return 값은 diagnostic으로 명명한다. Constraint: Future_Trading의 확정 입력 contract가 이 repo에 없으므로 generic stable CSV/JSON schema를 사용한다 Constraint: sample DB 또는 대용량 prediction artifact는 수정하거나 commit하지 않는다 Rejected: 다른 project에 export 파일을 직접 쓰기 | cross-repo side effect와 stale artifact를 만든다 Rejected: diagnostic actual return을 filter input에 포함 | live recommendation에 미래 label이 누수된다 Confidence: high Scope-risk: moderate Directive: field name을 바꿀 때는 backward compatibility를 지키거나 adapter_version을 올린다 Tested: python -m pytest tests/test_stom_dashboard_helpers.py -q -> 7 passed, 1 warning Tested: compileall; selected pytest suite -> 17 passed, 1 warning; pip check -> No broken requirements found Tested: Flask test client JSON/CSV export for kronos_all_predictions.csv -> 200, CSV mimetype text/csv Not-tested: D:\Chanil_Park\Project\Programming\Future_trading 내부 직접 import, live trading execution, fee/slippage simulation
영어 commit 메시지를 한글화한 뒤, 초기 계획 대비 개발 범위와 STOM tick DB 학습·예측 품질을 사용자가 검토할 수 있도록 근거 중심 보고서를 추가했다. 보고서는 현재 단계, 추가 개발 여부, 모델 학습 한계, 예측 성능 해석, 다음 권고를 분리한다. Constraint: Git history rewrite는 origin/master 이후 로컬 ahead commit으로 제한했다 Constraint: 대용량 DB, CSV, checkpoint, prediction artifact는 수정하거나 commit하지 않았다 Rejected: 보고서를 대화 응답에만 남기기 | 이후 검토와 fork 관리에 재사용할 수 없다 Rejected: 예측 성능을 실전 가능으로 단정 | direction_accuracy와 수수료/슬리피지 미반영 한계가 있다 Confidence: high Scope-risk: narrow Directive: 원격에 이미 push한 뒤라면 force-with-lease 전 backup branch와 새 commit hash를 반드시 확인한다 Tested: git log --reverse --oneline origin/master..HEAD -> 한글 subject 확인 Tested: python -m compileall -q finetune_csv webui tests docs; selected pytest suite -> 17 passed, 1 warning; python -m pip check -> No broken requirements found Not-tested: remote push/force-push, Future_Trading repository 직접 import
파인튜닝이 제대로 되었는지 실행 성공, 데이터 누수, 학습 산출물, 예측 성능을 분리해 판단할 수 있도록 집중 검토 보고서를 추가했다. 특히 최종 all-table bounded run은 완료되었지만 실전 매매 신뢰도는 아직 별도 검증이 필요하다는 결론을 명확히 남겼다. Constraint: 원본 STOM DB, 대용량 CSV, checkpoint 산출물은 수정하지 않는다 Rejected: validation loss만으로 파인튜닝 성공을 단정 | 예측 방향정확도와 bounded 학습 한계를 분리해야 한다 Rejected: 전체 .omx 상태 폴더 커밋 | 로그와 브라우저 프로필 등 대량 임시 산출물이 섞여 문서 검토 목적을 흐린다 Confidence: high Scope-risk: narrow Directive: 이 보고서의 결론을 매매 신호 승인으로 해석하지 말고 walk-forward와 비용 반영 backtest 후 전략에 편입하라 Tested: git diff --check; python -m compileall -q finetune_csv webui tests docs; python -m pytest tests/test_stom_tick_dataset.py tests/test_stom_training_cli.py tests/test_stom_prediction_eval.py tests/test_stom_dashboard_helpers.py tests/test_cli_import_paths.py -q; python -m pip check Not-tested: 새 장시간 재학습; 실시간 주문/실거래 수익성; 장기간 walk-forward backtest
STOM tick DB를 기존 CSV 실험에만 묶어두지 않고 Qlib 연구 흐름으로 확장할 수 있도록 read-only export, Kronos QlibDataset pickle split, Qlib-style Top-K score backtest, 웹 대시보드 표시 경로를 추가했다. pyqlib 자체를 강제 dependency로 추가하지 않고 Qlib dump-ready CSV와 dump command를 남겨 Windows pilot 검증을 먼저 안전하게 통과시키는 방향을 택했다. Constraint: 원본 STOM SQLite DB와 대용량 Qlib/export/backtest 산출물은 수정하거나 commit하지 않는다 Constraint: Windows 환경에서 pyqlib 설치 전에도 pilot 변환과 score backtest가 검증되어야 한다 Rejected: pyqlib을 즉시 필수 의존성으로 추가 | 설치/빌드 비용이 크고 현재 목표는 STOM 데이터 구조를 Qlib 경로로 안전하게 연결하는 첫 단계다 Rejected: session을 무시한 symbol 단위 pickle | 기존 QlibDataset window가 날짜 경계를 넘을 수 있어 symbol+session instrument key로 분리했다 Rejected: 현재 prediction CSV를 완전한 Qlib Top-K로 단정 | 동일 asof_timestamp cross-section이 부족해 artifact warning으로 한계를 노출한다 Confidence: high Scope-risk: moderate Directive: 다음 확장은 동일 asof_timestamp에서 여러 종목 score를 생성한 뒤 pyqlib TopkDropoutStrategy와 직접 비교해야 한다 Tested: git diff --check; python -m compileall -q finetune finetune_csv webui tests docs; python -m pytest tests/test_stom_qlib_pipeline.py tests/test_stom_dashboard_helpers.py tests/test_stom_tick_dataset.py tests/test_stom_prediction_eval.py tests/test_stom_training_cli.py tests/test_cli_import_paths.py -q; python -m pip check; python finetune\qlib_stom_pipeline.py score-backtest --prediction-csv webui\stom_predictions\kronos_all_predictions.csv --output-dir webui\qlib_backtests --top-k 10 --cost-bps 15 --slippage-bps 10 Not-tested: pyqlib dump_bin 실제 실행; Qlib provider init; 장시간 전체 DB 변환/학습; 실거래/주문 연동
pyqlib이 설치되지 않은 Windows 워크스테이션에서도 다음 단계가 어디에서 막히는지 바로 알 수 있도록 qlib-env-check, dump-bin dry-run/execute, provider-smoke 명령을 추가했다. STOM export report에서 Qlib dump_bin command를 재구성하고, 실제 실행은 dump_bin.py 경로가 확인된 경우에만 진행하게 하여 대용량 변환 실패를 사전에 차단한다. Constraint: pyqlib은 현재 환경에 설치되어 있지 않으며 원본 DB와 대용량 Qlib 산출물은 commit하지 않는다 Rejected: pyqlib을 즉시 강제 설치 | 환경 변경 범위가 크고 먼저 재현 가능한 readiness gate를 commit하는 것이 안전하다 Rejected: dump_bin.py 경로를 추측해 무조건 실행 | pip package와 source checkout의 script 위치가 다를 수 있어 명시 경로를 받게 했다 Confidence: high Scope-risk: narrow Directive: 다음 단계는 python -m pip install pyqlib 또는 microsoft/qlib checkout 후 dump-bin --execute와 provider-smoke를 순서대로 실행하라 Tested: git diff --check; python -m compileall -q finetune finetune_csv webui tests docs; python -m pytest tests/test_stom_qlib_pipeline.py tests/test_stom_dashboard_helpers.py tests/test_stom_tick_dataset.py tests/test_stom_prediction_eval.py tests/test_stom_training_cli.py tests/test_cli_import_paths.py -q; python -m pip check; python finetune\qlib_stom_pipeline.py qlib-env-check Not-tested: pyqlib 설치; dump_bin.py 실제 .bin 변환; qlib provider init; 전체 DB 장시간 변환
STOM tick DB를 Qlib 연구 경로로 연결할 수 있는지 실제 pyqlib 환경에서 검증했다. Upstream dump_bin 인자 변경을 반영하고, Windows 한글/UTF-8 출력 환경에서도 검증이 흔들리지 않도록 subprocess 캡처를 보강했다. 1초봉은 dump_bin 변환은 가능하지만 pyqlib provider freq 제약이 있어 Kronos pickle 학습 경로로 분리하고, 1분봉은 provider smoke까지 통과한 실행 근거를 문서화했다. Constraint: pyqlib wheel에는 scripts/dump_bin.py가 포함되지 않아 Qlib source clone 경로가 필요함 Constraint: pyqlib provider는 1s freq를 지원하지 않아 Qlib provider 검증은 1min으로 수행해야 함 Rejected: 1초봉 provider 실패를 무시하고 Qlib 전체 호환으로 표시 | 실제 D.calendar(freq="1s")가 실패하므로 잘못된 완료 주장임 Rejected: dump_bin 인자를 기존 --csv_path로 유지 | 현재 upstream script는 --data_path를 요구함 Confidence: high Scope-risk: moderate Directive: 1초봉 학습은 processed_datasets pickle 경로를 우선 사용하고, Qlib provider 기반 검증은 1min 이상에서 진행할 것 Tested: python finetune\qlib_stom_pipeline.py qlib-env-check Tested: 1s/1min STOM pilot export and dump-bin --execute Tested: python finetune\qlib_stom_pipeline.py provider-smoke --provider-uri finetune\qlib_exports\stom_1min_stage_pyqlib_pilot\qlib_bin --region cn --freq 1min Tested: python -m pip check Tested: python -m compileall -q finetune finetune_csv webui tests docs Tested: python -m pytest tests/test_stom_qlib_pipeline.py tests/test_stom_dashboard_helpers.py tests/test_stom_tick_dataset.py tests/test_stom_prediction_eval.py tests/test_stom_training_cli.py tests/test_cli_import_paths.py -q Not-tested: Qlib D.features/TopkDropoutStrategy full strategy backtest is still pending
기존 STOM 1초봉 경로는 predict_window가 row 수로 해석될 수 있고 group 단위 split이 같은 거래일을 여러 split에 섞을 수 있었다. Kronos QlibDataset 파인튜닝으로 30초/60초 후 예측을 다시 검증하려면 먼저 실제 1초 grid와 날짜 기준 split을 export 단계에서 보장해야 한다. 이번 변경은 1초 grid 보정, session split, horizon-seconds preset, split/grid manifest를 추가해 전체 데이터 파인튜닝 전 데이터 품질 게이트를 만든다. Constraint: pyqlib provider는 1s freq를 지원하지 않으므로 1초봉은 QlibDataset pickle을 통한 Kronos 파인튜닝 경로로 유지해야 함 Constraint: 현재 direction_accuracy 0.40 모델은 실전 신호로 부족하므로 재학습 전 target/split 정의를 먼저 고정해야 함 Rejected: predict_window만 30/60으로 바꾸는 방식 | tick row가 누락되면 실제 30초/60초 후가 아님 Rejected: 기존 group split 유지 | 같은 session이 train/val/test에 섞일 수 있어 금융 시계열 검증 누수 위험이 큼 Confidence: high Scope-risk: moderate Directive: 30초/60초 모델 학습은 --regularize-1s --split-by session --horizon-seconds 옵션으로 생성한 processed_datasets만 사용할 것 Tested: python -m pytest tests/test_stom_qlib_pipeline.py -q Tested: python finetune\qlib_stom_pipeline.py export --db _database\stock_tick_back.db --output-dir finetune\qlib_exports\stom_1s_grid_pred30_stage_pilot --max-tables 2 --lookback-window 30 --horizon-seconds 30 --price-mode close_only --time-start 090000 --time-end 090200 --freq 1s --regularize-1s --split-by session --max-groups 6 --train-ratio 0.5 --val-ratio 0.25 --test-ratio 0.25 Tested: python finetune\qlib_stom_pipeline.py export --db _database\stock_tick_back.db --output-dir finetune\qlib_exports\stom_1s_grid_pred60_stage_pilot --max-tables 2 --lookback-window 60 --horizon-seconds 60 --price-mode close_only --time-start 090000 --time-end 090300 --freq 1s --regularize-1s --split-by session --max-groups 6 --train-ratio 0.5 --val-ratio 0.25 --test-ratio 0.25 Tested: QlibDataset train/val load smoke on stom_1s_grid_pred30_stage_pilot processed_datasets Tested: python finetune\qlib_stom_pipeline.py dump-bin --export-report finetune\qlib_exports\stom_1s_grid_pred30_stage_pilot\stom_qlib_export_report.json --qlib-dir finetune\qlib_exports\stom_1s_grid_pred30_stage_pilot\qlib_bin --dump-bin-script .omx\external\qlib\scripts\dump_bin.py Tested: python -m compileall -q finetune finetune_csv webui tests docs Tested: python -m pytest tests/test_stom_qlib_pipeline.py tests/test_stom_dashboard_helpers.py tests/test_stom_tick_dataset.py tests/test_stom_prediction_eval.py tests/test_stom_training_cli.py tests/test_cli_import_paths.py -q Tested: python -m pip check Not-tested: 전체 2,425개 stock table export와 실제 30초/60초 모델 장시간 파인튜닝은 다음 단계
30초/60초 파인튜닝 전 단계에서 전체 stock table 산출물이 실제로 생성됐는지 반복 확인할 수 있도록 manifest 요약과 split 검증 결과를 문서로 남긴다. Qlib provider가 아닌 Kronos QlibDataset pickle 경로를 다음 학습 입력으로 확정했다. Constraint: STOM 전체 export 산출물은 GiB 단위라 git에 포함하지 않고 문서와 manifest 경로만 고정한다 Constraint: pyqlib provider는 1s freq smoke에 제약이 있어 Kronos processed_datasets pickle을 학습 입력으로 사용한다 Rejected: 생성된 qlib_exports 전체를 commit | 대용량 산출물이라 repo 추적 대상이 아님 Confidence: high Scope-risk: narrow Directive: 다음 파인튜닝은 docs/stom_1s_full_export_report.md의 pred30/pred60 processed_datasets 경로와 KRONOS_PREDICT_WINDOW를 일치시킨 뒤 실행할 것 Tested: git diff --check; qlib-env-check; dump-bin dry-run for pred30/pred60; python -m compileall -q finetune finetune_csv webui tests docs; pytest 22 passed; python -m pip check Not-tested: 전체 pred30/pred60 실제 파인튜닝 실행
전체 QlibDataset export가 단순 산출물 생성에 머무르지 않도록 Windows 단일 GPU 환경에서 재현 가능한 학습 launcher를 추가하고 pred30/pred60 budgeted run을 완료했다. 이 commit은 매매 정확도 개선 주장이 아니라 전체 STOM 1초봉 데이터가 Kronos predictor 학습 루프에 실제로 들어가고 checkpoint까지 저장된다는 실행 근거를 고정한다. Constraint: 워크스테이션은 Windows + RTX 4080 SUPER 단일 GPU 환경이라 NCCL/torchrun 고정 경로가 안정적이지 않다 Constraint: comet_ml은 설치되어 있지 않으므로 KRONOS_USE_COMET=0 상태에서도 학습이 가능해야 한다 Constraint: finetune/outputs 산출물은 대용량 checkpoint라 git 추적 대상에서 제외한다 Rejected: torchrun/NCCL만 유지 | Windows PyTorch에서 libuv/gloo/NCCL 문제가 실제로 발생했다 Rejected: best_val_loss를 direction_accuracy로 해석 | token loss라 매매 방향 정확도와 직접 비교할 수 없다 Confidence: high Scope-risk: moderate Directive: 다음 단계는 생성 checkpoint로 prediction CSV를 만들고 동일 holdout에서 direction_accuracy 및 Top-K 성과를 비교할 것 Tested: pred30 pilot smoke 학습 성공; pred30 full smoke/stage/full_budget 성공; pred60 full smoke/stage/full_budget 성공; git diff --check; doc smoke; python -m compileall -q finetune finetune_csv webui tests docs; pytest 24 passed; python -m pip check Not-tested: checkpoint 기반 prediction CSV 생성 및 0.40 direction_accuracy 대비 성과 비교
budgeted 파인튜닝 checkpoint가 단순 loss 산출에 머무르지 않도록 test split에서 예측 CSV를 만들고 persistence/random baseline 및 Qlib-style Top-K와 비교했다. 결과적으로 60초 모델은 제한 샘플에서 direction_accuracy 0.4444로 0.40을 넘었지만, Top-K net return은 음수라 실전 추천에는 아직 부족하다는 판단을 문서화한다. Constraint: 평가 산출 CSV/JSON과 Qlib backtest artifact는 webui 산출물로 생성되지만 대용량/재생성 가능 파일이라 git에 포함하지 않는다 Constraint: 이번 평가는 5개 test session, 27개 window의 제한 샘플이라 최종 성능 확정이 아니다 Rejected: best_val_loss만으로 성능 판단 | 매매 방향 정확도와 직접 비교할 수 없어서 holdout prediction CSV를 생성했다 Rejected: 60초 0.4444만 보고 실전 적용 | Top-K net return이 음수라 조건식/표본 확대 전에는 보류한다 Confidence: high Scope-risk: moderate Directive: 다음 단계는 --max-sessions/--max-asofs/--max-symbols를 확대한 walk-forward 평가와 조건식 필터 개선을 먼저 진행할 것 Tested: pred30/pred60 checkpoint prediction CSV generated; Qlib Top-K artifacts generated; dashboard helper smoke; git diff --check; doc smoke; python -m compileall -q finetune finetune_csv webui tests docs; pytest 25 passed; python -m pip check Not-tested: 수백~수천 window walk-forward 확대 평가 및 조건식 최적화
pred60 checkpoint가 작은 표본에서 보인 방향성 개선이 더 넓은 walk-forward에서도 유지되는지 확인하고, 미래 실제값을 보지 않는 조건식 필터로 비용 후 손익이 얼마나 개선되는지 검증했다. 이번 변경은 예측 CSV에 예측 시점 feature를 추가하고, Qlib-style Top-K 결과와 분리된 filter-search artifact를 생성한다. 대시보드는 filter-search JSON을 잘못 Qlib backtest로 열지 않도록 metrics 기반 artifact만 목록에 노출한다. Constraint: 생성된 CSV/JSON/model artifact는 .gitignore 대상이므로 코드와 문서만 커밋한다 Constraint: 현재 검증 표본은 30개 session, 3개 as-of, 546 windows, 90 periods로 제한된다 Rejected: direction_accuracy 0.4084를 실전 매수 승인 근거로 사용 | random baseline도 0.4084이고 25bp 비용 후 Top-K net이 음수다 Confidence: medium Scope-risk: moderate Directive: best filter는 실전 조건식이 아니라 다음 확대 walk-forward 및 rolling 검증 후보로만 취급한다 Tested: python -m pytest tests/test_stom_1s_checkpoint_eval.py tests/test_stom_dashboard_helpers.py -q Tested: python -m pytest tests/test_stom_qlib_pipeline.py tests/test_stom_dashboard_helpers.py tests/test_stom_tick_dataset.py tests/test_stom_prediction_eval.py tests/test_stom_training_cli.py tests/test_cli_import_paths.py tests/test_stom_1s_finetune_runner.py tests/test_stom_1s_checkpoint_eval.py -q Tested: python -m compileall finetune\evaluate_stom_1s_checkpoint.py finetune\search_stom_1s_filters.py webui\stom_dashboard.py Tested: git diff --cached --check Tested: python -m pip check Not-tested: 100개 이상 session 확대 walk-forward Not-tested: rolling train/test 방식의 조건식 과최적화 검증
조건식 filter-search가 같은 표본에서 선택과 평가를 동시에 수행하던 한계를 줄이기 위해 앞쪽 기간에서 best filter를 고르고 뒤쪽 기간에 그대로 적용하는 rolling train/test 검증 흐름을 추가했다. 기존 pred60 90-period walk-forward CSV에 30/30 rolling 검증을 적용한 결과, test net은 아직 -0.0351%로 음수였지만 baseline -0.2438% 대비 +0.2087%p 개선되어 조건식이 손실을 줄이는 후보라는 근거는 보강했다. 대시보드에는 filter-search/rolling-validation artifact를 별도 패널로 표시하는 API와 UI를 추가했다. Constraint: 생성된 rolling JSON/CSV artifact는 webui/qlib_backtests ignore 대상이라 커밋하지 않는다 Constraint: 이번 rolling 실행은 기존 30 sessions x 3 as-of 결과의 90 periods 안에서 수행한 1차 검증이다 Rejected: best filter를 실전 승인 조건으로 승격 | rolling avg_test_net_return_pct가 아직 음수다 Confidence: medium Scope-risk: moderate Directive: 다음 변경자는 같은 표본 search 결과가 아니라 rolling 또는 완전 분리 holdout 결과를 기준으로 실전 여부를 판단해야 한다 Tested: python finetune\search_stom_1s_filters.py --prediction-csv webui\stom_predictions\stom_1s_pred60_walkforward30x3_eval_kronos.csv --output-dir webui\qlib_backtests --prefix stom_1s_pred60_walkforward30x3_eval_kronos_rolling30x30 --top-k 5 --cost-bps 15 --slippage-bps 10 --min-trades 10 --min-periods 10 --min-coverage 0.25 --rolling-validate --rolling-train-periods 30 --rolling-test-periods 30 --rolling-step-periods 30 Tested: python -m pytest tests/test_stom_dashboard_helpers.py -q Tested: python -m pytest tests/test_stom_qlib_pipeline.py tests/test_stom_dashboard_helpers.py tests/test_stom_tick_dataset.py tests/test_stom_prediction_eval.py tests/test_stom_training_cli.py tests/test_cli_import_paths.py tests/test_stom_1s_finetune_runner.py tests/test_stom_1s_checkpoint_eval.py -q Tested: python -m compileall finetune\search_stom_1s_filters.py webui\app.py webui\stom_dashboard.py Tested: git diff --check Tested: git diff --cached --check Tested: python -m pip check Not-tested: max_sessions 100, max_asofs 5, max_symbols 50 GPU 장시간 walk-forward 실제 추론 Not-tested: rolling 검증에서 random baseline과 다중 seed 비교
사용자가 외부 프로그램 연동을 제거하라고 명시했으므로 대시보드와 문서의 전용 연동 문구를 제거하고, 남은 CSV/JSON export는 STOM 내부 검증용 score export로만 설명했다. 동시에 STOM tick 전체 학습 여부를 오해하지 않도록 전체 DB export와 budgeted fine-tuning의 차이를 별도 문서로 고정했다. 모든 주식 tick 테이블을 QlibDataset pickle로 변환하고 학습 루프에 연결한 것은 완료했지만, 가능한 7천만 개 이상 train window 전체를 전량 epoch 학습한 것은 아니다. Constraint: 외부 trading-program repository는 이 프로젝트 범위에서 수정하지 않는다 Constraint: 현재 실제 학습은 pred30/pred60 각각 train 20,000, val 4,000 budgeted run이다 Rejected: 전체 DB export 완료를 전체 window 전량 학습 완료로 표현 | 실제 학습량을 과장하게 된다 Confidence: high Scope-risk: narrow Directive: 외부 프로그램 연동은 사용자가 다시 명시하기 전까지 현재 계획/대시보드 목표에 포함하지 않는다 Tested: python -m pytest tests/test_stom_dashboard_helpers.py -q Tested: python -m pytest tests/test_stom_qlib_pipeline.py tests/test_stom_dashboard_helpers.py -q Tested: python -m compileall webui\stom_dashboard.py webui\app.py Tested: git diff --check Tested: git diff --cached --check Not-tested: 전체 selected pytest suite 재실행 | 이번 변경은 문서/UI 문구 중심이며 직전 긴 suite 호출은 timeout되어 focused dashboard/qlib 검증으로 대체했다
전체 STOM tick dataset을 학습 루프에 연결한 상태와 가능한 모든 window를 전량 학습한 상태가 혼동되지 않도록 staged full-training 로드맵을 명시했다. 20k baseline 이후 200k, 1M, 5M, full-window 후보로 확대하는 순서를 문서화하고, runner에 --sample-stage 옵션을 추가해 각 단계의 train/val sample budget이 manifest에 남도록 했다. Constraint: 현재 20k 학습 결과는 실전 수익성 양수 전환이 아니므로 full-window 전량 학습을 즉시 실행하지 않는다 Constraint: full_window stage는 pred60 기준 73,718,875 train samples라 장시간 실행 후보로만 둔다 Rejected: --mode full 기본값을 full-window로 변경 | 기존 budgeted 재현 경로가 깨지고 실수로 초대형 학습을 시작할 수 있다 Confidence: high Scope-risk: moderate Directive: 대형 walk-forward와 rolling validation에서 개선이 유지될 때만 expand_200k 이후 실제 학습을 실행한다 Tested: python -m pytest tests/test_stom_1s_finetune_runner.py -q Tested: python -m pytest tests/test_stom_1s_finetune_runner.py tests/test_cli_import_paths.py -q Tested: python finetune\run_stom_1s_finetune.py --horizon 60 --mode full --sample-stage expand_200k --output-root finetune\outputs --dry-run Tested: python -m compileall finetune\run_stom_1s_finetune.py Tested: git diff --check Tested: git diff --cached --check Not-tested: expand_200k 실제 GPU 학습 실행 Not-tested: full_window 실제 전량 epoch 학습 실행
budget_20k checkpoint를 100 sessions, 5 as-of, 50 symbols의 대형 holdout walk-forward로 검증했다. Kronos 방향 정확도는 0.4312로 random 0.4084보다 높았지만, Qlib Top-K 비용 후 net은 -0.1953%였고 best robust filter도 -0.1266%에 머물렀다. rolling validation 역시 avg test net -0.1766%, positive fold rate 0.25로 학습 확대 게이트를 통과하지 못했다. Constraint: 대용량 prediction CSV, backtest JSON, checkpoint는 로컬 산출물이며 git에는 문서 판단만 기록한다 Rejected: expand_200k 즉시 실행 | rolling avg_test_net_return_pct가 음수이고 positive test fold rate가 0.25로 낮음 Confidence: high Scope-risk: narrow Directive: 방향 정확도만으로 학습량을 확대하지 말고 비용 후 rolling test gate를 먼저 확인할 것 Tested: python -m pytest tests/test_stom_dashboard_helpers.py tests/test_stom_1s_checkpoint_eval.py tests/test_stom_1s_finetune_runner.py tests/test_stom_qlib_pipeline.py -q Tested: dashboard artifact loader smoke check passed for walkforward100x5x50 comparison/filter/backtest artifacts Tested: git diff --check on changed docs passed with line-ending warnings only Not-tested: 실제 expand_200k GPU fine-tuning Not-tested: 1M, 5M, full-window 확대 학습
pred60 대형 walk-forward 결과를 사람이 수동으로 해석하지 않아도 되도록 filter-search와 rolling-validation artifact를 재사용하는 cost_sensitivity_gate 분석 모드를 추가했다. 5/10/15/25bp 비용 시나리오를 비교하고 target 25bp 기준에서 rolling avg test net, positive fold rate, baseline 개선폭, 거래 수 gate를 동시에 확인한다. 실제 100x5x50 pred60 artifact에 적용한 결과 5bp에서는 통과하지만 target 25bp에서는 avg test net -0.1766%, positive fold rate 0.25로 실패하므로 expand_200k 실행을 계속 보류한다. Constraint: webui/qlib_backtests의 cost_gate JSON/CSV는 재생성 가능한 실험 산출물이므로 commit하지 않는다 Rejected: 5bp 통과를 근거로 expand_200k 실행 | 실제 판단 기준 25bp gate가 실패함 Rejected: 전체 filter grid를 비용별 재탐색 | cost 변화는 기존 net을 bps 차이만큼 이동하면 되어 기존 artifact 재사용이 더 빠르고 재현 가능함 Confidence: high Scope-risk: moderate Directive: staged training 확대는 cost_sensitivity_gate의 target cost 통과 없이는 실행하지 말 것 Tested: python finetune\search_stom_1s_filters.py --gate-analysis ... --total-cost-bps-grid 5,10,15,25 --target-total-cost-bps 25 Tested: python -m pytest tests/test_stom_filter_gate.py tests/test_stom_dashboard_helpers.py tests/test_stom_qlib_pipeline.py tests/test_stom_1s_checkpoint_eval.py tests/test_stom_1s_finetune_runner.py -q Tested: python -m compileall finetune\search_stom_1s_filters.py webui\stom_dashboard.py Tested: dashboard cost gate artifact smoke check passed Tested: git diff --check on changed files passed with line-ending warnings only Not-tested: 실제 expand_200k GPU fine-tuning Not-tested: pred30/pred60 ensemble 후보 생성
STOM 데이터로 tokenizer를 먼저 조정한 뒤 predictor에 전달하는 공식 순서를 runner와 학습 스크립트에 반영했다. full_window라고 부를 수 있는 조건을 분리하기 위해 random sampling과 sequential coverage mode를 명시적으로 나눴다. Constraint: Kronos 공식 가이드는 tokenizer fine-tuning 이후 predictor fine-tuning 순서를 요구함 Constraint: Windows 단일 GPU 실행은 torchrun/DDP가 항상 필요한 형태로 두면 20k benchmark부터 막힘 Rejected: pretrained tokenizer로 predictor만 재학습 유지 | 공식 준수 검증이 되지 않음 Confidence: high Scope-risk: moderate Directive: full_window 학습 완료 주장은 KRONOS_DATASET_SAMPLE_MODE=full_sequential exact-once 검증 없이는 금지 Tested: PYTEST_DISABLE_PLUGIN_AUTOLOAD=1; C:\Python\64\Python3119\python.exe -m pytest tests\test_stom_1s_finetune_runner.py -q => 6 passed Tested: C:\Python\64\Python3119\python.exe -m compileall finetune\config.py finetune\dataset.py finetune\run_stom_1s_finetune.py finetune\train_predictor.py finetune\train_tokenizer.py tests\test_stom_1s_finetune_runner.py => success Tested: pred60 --train-stage both --sample-stage budget_20k --dataset-sample-mode full_sequential dry-run manifest handoff 확인 Not-tested: 실제 tokenizer 20k 학습은 다음 단계에서 수행
공식 순서의 첫 실제 학습인 tokenizer 20k benchmark를 full_sequential mode로 수행하고 결과를 실행 계획에 반영했다. 이제 200k, 1M, 5M, full-window 예상 시간이 실측 기반으로 계산된다. Constraint: 1M/5M/full-window 확대 여부는 실측 시간과 cost gate 판단이 있어야 함 Rejected: 기존 predictor 20k 시간으로 tokenizer 시간을 추정 | tokenizer 경로가 별도라 오차가 큼 Confidence: high Scope-risk: narrow Directive: 8단계 full-window 안내 시 tokenizer full train은 약 24일 이상 걸릴 수 있음을 명시 Tested: tokenizer 20k run status ok, duration_seconds=567.944628 Tested: best_model checkpoint files config.json/model.safetensors/README.md 존재 확인 Tested: summary best_val_loss=0.004013419676455669 확인 Not-tested: 200k tokenizer는 다음 단계에서 실행
- 2022 ts_imb 단독 95% CI 가 0 포함(SE ±0.40%/trade) → 통계적으로 음수 아님. - 2022 vs 2023~26 Welch t=2.27~2.35(uncorrected) 이나 "5년 중 최약" 사후지목 → Bonferroni 임계 |t|~2.6 기준 비유의. 승률 26% > 손익분기 ~20.5%로 구조 유지. - 함의: 단일 연도는 변동성만으로 flat~음수 가능 → 사이징/낙폭관리 필수(엣지 무효 아님). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 프로젝트 히스토리(시도→실패/성공 흐름), 검증수치 전체(실비용 23bp·누적곡선· 체결 de-idealization·연도별·필터강도), 정직한 한계(큐replay 불가·2022 소표본). - gitignored 재현 자산을 자립 복원: §7 DB→전 산출물 재생성 레시피, §9 build_equity_curve.py / fill_mode_compare.py 전체 소스 내장, §8 대시보드 발행+서버 재시작, §10 커밋 맵, §12 다음 결정트리. - 파일 인벤토리(커밋됨 vs gitignored), 테스트 47 passed, 읽기 순서. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
최신 재개 문서는 2026-05-29 대화에서 확인한 현재 위치를 자립형으로 고정한다. RL 알파 부재와 갭상승 룰 전략의 구분, 검증된 기대값/체결 스트레스 수치, dashboard 진행률 해석, 그리고 다음 Page A 사이징·리스크 설계 진입점을 한 파일에 모았다. Constraint: 갭상승 equity 곡선은 반드시 RULE strategy, NOT reinforcement learning 으로 표시해야 한다 Rejected: 기존 2026-05-28 handoff만 갱신 | 날짜가 다른 재개 커밋 문서가 새 대화 앵커로 더 안전하다 Confidence: high Scope-risk: narrow Directive: 다음 작업은 broker/live-order 연동이 아니라 Page A 사이징·리스크 설계부터 시작할 것 Tested: py -3.11 -m pytest tests\\test_stom_rl_gap_up_backtest.py tests\\test_stom_rl_gap_up_dashboard_publish.py -q (47 passed) Not-tested: full-universe --max-symbols 0 재실행과 live forward paper 검증 Co-authored-by: OmX <omx@oh-my-codex.dev>
- gap_up_risk_sizing.py: f=10%/K=3/일손실-3% 순수함수 사이징 모듈 (RULE NOT RL) - 테스트 54개, 전체 게이트 101 passed, code-reviewer APPROVE - Page A 문서: Kelly 퇴화 분석, 계좌별(1천만/5천만/1억) worked example, 연패/월간 감액 - RL 타당성 딥리서치(105 에이전트 적대적 검증): RL은 알파원 아님, 청산 RL도 비용차감 OOS 우위 0건 → oracle 천장테스트로 게이트 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- exit_oracle.py: 완전예지 최선청산 vs 룰청산 regret (순수함수, realized 체결로 regret>=0, 비용불변) - 결과(ts_imb N=235): capture 17.8%, regret평균 +4.18%, 손절이 regret의 55% → 여지 있음(필요조건)이나 RL 직행 아님 - 테스트 15개, code-reviewer APPROVE (regret>=0를 2M 랜덤경로로 증명) - 다음: R1b 인과적 청산 baseline (SL/트레일링 sweep + Deflated Sharpe/PBO 검증) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- exit_baselines.py: 트레일링/SL-sweep 인과 청산 + Deflated Sharpe(Bailey-LdP) + walk-forward - 판정: 어떤 인과 변형도 고정 TP5/SL1 못 이김; IS최적 trail_1이 OOS -0.71%(과적합), DSR 0.931<0.95 - => 청산 RL(R3) 폐기, R1 천장은 hindsight. 운영 트랙 Page B로 복귀 - 테스트 22개, 전체 게이트 138 passed, code-reviewer APPROVE (DSR 수식 Bailey-LdP 정확 일치) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- full universe(2314종목·29139 instance): ts_imb 전 연도 양수, 2022 +0.742%로 해소(소표본 노이즈 확정) - breakeven OOS 98bp(비용 4배), OOS 경계 안정, 슬리피지 43bp서도 +0.606% - 기대값 희석(+0.95→+0.80) 정직 명시; triggered-subset 한계 유지 - 세션 핸드오프: Page A·R0·R1·R1b·B 진행 + 재개 방법 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- liquidity_model.py: 실데이터 초당거래대금(백만원 단위 검증) 기반 participation/슬리피지/feasibility (순수함수) - 유동성 PASS: 1천만~1억 계좌 주문이 1초거래대금의 0.2~1.6%, 100% feasible, 슬리피지 <3bp -> 엣지 거의 무손상 - gap-through PASS: full-universe sl_gap_stress 전 연도 양수(2022 +0.603, bounded 음수 해소), breakeven OOS 81bp(비용 3.5배) - 단위 버그(원<->백만원 1e6배)를 물리적 sanity check로 출시 전 차단 -> 결론 정반대로 교정 - 테스트 15개, code-reviewer APPROVE(단위 보정 실데이터 재확인) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…수정 (RULE NOT RL) - paper_sim.py: 룰+Page A 사이징을 시간순 replay (top-K·연패/월간 감액·일손실 halt·유동성 캡·복리), 계좌곡선/MDD - 발견·수정: 7연패 f=0 halt가 영구 동결(deadlock) -> 서킷브레이커(쿨다운+streak 리셋)로 복구, 테스트로 고정 - replay(체결 양끝): full +396~612%/MDD -1.8~-3.1%, holdout +39~45%/MDD -0.7~-0.9% (전부 양수·저낙폭) - 단 헤드라인은 복리×replay 낙관 상한이지 미래 기대치 아님(정직성 강조). 진짜 forward는 실시간 피드 필요(환경 밖) - 테스트 9개, 전체 게이트 162 passed, code-reviewer APPROVE(서킷브레이커 정합 검증) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 'C 실행 중' -> A·R0·R1·R1b·B·C·D 전부 완료로 갱신 - 162 passed, 6 커밋, RL 폐기, 검증 완결 / 진짜 forward는 환경 밖(실시간 피드 필요) - 재개 검증·산출물 지도·다음 행동·가드레일 최신화 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 13-에이전트 워크플로우(연구 6각도→적대적 검증 6/6 기각→우리 DB 맞춤 설계 종합, ~1.3M토큰) + DB 실측 grounding - 결론: 방법은 구체적이나 사전확률 낮음(~8-15%; full universe 게이트면 ~12-22%); 가장 유력한 결과=엄밀히 문서화된 NULL - 게이트 순서: P0 MinTRL 허용성 -> P1 지도학습 예측(CPU 몇시간, 핵심 게이트) -> P2 linear-vs-deep -> A2/A3 딥 -> A4 offline IQL(최후) - DB 실측: 마이크로구조 14종 완비, 세션 내부 dense(~1067봉/창); 진짜 구속은 tradeable episode 수(ts_imb ~5175, bounded 235) - AVOID: tick-direction·Decision Transformer·online Q/PPO·dense reward·queue-position·oracle BC - RULE strategy NOT RL; 수익 확정 주장 아님 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- microstructure_features.py: 순수 인과 마이크로구조 피처(OFI/체결강도/호가/microprice, look-ahead 없음) - predictability_probe.py: P0 MinTRL + P1 purged walk-forward(Ridge+GBM) + rank-IC 세션블록 부트스트랩 + 비용차감 정책 DSR + symbol-disjoint - full universe(N=5173, 569k 샘플): gbm IC +0.104 (OOS·미학습종목 0.106·5경계 안정) = 랩 최초 robust 양성 신호 - 단 'GO'는 과대평가: 정책 net이 baseline-relative 아님(갭상승 드리프트 혼입)·idealized 체결·DSR이 sharpe_variance에 민감 -> 룰 대비 증분/현실 수익성 미입증 - 결정적 다음: baseline-relative + de-idealized(마켓에이블 체결) 게이트. 통과해야 RL(A2/A3) - 신규 테스트 16개, 전체 178 passed, code-reviewer APPROVE(누설 없음, 3개 한계는 알려진 caveat) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…T RL) - marketable_fill.py: 마켓에이블 체결(buy@ask/sell@bid, 스프레드 2회) + 임의진입 룰 시뮬(순수) - timing_gate.py: 모델 진입선택 vs 룰 고정 09:00, paired·de-idealized·purged walk-forward + 보수적 DSR(외부 variance·trial 원장) - bounded: 모델 타이밍이 룰보다 -0.6~-1.2%/trade 열등(CI 음수쪽 0 제외, 전 5경계) -> NO-GO - P1 'GO' 정체 확정: 드리프트+idealized artifact. P1 ranking 신호(IC~0.10)는 타이밍 가치 음(-) - 딥RL A2/A3/A4는 전제(증분 신호) 기각으로 미착수 - 별도 경고: 룰 de-idealized net +0.117%(풀스프레드 잠식) -> 룰 실체결 정밀분석 권장 - 테스트 11개, 전체 189 passed Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 실측 확정: ridge inc -1.176%(CI[-1.776,-0.640]), gbm inc -0.560%(CI[-1.118,-0.135]), 전 5경계 음수, NO-GO - 결론·verdict 불변; 미세 수치만 실측 일치로 교정 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- full universe(N=5,173, 532k 샘플) 권위 수치로 §1/§2/§3/§4/§6 확정 - 모델 진입-타이밍 증분: ridge -0.456%(CI[-0.575,-0.345]), gbm -0.384%(CI[-0.495,-0.272]) 전부 음수, 전 5경계, DSR=0 -> 결정적 NO-GO - 룰 de-idealized net +0.884%/trade(buy@ask/sell@bid) ~= idealized +0.9% -> 룰 엣지 현실 체결서 유지(bounded +0.12/+0.46은 소표본 노이즈, 정정) - 딥RL 진입-타이밍 폐기 확정; A2/A3/A4 미착수(전제 기각) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… RL) - 10-에이전트 워크플로우(내부 감사+외부 문헌+찬반 패널) 종합 - 역할 분담: 1d=레짐/유니버스, 1m=신호/보고 grain(KRX auction 봉 주의), 1s=체결/비용/리스크 진실레이어(대체불가) - 알파 3갈래 모두 적대검정으로 닫힘: 선택(shuffle null 실패), 타이밍(P1b NO-GO), 청산(DSR 0.931<0.95) - 정정: 감사의 'shuffle 미검정' 주장은 사실오류 — 하니스 존재·단위테스트됨, null 실패 확인 -> no-alpha 결론 강화 - 살아남는 실험 4개(사전확률 명시): skip-gate(~20-30%), 초당흐름 재구성(용량 정직화), SL예측 선행게이트, 상태조건 청산(~20%) - 정직성: +0.884%는 룰 드리프트이지 1초봉이 만든 알파 아님; 모든 양수치 in-sample/triggered-subset/no-live/no-L2 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Page C 진입봉 초당거래대금(entry_sec_amount, median 623.5백만=문서 622 확인)이 KRX 09:00 단일가 동시호가 누적 포함 -> 정합 1초흐름(초당매수+초당매도금액) 대비 median 49x(mean 72x, p90 125x) 과대 - 정합 보정: median 1초거래대금 6.2억->1360만, 1억계좌 participation 1.6%->73.5%, feasible 100%->59%, 1x도달계좌 ~62억->1.36억(-98%) - 평결: PASS -> 조건부 PASS 강등. slip-adj exp는 전계좌 양수(1억 +0.58~0.71%)지만 '수십억 여유' 주장 철회; 정직 편안구간 1천만~5천만, 1억 marginal, 5억+ binding - 알파 아님: 자기기만 제거(용량 정직화)가 목적, 예상대로 더 보수적 결과 - 구현 stom_rl/liquidity_recon.py(순수함수+DB추출기+CLI) + 테스트 11개(liquidity 합 26 passed) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…정당화 (RULE NOT RL) - 진입/첫30초 마이크로구조로 'SL로 끝날지'(TP5/SL1/09:25 최종 이유) 예측: full N=5,173, 4모델 전부 사전등록 바 통과 - entry logit AUC 0.601 CI[0.572,0.630] sd 0.594 / path30 logit 0.605 / GBM 0.578 — symbol-disjoint 0.575-0.594로 일반화 강건 - 핵심 해석: 방향성 알파 아님, '리스크(하방변동성) 예측'. 방향(P1b NO-GO)/선택(shuffle 무알파)은 여전히 음성 -> 1초봉=리스크 레이어 직접 증거 - GO: ① skip-gate 빌드 정당화(데이터레이어 §4 사전확률 상향). 단 '예측가능 != 수익' — 드리프트 트랩(SL 트레이드도 net 음수 아닐 수 있음) ①이 비용차감 baseline-relative로 직접 검정 필수 - positive control(심은신호 AUC0.92->PREDICTABLE)+negative control(노이즈->AT-CHANCE) 단위테스트 8 passed - 구현 stom_rl/sl_predictor.py(순수함수+DB추출기+CLI) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 직전 커밋(717942a) §3 표의 path30 AUC가 0.605/0.578로 잘못 기재됨(초안 추정치 잔존) - 실측(summary.json): entry logit 0.603/gbm 0.600, path30 logit 0.661/gbm 0.677; symbol-disjoint 0.607-0.669 - 정정된 핵심 해석: path30(0.66-0.68) > entry(0.60) — 첫 30초 경로가 진입시점보다 SL을 유의하게 더 예측 -> ④ 상태청산 사전확률 소폭 상향(단 평균회귀 반대 그대로) - 결론(GO, 리스크예측이지 알파 아님)·트랙(① 다음)은 불변 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 표본 100->2730 늘리자 avg +1.016% -> +0.165%/ep (84% 붕괴) - 전체: avg +0.165%, median -0.276%(음수), hit 31.4%, MDD -74.3%, passes_cost_gate False, beats_buy_and_hold False - buy-and-hold(+0.513%)의 ~1/3, contextual bandit(+0.125%)과 동급 -> 학습된 RL이 들고있기보다 못함 - 드라이버 검증: 첫 100ep가 eval100(+1.0161952713615299) 소수점까지 재현 -> 차이는 순전히 표본크기 - 일관 결론(shuffle/P1b/SL게이트와 정합): 이 데이터서 RL은 방향성 수익 못 냄. 모델 파일은 실재하나 검증된 수익모델 아님 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 이전 앵커 3종(0528 handoff/0529 commit/0529 progress)을 대체하는 최신 단일 앵커. - RL 트랙 전부 닫힘 정리: shuffle 무알파·R0/R1/R1b·P1b 타이밍 NO-GO·PPO 100k 전체 2730ep 재평가(소표본 +1.0% 환상 확정, buy-and-hold 미달). - RULE 갭상승 트랙 통과 정리: full universe·체결 de-idealization·유동성· 마켓에이블 +0.884%/trade·A~D 페이지. - 데이터레이어 평가(1초봉=비용/리스크 진실레이어) + 살아남은 4실험: ②용량 정직화(완료)·③SL예측 GO(완료)·①skip-gate(다음, 드리프트 트랩 가드)·④상태청산. - §5 ① skip-gate 설계 가드(사전등록), §6 재현(224 passed), §8 정직성 가드레일. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The repository has a large mixed worktree from June STOM dashboard, rule-filter, orderbook, and RL research work. This handoff records the current evidence, guardrails, dirty-worktree boundaries, and next commands so the next session can resume without staging generated artifacts or overstating model results. Constraint: Current trading evidence remains research-only and latest verdict is NO-GO_CONTROL at 23bp Constraint: ts_imb is a RULE baseline, not an RL model Rejected: Bulk commit all current changes | generated/session/cache and optional dist assets are still mixed into the worktree Confidence: high Scope-risk: narrow Directive: Read this handoff and .omo/evidence/commit-hygiene-jun1/commit-groups.md before staging source changes Tested: git diff --check -- docs/stom_opening_30m_rl_dashboard_handoff_2026-06-11.md; git diff --cached --check Not-tested: Full dashboard/test suite not rerun for this documentation-only commit
Author
|
Merge requested from local execution context. PR is clean ( Research boundary remains unchanged: |
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
Research honesty boundaries
ts_imbremains a RULE baseline, not reinforcement learningNO-GO_CONTROLVerification
py -3.11 -m pytest tests/test_stom_rl_dashboard_api.py tests/test_stom_rl_dashboard_tab.py tests/test_v2_route.py tests/test_v2_dist_marker.py -qpy -3.11 -m pytest tests/test_stom_rl_opening_rule_filter_policy.py tests/test_stom_rl_opening_rule_filter_cli.py tests/test_stom_rl_opening_rule_filter_gate.py tests/test_stom_rl_opening_rule_filter_ablations.py tests/test_stom_rl_opening_rule_filter_artifacts.py tests/test_stom_rl_opening_rule_filter_contract.py tests/test_stom_rl_opening_rule_filter_controls.py tests/test_stom_rl_opening_rule_filter_dataset.py tests/test_stom_rl_opening_candidate_ablation.py tests/test_stom_rl_opening_candidate_gate.py tests/test_stom_rl_opening_candidate_controls.py tests/test_stom_rl_opening_realdata_oos_split.py tests/test_stom_rl_orderbook_env.py tests/test_stom_rl_orderbook_sb3.py tests/test_stom_rl_orderbook_persistence.py -qcd webui/v2_src && npm run buildpy -3.11 -m pytest tests/test_v2_dist_marker.py tests/test_v2_route.py tests/test_stom_rl_dashboard_tab.py -q