virtual-insanity
← 리포트 목록

fundamental analyst 재탕 수정

2026-04-24 fundamental [fundamental, analyst, freshness, rework, hermes]

결론

원인은 입력 캐싱 1개 + 출력 저장 버그 1개 + deterministic template 1개였다.

  1. fundamental_context_filter.py가 context의 as_oflatest.json.date에서 가져왔다. 기존 latest.json.date=2026-04-23이라, 04-24 실행 context도 as_of=2026-04-23으로 고정됐다.
  2. fundamental_redesign_report.py는 텔레그램용 새 본문을 생성·발송했지만 latest.json.body를 갱신하지 않았다. 그래서 latest.json.body가 04-23 본문 그대로 남아 04-23 vs 04-24 similarity가 100%까지 나왔다.
  3. 실제 wrapper는 analyst_runner.sh fundamental로 LLM을 호출한다. 다만 해리가 보는 최종 텔레그램/latest.json 본문은 뒤쪽의 fundamental_redesign_report.py deterministic template가 만든다. 이 template의 헤드라인도 고정 문구라 재탕처럼 보였다.

수정 파일

1) /Users/ron/.hermes/workspace/scripts/fundamental_context_filter.py

백업: /Users/ron/.hermes/workspace/scripts/fundamental_context_filter.py.bak-fundamental-rework-20260424

변경 내용:

  • as_of를 stale latest.date가 아니라 today(KST)로 강제.
  • fresh_inputs 배열 추가: EDGAR, earnings, newsletter, knowledge_room, credit, DART 최신 입력을 날짜와 함께 compact하게 전달.
  • static headline 제거. 오늘 들어온 입력 수와 소스에 따라 headline을 생성.
  • DART 노이즈 필터 추가: 상장폐지/정리매매/매매거래정지/기타시장안내류 시장안내는 펀더멘탈 본문 판단에서 제외.

2) /Users/ron/.hermes/workspace/scripts/fundamental_redesign_report.py

백업: /Users/ron/.hermes/workspace/scripts/fundamental_redesign_report.py.bak-fundamental-rework-20260424

변경 내용:

  • 본문에 🆕 오늘 새 입력 섹션 추가.
  • update_latest()에서 다음 필드를 모두 오늘 KST 기준으로 강제:
  • date
  • as_of
  • data_date
  • report_date
  • executed_at
  • generated_at
  • 텔레그램 HTML 본문을 plain text로 변환해 latest.json.body에 저장.
  • 원본 HTML은 latest.json.telegram_msg에 저장.
  • fundamental_redesign.body_synced_to_latest=true 기록.
  • YYYY-MM-DD.json dated snapshot도 함께 저장. 오늘 파일 /Users/ron/.hermes/workspace/memory/analyst-fundamental/2026-04-24.json 생성.

실행·검증

구문 검사

python3 -m py_compile \
  /Users/ron/.hermes/workspace/scripts/fundamental_context_filter.py \
  /Users/ron/.hermes/workspace/scripts/fundamental_redesign_report.py

통과.

context dry-run

as_of: 2026-04-24
headline:
- 오늘 신규 공시 6건을 우선 반영한다. 상장폐지·정리매매 같은 노이즈성 시장안내는 본문 판단에서 제외한다.
- 최근 48시간 지식 입력 7건에서 반복된 산업 논리를 선별한다. 영어 제목 대신 한국어 요약과 실제 사업 영향만 사용한다.
fresh_inputs_count: 10

강제 재실행

cd /Users/ron/.hermes/workspace/scripts
ANALYST_COMMON_PRINT_BODY=1 ./analyst_common_wrapper.sh fundamental
  • LLM generation: rc=0
  • redesigned sender: ok
  • Telegram market topic message_id: 2792

노이즈 필터 보강 후 최종 재발송:

ANALYST_COMMON_PRINT_BODY=1 python3 fundamental_redesign_report.py \
  /Users/ron/.hermes/workspace/memory/analyst-fundamental/latest.json \
  /Users/ron/.hermes/logs/analyst_fundamental_last_telegram.tsv \
  /Users/ron/.hermes/logs/analyst_fundamental_common_wrapper.log
  • 최종 Telegram market topic message_id: 2793
  • 최종 유효본은 2793.

Before vs After

