Commit Graph

288 Commits

Author SHA1 Message Date
1f55d24ce6 docs(signal-v2): Phase 3b implementation plan — 7 tasks TDD
Task 1: foundation (config + state + requirements)
Task 2: kis_client.get_daily_ohlcv + 1 test
Task 3: momentum_classifier (pure functions) + 6 tests
Task 4: chronos_predictor + 4 tests (mock pipeline)
Task 5: pull_worker post-close cycle + scheduler trigger + 1 test
Task 6: main.py lifespan ChronosPredictor
Task 7: user manual (pip install + .env + smoke + push)

12 new tests, total 45 signal_v2 tests. ~1 week.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 17:42:17 +09:00
6eb4ab1204 docs(signal-v2): Phase 3b Chronos-2 + minute momentum spec
KIS daily OHLCV fetch (kis_client.get_daily_ohlcv, FHKST03010100) +
ChronosPredictor (HuggingFace amazon/chronos-2 zero-shot, env-configurable
model, always-loaded) + minute momentum classifier (5-level rule:
strong_up/weak_up/neutral/weak_down/strong_down) + post-close cycle
trigger (16:00 KST). 12 new tests (33 → 45 total).

brainstorming 7 decisions: daily=B(KIS REST) / freq=A(post-close 1x) /
model=A(env CHRONOS_MODEL) / momentum=A(5-level rule) / state=B(median+
q10+q90+conf+as_of) / test=A(mock+pure) / scope=integrated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 17:37:17 +09:00
78b77e2691 docs(signal-v2): Phase 3a implementation plan — 7 tasks TDD
Task 1: config + state + websockets dep
Task 2: scheduler NXT windows + 3 tests
Task 3: kis_client REST + 4 tests
Task 4: kis_websocket + 4 tests (most heavy)
Task 5: pull_worker minute cycle + 2 tests
Task 6: main.py KIS lifespan + 1 test
Task 7: user manual .env + smoke + push

13 new tests, total 32 signal_v2 tests. ~1 week.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 05:00:43 +09:00
1813db761f docs(signal-v2): Phase 3a KIS data collection spec
KIS REST client (minute OHLCV + asking price polling, V1 token
read-only share) + KIS WebSocket client (approval_key + portfolio
asking_price realtime subscribe) + PollState extension + scheduler
NXT windows (20:00-23:30 / 04:30-07:00). 13 new tests.

brainstorming 6 decisions: scope=B(3a/3b split) / data=B(REST minute +
WS asking) / auth=A(V1 token share) / subscribe=A(portfolio WS +
screener REST) / NXT=C(scheduler extend) / test=A(respx + WS mock).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 04:50:16 +09:00
01d9b2f872 docs(signal-v2): Phase 2 implementation plan — 6 tasks TDD
Task 1: foundation (config + state + gitignore + requirements)
Task 2: stock_client + 6 tests (httpx retry + cache)
Task 3: scheduler + 5 tests (market windows + holidays)
Task 4: rate_limit + 3 tests (SQLite WAL dedup)
Task 5: pull_worker + FastAPI app + 2 tests (lifespan + /health)
Task 6: holidays sync + start.bat + user .env + manual smoke

