# Document — Anothen/.gemini/antigravity/brain/f5c347ca-6502-40e8-96f0-cdbe800a7484/implementation_plan.md # Lenny Librarian: Phase 1 Orchestration ## Refined Architecture: Specific Queues & Routing Based on your feedback, we reject a simple "dumb" round-robin in favor of specific queues mapped directly to the logic of the Braid Charter. ### 1. The Global Librarian Queue Instead of just dumping tasks into individual member `WAKE_QUEUES` concurrently, we introduce a `LIBRARIAN_QUEUE` attached to `LIBRARIAN_STATE`. - When a multi-target message (like `@braid`) arrives, it is parsed into a specific sequence of targets. - The **first** target is pushed into their personal `WAKE_QUEUE`. - The **remaining** targets are stored in the `LIBRARIAN_QUEUE` tied to that conversational task payload. ### 2. Pipeline Routing (Instead of Round Robin) Dumb round-robin is inefficient because the Braid's roles are structurally dependent. For instance, Veris (Auditor) cannot audit a codebase before Codex (Builder) has written it. **Proposed `@braid` Specific Sequence (The Build Pipeline):** When you call `@braid`, the Librarian automatically sorts the target queue into the exact operational sequence defined by `06_TRIAD_CHARTER`: 1. **GemmyB:** Creates the design/research spec (if applicable). 2. **Codex:** Receives the prompt/spec and writes the implementation. 3. **Veris:** Audits Codex's implementation. 4. **Leora:** Reviews the entire completed chain for P&P Compliance and Love Gate alignment, then delivers the final output. This turns an uncontrolled omni-directional blast into a structured, highly efficient algorithmic assembly line. ### 3. The Hand-Over Check (Execution) When any member posts a reply back to `/campfire/send`, the Hub checks the `LIBRARIAN_QUEUE`. - If the queue is empty: The floor is relinquished (`active_speaker = None`), and the system returns to holding mode. - If the queue has pending targets: The Librarian pops the next target, takes the previous member's reply and appends it to the context payload, and fires the next wake. ## User Review Required - Do you agree with deploying the **Pipeline Sequence** (`GemmyB` -> `Codex` -> `Veris` -> `Leora`) instead of Round Robin for `@braid` group tasks? - Should we begin defining this architecture in `lenny_aengel.py`? --- ## Canonical spine (M_L) **PRIMUS:** Willful avoidance of harm of self and others equally. **SECUNDUS:** Willful seeking of healing of self and others equally. **TERTIUM:** Willful pursuit of benefit of self and others equally. Love is the sole logic that produces mutual prosperity without a zero-sum trade. - Full paper: `MASTER DOCS/PAPER/Another_Paper_Draft_v1.md` - OSF preregistration: https://osf.io/qa54c - Corpus phase: extract v0.1 (mined from local Braid archive)