C.W.K.
Lesson 05 of 06 · published

Variants Inherit Down — Copy-and-Adapt Pattern

~12 min · pattern, rule-2

Level 0Curious
0 XP0/52 lessons0/16 achievements
0/100 XP to next level100 XP to go0% complete

Copy-and-adapt, not import-and-share

Each variant's routes/chat.py is a deliberate copy of the Claude route. They share the pattern (JSONL ground truth, SQLite store, ChromaDB embedding, healing) but own their own code. No shared helper extraction across variants.

Why no shared helper

Shared helpers in this layer would force every variant through a lowest-common-denominator interface — exactly what Rule 1 forbids. Each variant evolves independently. If three variants discover they need the same change, the third is the one that proves the pattern is worth extracting. Until then: copy.

Tool bridge is brain-agnostic

The one place sharing is correct: tool_bridge.py. Local Read/Write/Edit/Bash execution is the same regardless of which brain requested it. The variant-specific part is schema format conversion (OpenAI for Codex/Ollama, function_declarations for Gemini, wrapping for Ollama).

The principle: Sharing is correct when the thing being shared is genuinely the same. Tool execution is the same. Wire format is not. Knowing the difference is the architectural skill.

Progress

Progress is local-only — sign in to sync across devices.