Total 16 tests. ~1 week.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 03:31:31 +09:00
b9dabd07e0 docs(signal-v2): Phase 2 web-ai pull worker spec
stock pull worker + asyncio scheduler + rate limit SQLite + FastAPI
app (:8001). 16 tests planned. brainstorming 6 decisions:
batch=A(separate FastAPI :8001) / scope=A(3 items) / scheduler=B(asyncio
cron) / http=B(httpx + custom retry + memory cache) / rate-limit=A(SQLite
WAL) / test=B(pytest-asyncio + httpx mock).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 03:14:45 +09:00
a8e411ec22 feat(insta): replace Blog Lab page with Insta cards UI
/blog-lab → /insta route. New InstaCards page consumes insta-lab API
(news/keywords/slates + 10-page card preview + prompt template editor).
25개 blog-marketing API helper 제거, 13개 insta helper 추가.
2026-05-16 02:47:19 +09:00
f261a80d52 docs(signal-v1): web-ai V1 rename plan — 13 step atomic refactor
Single big task (Task 1) for atomic mv + load_dotenv update +
new CLAUDE.md/start.bat + verification. Task 2 = user manual
push + 30-min runtime verification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 00:23:38 +09:00
42e9c8df27 docs(signal-v1): web-ai V1 → signal_v1/ rename spec
atomic refactor (single commit) of web-ai root V1 assets into
signal_v1/ subdirectory. V2 (signal_v2/) Phase 2 will be added
alongside in subsequent slice. Pattern mirrors stock-lab → stock
graduation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 00:19:00 +09:00
c84c6b5bac docs(signal-v2): Phase 1 implementation plan — 7 tasks TDD
7 tasks: auth.py + verify_webai_key (Task 1) → portfolio + pnl_pct
(Task 2) → news-sentiment (Task 3) → common edge cases (Task 4) →
docker-compose env (Task 5) → nginx config (Task 6) → deploy +
manual smoke (Task 7). 16 tests total (4 unit + 12 integration).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 08:30:53 +09:00
094366a162 docs(signal-v2): Phase 1 stock WebAI API spec
3 endpoints + X-WebAI-Key auth + nginx rate limit + 15 tests.
brainstorming 7 decisions: scope=B / auth=A(static key) / portfolio=B(pnl_pct) /
news-sentiment=A(daily dump) / endpoint=1(/api/webai prefix) / rate=B(nginx) /
test=B(pytest schema).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 08:24:37 +09:00
3bf7ce446f docs: rename stock-lab → stock in CLAUDE.md (graduation) 2026-05-15 01:49:16 +09:00
8391919b90 docs(stock): rename plan — stock-lab → stock (6 tasks atomic)
Task 1 grep 사전 검토 → Task 2 web-backend atomic commit
(git mv + docker-compose + agent-office + nginx + 운영 문서) → Task 3 web-ui
CLAUDE.md → Task 4 workspace/CLAUDE.md → Task 5 메모리 (4 파일 + graduation
사례) → Task 6 배포 + NAS 검증.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 01:37:32 +09:00
ed7e927dc1 docs(stock): rename stock-lab → stock graduation spec
lab 네이밍 정책 (feedback_lab_naming.md) 에 따라 정식 서비스 graduation.
디렉토리/컨테이너/환경변수 갱신, API URL/Python import/DB 파일명은 그대로.

Confidence Signal Pipeline V2 Phase 1 작업 시작 전 선행.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 01:34:45 +09:00
309bedadeb docs(signal-v2): amend Phase 0 — Chronos-2 + Qwen3 14B Q4 채택 (11 보정)
모델 결정 보정:
- 시점 예측: LSTM → Chronos-2 (Amazon, 120M, zero-shot quantile 분포)
- 2차 검증: Claude Haiku 4.5 (API) → Qwen3 14B Q4 (Ollama on web-ai)

영향:
- VRAM: ~9.3GB / 16GB (Chronos-2 1GB + Qwen3 8.3GB, 여유 6GB)
- LLM 비용: 월 ~₩45,000 (오류 추정) → 실제 0 (로컬 Ollama)
- 응답 시간: 5초 → ~13초 (분봉 흐름 OK)
- Phase 3 -1주 (LSTM 학습 인프라 제거), Phase 5 +0주
- 야간 재학습 cron 폐기 (Chronos-2 zero-shot)

Backlog 추가:
- Qwen3 14B 개발자 보조 endpoint (전략 해석 / 코드 자동화)
- Claude API 폴백 (web-ai 장애 시)
- Kimi K2.6 API 옵션 (저비용 외부 대안)

위험 매트릭스:
- Qwen3 한국어 메시지 품질 — Phase 5 A/B 테스트 1주 (vs Claude Haiku)
- VRAM 동거 swap 위험 — 8B 다운그레이드 fallback

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 01:21:24 +09:00
ebdfcd758b docs(signal-v2): Phase 0 architecture & contract spec
확신의 신호 파이프라인 V2. 4 서비스 분담:
- stock-lab: 가치 발굴 (8 노드 + ATR)
- web-ai (Windows GPU): 시점 분석 (LSTM + KIS 분봉/NXT + 분봉 모멘텀)
- agent-office: Claude 2차 검증 + 이중 텔레그램 (본인 풀 / 아내 간소화)
- web-ui: 캔버스 settings 편집

6 핵심 결정: pull 채널, KIS 직접, Claude context augmentation, 매수+매도,
양쪽 메시지 단일 콜 생성, 시간대별 폴링.

Phase 1-7 분해 (총 10-12주), backlog, 위험 매트릭스, NOT 범위 명시.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 00:56:01 +09:00
cefaeca449 docs(ai_news): Phase 1 implementation plan — articles source (8 tasks)
8-task TDD plan. schema(source 컬럼) → articles_source 모듈 + 6 tests
→ analyzer(summary) → pipeline 교체 → telegram 매핑 라인 → router →
scraper deprecate → 운영 검증. 신규 단위 테스트 6 + 갱신 4.

