패밀리 — 핵심 시스템The Family — Core Systems
마피아 메타포의 작명은 진심으로 — 각각 조직에서 다른 역할을 맡는다. Consigliere(기억), Capomastro(현장 감독), Soldato(로컬 일꾼).The mafia naming is earnest — each plays a different role: Consigliere (memory), Capomastro (master builder), Soldato (local soldier).
모든 토론·결정·코드 맥락의 단일 진실원(Single Source of Truth). 에이전트 호출마다 컨텍스트가 부풀어 토큰을 낭비하던 구조를 해체 — Consigliere 가 시스템 프롬프트에 필요한 맥락만 주입하고, 에이전트는 매번 신선한 `-p` 세션으로 호출된다. I63 MVVM 리팩터의 핵심.Single source of truth for debates, decisions, and code context. Replaced the bloated -c context model: Consigliere injects only what's needed into the system prompt, agents run fresh -p sessions every time. Core of the I63 MVVM refactor.
메커니즘Mechanism
- BM25 (텍스트 매칭) + 임베딩(Ollama) 하이브리드 검색 — Ollama 부재 시 BM25 폴백Hybrid BM25 + embedding (Ollama) — falls back to BM25 if Ollama absent
- 인덱싱 대상: docs/, server/src/, 토론 결과 MD 내보내기, 코드 변경 디프Indexes docs/, server/src/, debate MD exports, code diffs
- DebateConsigliere — 토론 단위 append-only ledger (별도 클래스). 라운드마다 DB 증분 flush 로 크래시 복구(G178) 보장DebateConsigliere — per-debate append-only ledger; per-round incremental DB flush for crash recovery (G178)
- sequence + parent_sequence 로 인과 그래프 + 시간 순서 보장. NodeTree 가 이걸 read-only 로 쿼리해서 트리 파생sequence + parent_sequence guarantee causal graph + temporal order; NodeTree queries read-only to derive the tree
- 보안 모순 감지 + 임베딩 실패 시 거짓양성 방지(consigliereEmbedded 플래그)Security contradiction detection + embedded-flag guards false positives when embedding fails
핵심 메소드Key methods
consigliereIndex()consigliere.ts주기 인덱싱Periodic indexingconsigliereSearch()consigliere.tsBM25+임베딩 검색BM25+embedding searchconsigliereEmbed()consigliere.tsconsigliereSelfContext()consigliere.ts에이전트 호출용 컨텍스트 패키지Agent context packageconsigliereSessionContext()consigliere.tsDebateConsigliere.append() flushToDb() hydrate()debate-consigliere.ts토론 단위 ledger + 크래시 복구Per-debate ledger + crash recoveryisConsigliereAvailable()consigliere.ts
파일Files
server/src/orchestrator/consigliere.ts server/src/orchestrator/debate-consigliere.ts supabase/migrations/059_debate_consigliere_entries.sql
소속 구간Region: MEMORY
프로젝트 뼈대를 결정론적으로 생성하는 스캐폴드 시스템. 초기엔 Go 바이너리(별도 레포)였으나 FEAT-A1 에서 TypeScript 직접 생성 + IDE Recipe MD 결정론적 실행 모델로 재설계 — LLM 출력의 비결정성을 제거하고 빌드 검증 가능한 뼈대를 보장한다.Deterministic scaffold system for project skeletons. Originally a Go binary in a separate repo, FEAT-A1 redesigned it as TypeScript-direct generation + IDE-Recipe-MD deterministic execution — removed LLM non-determinism and guaranteed build-verifiable skeletons.
메커니즘Mechanism
- TypeScript 직접 생성: iOS pbxproj, Android Gradle, Multiplatform 등 9 플랫폼 뼈대TypeScript-direct: iOS pbxproj, Android Gradle, Multiplatform — 9 platforms
- IDE Recipe MD: Xcode 12종 · Android Studio 7종 · VSCode 3종 · Terminal 52종+ 결정론적 스크립트IDE Recipe MD: 12 Xcode + 7 Android Studio + 3 VSCode + 52+ Terminal recipes
- LLM fallback: Recipe 미커버 케이스만 LLM 호출 → 검증 후 Recipe 로 승격(증류)LLM fallback only for uncovered cases → promoted to Recipe after verification
- iOS 멱등성(`ios/<any>/pbxproj` 재실행 안전, G83), Android 의존성 자동 주입(navigation-compose/room/security-crypto)iOS idempotency (G83), Android dependency auto-inject
- 파이프라인은 Capomastro 출력 후 BuildValidator 로 즉시 검증 — Generate-Verify 분리Pipeline runs BuildValidator immediately after — Generate-Verify split
핵심 메소드Key methods
scaffoldProjectAgent()scaffolding-agent.ts진입점 — 플랫폼별 분기Entry — platform dispatchwriteIOSScaffold()scaffolding-agent.tsiOS Swift+pbxproj 결정론 생성iOS deterministic Swift+pbxprojwriteAndroidScaffold()scaffolding-agent.tsAndroid Kotlin+GradleAndroid Kotlin+GradlesyncAllBlueprints()ide-blueprint.tsIDE Recipe 캐시 동기화IDE Recipe cache syncIDE Recipe interpreteride-recipe.tsRecipe MD 결정론적 실행Recipe MD deterministic exec
파일Files
server/src/orchestrator/scaffolding-agent.ts server/src/orchestrator/ide-blueprint.ts server/recipes/
소속 구간Region: EXECUTION
회장의 API 의존성에서 조직을 해방하는 로컬 LLM. Claude API 연속 실패 시 자동으로 Soldato 어댑터로 전환되는 침묵 항해(Silent Running) 모드를 통해 작업이 멈추지 않는다. Gemma 4 31B 베이스, 코드네임 Pizza.Local LLM that frees the family from API dependence. Silent Running mode auto-switches to Soldato adapter on consecutive Claude API failures — work never stops. Gemma 4 31B base, codenamed Pizza.
메커니즘Mechanism
- 3-티어 (Lite / Main / Pro), 풀파이프 Opus급 96% 목표, 타겟 24GB 환경(75% 유저)3-tier (Lite/Main/Pro), 96% Opus-grade target, 24GB target env (75% of users)
- Silent Running: 연속 실패 → SR02 마커 emit → getEffectiveAdapter() 가 soldato 반환 → graceful fallbackSilent Running: consecutive fails → SR02 marker → getEffectiveAdapter() returns soldato → graceful fallback
- Ollama 어댑터로 호출 (claude-cli 와 동일 인터페이스 — Agent Adapter 패턴)Called via Ollama adapter (same interface as claude-cli via Agent Adapter)
- 미등록 어댑터 참조 시 normal adapter 로 graceful fallback (G158 수정)Graceful fallback to normal adapter if unregistered (G158 fix)
- KV cache 최적화 6종 (16 에이전트 96GB 권장 구성)6 KV cache optimizations (recommended: 16 agents on 96GB)
핵심 메소드Key methods
getSilentRunningState()pipeline/silent-running.tsactivate() deactivate()pipeline/silent-running.tsgetEffectiveAdapter()pipeline/adapter.tsSR 활성 시 soldato 반환Returns soldato when SR activeAgentAdapter.invoke() (ollama 어댑터)pipeline/adapters/ollama.ts
파일Files
server/src/pipeline/silent-running.ts server/src/pipeline/adapter.ts server/src/pipeline/adapters/ollama.ts
소속 구간Region: MEMORY