> Codex v9.10.64 · Track 4 · 🔴 not started · Codex §Comprehensive Plans
> AI / low-credit: One extraction phase per session; compile-verify after each; on stop log Last worked / Next.
Refactor App::process_input in src/main.rs to improve maintainability, reduce cognitive load for developers, and prepare for multi-threaded cognitive processing.
src/main.rsApp::process_inputExtract L3972-L4746 into App::handle_command(&mut self, input: &str) -> bool.
true, the input was a command and further processing should stop.readfile, writefile, recall, learn, spell, store, import logic here.Create a new method App::run_cognitive_cycle(&mut self, input: &str).
Inside this, group module updates into logical "Phases":
1. Ingestion Phase: Amygdala, LexSem, Wernicke, Hub Ingest.
2. Retrieval Phase: RSHL Query, Hippocampus CA3, Predictor.
3. Limbic Processing Phase: Dopamine, VTA, Serotonin, Norepinephrine, ACC, Cortisol.
4. Social/ToM Phase: ToM, TPJ, STS, Mirror Neurons, Oxytocin.
5. Executive/Decision Phase: PFC, Basal Ganglia, OFC, Cerebellum.
6. Integration Phase: Claustrum, Global Workspace, Self-State Hub.
7. Synthesis Phase: Voice Engine, NLS, Broca.
Move module-specific logic (e.g., the complex RPE math) into the modules themselves where possible. process_input should ideally just be a series of self.module.update(...) calls.
handle_command.process_input by ~800 lines.BrainSignals struct and the SelfStateHub to be the primary data exchange.Hub and write to the Hub rather than having main.rs manually pass 10+ variables between them.App::update_cognitive_modules.CognitiveStack struct that can be processed in parallel with the UI thread.Sonic-Parallel logic into a dedicated VocalConductor class in leo.mjs.Promise.all wrapper to maintain the sub-3.5s latency benchmark.execSync remnants from voice-biometrics.mjs to prevent event-loop blocking.IDENTITY PROTOCOL is consistently injected during parallel neural synthesis.