bf5897fc85
fix(insta-lab): trend_collector — Google Trends RSS + seed placeholder filter
...
(1) pytrends 4.x가 Google API 변경으로 trending_searches(pn='south_korea')
가 404 반환 → daily trending searches RSS endpoint를 requests로 직접 호출
하도록 교체. pytrends 의존성 제거.
(2) category_seeds 프롬프트 템플릿에 placeholder ('...', 'TBD' 등) 또는
2자 미만 값이 들어가면 NAVER가 400 Bad Request 반환 → _seeds_for에
_is_valid_seed 가드 추가, 모두 invalid면 DEFAULT_CATEGORY_SEEDS 폴백.
테스트 8/8 PASS (기존 6 + placeholder/fallback 2 신규).
2026-05-17 09:21:38 +09:00
ad6c744f2c
fix(deploy): increase docker/buildkit/pip timeouts for NAS slow build
...
webhook 자동 배포가 pip install (pytrends 추가 후 75s+)에서 buildkit
context deadline exceeded로 실패하던 이슈 대응. scripts/deploy.sh
상단에 COMPOSE_HTTP_TIMEOUT/DOCKER_CLIENT_TIMEOUT/BUILDKIT_STEP_LOG_MAX_SIZE
10분 환경변수 설정 + insta-lab Dockerfile의 pip install에 --timeout 600
--retries 5 추가. NAS Celeron J4025 환경 영구 대응.
2026-05-17 09:03:20 +09:00
aad9bfbe8b
Merge pull request 'feat/insta-trends' ( #4 ) from feat/insta-trends into main
...
Reviewed-on: #4
2026-05-17 08:52:49 +09:00
42bd53ee7b
feat(insta): _bg_extract uses preferences + 09:00 trends_collect cron
2026-05-16 17:58:52 +09:00
86694ae4fe
feat(agent-office): InstaAgent collect_trends action + preferences-aware on_schedule
2026-05-16 17:57:44 +09:00
41225b3337
feat(insta-lab): main.py — trends + preferences endpoints
...
- POST /api/insta/trends/collect — background trend collection via trend_collector.collect_all
- GET /api/insta/trends — list external trends with source/category/days filters
- GET /api/insta/preferences — return category weights (defaults seeded on init_db)
- PUT /api/insta/preferences — upsert category weights
- Modified GET /api/insta/keywords to accept source= filter (source present → list_trends, else existing list_trending_keywords, backward compatible)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-16 17:54:09 +09:00
6bb5c2fb40
feat(insta-lab): keyword_extractor.extract_with_weights for category proportions
2026-05-16 17:51:16 +09:00
bd1773e29e
feat(insta-lab): trend_collector adds Google Trends + LLM category classification
2026-05-16 17:48:26 +09:00
685320f3cf
feat(insta-lab): trend_collector with NAVER popular fetcher
2026-05-16 17:47:17 +09:00
b3982c8f72
feat(insta-lab): db migration — trending_keywords.source + account_preferences + CRUD
...
- Idempotent ALTER TABLE adds source column (default 'manual') + idx_tk_source index
- New account_preferences table seeded with economy/psychology/celebrity at weight=1.0
- add_trending_keyword now accepts optional source param
- New helpers: add_external_trend, list_trends, get_preferences, upsert_preferences
- test_db updated: six→seven tables; test_preferences_crud.py (7 new tests, all pass)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-16 17:44:01 +09:00
002c0893f8
chore(insta-lab): add pytrends>=4.9 dependency
2026-05-16 17:41:30 +09:00
d6081ba2d3
docs(insta-trends): implementation plan (10 TDD-grouped tasks)
...
trend_collector NAVER+Google+LLM 분류, db migration + preferences CRUD,
extract_with_weights, 4 endpoints + keywords source 필터, InstaAgent
collect_trends action + preferences-aware schedule, web-ui 탭 + 3 패널,
스모크 매트릭스.
2026-05-16 17:39:19 +09:00
10cb3ae1df
docs(insta-trends): 셀프 리뷰 보강 — LLM 분류 캐시 위치, days 쿼리 의미 명시
2026-05-16 17:31:22 +09:00
e3348da642
docs(insta-trends): 외부 트렌드 + 카테고리 가중치 설계
...
NAVER 인기 + Google Trends 두 source 수집, account_preferences로 카테고리
가중치 모델, 가중치 기반 키워드 추출 알고리즘, Insta 페이지 Cards/Trends
탭 분리.
2026-05-16 17:30:45 +09:00
088bbaa097
fix(deploy): use docker inspect for healthcheck (호스트/컨테이너 둘 다 동작)
...
기존 curl http://lotto:8000/health은 deployer 컨테이너 내부에서만
Docker DNS가 'lotto'를 해석. 호스트 셸에서 sudo bash로 직접 실행 시
DNS 해석 실패해 모든 서비스가 HEALTH_FAIL로 오판정. docker inspect로
이미 정의된 compose healthcheck 결과를 직접 조회하도록 변경. starting
상태는 최대 60초 대기 후 최종 판정.
2026-05-16 02:11:38 +09:00
be322557ee
fix(insta-lab): pin to bookworm + manual Chromium deps (drop --with-deps)
...
python:3.12-slim이 trixie(Debian 13)로 옮겨가면서 Playwright 1.48의
--with-deps가 ttf-ubuntu-font-family / ttf-unifont 등 ubuntu20.04
fallback 패키지를 시도하다 apt 실패 → Docker build exit 100.
해결: python:3.12-slim-bookworm 명시(Debian 12, Playwright 공식 지원)
+ Chromium 런타임 라이브러리 직접 apt 설치 + --with-deps 제거.
2026-05-16 01:58:53 +09:00
70438caa1f
fix(scripts): blog-lab → insta-lab in deploy/healthcheck service lists
...
배포 스크립트 hardcoded 서비스 리스트가 blog-lab을 참조해 머지 후
첫 webhook 배포가 rsync(/repo/blog-lab 없음) + docker compose
(서비스 미정의) 양쪽에서 실패. SERVICES/BUILD_TARGETS/HEALTH_ENDPOINTS/
DATA_DIRS를 insta-lab 기준으로 갱신. CONTAINER_NAMES는 blog-lab 고아
정리용으로 유지(다음번 docker rm -f가 안전 실행).
2026-05-16 01:51:45 +09:00
e16029ebdb
Merge pull request 'feat/insta-agent' ( #3 ) from feat/insta-agent into main
...
Reviewed-on: #3
2026-05-16 01:43:21 +09:00
cefc3119c0
docs(claude-md): replace blog-lab references with insta-lab
2026-05-16 00:53:58 +09:00
5485d4858a
chore: remove blog-lab service and BlogAgent (replaced by insta-lab)
2026-05-16 00:52:05 +09:00
fbd963db86
feat(agent-office): telegram render_<id> callback dispatches to InstaAgent
2026-05-16 00:49:30 +09:00
9095423026
feat(agent-office): register InstaAgent + 09:30 cron job
2026-05-16 00:47:28 +09:00
6eb24090ed
feat(agent-office): InstaAgent — daily extract + keyword push + media group render
2026-05-16 00:47:24 +09:00
8cb5a01431
feat(agent-office): replace blog_* proxy with insta_* helpers
2026-05-16 00:47:16 +09:00
8a4a8790ca
chore(agent-office): swap BLOG_LAB_URL for INSTA_LAB_URL
2026-05-16 00:47:12 +09:00
2200748122
chore(nginx): replace /api/blog-marketing with /api/insta
2026-05-16 00:40:41 +09:00
7bc0a7cd77
chore(compose): replace blog-lab service with insta-lab
2026-05-16 00:40:26 +09:00
b84efd730b
feat(insta-lab): main.py FastAPI endpoints + BackgroundTasks
...
13 REST endpoints covering health, status, news, keywords, slates,
tasks, and prompt templates. All background functions are async def
so FastAPI awaits them without asyncio.run conflicts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-16 00:38:34 +09:00
11bd223612
feat(insta-lab): card_renderer with Jinja + Playwright (1080x1350)
2026-05-16 00:35:55 +09:00
c3a5d7210f
feat(insta-lab): card_writer with Claude 10-page JSON generator
2026-05-16 00:31:34 +09:00
07c4459085
feat(insta-lab): keyword_extractor with frequency + Claude refinement
2026-05-16 00:30:38 +09:00
c057304981
feat(insta-lab): news_collector with NAVER news.json + dedupe
2026-05-16 00:27:13 +09:00
d1245d040c
feat(insta-lab): db.py with 6 tables + CRUD
2026-05-16 00:26:28 +09:00
34ca407ca2
feat(insta-lab): anchor templates/default/ directory with .gitkeep
2026-05-16 00:22:42 +09:00
b1ef778fc5
feat(insta-lab): project scaffold (Dockerfile, requirements, config)
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-16 00:20:49 +09:00
30706e2eb6
docs(insta-agent): add implementation plan (18 TDD tasks)
...
scaffold → db → news_collector → keyword_extractor → card_writer →
card_renderer → main.py FastAPI → docker-compose/nginx 교체 →
agent-office service_proxy/InstaAgent/registry/scheduler/webhook
콜백 → blog-lab 폐기 → CLAUDE.md → 스모크 테스트.
2026-05-15 08:58:15 +09:00
6062445c12
fix(stock-webai): final review notes — env default + 1-time auth error log
...
(1) docker-compose: ${WEBAI_API_KEY} → ${WEBAI_API_KEY:-} matches
project convention, avoids "variable not set" warning when NAS .env
lacks the key during initial deploy.
(2) auth.py: ERROR log when WEBAI_API_KEY env unset fires only on
first miss, then silent (module-level _WEBAI_AUTH_WARNED flag).
Flag resets when env becomes configured, so future regressions log
again. Eliminates log spam under web-ai polling (~3/min).
All 102 tests still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 08:56:03 +09:00
13da2226c3
feat(nginx-webai): /api/webai/ location with rate limit + X-WebAI-Key forward
...
limit_req_zone webai:5m rate=60r/m, burst=20 nodelay, return 429 on
limit hit. Proxies to stock:8000 with X-Real-IP, X-Forwarded-For,
and X-WebAI-Key headers preserved.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 08:48:14 +09:00
1e377e1559
chore(stock-webai): pass WEBAI_API_KEY env to stock container
...
Required by /api/webai/* endpoints. Operator must set WEBAI_API_KEY
in NAS /volume1/docker/webpage/.env before deploy.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 08:46:52 +09:00
eb75d692f5
test(stock-webai): edge cases — 401 no leak, 503 env missing, unknown date
...
Verifies auth failure responses contain no portfolio/sentiment data,
503 when WEBAI_API_KEY env unset (existing endpoints unaffected),
news-sentiment unknown date returns empty result.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 08:44:17 +09:00
6c25866487
docs(insta-agent): 셀프 리뷰 수정 — 6테이블 표기 일치, auto_select 설정 위치 명확화
2026-05-15 08:42:38 +09:00
6ac7469f26
docs(insta-agent): blog-lab 폐기 및 insta-lab 설계 (1080x1350 카드 피드)
...
뉴스 수집 → 키워드 추출 → 10페이지 카드 카피·PNG 생성 → 텔레그램 푸시 →
사용자 수동 인스타 업로드 파이프라인. blog-lab 디렉토리·DB 폐기, 포트
18700 재활용, agents/blog.py → agents/insta.py, Playwright 기반 카드 렌더.
2026-05-15 08:42:03 +09:00
d1b2b6a4ba
feat(stock-webai): /api/webai/news-sentiment daily dump
...
JOINs news_sentiment with krx_master for name fallback. Sorted by
score DESC. Date param defaults to latest. Empty table returns
{date: null, count: 0, items: []}. 4 integration tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 08:40:49 +09:00
2abfa5cb23
feat(stock-webai): /api/webai/portfolio + pnl_pct augment
...
Reuses get_portfolio() and adds pnl_pct (ratio, profit_rate/100) to
each holding plus total_pnl_pct to summary. 4 integration tests pass.
verify_webai_key dependency enforced.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 08:36:27 +09:00
227e294bd3
feat(stock-webai): add X-WebAI-Key auth dependency + tests
...
verify_webai_key FastAPI dependency: 401 on missing/wrong key,
503 when WEBAI_API_KEY env unset. 4 unit tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 08:33:07 +09:00
ace0339d33
refactor: rename stock-lab → stock (graduation)
...
- git mv stock-lab/ → stock/
- docker-compose.yml: 서비스 키 + container_name + build.context +
frontend.depends_on + agent-office STOCK_LAB_URL → STOCK_URL
- agent-office/app: config.py, service_proxy.py, agents/stock.py, tests/
STOCK_LAB_URL → STOCK_URL
- nginx/default.conf: proxy_pass http://stock-lab → http://stock (3 lines)
- CLAUDE.md / README.md / STATUS.md / scripts/ 문구 갱신
- stock/ 내부 자기 참조 갱신
lab 네이밍 정책 (feedback_lab_naming.md) graduation.
API URL / Python import / DB 파일명 변경 없음.
2026-05-15 01:45:44 +09:00
8812bd870a
docs(ai_news): mark scraper.py deprecated (Phase 1 transition)
2026-05-14 02:13:30 +09:00
b3fac4f442
feat(ai_news): router forwards mapping stats to telegram
2026-05-14 02:13:06 +09:00
19aed304cb
feat(ai_news): telegram includes article mapping stats line
2026-05-14 02:12:17 +09:00
bbe5221e57
feat(ai_news): pipeline uses articles_source (replaces Naver scraper)
2026-05-14 02:09:41 +09:00