Releases: eddmpython/dartlab
Releases · eddmpython/dartlab
v0.9.11
Full Changelog: v0.9.10...v0.9.11
v0.9.10
AI 적극 개입 레이어 + 클린코드 + 블로그 경험 생태계
Added
- AI 적극 개입 레이어: CoT 4단계(추세→비율→근거→판단) + Direction/Magnitude/Confidence 구조화 판단. AI가 엔진 결과를 원본 재무제표로 직접 검증하고, 이상 시 override로 재계산
- analysis() overrides 전파:
c.analysis("가치평가", overrides={"wacc": 9.0}) - 블로그 경험 생태계: frontmatter
ai:블록 → KnowledgeDB(source="blog") 자동 파생
Changed
- 시스템 프롬프트 클린코드 (중복 50줄 제거)
- 엔진/review/AI 역할론 확립
Removed
- financials.py, assumptions.py (AI가 직접 하면 되는 보조 레이어)
v0.9.9
Added
- Pyodide 브라우저 실행:
micropip.install("dartlab")한 줄로 브라우저/xlwings lite/JupyterLite에서 dartlab 사용. Company → show → analysis → review 전체 경로 동작 - dFV (dartlab Fair Value): 4엔진 통합 적정주가 — DCF Anchor + 삼각검증 + Quality WACC
- AI Override: analysis calc 결과를 AI가 자체 판단으로 보정 — 4엔진 확산
- How축 상황별 개선 레버: 적자/턴어라운드/현금부자/사이클/고성장 5종 분기
- 추정재무제표 → DCF 연결: proforma FCF 우선 사용
- 블로그 8편: #21~#28 (현대모비스, SK텔레콤, GS건설, 현대코퍼레이션, 한전, 에코프로, 쿠팡, 현대자동차)
- 검색 scope 분리: title(ngram) + content(BM25) 독립 엔진
- EDGAR Phase 4: treasuryStockStatus XBRL fallback, 매일 2회 수집
Changed
- review reportType 단일축 통합: 11종 보고서 타입 (full/executive/credit/valuation/growth/crisis/audit/dividend/governance/macro/thesis)
- pyproject.toml 환경 마커: pyodide(emscripten)에서 native deps 자동 제외
Fixed
- review Section UnboundLocalError (pyodide 순환 참조)
- 메모리 최적화 (scan lazy, macro 방어, BoundedCache)
- 블로그 실측 수치 재검증 5건
v0.9.8
Added
- 매크로 역사적 팩트 엔진 (
core/finance/historicalContext.py): HY 스프레드 급등/YC 역전/실업률 반등/CPI 가속 시점별 침체 선행 통계, 호황 신호, 10개 역사적 시대 매칭, 현재와 유사한 과거 시기의 후속 위험 자동 추론 - 매크로 시나리오 시뮬레이션 110개 프리셋 (
macro/scenarios/): 역사적 재현 15 (1973 오일쇼크 ~ 2023 SVB), Fed DFAST 3단계, 유형별 × 심각도 24, 현대적 리스크 24 (AI 버블/중국 디플레/일본식 침체/대만 해협/무역전쟁/미국 국채), 구조적 20 (스태그플레이션/디플레이션/골디락스/경착륙/연착륙), 한국 특화 24 —dartlab.macro("시나리오", "2008 금융위기")호출로 baseline 대비 자동 비교 - 매크로 6막 인과 서사 구조: "경제는 어디에 있나 → 왜 여기에 있나 → 정책은 → 금융은 → 시장은 → 앞으로는" — FOMC/ECB/Bernanke/Dalio 학술 근거
- core SSOT 헬퍼 이동:
toDictBySnakeId,toDict,parseNumStr,sumBorrowingsKorean등 범용 재무 헬퍼를core/finance/helpers.py로 이동.memoized_calc를core/memory.py로 통합 - analysis 임계값 중앙 관리 (
analysis/financial/_constants.py): OCF/NI, 발생액, R², FX 민감도 등 6개 임계값 SSOT - core/finance/fmt.fmtBig 확장: 조/억/만 자동 단위 전환 + None 처리
Changed
- 엔진 책임 재정의 — 6레이어 구조 확립:
L0 core ← L1 providers/gather ← L1.5 scan ← L2 analysis/quant/credit/macro ← L3 review ← L4 ai+사람. L2 엔진 4개는 동등하고 상호 독립, review가 이야기꾼, AI/사람이 소비자 - 엔진 = 도구, review = 이야기꾼: L2 엔진은 dict/숫자만 반환. 해석 문장/Block/보고서 생성은 review(L3)의 책임
- macro 보고서 조립을 review로 이동:
macro/narrative.py,macro/mbuilders.py,macro/mcatalog.py,macro/report.py,macro/charts.py→review/macro/하위 패키지로 물리 이동 - quant 서사 함수 분리:
calcXxxNarrative6개를calcXxxData(숫자만)로 교체. 서사 생성은review/registry.py가 담당 - import 위반 26건 → 0건: L2↔L2 상호 import 0건, L2→L3 역방향 import 0건 달성 (CI 검증)
- macro API 통합:
macro.report(),macro.scenario()별도 메서드 제거 → 축 계약macro("시나리오", "2008 금융위기")로 통일 - SSOT 위반 정리: 숫자 파싱 5곳 중복,
_safe나눗셈 2곳 중복, 포맷 함수 3곳 중복,_memoized_calc중복 구현 → 전부 core SSOT 경유
Removed
macro/narrative.py,mbuilders.py,mcatalog.py,report.py,charts.py: review/macro/로 이동credit/publisher.py: deprecated, review.publisher가 단일 진입점analysis/financial/creditRating.py: deprecated stub,credit/calcs.py가 SSOT- quant의
calcTrendNarrative등 6개 함수:calcTrendData등으로 대체
Fixed
- macro
recessionDashboardhistoricalFacts필드 추가 — 규칙 기반 "resembles_2008" → 역사적 팩트 dict 기반 매칭 - analysis → quant/credit 교차 의존 제거 (valuation 내 quant 참조, creditRating의 credit 호출)
- credit 엔진의 analysis._helpers 의존 제거 → core 경유
- macro/__init__.py _AxisEntry에
act: int필드 추가 — 6막 메타데이터 선언적
v0.9.7
Added
- AIView 정량 데이터 보강:
autoEnrich()— calc 결과에 5년평균/YoY/백분위 자동 주입. AI가 "영업이익률 13%"만 보던 것에서 "전기비 +2.2pp, 5년평균 위 1.2pp" 맥락까지 이해 - Returns 독스트링 표준화: analysis 전 calc 함수에 numpydoc 표준 Returns (키:타입—설명(단위)) 적용. parseReturnsSchema() → autoEnrich 자동 연결
- 예측신호 고도화: 업종별 사전확률 41개 + 베이즈 연속 확률 + 매크로 민감도 매핑
- DART/EDGAR Company: notes 12항목 동기화, show/select 인터페이스 통합
Fixed
- predictionSignals: 패키지 설치 환경 경로 호환 (parents[4]→parents[2])
- standalone.py: deprecated
use_tools파라미터 제거
v0.9.6
Added
- Context Engineering + ACE Playbook:
ai/context/모듈 — intent 분류(8타입, 100% 정확도), TOON 인코딩(토큰 60% 절감), ACE(ICLR 2026) evolving playbook, analysis calc selector 8개, 인과 그래프 traversal. A/B 검증 +31.6% 응답 풍부도 - Causal Graph:
core/graph/— 6 노드 + 5 엣지 타입. Company × analysis calc → CompanyGraph. "왜" 질문 시 graph causes 자동 주입 - 5엔진 review 체계: quant 5 narration 블록(6막-3 시장분석) + macro 10 블록(6막-4 매크로)
- 관점별 템플릿: bottomUp/topDown/cashflow/stability/growth 5개 분석 관점
- macro narration: crisis/cycle/rates/sentiment/summary 블록 함수
- FinSLM 파이프라인 스크립트: extractTraining/extractGraph/formatDataset/evalBaseline/trainLoRA/deploy (인프라)
Fixed
- 이벤트성 계정 연간 합산 복원: Plan v4 "4분기 strict 합산"이 배당금/자사주 등 이벤트성 계정도 잘라버린 문제 근본 fix.
_EVENT_ACCOUNTS14개 계정은 있는 분기만 합산 - notes 외화 차입금 파싱: NAVER "합계 128,659조" → 1.7조 정상화. 외화 통화코드 필터(
_hasForeignCurrency) + 같은 항목명 반복 시 첫 번째 원화 값 우선 - notes 비금액 행 필터: "연이자율 33만" → 제거.
_isNonAmountRow로 이자율/기술/설명 행 제외 - DCF FCF 단위: "Y1 22만" → "Y1 22(조원)" 정상화
- 매출품질 총이익률 추세: 기간 라벨 없는 숫자 나열 제거 → 방향만 표시
- 지주사 영업이익률 100%+: "데이터 이상 가능" → "매출 대비 영업이익이 크다 (지주사 구조일 수 있음)"
- context 데이터 중복 조회 방지:
<context>태그에 이미 데이터 있으면 코드 재실행 안 함 - dependencies: openai/genai core에서 optional로 이동
- provider/CLI/viz 소소 개선
Changed
- ContextBuilder 기본 ON:
DARTLAB_CONTEXT_V2feature flag 제거. legacy 복원은DARTLAB_CONTEXT_V1=1 - 축수 자랑 표기 전면 제거: ops/코드에서 "14축/30축/7축" → 기능 설명으로 변경
- audit 체계 통합: 파편 audit 10개 삭제, review audit 1개로 통합 (ops/review.md)
- review audit Fix 원칙 명시: 근본 1곳만, 우회로/덕지덕지 금지
v0.9.5
Fixed
- ratio label dict 중복 key 정리 (F601) — 카테고리별 재정렬
- ruff lint 16건 (unused imports, f-string placeholder)
- qualityGate.py _HISTORY_PATH 새 위치 (
scripts/audit/) 반영
v0.9.3
Changed — Plan v10: 1.0.0 전 클린업 (BREAKING)
API contract 단일 진입점 원칙 강제 — 사용자 surface 를 c.show() / c.select() / c.sections / c.diff() / c.filings() / c.facts / c.review() / c.analysis() / c.credit() 만으로 단일화.
P0 — finance property 4종 제거:
c.IS / c.BS / c.CF / c.CIS(DART + EDGAR) →c.show("IS")/c.show("BS")/c.show("CF")/c.show("CIS")
P1 — ratios/SCE property 제거:
c.ratios / c.ratioSeries / c.SCE / c.sceMatrix→c.show("ratios")/c.show("ratioSeries")/c.show("SCE")/c.show("sceMatrix")
P2 — notes 12 sub-property 제거:
c.notes.inventory/borrowings/tangibleAsset/intangibleAsset/receivables/provisions/eps/segments/costByNature/lease/affiliates/investmentProperty→c.show("inventory")등 12 topic dispatch
P3 — 4 namespace 전면 제거:
c.docs / c.finance / c.report / c.profile(DART + EDGAR) public 접근 0- 사용자 surface 에서 namespace 4종 완전 제거
c.facts신설 (이전c.profile.facts)c.sections / c.diff() / c.trace() / c.filings()는 top-level 유지 (sections 사상 핵심)- 내부 compute (review/credit/valuation/analysis) 는
c._docs / _finance / _reportprivate 백엔드 사용 — 데이터 형식 차이 (RatioResult 객체 vs DataFrame) 로 show() 흡수 불가
P4 — Plan vN 마커 정리: Plan v3~v9 / R26 마커 38곳 수동 정리.
P5 — finance DataFrame 컬럼 단일화:
계정명컬럼 완전 제거 →항목단일화 (sections 사상 정합 —topic × period × 항목3차원)- 197 ref 마이그레이션, alias backward-compat 도 제거 (1.0.0 전 breaking 허용)
P6 — label SSOT 통합:
core/finance/labels.py::get_korean_labels()가 snakeId → 한국어 라벨 단일 진실의 원천AccountMapper.labelMap()은 한 줄 위임으로 축소 (이중 매핑 함수 통합)- L0 ← L1 import 방향 유지 (provider → core)
Migration
# Old # New
c.IS c.show("IS")
c.BS / c.CF / c.CIS c.show("BS") / c.show("CF") / c.show("CIS")
c.IS_annual c.show("IS", freq="Y")
c.timeseries() c.show("IS")
c.annual c.show("IS", freq="Y")
c.cumulative c.show("IS", freq="YTD")
c.ratios c.show("ratios")
c.ratioSeries c.show("ratioSeries")
c.SCE / c.sceMatrix c.show("SCE") / c.show("sceMatrix")
c.notes.inventory c.show("inventory")
c.notes.borrowings c.show("borrowings")
c.docs.sections c.sections
c.docs.diff() c.diff()
c.docs.filings() c.filings()
c.finance.ratios c.show("ratios")
c.report.dividend c.show("dividend")
c.report.majorHolder c.show("majorHolder")
c.profile.facts c.facts
c.profile.trace(topic) c.trace(topic)
c.profile.sections c.sections
df["계정명"] df["항목"]unit tests: 2065 → 2066 passed (Plan v10 전체).
Changed — 헬퍼 단일 진실의 원천 (SSOT) 통합
core/finance/flow.py::synthesizeAnnualFromQuarters신설 — 분기 → 연간 합성 SSOT.
toDict,toDictBySnakeId,_financeToDataFrame모두가 위임.core/finance/labels.py::mergeAliasRows신설 — SNAKEID_ALIASES 양방향 row 머지 SSOT.
pivot DataFrame 머지와 calc dict 머지 모두 단일 함수 호출.analysis/financial/_helpers.py의_synthesizeAnnualInPlace인라인 머지 로직 제거 → SSOT 위임.providers/dart/_finance_helpers.py::_financeToDataFrame의 인라인 머지 로직 제거 → SSOT 위임.- 결과: 이중/삼중 매핑 경로 정리, 규칙 변경 시 단일 파일만 수정.
Added — Plan v7 부채 청산 (5 commit, R0~R8)
- annual 컬럼 옵션화:
c.IS / c.BS / c.CF / c.CIS기본 분기만 노출.
연간 합성은toDictBySnakeId가 4분기에서 자동. - CF derived row 통합:
financing_cashflow↔cash_flows_from_financing_activities
같은 alias 쌍을 pivot 에서 한 row 로 머지 (SK하이닉스 2025 재무CF 결손 해결). - toDict → toDictBySnakeId 단일 경로 마이그레이션: 14 calc 파일 + credit/engine + review/narrative.
한국어 라벨도 키로 노출하여 양 provider 호환. - except narrow: 11 곳
except Exception:→ 구체적 예외로 좁힘. - F841 unused variable: 120 곳 자동 정리.
- dict literal
or 0: 결과 dict 노출 위치 None 보존 (scan/macroBeta, scan/network/export). - credit/metrics docstring:
_div,_cv,_isQuarterlyFallback9 섹션 보강.
v0.9.2
Added
channel 엔진 — 외부 공유 정식 엔진 (DevTunnels)
dartlab channel: 한 줄로 PC dartlab을 폰에서 사용. Microsoft DevTunnels 기반 (VS Code Remote Tunnels와 동일 인프라).- 자동화 파이프라인 7단계: winget 자동 설치 → GitHub OAuth → tunnel 생성 → anonymous access → port mapping → host 시작 → URL/QR 출력
- 영구 URL:
https://<id>-8400.<region>.devtunnels.ms— 재실행해도 동일 - 모바일 호환 검증: Android Chrome (2026-04-07)
- 메시징 봇 옵션:
--telegram/slack/discord(channel/adapters/) - ops/channel.md: 기술 스택, 자동화 파이프라인, 검증된 진단 사례 전부 문서화
Removed
- share 명령 → channel 통합:
dartlab sharedeprecated 별칭 제거 - Cloudflare Quick/Named Tunnel 백엔드 삭제: 모바일 fetch hang / 도메인 필수 사유. devtunnel만 정식
- ngrok / ssh / Tailscale 백엔드 삭제
server/security.py삭제: TokenManager/Whitelist/Ratelimit/AuditLog/AnomalyDetector. devtunnel은 미들웨어 비활성- UI 죽은 코드: ActivityBar, DebugOverlay, debug.js, token.js, SettingsPanel 채널 탭
Fixed
- 모바일 hydration 실패: lucide-svelte의 deprecated
<Settings>아이콘 →<Cog>일괄 교체. 진짜 원인이 8시간 추적 끝에 발견됨 (상세: ops/channel.md "검증된 진단 사례") - Svelte 5 버전:
vite-plugin-svelte 5.0 → 6.2.4+svelte 5.0 → 5.55.1 - Svelte 5 body event delegation: ProviderDropdown의
stopPropagation()제거,document.addEventListener직접 사용 - 모바일 반응형: EmptyState/ChatArea 풀너비, 우상단 검색 모바일에서 숨김, 하단 nav
position: fixed - 레거시 폴리필:
@vitejs/plugin-legacy도입 + es2020 target
v0.9.1
v0.9.1 — quant 29축 확장 + select 버그 수정 + EDGAR 컬럼 통일
Highlights
- quant 엔진 29축 7그룹 확장 — 기술적/리스크/미시구조/펀더멘털/텍스트공시/횡단면/포트폴리오. GARCH, HMM, HRP, ADF 전부 numpy 직접 구현.
- select 버그 4건 수정 (#14, #15, #16, #17) — cascade 재설계, 동의어 bridge, 컬럼명 통일, SegmentTable 중복컬럼 처리.
- EDGAR 컬럼명 DART 통일 — IS/BS/CF
"account"→"snakeId"+"계정명", ratios"category"→"분류".
Breaking Changes
- DART ratios:
"항목"→"계정명"(pl.col("항목") → pl.col("계정명")) - EDGAR IS/BS/CF:
"account"→"snakeId"+"계정명"컬럼 추가 - EDGAR ratios:
"category"→"분류","metric"→"계정명" - quant 호출 규약:
quant("축명", "종목코드")— 기존 방식 DeprecationWarning 후 자동 swap
Migration Guide
# ratios 컬럼명 변경
# Before
ratios.filter(pl.col("항목") == "ROE")
# After
ratios.filter(pl.col("계정명") == "ROE")
# EDGAR finance 컬럼명 변경
# Before
is_df.select("account")
# After
is_df.select("snakeId")
# quant 호출 규약 변경
# Before
dartlab.quant("005930", "indicators")
# After
dartlab.quant("indicators", "005930")전체 변경사항은 CHANGELOG.md 참조.