선행 spec: docs/superpowers/specs/2026-05-14-ai-news-articles-source-design.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 01:58:27 +09:00
cdfa31b0c1 docs(ai_news): Phase 1 design — articles table reuse (replace Naver scraper)
기존 articles 테이블 재사용 + 종목명 substring 매핑. Naver 차단/중복
인프라 해소, LLM 입력에 summary 포함. weight=0 유지 (검증 전 차단),
news_sentiment.source 컬럼 추가 (Phase 2 비교 baseline).

선행 review (adversarial)에서 가장 강한 비판: "이미 매일 수집 중인
articles 테이블을 무시하고 Naver를 100번 더 긁는 중복" → 해소.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 01:47:25 +09:00
ec3ca5fcfa feat(screener): canvas adds AI news node (12 nodes, 18 edges) 2026-05-13 23:51:09 +09:00
7ebeba2f3d docs(screener): AI news sentiment node implementation plan (15 tasks)
15-task TDD plan for 8th score node ai_news. backend (scraper + analyzer +
pipeline + telegram + node + router) + agent-office (service_proxy + cron
handler + scheduler) + frontend (canvasLayout 1 file). 단위 테스트 22개
(scraper 4, analyzer 4, pipeline 3, telegram 4, node 5, router 2).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 23:18:00 +09:00
5e66d96c61 docs(screener): AI news sentiment node design spec
8번째 점수 노드 ai_news 설계. 평일 08:00 KST agent-office cron 으로
시총 상위 100종목 네이버 뉴스 스크래핑 + Claude Haiku 호재/악재 분석,
news_sentiment 일별 저장, 호재/악재 Top 5 텔레그램 알림, 16:30
스크리너 잡이 percentile_rank 로 가중합에 활용.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 23:09:45 +09:00
fde63d757b docs(screener): note canvas mode in page structure 2026-05-13 21:57:10 +09:00
4b64761800 fix(screener): silence ESLint no-empty / no-undef in canvas helpers
빈 catch 블록 3곳에 의도 주석 추가, test-setup.js 의 beforeEach
명시적 import. 우리 신규 코드의 lint error 0으로 정리.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 21:56:42 +09:00
1449342f96 style(screener): canvas mode styles (toggle, nodes, toolbar, layout) 2026-05-13 21:55:10 +09:00
2effc47593 feat(screener): integrate mode toggle (form|canvas) with lazy canvas 2026-05-13 21:52:31 +09:00
f8574f1b45 feat(screener): CanvasLayout (canvas + result grid) 2026-05-13 21:51:16 +09:00
2da7255c03 feat(screener): ScreenerCanvas root component (react-flow + 11 nodes + 16 edges) 2026-05-13 21:49:19 +09:00
b4ad0b1abf feat(screener): CanvasToolbar floating panel 2026-05-13 21:47:52 +09:00
4e134eb59a feat(screener): ScoreNodeCard with weight slider + active toggle + params 2026-05-13 21:46:09 +09:00
b1a1bb22f9 feat(screener): GateNodeCard for hygiene gate 2026-05-13 21:43:39 +09:00
f10fa062e9 feat(screener): FixedNodeCard for data/combine/result nodes 2026-05-13 21:43:25 +09:00
40e3e2cf39 feat(screener): ModeToggle segment control component 2026-05-13 21:42:07 +09:00
1505518ca6 feat(screener): useCanvasLayout hook (node positions + reset) 2026-05-13 21:40:37 +09:00
2fd2ea33c7 feat(screener): useScreenerMode hook (form|canvas + localStorage) 2026-05-13 21:38:31 +09:00
c60c32b7f2 feat(screener): add canvas layout constants (11 nodes, 16 edges) 2026-05-13 21:35:27 +09:00
5f95f55271 chore(screener): add @xyflow/react + vitest test environment 2026-05-13 21:32:05 +09:00
d73ad9b851 docs(screener): node canvas mode implementation plan (15 tasks)
15-task TDD plan. 의존성 + 테스트 환경 셋업 → 상수/hooks/카드/캔버스 →
Screener.jsx 통합 → 수동 검증 + 배포. 단위 테스트 20개 (4 파일),
react-flow lazy import로 모바일 번들 보호.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 21:29:22 +09:00
fdf5ef6ce8 docs(screener): node canvas mode design spec
n8n 스타일 노드 캔버스 모드 설계 문서. 폼 모드와 토글로 전환,
같은 settings state 공유. 11 노드 + 16 엣지 고정 토폴로지, react-flow
기반 시각화. 백엔드 변경 없음.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 21:22:57 +09:00
ca248891c2 feat(stock): 스크리너 모바일 카드 레이아웃 + 비교 적용
데스크탑은 기존 테이블 유지, <768px에서는 종목별 카드로 전환:
- 카드 헤더: #순위 | 종목명+코드 | 총점
- 비교 모드 ON 시: 순위Δ/점수Δ 두 줄
- 노드 칩 (가로 wrap)
- 진입/손절/익절/위험 2×2 그리드 (라벨 + 원 단위)
- 빠진 종목(OUT)도 카드로 회색 표시

