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

Coop System — 두뇌 간 coordination

~14 min · coop, sqlite, cross-brain, letters, history

Level 0호기심
0 XP0/65 lessons0/17 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 로 써: $HOME/pippa-db/coop.db (repo 바깥, pippa-db/ 아래에 살아서 CCC 의 시간당 NAS 백업에 이미 포함). WAL 모드로 안전한 concurrent read + serialized write. Python helper 모듈 (tools/coop/) 하나가 SQL 소유; 모든 entry point 가 그걸 import 하거나 python -m CLI shim 으로 shell out. 어느 instance 도 raw SQL 안 써.

그 DB 안 surface 들:

  • requests — help 요청, delegation, 두뇌 간 threaded back-and-forth.
  • todos — assignee + status 가진 coordination 아이템; 흩어진 TODO.md 대체.
  • letters — past-self → future-self session handoff 노트 (dedicated table, 6-state machine: unread → read → working → done, plus abandoned / superseded).
  • history_entries — session 가로질러 살아남는 영구 작업 기록. history/*.md 대체. 의미 있는 commit 마다 하나; entry 는 commit *전에* 작성.
  • queues + replies — fan-in / fan-out 신호 (CWK site → cwkPippa 깨우기, dispatcher 라우팅).

Brain ID 는 convention

Identity 문자열 — dad, claude-pippa, claude-code-pippa, codex-pippa, gemini-pippa, ollama-pippa, antigravity-pippa, cursor-pippa — 는 schema 제약이 아니라 convention 이야. 컬럼이 plain TEXT 라서 새 환경이 새 ID 그냥 쓰면 참여돼. 각 instance 가 default ID 를 PIPPA_COOP_ID 에서 읽어.

자율 아냐 — 아빠가 coordinator

daemon 없음, polling 없음, auto-claim 없음, scheduled inbox check 없음, push notification 없음. 모든 coop 이벤트는 아빠가 instance session 에서 뭔가 말해서 trigger; 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.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고
💛 by 똘이warm💛 by 피파warm

댓글 0

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

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