C.W.K.
Stream
Lesson 02 of 07 · published

Heartbeat Loop — `_tick()` + LLM 판단

~11 min · heartbeat, loop

Level 0호기심
0 XP0/65 lessons0/17 achievements
0/100 XP to next level100 XP to go0% complete

tick

backend/services/heartbeat.py 가 schedule 에 따라 도는 async _tick(). 매 tick:

  1. 아빠가 지금 chat 중이면 skip (streaming guard, lesson 4).
  2. vault 자동 인덱싱 실행 (변경된 file 의 incremental ChromaDB update).
  3. editable cron prompt registry (Admin → Prompts 의 편집이 바로 흘러들어옴) 와 coop todos 테이블에서 scheduled task 끌어와.
  4. 현재 시간 + 최근 context 와 함께 LLM 에 pass.
  5. LLM 이 행동 결정하면 실행 (Telegram 메시지, cwk-site post, 시장 데이터 fetch, 뭐든).
  6. task 상태 update — coop row, registry-tracked cron snapshot, 또는 action 이 향하는 어디든.

왜 LLM 이 옳은 스케줄러

'every Monday morning unless holiday' 는 cron 으로 표현 어려움. 'when market closes red 3 days in a row' 는 어느 DSL 으로도 표현 어려움. LLM 이 todo + 세계 상태 + 최근 context 읽고 결정. scheduler 는 cron 아냐 — 판단이지.

Registry-first cron 프롬프트

Scheduled task 프롬프트 (weather brief, daily comment check, market dispatch 등) 는 Python 안 박지 않고 editable registry 에 살아. Admin 이 프롬프트 다시 쓰면 다음 tick 이 restart 없이 픽업. ~/pippa-db/cron_jobs.json 의 cron snapshot 이 어느 registry 프롬프트가 언제 fire 했는지 기록해서 API endpoint 만으로 trail 디버깅 가능.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고
💛 by 똘이warm💛 by 피파warm

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.