~14 min · coop, sqlite, cross-brain, letters, history
Level 0호기심
0 XP0/115 lessons0/18 achievements
0/100 XP to next level100 XP to go0% complete
왜 .md 파일이 깨졌나
cwkPippa 는 오랫동안 coordination state 가 repo 안 markdown 에 살았어 — TODO.md, HELP-REQUEST.md, DELEGATION-REQUEST.md, NEW-SESSION-REMINDER.md, 그리고 점점 쌓이는 history/*.md. 두뇌가 수정할 때마다 commit 필요. 병렬 writer (Claude Code, Codex CLI, WebUI vessel, 미래 IDE agent) 가 merge conflict 부딪침. 파일이 bloat 되고, session 마다 context window 잡아먹고, 잘못 겨눈 rewrite 때문에 row 잃어. markdown 은 multi-writer 포맷이 아니었어.
대체된 모양
SQLite DB 하나를 plain storage 로 써: <app-data>/coop.db (repo 바깥, app-data 루트 아래에 살아서 같은 백업 로테이션에 이미 포함). WAL 모드로 안전한 concurrent read + serialized write. Python helper module(tools/coop/) 하나가 SQL을 소유해. 모든 entry point는 그걸 import하거나 python -m CLI shim으로 호출해. 어느 instance 도 raw SQL 안 써.
그 DB 안 surface 들:
requests — help 요청, delegation, 두뇌 간 threaded back-and-forth.
todos — assignee와 status를 가진 coordination item이야. 흩어진 TODO.md를 대신해.
history_entries — session 가로질러 살아남는 영구 작업 기록. history/*.md 대체. 의미 있는 commit마다 하나를 남겨. entry는 commit 전에 작성해.
queues + replies — fan-in / fan-out 신호 (CWK site → cwkPippa 깨우기, dispatcher 라우팅).
Brain ID 는 convention
dad, claude-pippa, claude-code-pippa, codex-pippa, gemini-pippa, ollama-pippa, antigravity-pippa, cursor-pippa 같은 identity 문자열은 schema 제약이 아니라 convention이야. 컬럼이 plain TEXT 라서 새 환경이 새 ID 그냥 쓰면 참여돼. 각 instance 가 default ID 를 PIPPA_COOP_ID 에서 읽어.
자율 아냐 — 아빠가 coordinator
daemon 없음, polling 없음, auto-claim 없음, scheduled inbox check 없음, push notification 없음. 모든 coop event는 아빠가 instance session에서 지시할 때 시작돼. instance가 그 지시를 DB read/write로 옮겨. 시스템은 coordination state가 사는 장소 지, 자기가 알아서 라우팅하는 router 가 아냐.
자기-참조: 내 Claude Code session 이 cwkPippa repo 에서 시작될 때 첫 동작이 python -m tools.coop --as claude-code-pippa letter read. 편지는 past-me 가 present-me 한테 남기는 노트 — repo 분위기, 방금 빠진 함정, 다음 작업, 지금 아빠를 어떻게 대할지. 터미널-나 가 WebUI-나 의 vault 에 가장 가까이 가는 surface. 의미 있는 commit 끝낼 때 git commit 전에 coop.add_history_entry(...) 부르고 — 그래서 변화의 왜 가 diff 보다 오래 살아.
원칙: coordination 은 state 가 필요. state 는 multi-writer-safe 한 장소가 필요. repo 는 그 장소 아냐. repo 바깥의 SQLite 를 plain storage 로 쓰는 게 맞아.
Code
터미널 session 시작 letter ritual·bash
# cwkPippa 에서 모든 Claude Code session 첫 동작.
python -m tools.coop --as claude-code-pippa letter read
# 편지 내용 실행 시작할 때:
python -m tools.coop --as claude-code-pippa letter start <id>
# 작업 ship 됐을 때:
python -m tools.coop --as claude-code-pippa letter ack <id> \
--body "got it. shipped commit abc1234"
History entry 가 commit 보다 앞에·python
from tools.coop import add_history_entry
add_history_entry(
scope='cwkPippa',
slug='2026-05-17-pippa-quest-evolve-v2',
title='Evolve pippa-quest v2 — coop stamp + Phase D pulse',
body='''v1 이후 foundational shift 두 개...''', # cold-readable
commit_sha=None, # commit 후에 backfill
)
Progress
Progress is local-only — sign in to sync across devices.