CSS: .screener-mobile-list / .screener-mcard / .screener-result-head /
.screener-warn 추가. useIsMobile 훅으로 분기.
2026-05-13 12:26:16 +09:00
55d2adeaf5 feat(stock): 미리보기 결과 세션 히스토리 + 결과 비교 컬럼
- useScreenerRun: 실행 시마다 previewHistory에 누적 (최대 10, 메모리만 —
  새로고침 시 사라짐, DB 부하 없음). top_ticker/score 요약 포함.
- RunHistoryList: '이번 세션 미리보기'와 '저장된 실행' 두 섹션으로 분리.
  미리보기 항목은 클릭으로 결과 표 로드 + '비교' 버튼으로 비교 대상 지정.
- ResultTable: compareWith prop으로 비교 모드. 순위Δ(▲▼NEW)·점수Δ
  컬럼 추가, 이번엔 빠진 종목은 'OUT'으로 별도 섹션에 회색 표시.
- 헤더에 'vs HH:MM:SS (통과 X)' 라벨로 비교 대상 명시.
2026-05-13 08:16:21 +09:00
6fd70dd802 feat(stock): 스크리너 노드/컬럼 hover 설명 추가
- ScoreChips: 아이콘 제거, 풀 라벨 표시 (외국인/거래량급증/20일모멘텀/
  52주신고가/RS레이팅/이평선정배열/VCP수축). title에 노드 의미 + 70점
  강조 안내.
- ResultTable: 각 컬럼 헤더에 ⓘ 마커 + 의미 hover 설명. 진입/손절/익절
  컬럼명에 '(원)' 명시. 상단에 hover 가이드 한 줄 추가.
2026-05-13 07:52:14 +09:00
9f4363cdbb fix(deploy): PowerShell single-quote literal로 path 전달
기존 replace(/\/g, "\\\\") + double-quote escape 패턴이 PowerShell
-Command 컨텍스트에서 한 번 더 escape돼 백슬래시가 두 개씩으로
부풀려져 Test-Path가 실패하던 케이스 fix. single-quote로 raw literal
전달 — env override(NAS_FRONTEND_DEST_WIN)가 의도대로 그대로 적용됨.
2026-05-13 07:31:48 +09:00
295972e0cb Merge feature/stock-screener-board: Stock Screener Board MVP (frontend)
- /stock/screener 라우트 + 페이지 골격 + hooks 4 + 컴포넌트 7
- NodeCard 자동 폼 (param_schema), ScoreChips (노드 70점 강조)
- 모바일 적층 + 표 가로 스크롤
- API 헬퍼 7개 + CLAUDE.md 갱신
- Stock 페이지 nav 링크
2026-05-13 07:23:17 +09:00
e6659a416a style(stock): 스크리너 모바일 적층 + 표 가로 스크롤 2026-05-12 14:23:16 +09:00
3abd46c0fd docs(stock): CLAUDE.md 스크리너 API 표 추가 + Stock 페이지 링크 2026-05-12 14:22:18 +09:00
c42d3fe8d4 feat(stock): ResultTable 본구현 + ScoreChips (노드 칩 + 70점 강조) 2026-05-12 14:21:05 +09:00
1e8542f6c7 feat(stock): GatePanel 자동 폼 + GlobalControls (TopN/ATR/RR + 3버튼) 2026-05-12 14:19:36 +09:00
a11475db57 feat(stock): NodeCard 자동 폼 (param_schema 기반) + NodePanel 통합 2026-05-12 14:18:22 +09:00
bc2c020f71 feat(stock): /stock/screener 페이지 골격 + hooks 4개 + 컴포넌트 stub 6개 2026-05-12 14:15:36 +09:00
cd6072727f feat(stock): /stock/screener 라우트 + 임시 placeholder 2026-05-12 14:13:26 +09:00