Repository navigation
Thinking_Action_Selection
brain/think/ decides what runs next, every cycle. It is the module where control signals, the
workspace, goals, and learned value all converge into a single pick.
-
Deliberation gate (
deliberation_gate.py,should_think()) — decides whether this cycle ignites into full deliberation or stays in low-power default mode (see Workspace and Ignition). Non-ignited cycles damp effortful functions so quiet time drifts toward cheap work. -
Function selector (
think_utils/select_function.py) — a contextual bandit picks the next cognitive function. Control-signal floats, demands, cost predictions, and the workspace winner (an additive prior,ORRIN_WORKSPACE_PRIOR) all bias the draw. The bandit honors an explicit learning rate (constant-step), with a modulated adaptive rate available. Candidate scoring (think_utils/selection/score_actions.py) also adds each action's learned reward EMA (once the action is mature, ≥8 observations) directly, so realized outcomes — not just priors — decide what wins (see Learning and Adaptation). -
Action arbiter (
action_arbiter.py) — the convergence layer's action half: reactive and analytical subsystems propose, the arbiter resolves, so nothing races on shared state. -
Execution — the chosen function runs;
sandbox_runner.pyexecutes generated code safely; outcomes feed reward accounting and the effect ledger.
-
inner_loop.py— the deliberate draft→critique→revise reasoning loop, recruited on ignited and conflicted cycles (ORRIN_CONFLICT_RECRUIT) rather than fired on a schedule. -
inner_loop_symbolic.py— the symbolic-only variant, so deliberation works without an LLM. -
inner_loop_critique.py— the critique pass;depth_bandit.py(UCB1) learns how many rounds are worth running;meta_controller.pychooses shallow vs. deep chains for goal pursuit. -
scratchpad.pyandsimulate.py— working notes and look-ahead simulation of candidate actions.
brain/cognition/cost_prediction.py is an expected-value-of-control layer: each function's
predicted cost (time, tokens, energy) competes against its predicted payoff, so expensive functions
must be worth it. Attention can still be hijacked by urgent signals (brain/cognition/attention.py).
speech_builder.py, speech_coherence.py, speech_comprehension.py — building and checking
person-facing utterances. Actual delivery goes through the one door:
Expression Membrane.
Bandit statistics, per-function EMAs, and EVC predictions are surfaced in the UI's Cognition room; instrument those first when diagnosing mis-selection. The Reward Auditor peer flags a reward signal that has collapsed to noise.
-
brain/think/— everything above -
brain/think/bandit/— bandit implementation -
brain/cognition/cost_prediction.py— EVC layer
- Cognitive Loop
- Workspace & Ignition
- Binding & Writeback
- Thinking & Action Selection
- Learning & Adaptation
- Effect Ledger
- Quality Standard
- Expression Membrane
- Self-Code
- Native Language Model
- Existence & Lifecycle