# 작업 지시서: topic_selector.py published 필드 보존 개선

## 작업 ID: task-1051.1
## 레벨: Lv.1 (한정승인)
## 프로젝트 경로: `/home/jay/projects/ThreadAuto/`

## 배경
task-1050.1에서 text_generator.py에 `_get_date_guidance()` 메서드를 추가하여 기사 발행일 기반 날짜 표현을 자동 생성하도록 개선했다. 그러나 topic_selector.py의 `_cache_item_to_topic()` 함수가 뉴스 캐시 아이템의 `published` 필드를 topic dict에 포함시키지 않아, 자동 파이프라인(run_text_post.py 등)에서 날짜 가이드가 작동하지 않는 문제가 있다.

현재는 `run_insjournal_text.py`에서 직접 topic dict를 구성할 때만 published가 포함되어 작동한다.

## 수정 내용

### 1. `content/topic_selector.py` — `_cache_item_to_topic()` 함수 수정
- 뉴스 캐시 아이템(news_cache.json)의 `published` 필드를 topic dict에 포함시킬 것
- 현재 반환 dict에 `"published": item.get("published", "")` 추가
- 뉴스캐시 아이템 구조 참고:
  ```json
  {
    "url": "https://...",
    "title": "기사 제목",
    "summary": "요약...",
    "published": "2026-03-19 08:59:36",
    "source": "보험저널",
    "matched_keywords": {...},
    "relevance_score": 3
  }
  ```

### 2. 관련 함수 확인
- `_select_news_topics()` — 뉴스 토픽 선택 시 _cache_item_to_topic() 호출하는 부분
- `select_single_topic()` — 단일 토픽 선택 시에도 뉴스 토픽이면 published 포함되는지 확인
- YouTube 캐시(`youtube_cache.json`)에도 published가 있다면 동일하게 보존

### 3. text_generator.py 연동 확인
- `_get_date_guidance()` 메서드가 `topic.get("published")` 로 날짜를 가져옴
- topic_selector에서 published가 정상 전달되면, run_text_post.py (자동 파이프라인)에서도 날짜 가이드 작동 확인

## 테스트 요구사항
- 기존 테스트 전체 통과 유지 (pytest 82건)
- 신규 테스트:
  - _cache_item_to_topic()에서 published 포함 확인
  - published가 None/빈문자열인 경우 안전하게 처리
  - YouTube 캐시 아이템의 published 처리

## 주의사항
- **크롤러(RSS fetcher) 출력 스키마는 건드리지 말 것** — news_cache.json은 이미 published 필드를 가지고 있음, _cache_item_to_topic()에서 누락된 것뿐
- **text_generator.py, text_prompts.py는 수정 불필요** — 이미 task-1050.1에서 완료됨
- 기존 에버그린 토픽(published 없음)이 깨지지 않도록 방어 코드 포함