feat: 리밸런싱 엔진 V1 + GAS 버그 수정 (2026-06-13)
주요 변경: - tools/build_rebalance_engine_v1.py: REBALANCE_ENGINE_V1 신규 * account_snapshot 직접 합산(_build_snap_position_map) → 소수주 분리 행 병합 * 레짐 소스 macro.REGIME_PRELIM 최우선 (GAS 와 동일) - src/gas_adapter_parts/gdf_06_rebalance.gs: runRebalanceSheet_() 신규 * Logger.log / getSpreadsheet_() 로 run_all 연동 수정 - src/gas_adapter_parts/gdc_01_fetch_fundamentals.gs * _mergePositionRecord_(): 소수주 중복 행 합산 신규 * parseInt → parseFloat (qty, availQty) - src/gas_adapter_parts/gdf_01_price_metrics.gs * 미보유 종목 SELL_READY → WATCH_EXIT_SIGNAL - spec/41_release_dag.yaml: build_rebalance_sheet 노드 추가 (step_count 63) - spec/51_formula_lifecycle_registry.yaml: REBALANCE_ENGINE_V1 등록 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
# Core/Satellite Collector v4
|
||||
|
||||
은퇴자산용 코어/위성 후보 데이터 수집기입니다.
|
||||
|
||||
## v4 기본 정책
|
||||
|
||||
- 파라미터 없이 실행
|
||||
- 1차 유니버스: KOSPI 160개 + KOSDAQ 40개
|
||||
- 최종 후보: 100개
|
||||
- 최종 후보 내 KOSDAQ: 최대 20개
|
||||
- 1차 탐색 총량은 v3와 동일한 200개로 유지하여 호출 수 증가를 막습니다.
|
||||
|
||||
## 설치
|
||||
|
||||
```powershell
|
||||
npm install
|
||||
node core_satellite_collector.js
|
||||
```
|
||||
|
||||
OpenDART 공시까지 확인하려면:
|
||||
|
||||
```powershell
|
||||
$env:DART_API_KEY="발급받은키"
|
||||
node core_satellite_collector.js
|
||||
```
|
||||
|
||||
## 운영 표준
|
||||
|
||||
하네스/보고서/동기화까지 포함한 최종 게이트는 아래 순서를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run full-gate
|
||||
```
|
||||
|
||||
이 스크립트는 아래를 직렬로 수행합니다.
|
||||
|
||||
- `convert-data-json`
|
||||
- `validate-gas-call-arity`
|
||||
- `validate-proposal-reference`
|
||||
- `validate-harness-context`
|
||||
- `validate-operational-report-contract`
|
||||
- `audit-coverage`
|
||||
- `validate-harness-coverage-auditor`
|
||||
- `validate-strategy-tests-contract`
|
||||
- `validate-breakout-gate`
|
||||
- `validate-anti-whipsaw`
|
||||
- `validate-cash-raise-route`
|
||||
- `validate-brt-harness`
|
||||
- `validate-determinism`
|
||||
- `validate-alpha-execution-harness:strict`
|
||||
- `render-report-json`
|
||||
- `validate-report-json`
|
||||
- `validate-report-quality`
|
||||
- `validate-report-sync`
|
||||
|
||||
spec와 데이터 샘플 검증까지 포함한 전체 엄격 검증은 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run validate-engine-strict
|
||||
```
|
||||
|
||||
proposal 평가 이력까지 갱신하는 일일 실행은 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run daily-feedback-report
|
||||
```
|
||||
|
||||
백필 누적 원장(`backdata_feature_bank`) 상태를 즉시 검증하려면 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run validate-backdata-migration-state
|
||||
```
|
||||
|
||||
Outcome/Evaluation 복구 파이프라인(YOLO)을 한 번에 실행하려면 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run yolo-outcome-recovery
|
||||
```
|
||||
|
||||
GAS 함수 정의/호출 인자 수 불일치만 단독 점검하려면 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run validate-gas-call-arity
|
||||
```
|
||||
|
||||
사용자 판단용 제안표 하네스 출력이 실제로 존재하는지 점검하려면 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run validate-proposal-reference
|
||||
```
|
||||
|
||||
GAS `runHarnessRefresh_()` 반영 후에는 아래 강제 검증으로 올릴 수 있습니다.
|
||||
|
||||
```powershell
|
||||
npm run validate-proposal-reference:strict
|
||||
```
|
||||
|
||||
GAS 반영 후 `proposal_reference_json`까지 포함한 최종 엄격 게이트는 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run full-gate:proposal-strict
|
||||
```
|
||||
|
||||
spec/데이터 샘플까지 포함한 전체 엄격 검증은 아래를 사용합니다.
|
||||
|
||||
```powershell
|
||||
npm run validate-engine-proposal-strict
|
||||
```
|
||||
|
||||
## GAS 반영 체크리스트
|
||||
|
||||
`proposal_reference_json`을 실제 하네스 출력으로 승격하려면 아래 순서를 따릅니다.
|
||||
|
||||
1. Apps Script에 최신 [gas_harness_rows.gs](/C:/Temp/data_feed/gas_harness_rows.gs:73) 반영
|
||||
2. Apps Script에서 `runHarnessRefresh_()` 실행
|
||||
3. Google Sheets `harness_context` 시트에 아래 키 생성 확인
|
||||
- `proposal_reference_json`
|
||||
- `proposal_reference_lock`
|
||||
4. 로컬에서 `npm run convert-data-json` 실행
|
||||
5. `npm run validate-proposal-reference:strict` 실행
|
||||
6. `npm run full-gate:proposal-strict` 실행
|
||||
7. 최종 운영 전환 시 `npm run validate-engine-proposal-strict` 기준으로 사용
|
||||
|
||||
## 운영 리포트 계약
|
||||
|
||||
운영 리포트는 사람이 읽는 `Temp/operational_report.md`와 기계 검증용 `Temp/operational_report.json`을 함께 생성합니다.
|
||||
|
||||
- `operational_report.json`이 canonical 계약입니다.
|
||||
- `operational_report.md`는 표시용 렌더입니다.
|
||||
- JSON 스키마는 `schemas/operational_report.schema.json`을 사용합니다.
|
||||
- 계약 드리프트 검사는 `npm run validate-operational-report-contract`로 수행합니다.
|
||||
- 전체 게이트에는 `render-report-json -> validate-report-json -> validate-report-quality -> validate-report-sync` 순서가 포함됩니다.
|
||||
|
||||
전환 기준:
|
||||
- `validate-proposal-reference`가 `SKIP`이면 아직 GAS 산출물 미반영 상태
|
||||
- `validate-proposal-reference:strict`가 `PASS`여야 proposal 하네스 strict 전환 완료
|
||||
Reference in New Issue
Block a user