a4614ebeae
feat(weight-evolver): lotto.db에 weight_trials/auto_picks/weight_base_history + CRUD
2026-05-22 03:03:51 +09:00
875e750f77
feat(weight-evolver): 순수 함수 (clamp/perturb/Dirichlet/score/base-rule)
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-22 02:59:38 +09:00
9cb40fb4e5
test(weight-evolver): 순수 함수 + base update rule 단위 테스트
2026-05-22 02:56:06 +09:00
383f48c71e
feat(stock): GET /api/stock/holidays endpoint (SP-10 task-watcher용)
...
holidays.json(list) 노출. task-watcher가 휴장일 판정에 조회.
인증 불필요. 주말은 task-watcher가 weekday로 별도 판정.
Plan-B-Infra Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 01:40:44 +09:00
6be74737c2
docs(plan): Lotto Weight Evolver 구현 plan (13 tasks, Phase 1-4 + 배포)
...
Why: spec (2026-05-22-lotto-weight-evolver-design.md)을 13개 atomic
task로 분해. TDD red→green→commit 패턴. analyzer.score_combination
기존 fixed 가중치 보존+동적 W 옵션 추가. v1 시그널 자동 cascade.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 01:38:23 +09:00
3106716e70
docs(plan): Plan-B-Infra — NSSM 자동 시작(SP-9) + task-watcher(SP-10)
...
SP-9 NSSM 안내(ai_trade HIGH + wsl_docker NORMAL) + SP-10 task-watcher
WSL2 컨테이너(시간대 큐 토글). 박재오 결정: idle 감지 생략 — 시간대만.
8 task: NAS holidays endpoint(1) → task-watcher mode/watcher/main/compose(2-5)
→ NSSM 안내 문서(6) → 박재오 빌드+검증(7) → 메모리(8).
spec 정정: signal_v2→ai_trade, Ubuntu-22.04→24.04, web-ai-services→web-ai/services.
완료 시 spec 12 SP 전부 완료.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 01:37:36 +09:00
a126155948
docs(spec): Lotto Weight Evolver — 자율 학습 루프 설계 (v2)
...
Why: v1 능동 모니터링 위에 매주 6가지 가중치 시도+토요일 회고+
winner 기반 base 갱신 루프를 lotto-lab에 추가. 5종 시뮬 점수
가중치를 사람 없이 자가 학습.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-22 01:12:12 +09:00
f509339cbb
fix(lotto-signals): draw_no 모든 source에 전달 (drift baseline 회차 가드 활성화)
...
light/sim source에서도 current_draw_no를 항상 fetch해 drift/confidence
메트릭의 회차 단위 중복 push 가드가 올바르게 동작하도록 수정.
lotto_latest_draw() 헬퍼를 service_proxy에 추가하고 run_signal_check에서
source에 무관하게 최신 회차를 먼저 조회; deep_check는 curate_weekly
반환값을 우선 사용.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 08:24:02 +09:00
e72a52a950
feat(lotto): /api/lotto/best에 5종 점수 array 노출 (agent-office sim_consensus 입력)
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 08:21:48 +09:00
eecaefc26d
docs(CLAUDE): agent-office 로또 능동 시그널 API/스케줄러/env 추가
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 03:21:51 +09:00
b3c0683364
feat(lotto-signals): GET signals/baselines + POST signal-check endpoint
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 03:20:08 +09:00
17321d948e
feat(lotto-signals): urgent 텔레그램 발송 + throttle/cap + daily digest 발송 + baseline_mu/sigma 노출
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 03:13:29 +09:00
8552cbc184
feat(lotto-signals): 텔레그램 urgent/digest 메시지 포맷
2026-05-20 03:07:30 +09:00
b1c786e59d
feat(lotto-signals): scheduler cron 4종 등록 (light/sim/deep/digest)
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 03:04:14 +09:00
b885d02ac4
fix(tests): test_lotto_signal_runner DB_PATH 패치 (import order 안전)
...
db.DB_PATH = _TMP를 from app import db 직후에 주입해
타 테스트 파일이 app.db를 먼저 import해 DB_PATH가 동결된 경우에도
올바른 임시 경로를 사용하도록 수정.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 03:02:40 +09:00
b35fab777e
feat(lotto-signals): LottoAgent.run_signal_check/run_daily_digest (텔레그램 X)
...
Phase 2: on_command에 signal_check/light_check/sim_check/deep_check/daily_digest 액션 추가.
run_signal_check는 lotto_signals DB INSERT만, run_daily_digest는 24h 발화 카운트 반환.
텔레그램 발송은 Task 9 (Phase 3)에서 추가 예정.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 02:54:09 +09:00
43081bea0e
feat(lotto-signals): config env vars 7종 추가 (window/임계치/digest/throttle)
2026-05-20 02:51:28 +09:00
bebe5797e7
feat(lotto-signals): signal_runner orchestrator + service_proxy GET helpers
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 02:48:12 +09:00
9e1001b935
feat(lotto-signals): lotto_signals/lotto_baselines 테이블 + CRUD
...
agent-office DB에 lotto_signals, lotto_baselines 테이블 추가 및
insert/mark/query/upsert CRUD 헬퍼 함수 구현 (throttle, z-score, baseline 관리)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 02:43:27 +09:00
e5465ad136
fix(lotto-signals): pstdev→stdev (ddof=1 sample) + z=None contract 문서화
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 02:41:09 +09:00
21d46d95dd
feat(lotto-signals): 메트릭 함수·adaptive baseline 순수함수 구현
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 02:38:33 +09:00
ac4a574ef2
test(lotto-signals): floating-point 임계치 보정 + import 정리 + decide_fire 분리
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 02:36:32 +09:00
c985d2c605
test(lotto-signals): 메트릭 함수·adaptive baseline 단위 테스트
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-20 02:32:10 +09:00
b4e873b5b0
docs(plan): LottoAgent 능동성 확장 구현 plan (12 tasks, Phase 1-3)
...
Why: spec (2026-05-20-lotto-active-agent-design.md)을 12개 atomic task
(TDD: 테스트→fail→구현→pass→commit)로 분해. 24h 가동 검증 task 포함.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-20 02:26:49 +09:00
6c5e93f64e
docs(spec): LottoAgent 능동성 확장 설계 (능동 시그널·일일 요약)
...
Why: 매주 1회 무조건 큐레이션만 있는 현 구조를 다중 트리거+적응형
시그널 모니터링으로 확장. 좋은 수치(z≥1.5) 일 때만 텔레그램 보고.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-20 02:07:39 +09:00
6b7eb5a9c1
fix(deploy): register video-lab in deploy scripts (5 locations)
...
Plan-B-Video T6 가 docker-compose + nginx 만 등재했고 scripts/* 누락 →
deploy-nas.sh rsync가 video-lab/을 sync 안 함 →
NAS target 빈 context → docker buildkit "transferring dockerfile: 2B" →
"failed to read dockerfile: no such file or directory"
Fix:
- deploy-nas.sh SERVICES: + video-lab (rsync 대상)
- deploy.sh BUILD_TARGETS: + video-lab (docker compose build/up)
- deploy.sh CONTAINER_NAMES: + video-lab (orphan cleanup)
- deploy.sh HEALTH_ENDPOINTS: + video-lab (post-deploy health wait)
- deploy.sh DATA_DIRS: + video (단수형, /data/video volume mount)
memory feedback_nas_deploy_paths.md "depends_on 9개 lab 등재 완료" 패턴
정확히 이 케이스 경고했으나 plan T6에서 적용 누락. 메모리 → 10개 lab 갱신 예정.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:59:51 +09:00
4b28ef3afa
feat(nginx): /api/internal/video/ 3-layer 차단 (SP-8)
...
LAN(192.168.45.0/24) + Tailscale(100.64.0.0/10) + 127.0.0.1 allow.
deny all. X-Internal-Key forward → video-lab:8000.
insta/music 블록과 동일 패턴.
Plan-B-Video Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:33:37 +09:00
211aff1e45
docs(plan): Plan-B-Video port 18800 → 18801 (realestate-lab 충돌)
...
T6 implementer가 발견: realestate-lab이 이미 18800 점유.
video-lab 포트를 18801로 정정. plan 18 occurrence 일괄 변경.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:32:56 +09:00
37ca8e594e
feat(video-lab): docker-compose entry + nginx routing (SP-8)
...
video-lab service: port 18801, REDIS_URL/INTERNAL_API_KEY env,
depends_on redis, /app/data volume mount.
nginx: /api/video/ proxy + /media/video/ direct serve alias.
frontend depends_on + volume mount 추가.
Plan-B-Video Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:31:37 +09:00
c9a094969d
feat(video-lab): main.py — FastAPI + redis client + 2 endpoint (SP-8)
...
POST /api/video/generate (provider validation + Redis push + task_id 반환).
GET /api/video/tasks/{id} (DB 조회).
GET /api/video/providers (4 provider 메타).
SUPPORTED_PROVIDERS = sora/veo/kling/seedance.
Plan-B-Video Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:30:21 +09:00
e8dbf8092a
feat(video-lab): /api/internal/video/update endpoint + tests (SP-8)
...
UpdatePayload schema (task_id/status/progress/message/video_url/error).
404 if task not found. insta/music-lab과 동일 패턴 + video_url 필드.
Plan-B-Video Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:29:05 +09:00
21cf0114f4
feat(video-lab): verify_internal_key + tests (SP-8)
...
X-Internal-Key 검증 dependency. insta-lab/music-lab 동일 패턴.
Plan-B-Video Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:27:38 +09:00
20f83cee33
feat(video-lab): app/db.py — video_tasks 테이블 + CRUD (SP-8)
...
WAL + busy_timeout 표준 fix. create_task / update_task / get_task.
provider 컬럼 추가(Sora/Veo/Kling/Seedance 구분). video_url 필드.
Plan-B-Video Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:26:19 +09:00
1e77123394
feat(video-lab): Dockerfile + requirements + app package skeleton (SP-8)
...
NAS video-lab 신설. python:3.12-alpine 기반. redis>=5.0 의존성.
영상 외부 호출 없음(gateway만) — 외부 API 의존 없음.
Plan-B-Video Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:24:50 +09:00
fbd8d26ec6
docs(plan): Plan-B-Video — video-lab 신설 + 4 provider Windows worker
...
SP-7 + SP-8 — 4 video provider (Sora 2, Veo 3.1, Kling via PiAPI, Seedance 2.0)
Windows video-render로 분산. NAS video-lab 신설 (port 18800).
spec §10 SP-7 갱신: 6 provider(Runway/Pika/Luma 포함) → 4 provider 축소
(박재오 2026-05-19 결정 — 실사용 provider만).
17 task: NAS video-lab 신설(1~6) → nginx 차단(7) → Windows video-render(8~14)
→ NAS push + 박재오 빌드(15) → Kling end-to-end(16) → 메모리 기록(17).
부록: 4 provider API 키 발급 가이드 (Sora/Veo/Kling/Seedance).
Plan-B-Music 3가지 함정 (WSL2 mirror + Redis chown + .env NAS_BASE_URL) 모두 사전 인지.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 08:22:20 +09:00
6f505b8cb1
feat(nginx): /api/internal/music/ 3-layer 차단 (SP-6)
...
LAN(192.168.45.0/24) + Tailscale(100.64.0.0/10) + 127.0.0.1 allow.
deny all. X-Internal-Key forward → music-lab:8000.
insta 블록과 동일 패턴.
Plan-B-Music Phase 4.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 05:24:41 +09:00
e1722e3963
refactor(music-lab): suno_provider/local_provider → stub (SP-6)
...
기존 13+1 외부 API 호출 함수는 web-ai/services/music-render/providers로 이식.
NAS는 SUNO_MODELS (정적 데이터)만 잔존. SUNO_API_KEY = "" sentinel.
Plan-B-Music Phase 3 (cutover 4/4).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 05:22:05 +09:00
b1e28aa725
refactor(music-lab): batch_generator _generate_one_track → Redis push (SP-6)
...
기존 직접 run_suno_generation 호출 + asyncio.to_thread를
Redis push (queue:music-render, job_type=suno_generation) +
task 상태 polling 패턴으로 변경. 결과는 task_id로 music_library 조회.
Plan-B-Music Phase 3 (cutover 3/4).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 05:19:41 +09:00
532b794c11
refactor(music-lab): sync helpers → Windows HTTP forward + cleanup (SP-6)
...
/api/music/{lyrics, credits, timestamped-lyrics, style-boost}
모두 sync_forward 모듈로 위임 → Windows :18711/api/music-render/sync/*.
SUNO_API_KEY가 NAS에 없으므로 직접 호출 불가.
run_*, generate_*, get_* import 제거 (Windows로 이전됨).
SUNO_MODELS만 잔존 (정적 데이터).
추가 cleanup (T11 reviewer 지적):
- _push_render_job의 datetime import를 모듈 상위로
- 11 endpoint의 unused BackgroundTasks 매개변수 제거
generate_batch: SUNO_API_KEY 체크를 os.getenv()로 전환 + 테스트 monkeypatch 갱신.
Plan-B-Music Phase 3 (cutover 2/4).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 05:16:15 +09:00
e7f6edf7c5
refactor(music-lab): 13 background_tasks → Redis push (SP-6)
...
generate, extend, vocal-removal, cover-image, wav, stem-split,
upload-cover, upload-extend, add-vocals, add-instrumental, video
모두 _push_render_job 헬퍼로 queue:music-render에 push.
job_type 디스크리미네이터로 Windows worker가 분기.
Plan-B-Music Phase 3 (cutover 1/4).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 05:10:20 +09:00
42cf39d0da
feat(music-lab): wire redis client + internal_router + compose env (SP-6)
...
main.py에 redis.asyncio client 추가 + internal_router include.
docker-compose의 music-lab에 REDIS_URL/INTERNAL_API_KEY/MUSIC_RENDER_URL.
SUNO_API_KEY 라인 제거 (spec §9 — Windows로 이전).
Plan-B-Music Phase 1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 03:16:54 +09:00
74196396c5
fix(music-lab): track guard if payload.track is not None: (T1 follow-up)
...
Code review found: empty dict `{}` was falsy and would silently skip
add_track. Use explicit None check.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 03:14:41 +09:00
4393ba706b
feat(music-lab): verify_internal_key + /api/internal/music/update (SP-6)
...
X-Internal-Key 헤더 검증 dependency (insta-lab 동일 패턴).
Windows music-render webhook 수신 endpoint — update_task + 옵션 add_track.
Plan-B-Music Phase 1 (수신부).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 03:10:05 +09:00
714224a9b4
docs(plan): Plan-B-Music — music-render Windows worker + NAS 분할
...
SP-5 + SP-6 — 모든 Suno(13) + MusicGen(1) 외부 호출 + sync helpers(4)를
Windows music-render로 이전. NAS music-lab은 Redis push(async) +
httpx forward(sync)만. SUNO_API_KEY는 Windows .env 단독 보유 (spec §9).
17 task: NAS 수신부(1-2) → Windows worker(3-10) → NAS cutover(11-14) →
nginx 차단 + end-to-end 검증(15-17).
박재오 결정: 모든 Suno + MusicGen 일괄 이전 (Plan-B-Insta 패턴 + sync forward 추가).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 03:02:48 +09:00
ea93dc522b
fix(insta): wire /media/insta nginx alias + frontend insta_cards mount (Plan-B-Insta)
...
End-to-end 검증 중 발견된 2 가지 인프라 누락 보완:
1) frontend 컨테이너에 /data/insta_cards 마운트 추가 (NAS의 실저장 위치는
data/insta/insta_cards/<slate_id>/ 로 기존 insta-lab 컨테이너가 사용)
2) nginx /media/insta/ location → /data/insta_cards/ alias
이로써 Windows insta-render worker가 result_path "/media/insta/<id>/01.png"
로 보낸 URL이 NAS frontend nginx에서 정상 서빙됨.
Plan-B-Insta Phase 5 (검증) — T15 end-to-end 디버깅 fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 02:36:44 +09:00
408b6a3df7
feat(nginx): 3-layer block for /api/internal/insta/ (SP-4)
...
Layer 1·2: IP 화이트리스트 (192.168.45.0/24 LAN + 100.64.0.0/10 Tailscale).
Layer 3: X-Internal-Key 헤더 (FastAPI dependency, 별도 검증).
외부에서 직접 호출 시 403 (nginx deny), LAN에서 키 없으면 401 (FastAPI).
Windows insta-render만 호출 가능.
Plan-B-Insta Phase 4.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 02:25:40 +09:00
e6ff234031
refactor(insta-lab): remove Playwright + slim Dockerfile (SP-4)
...
NAS에서 더 이상 카드 렌더 안 함 → Windows insta-render 워커로 완전 이전.
- card_renderer.py를 1줄 deprecation stub로 교체
- main.py의 import card_renderer 제거 + startup/shutdown hook 정리
- requirements.txt에서 playwright 삭제
- Dockerfile에서 Chromium 30+ dep 라인 + playwright install 제거 → image ~50% 감소
- test_card_renderer.py 폐기 (Windows 측 test_worker.py가 대체)
- test_main.py의 create_slate 테스트를 Redis-push 플로우에 맞게 업데이트
Plan-B-Insta Phase 3 완료.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 02:21:02 +09:00
912cd18e48
feat(insta-lab): cutover to Redis push, Playwright 렌더 호출 제거 (SP-4)
...
_bg_create_slate, _bg_render의 await card_renderer.render_slate(...)
호출을 Redis RPUSH queue:insta-render 로 전환.
NAS는 task_id 발급 + 큐 푸시 + 30~70% 진행률 보고만. Windows insta-render
워커가 BLPOP → 렌더 → webhook으로 succeeded 보고 시 NAS가
update_slate_status('rendered') 트리거.
Plan-B-Insta Phase 3 (cutover).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 02:18:12 +09:00
a06cc424ca
chore(compose): insta-lab REDIS_URL + INTERNAL_API_KEY env + depends_on redis
...
박재오: NAS .env에 INTERNAL_API_KEY=$(openssl rand -hex 32) 추가 필요.
같은 값을 Windows insta-render .env에 보관 (대칭).
Plan-B-Insta Phase 1 완료.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 02:01:23 +09:00
e87c43a7a4
feat(insta-lab): wire internal_router + Redis client (SP-4 prep)
...
main.py에 internal_router include + 모듈 레벨 redis client.
requirements.txt에 redis>=5.0 추가 (playwright 제거는 Task 12에서).
Plan-B-Insta Phase 1 마무리. Task 11에서 _bg_render를 Redis push로 전환.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-19 01:59:55 +09:00