feat(collection): wire KIS collection end-to-end, add price-history pipeline (WBS QE-M0/M1/M2)
Critical re-review of the QuantEngine WBS evidence system found several
regressions of the "no fake gates" discipline established by M0, plus a
still-unwired M1 collection path. This closes 10 more WBS tasks
(QE-M1-01..06, QE-M2-01/02/04/05/06 — see spec/60_quant_engine_wbs.yaml)
with real, gate-verified evidence (18/34 total).
M1 — real KIS data now lands in PostgreSQL end-to-end:
- SchedulerService: load ticker universe from GatherTradingData.json instead
of a hardcoded array; fix a Hangfire scoped-service resolution bug.
- KisDataCollectionOrchestrator: restore logging on the lineage-event write
path (was a bare `catch {}` swallowing all failures silently); persist
daily OHLCV bars into quantengine.price_history_daily per run.
- Verified live: POST /api/collection/run -> Hangfire -> orchestrator ->
KIS mock API -> PostgreSQL, with Playwright DOM/API parity evidence.
M2 — historical price-history pipeline:
- CollectionRepository: SavePriceHistoryDailyAsync (idempotent upsert),
GetPriceHistorySummaryAsync (per-ticker aggregation) + a new
DateOnlyTypeHandler registered globally, since Dapper has no built-in
System.DateOnly support in either direction (write threw
NotSupportedException, read threw a constructor-mismatch
InvalidOperationException — found by exercising both paths live).
- tools/validate_price_history_integrity_v1.py: gap-freeness (vs KIS
trading calendar) + price-sanity gate over collected history.
- Admin Collection page: new "히스토리 현황" summary table +
GET /api/collection/history-summary, with Playwright evidence.
Governance/gate fixes:
- validate_market_time_series_schema_v1.py mislabeled its own output
"runtime_database_query": "DATA_GATED" despite never opening a DB
connection (pure file/regex check) — relabeled "check_scope":
"STATIC_STRUCTURAL_ONLY" and wired the node into the release DAG so it
isn't only reachable from ci.yml, matching every other validator.
Live-data authority for the same claim stays with QE-M2-01's pg_query
gate (spec/60), documented in spec/64.
- Fixed a WBS log_pattern check (QE-M1-06) that couldn't match its own
multi-line target; loosened two depends_on edges (QE-M1-05/06,
QE-M2-04/05) that encoded "needs X verified" when the real requirement
was only "needs X's code merged."
- Discovered and fixed admin-pages.spec.ts logging in with the wrong
seeded password (admin/admin instead of admin/quant123!, per CLAUDE.md)
— every test in that suite had been silently failing at the login step.
Deferred: QE-M2-03 (2-year backfill) — the KIS mock/VTS token endpoint
started returning 403 after the first successful call this session; looks
like a token-issuance rate limit or credential issue on KIS's side, not a
code defect. Backfilling at scale right now would just generate more 403s,
so left QE-M2-03 PENDING pending KIS account/console verification.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2357,3 +2357,16 @@ python tools/validate_snapshot_admin_web_v1.py
|
||||
|
||||
완료 판정 원칙: 작업은 게이트 실행(PASS)으로만 `DONE` 이 될 수 있다.
|
||||
BE = PostgreSQL 쿼리 + Serilog 로그 패턴 + JSON 아티팩트, FE = Playwright(DOM assert + API 기대값 대조 + 스크린샷).
|
||||
|
||||
### 폐기: schemas/generated/ + src/quant_engine/models/generated/ (2026-07-12, QE-M0-07)
|
||||
|
||||
`schemas/generated/*.schema.json`(174) + `src/quant_engine/models/generated/*.py`(347)로
|
||||
구성된 스키마-모델 생성 레이어를 **폐기**했다. 기존 `runtime/python/core/formulas/generated/`
|
||||
(172개 stub)와 동일한 목적(공식 메타데이터 서술)을 범용 wrapper로 중복 구현했을 뿐 실질
|
||||
계산 로직이 전혀 없었고, 검증도 `validate_schema_model_generation_v1.py`가 파일 개수만
|
||||
세는 가짜 게이트였다(QUANT_ENGINE_WBS_V1 재검토에서 발견). CI 시간만 늘리고 기능적
|
||||
이득이 없어 삭제. `tools/generate_schema_model_generation_evidence_v1.py`,
|
||||
`tools/validate_schema_model_generation_v1.py`, `src/quant_engine/generate_models_from_schema.py`
|
||||
및 ci.yml/`spec/41_release_dag.yaml`의 관련 스텝·노드도 함께 제거했다.
|
||||
`schemas/generated/gas_adapter_contract.schema.json`은 별개 목적(GAS 어댑터 계약 검증,
|
||||
`validate_gas_adapter_contract_v1.py`)으로 쓰이므로 보존.
|
||||
|
||||
Reference in New Issue
Block a user