You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
I Luk Kim e46395bfeb Backfill: renormalize 1,069 historical oracle-fallback rows
Apply libs.parser.event_type_normalizer (added in commit 722e5cf) to
existing events whose parser_version LIKE 'oracle-fallback%' so historical
rows match the forward-going normalization wired into the parser.

Implementation:
 - New renormalize_oracle_fallback_events() in apps/pipeline/event_parser/main.py
 - SELECT filter Event.parser_version.like("oracle-fallback%") — broader
   than a hardcoded IN list, so already-aligned values skip naturally and
   future additions to _ORACLE_TO_STRATEGY get picked up automatically
 - New --renormalize-oracle-fallback CLI flag, chainable with --reparse
 - JobRun row written (job_name=event_parser_renormalize_oracle)
 - Per-row renormalize_event_updated INFO log + final renormalize_done
   summary with transition counters

Live DB run: seen=2937 / updated=1069 / skipped=1868 / errors=0.
Wall ~2 sec (pure DB UPDATEs, no Oracle calls).
Transitions:
  earnings_result          -> earnings_release        : 412
  shareholder_vote         -> other_material_event    : 409
  regulation_fd            -> guidance_update         : 237
  acquisition_disposition  -> other_material_event    :   7
  other                    -> other_material_event    :   4

Unmapped Oracle values (financial_obligation 225, articles_amendment 81,
contract_termination 48, etc.) preserved verbatim — honest filter-drop.

Stale-by-design (mirrors existing reparse_events convention):
 - Event.event_id PK still embeds old raw event_type substring
 - EventParse.output_json["event_type"] still carries raw Oracle value
Strategies read Event.event_type, not those fields. Avoids cascading
PK rewrites across event_parses/feature_snapshots/event_labels tables.

Integration test: tests/integration/test_renormalize_oracle_fallback.py
inserts 4 fixtures, drives _apply_oracle_renormalization() against the
rolled-back db_session, asserts updated/skipped/error counts and final
row state.

Snapshot rebuild not run — nightly auto-rebuild picks up normalized
values incrementally.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3 months ago
..
backtest Add ownership/risk-off sleeves, v17-v19 experiments, and web app restructure 4 months ago
__init__.py feat: implement ACE-F v1 Phase 1 -- Stock Oracle 기반 이벤트 파이프라인 5 months ago
conftest.py test: Phase 1/2 체크리스트 재작성 및 Oracle 실연동 통합 테스트 5 months ago
test_db_migration.py test: Phase 1/2 체크리스트 재작성 및 Oracle 실연동 통합 테스트 5 months ago
test_feature_pipeline.py Update tests for pipeline, backtest engine, paper trader, and new modules 5 months ago
test_filing_pipeline.py fix: use TEST-prefixed IDs in integration tests to avoid real-data conflicts 5 months ago
test_label_pipeline.py feat: PEAD mid-cap strategy + pipeline hardening + README cleanup 5 months ago
test_renormalize_oracle_fallback.py Backfill: renormalize 1,069 historical oracle-fallback rows 3 months ago
test_review_queue_integration.py feat: implement Phase 3 -- LLM enrichment, labeler, review queue, dataset export 5 months ago
test_sync_jobs.py test: Phase 1/2 체크리스트 재작성 및 Oracle 실연동 통합 테스트 5 months ago