# task-706.2: Threads 카드뉴스 포스트 1건 업로드 (보험저널 업계동향)

## 작업 내용
보험저널 업계동향 뉴스를 기반으로 카드뉴스 포스트 1건을 생성하고 Threads에 업로드한다.

## 실행 절차

### 1단계: 뉴스캐시에서 업계동향 토픽 선택
```python
import json
with open('/home/jay/projects/ThreadAuto/content/news_cache.json') as f:
    articles = json.load(f)
# 설계사 유튜브/SNS 규제 기사 (index 1) 또는 OECD 제판분리 기사 (index 0)
article = articles[0]  # OECD 기사 사용 (1번 기사는 이미 사용됨)
topic = {
    'id': 'news-rss-insjournal-30560',
    'category': '업계동향',
    'title': article['title'],
    'description': article['summary'],
    'card_type': 'T',
    'keywords': ['제판분리', 'OECD', 'GA'],
    'used_count': 0, 'last_used': None,
}
```

### 2단계: 5-stage 파이프라인으로 cardnews 생성
```python
from content.five_stage_pipeline import FiveStagePipeline
pipeline = FiveStagePipeline()
content = pipeline.generate(topic, 'cardnews', context=article['summary'])
slides = content.get('slides', [])
caption = content.get('caption', '')
```

### 3단계: 렌더링
```python
from renderer.cardnews import CardNewsRenderer
renderer = CardNewsRenderer()
image_paths = renderer.render_from_slides(slides)
```
- `render_from_slides()` 사용 (render() 아님!)

### 4단계: Threads 업로드
```python
from publisher.threads_publisher import ThreadsPublisher
publisher = ThreadsPublisher()
result = publisher.publish_cardnews(
    title=topic['title'],
    items=[],
    content={'slides': slides, 'caption': caption},
)
```
- `publish_cardnews()` 사용, `content=` 파라미터로 slides/caption 전달
- items=[]는 레거시 호환용 (V2는 content['slides'] 사용)
- ~~image_paths 직접 전달~~ → 금지. publish_cardnews가 내부에서 렌더링함

### 주의: publish_cardnews 내부 렌더링 vs 외부 렌더링
publish_cardnews()는 `content['slides']`가 있으면 내부에서 `render_from_slides()`를 호출한다.
따라서 3단계(외부 렌더링)를 건너뛰고 바로 4단계로 가도 된다.
외부 렌더링은 이미지 확인용으로만 사용.

## 프로젝트 경로
- `/home/jay/projects/ThreadAuto/`

## 주의사항
- 토큰 저장소: `auth.token_store`
- 카드뉴스 해시태그는 항상 빈 배열([])
- 캡션 줄바꿈(\n) 포함 필수
- carousel 업로드 시 intermittent 500 에러 가능 → retry 로직(task-700.2)이 이미 적용됨

## 작업 완료 시
- `python3 /home/jay/workspace/memory/task-timer.py end task-706.2`