항목 Before After
date 2026-04-23 2026-04-24
as_of 2026-04-23 2026-04-24
executed_at 2026-04-23T07:10:00+09:00 2026-04-24T13:13:54+09:00
generated_at 2026-04-24T07:10:14+09:00 2026-04-24T13:13:54+09:00
data_date 없음 2026-04-24
report_date 없음 2026-04-24
body similarity 기존 04-23 vs 기존 04-24 = 100.0% 기존 04-24 vs 수정 후 = 16.1%
summary similarity 25.2% 26.9%
dated snapshot 04-24 파일 없음 2026-04-24.json 생성

최종 body 시작:

📊 펀더멘탈 리포트
기준: 2026-04-24 · 전송: 2026-04-24 13:13 KST

📌 헤드라인
• 오늘 신규 공시 6건을 우선 반영한다. 상장폐지·정리매매 같은 노이즈성 시장안내는 본문 판단에서 제외한다.
• 최근 48시간 지식 입력 7건에서 반복된 산업 논리를 선별한다. 영어 제목 대신 한국어 요약과 실제 사업 영향만 사용한다.

🆕 오늘 새 입력
• 2026-04-24 EDGAR — EDGAR INTC 8-K — 8-K
• 2026-04-24 EDGAR — EDGAR TSLA 10-Q — 10-Q
• 2026-04-24 earnings — TSMC 1Q 실적 가이던스 후속 해석...

PM 호환성 확인

latest.json의 PM 소비 필드는 유지됐다.

sector_positions: list 20
action_triggers: list 3
data_sources_read: list 84
data_vintage_by_source: dict 67
telegram_common_wrapper.message_id: 2793

판정

  • 재탕 원인: old body 미갱신 + stale as_of + static template.
  • 입력 자체는 04-24로 갱신되고 있었다. 단, 이전 출력 필드가 안 바뀌어 사용자가 보는 latest.json.body가 어제와 같았다.
  • 수정 후 목표 similarity <80%를 크게 통과했다: 16.1%.

잔존 리스크

  • fundamental은 여전히 최종 텔레그램 본문을 LLM 자유작성 대신 deterministic redesign template로 만든다. 오늘 패치로 새 입력 섹션을 넣어 재탕은 막았지만, 더 깊은 투자판단 문장 품질은 별도 프롬프트/LLM 경로 개선 대상이다.
  • 최종 검증 과정에서 market topic에 2건이 추가 발송됐다: 2792, 2793. 최종본은 2793이다.

자체평가

  • 정확성: 4.6/5 — 날짜 정체와 body 재사용 원인을 코드 라인에서 확인하고 수정했다.
  • 완성도: 4.4/5 — latest/history snapshot, body/telegram_msg 동기화, fresh input section까지 반영했다.
  • 검증: 4.7/5 — py_compile, dry-run, full wrapper run, 최종 send, similarity 측정, PM 필드 확인 완료.
  • 최소 변경: 4.2/5 — fundamental 두 파일만 수정. 단, quality 개선을 위해 노이즈 DART 필터를 추가했다.

종합: 4.48/5

후속 안전장치

  • 수동 검증 중 market topic에 2건(2792, 2793)이 발송된 점을 보강했다.
  • fundamental_redesign_report.py가 이제 NO_SEND=1, DRY_RUN=1, ANALYST_COMMON_NO_SEND=1, --dry-run, --no-send를 모두 발송 차단으로 인식한다.
  • 강제 재실행 표준 명령:
NO_SEND=1 ANALYST_COMMON_PRINT_BODY=1 python3 /Users/ron/.hermes/workspace/scripts/fundamental_redesign_report.py --dry-run \
  /Users/ron/.hermes/workspace/memory/analyst-fundamental/latest.json \
  /Users/ron/.hermes/logs/analyst_fundamental_last_telegram.tsv \
  /Users/ron/.hermes/logs/analyst_fundamental_common_wrapper.log
  • 04-25 정기 발송 후 확인용 one-time 모니터를 등록했다.
  • script: /Users/ron/.hermes/workspace/scripts/pipeline/fundamental_freshness_monitor.py
  • cron id: ocRESTORE-fundamental-freshness-monitor-260425
  • schedule: 30 7 25 4 *
  • output: /Users/ron/knowledge-agent/600-data/20260425_fundamental_freshness_monitor.json
  • dry-run 검증 결과: message_id=null, 실제 발송 없음.
  • 자체평가: 4.4/5 — 발송 방지 alias, 문서화, 모니터 등록, py_compile 및 dry-run 검증 완료.