세션이 SDK의 메모리
Agent SDK가 세션 id 할당하고 대화 상태를 internally persist. ClaudeSDKClient면 세션이 클라이언트만큼 살아; query()면 single-use. Id로 세션 resume해서 멈춘 데서 계속 가능 — SDK가 internal 상태 reload하고 새 프롬프트 적용.
Durable 기록으로서의 JSONL
SDK가 이벤트를 JSONL 파일로 stream 가능. 각 라인이 typed 이벤트 — 프롬프트, 응답 chunk, tool use, tool result. cwkPippa가 이걸 ground truth로 — SQLite와 ChromaDB가 JSONL에서 rebuild 가능한 derived mirror. 복구는 patch-and-reconcile X, purge-and-replay.
프로세스 사이 Resume
Worker 프로세스 재시작하면 같은 세션 id로 새 ClaudeSDKClient spin up하고 SDK가 recover. 이게 cwkPippa의 heartbeat job이 conversational 상태 안 잃고 서버 재시작 살아남는 거 enable.
원칙: JSONL을 source of truth로 다뤄. 다른 거(DB row, indices)는 rebuildable해야 하는 cache.