geostock-analyzer-docs

LAYER3 — Global Macro → US Equity Sector Analysis Engine

상태: zero-shot PoC (branch: feature/layer3-zero-shot, main 머지 보류) 버전: 0.1.0 (2026-05-01)

v2 아키텍처 문서(geopolitics_stock_analyzer_architecture_v2.md §3층) 구현.

역할

방식

LLM 중심 (현재 zero-shot, 향후 이벤트 카드 RAG 추가).

사용

from data_sources import fetch_realtime_data  # LAYER2
from layer2_engine import run_layer2          # LAYER2
from layer3_engine import run_layer3, format_output

realtime = fetch_realtime_data()
l2 = run_layer2(asof="2026-05-01", realtime=realtime)
l3 = run_layer3(l2)

print(format_output(l3))

또는 CLI 시연:

cd ~/Projects/claude/LAYER3
python3 layer3_engine.py

출력 예시 (2026-05-01 실데이터 기반)

asof: 2026-05-01  |  market_phase: 약세  |  model: claude-opus-4.5-cli
layer2 입력: slow=20, fast=24, anomalies=1, events=2

섹터                        영향         확신     단기         중기
──────────────────────────────────────────────────────────────────────
IT                        악재         중간     악재         중립
Health Care               중립         중간     호재         중립
Financials                악재         중간     악재         중립
Consumer Discretionary    강한 악재    높음     강한 악재    악재
Consumer Staples          호재         중간     호재         중립
Industrials               악재         중간     악재         중립
Energy                    강한 호재    높음     강한 호재    호재
Materials                 호재         중간     호재         중립
Utilities                 호재         중간     호재         중립
Real Estate               악재         높음     악재         악재
Communication Services    중립         낮음     악재         중립

자세한 sample: layer3_output_sample.json

폴더 구조

LAYER3/
├── README.md                    # 이 파일
├── layer3_engine.py             # 메인 엔진 (~250줄)
└── layer3_output_sample.json    # PoC 시연 결과 sample

의존성

검증된 분석 품질 (2026-05-01)

LLM이 LAYER2 변수를 직접 인용해 근거 생성:

변수 충돌 자동 인식 → confidence “낮음” 표기 (Communication Services 등)

branch 전용 사유

Next (zero-shot 안정 후)

변경 이력