You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,54 +22,75 @@ This project builds that infrastructure layer — so that researchers, journalis
22
22
23
23
## Current State / 현재 상태
24
24
25
-
**Milestone 1 complete. Milestones 2–4 data extraction complete — all four milestones runnable.**
25
+
**Milestones 1–4 complete. All four analysis milestones runnable. FastAPI web/API layer and MCP server added.**
26
26
27
-
**마일스톤 1 완료. 마일스톤 2–4 데이터 수집 완료 — 4개 마일스톤 모두 실행 가능.**
27
+
**마일스톤 1–4 완료. 4개 마일스톤 모두 실행 가능. FastAPI 웹/API 레이어 및 MCP 서버 추가.**
28
28
29
29
| Output | Location | EN | 한국어 |
30
30
|---|---|---|---|
31
31
|`beneish_scores.csv`|`03_Analysis/`| Ranked anomaly table with DART links — main deliverable | DART 링크 포함 이상 징후 순위표 — 주요 산출물 |
32
-
|`beneish_scores.parquet`|`01_Data/processed/`| All 8 M-Score components, sector percentiles, CFS/OFS provenance | M-Score 8개 구성 요소, 섹터 백분위, CFS/OFS 출처 |
33
-
|`company_financials.parquet`|`01_Data/processed/`|5-year financials, all KOSDAQ companies |5개년 재무제표, 코스닥 전 상장사 |
34
-
|`cb_bw_events.parquet`|`01_Data/processed/`| CB/BW issuance events from DART DS005 | CB/BW 발행 이벤트, DART DS005|
32
+
|`beneish_scores.parquet`|`01_Data/processed/`| All 8 M-Score components, 2018–2023, sector percentiles, CFS/OFS provenance | M-Score 8개 구성 요소, 2018–2023, 섹터 백분위, CFS/OFS 출처 |
33
+
|`company_financials.parquet`|`01_Data/processed/`|2017–2023 financials, all KOSDAQ companies |2017–2023 재무제표, 코스닥 전 상장사 |
34
+
|`cb_bw_events.parquet`|`01_Data/processed/`| CB/BW issuance events — 11 cols including issue_amount, refixing_floor, maturity_date, board_date, warrant_separable | CB/BW 발행 이벤트 — 발행금액·리픽싱하한·만기일·이사회일·분리형 여부 포함 11개 컬럼|
35
35
|`price_volume.parquet`|`01_Data/processed/`| OHLCV price/volume windows around CB/BW events | CB/BW 이벤트 전후 OHLCV 주가/거래량 |
|`officer_holdings.parquet`|`01_Data/processed/`| Officer holding changes | 임원 보유 주식 변동 |
38
-
|`disclosures.parquet`|`01_Data/processed/`| DART filing listings for timing analysis | DART 공시 목록 — 공시 시점 분석용|
38
+
|`disclosures.parquet`|`01_Data/processed/`|271,504 DART filings across 921 corps — wired into pipeline automatically | DART 공시 목록 271,504건, 921개사 — 파이프라인에 자동 연결|
39
39
|`major_holders.parquet`|`01_Data/processed/`| 5%+ ownership threshold filings from DART majorstock.json | 대량보유상황보고서 — 5% 이상 지분 신고 이력 |
40
40
|`bondholder_register.parquet`|`01_Data/processed/`| CB bondholder names and face values from 사채권자명부 sub-documents | CB 사채권자명부 — 권리자명·채권금액 |
41
41
|`revenue_schedule.parquet`|`01_Data/processed/`| Revenue by customer/segment from 매출명세서 in 사업보고서 | 매출명세서 — 고객·품목별 매출 |
42
+
|`bond_isin_map.parquet`|`01_Data/processed/`| 1,859 CB/BW ISINs mapped to 656 corp_codes via FSC API | FSC API로 수집한 CB/BW ISIN 1,859건 — 656개사 연결 |
42
43
|`dart_xbrl_crosswalk.csv`|`tests/fixtures/`| XBRL element → variable mapping; audit trail | XBRL 요소 → 재무 변수 매핑; 감사 추적 |
43
44
|[`beneish_viz.html` ↗](https://raw.githack.com/pon00050/kr-forensic-finance/master/03_Analysis/beneish_viz.html)|`03_Analysis/`| Self-contained visual summary of Phase 1 results (5 Plotly charts) | Phase 1 결과 시각적 요약 — 5개 Plotly 차트, 단독 실행 가능 HTML |
44
45
|`<corp_code>_report.html`|`03_Analysis/reports/`| Per-company forensic HTML report (all 4 milestones + AI synthesis) | 기업별 포렌식 HTML 보고서 |
45
46
46
47
**Visual summary (no Python required):**[beneish_viz.html — Phase 1 결과 보기](https://raw.githack.com/pon00050/kr-forensic-finance/master/03_Analysis/beneish_viz.html) — interactive Plotly charts, no Python required. / Python 없이 바로 보기.
47
48
48
-
**All four milestones are runnable now.** Run `extract_disclosures.py` first to populate `disclosures.parquet` for Milestone 3.
49
-
50
-
**4개 마일스톤 모두 실행 가능.** 마일스톤 3용 `disclosures.parquet`는 `extract_disclosures.py`로 추출.
@@ -122,6 +142,47 @@ All data is publicly available and free. 사용된 데이터는 모두 무료로
122
142
123
143
See also: [CONTRIBUTING.md](CONTRIBUTING.md) · [ROADMAP.md](ROADMAP.md)
124
144
145
+
### Web API + MCP Server
146
+
147
+
`krff serve` starts a FastAPI application at `http://localhost:8000` that exposes both a REST API and an MCP (Model Context Protocol) server — a standard interface that lets Claude and other AI clients call tools directly against live pipeline data.
148
+
149
+
**REST API (`http://localhost:8000`):**
150
+
151
+
| Endpoint | Description |
152
+
|---|---|
153
+
|`GET /api/status`| Artifact inventory (same as `krff status`) |
154
+
|`GET /api/quality`| Data quality metrics |
155
+
|`GET /api/companies/{corp_code}/summary`| All signals for one company |
156
+
|`GET /api/companies/{corp_code}/report`| Trigger per-company HTML report generation |
157
+
|`GET /api/alerts`| Recent anomaly alerts |
158
+
|`GET /api/monitor/status`| Monitor pipeline health |
159
+
160
+
Swagger UI at `/docs`. Web routes at `/`, `/demo`, `/about`, `/datasets`, `/contact`, `/privacy`, `/terms`.
161
+
162
+
**MCP Server (`http://localhost:8000/mcp/`):**
163
+
164
+
10 tools are available to any MCP-compatible client (Claude Code, Claude Desktop, etc.):
165
+
166
+
| Tool | Description |
167
+
|---|---|
168
+
|`lookup_corp_code`| Name or ticker → corp_code. **Call this first** — all other tools require corp_code. |
169
+
|`get_company_summary`| All signals for one company in one call |
170
+
|`get_beneish_scores`| M-Score history with all 8 components (2018–2023) |
171
+
|`get_cb_bw_events`| CB/BW events with manipulation flag counts |
172
+
|`get_price_volume`| OHLCV for a date range (paginated) |
173
+
|`get_officer_holdings`| Officer holding changes from DART |
174
+
|`get_timing_anomalies`| Disclosure timing vs. price/volume anomalies |
krff report 01051092 --skip-claude # skip AI synthesis (no API key needed)
335
+
krff batch_report # generate reports for all flagged companies
256
336
```
257
337
258
338
Reports are self-contained HTML files. Run pipeline and analysis scripts first, then generate:
@@ -268,11 +348,10 @@ krff report <corp_code>
268
348
269
349
Set `ANTHROPIC_API_KEY` in `.env` to enable the AI synthesis section (claude-sonnet-4-6).
270
350
271
-
**Data coverage:** Reports reflect 2019–2023 data. Re-run the pipeline to update.
351
+
**Data coverage:** Reports reflect 2017–2023 data. Re-run the pipeline to update.
272
352
273
353
### Further Reading
274
354
275
355
Architecture notes, API research findings, and methodology documentation are maintained locally in `00_Reference/` (not committed to the public repository). Clone the repo and run the pipeline — the code is self-documenting.
276
356
277
357
S3-compatible cloud storage is optional — all scripts fall back to local files.
0 commit comments