Part of #333. ## Scope ai-server가 **assets 프로젝트**에 직접 쓰도록 env를 전환하고, raw_posts 상태머신(5개)과 pipeline_events 기록을 도입. ## Deliverables - [ ] \`packages/ai-server/src/managers/database.py\` - \`ASSETS_DATABASE_URL\` 읽기, 없으면 \`DATABASE_URL\` fallback + \`logger.warning\` - [ ] \`packages/ai-server/src/services/raw_posts/repository.py\` - 모든 SQL 문자열 \`warehouse.raw_post_sources\`/\`warehouse.raw_posts\` → \`public.raw_post_sources\`/\`public.raw_posts\` - 신규 헬퍼: \`insert_pipeline_event(conn, raw_post_id, from_status, to_status, note=None)\` - \`raw_posts.status\` UPDATE 메서드 (NOT_STARTED → IN_PROGRESS → COMPLETED/ERROR) - [ ] \`packages/ai-server/src/services/raw_posts/scheduler.py\` - dispatch 시점: 대상 \`raw_post\` 를 \`IN_PROGRESS\`로 마킹 + pipeline_events 기록 - [ ] \`packages/ai-server/src/services/raw_posts/pipeline.py\` - 성공 완료 시: \`COMPLETED\` + 이벤트 기록 - 치명적 실패 시: \`ERROR\` + parse_error 저장 + 이벤트 기록 - [ ] \`.env.example\` / \`docker-compose-ai.yml\` — \`ASSETS_DATABASE_URL\` 추가 - [ ] **테스트** - 기존 fixture \`warehouse.raw_posts\` → \`public.raw_posts\` 로 교체 - \`test_status_transitions_write_pipeline_events\` 신규 ## Acceptance - \`uv run pytest tests/raw_posts/\` 녹색 - 실제 cloud assets에 IN_PROGRESS → COMPLETED 전환 로그 기록 (스모크) ## Depends on - #1
Part of #333.
Scope
ai-server가 assets 프로젝트에 직접 쓰도록 env를 전환하고, raw_posts 상태머신(5개)과 pipeline_events 기록을 도입.
Deliverables
Acceptance
Depends on