Conscious automatisms and the awareness process — implementation strategy
Document to prepare the next stage: conscious automatisms and the awareness process. The old implementation was in Go (OLD_CODE); the new JS stack already has stronger adaptive systems — avoid dragging obsolete patterns into the new code, but keep the conceptual frame.
0. Project purpose and scope
Purpose: the project is not “a working creature and raising it”, but the most adequate way to implement the theory of individual adaptivity. As theories are formalized mathematically, adaptivity theory is best described by a program — an analogue of math in physics, but more effective for describing the circuitry of adaptive systems.
Out of scope for the new implementation:
- Operator word/phrase input and verbal trees (phrase recognition, words, symbols, tone and mood of messages). They greatly complicate the project and its understanding; to formalize the theory, layers suffice: homeostasis, contexts, stimuli (buttons), reflexes, conditional perception tree (by active stimuli), episodic and semantic memory, awareness and automatisms.
- The perception tree keeps a 6-level structure (BaseID, EmotionID, ActivityID, ToneMoodID, SimbolID, PhraseID) for compatibility with theory and OLD_CODE, but levels 4–6 are not filled from verbal input — they stay 0 or may later serve other non-verbal measures.
1. Where we are now (JS)
Hooks for awareness and automatisms already exist:
| Component | Purpose |
|---|---|
| OR | Pick the most salient stimulus, block reflex for 2 pulses, call hippocampus, stimuls_consciousness(actual_stimul_ID), save EM. |
| Hippocampus | active_stimulsArr_ID, actual_stimul_ID — hold the stimulus that triggered OR. |
| _9_Conscience | stimuls_consciousness(actual_stimul_ID) — stub; called from OR on a new winner and on response stimulus during EM waiting. Natural place to hang the “awareness process”. |
| Perception tree | 6 levels, terminal node = conditions; binding reflexes/automatisms to a branch is already described. |
| EM | Frame: conditions (perceptionNodeId), stimulus, action, effect, response stimulus — ready context for comprehension. |
| AI | Action images; stimulus → action link already exists. |
| CR | Conditioned reflexes by context (BadNormWell + emotion) and FinalImageId. |
So: a channel to the “cortex” exists (stimuls_consciousness call), context can be built from tree, EM, and AI. Missing: an explicit “conscious automatism” model and an “awareness process” loop (what this channel processes).
2. Recommendation: lean on the new stack; old code is concept only
- Do not port OLD_CODE wholesale into JS. Language, data structures, and flows differ; already implemented pieces (pulse, OR, EM by pulses, tree, SM, CR with global IDs, etc.) may be missing or behave differently in the old version. Copying “as was” is risky and creates friction.
- Use OLD_CODE as a glossary of concepts and scenarios: what was called “conscious automatism”, what went into “awareness process”, call order. Terms and step order can be listed and mapped onto the current architecture.
- Build new logic on what exists: perception tree (terminal node = conditions), EM (frame with conditions, stimulus, action, effect, response), AI, hippocampus, OR. Conscious automatisms then sit above conditioned reflexes and tree (e.g. bind to tree node + awareness). The awareness process is what runs inside or around
stimuls_consciousness(what passes through the attention channel and how it is used).
If the OLD_CODE folder is available (next to the project or another repo), it helps to:
- extract key entities (automatism structures, awareness steps);
- map them to current: perceptionNodeId, stimulusImageId, actionImageId, Episodes, FinalImage, tree;
- record gaps and decide within the JS architecture.
3. Possible shape of a “conscious automatism” in the new stack
Without relying on old code, a draft format:
- Conscious automatism — rule: under conditions C (perception-tree branch, i.e. perceptionNodeId or path) and stimulus image S (FinalImageId) execute action image A (AI), optionally after “running through” awareness (decision confirmed/adjusted by the awareness process).
- Unlike conditioned reflex: bind to tree node (conditions unfolded by levels), optional episodic context (recent EM frames), explicit awareness step before/after action.
Then:
- inputs: current terminal tree node, actual_stimul_ID (and if needed recent EM frames);
- outputs: chosen/confirmed action (AI), possible memory updates (EM/SM) from awareness outcome.
4. Possible shape of the “awareness process”
- Awareness process — what happens on
stimuls_consciousness(actual_stimul_ID)and, if needed, over the next pulses: what is “made aware” and how that affects behavior and memory. - In current code
stimuls_consciousnesscan already receive not onlyactual_stimul_IDbut a context bundle: terminal tree node, last/current EM frame (if any), flag “response stimulus during waiting”, etc. Then the “awareness process” is a function that takes this bundle and decides next steps (e.g. start conscious automatism, reprioritize, write memory).
Next implementation steps could be staged, for example:
- Widen the
stimuls_consciousnesscall with context (tree, EM, OR/EM flags). - Define the “conscious automatism” data structure and storage (array + persistence, like CR/EM).
- Introduce an awareness loop: from context pick candidate automatisms, optionally run through “awareness”, execute chosen action (via existing effectors/AI).
5. Summary
- Old code (OLD_CODE): use only for terms and ideas; do not copy implementation.
- New implementation: build conscious automatisms and awareness on the current JS stack (pulse, OR, tree, EM, AI, SM, CR, hippocampus,
stimuls_consciousness). - Next step: if OLD_CODE is available — extract concepts and flows and align with this doc; then fix the
stimuls_consciousnesscontract (input context) and conscious automatism format and implement in stages above.
6. Mapping to OLD_CODE (Go) — after loading the old implementation
The OLD_CODE folder holds the old implementation (Go + console). Below: distilled concepts and flows for idea transfer to JS, without copying code.
6.1 Automatism tree (Go)
- Files:
OLD_CODE/GO/brain/psychic/automatism_tree.go,automatizm_functions.go,automatism_tree_func.go. - Node structure: 6 levels — BaseID, EmotionID, ActivityID, ToneMoodID, SimbolID, PhraseID (same layout as our perception tree). In the new build levels 4–6 (ToneMoodID, SimbolID, PhraseID) are unused — verbal input and verbal trees are out of scope (see §0).
- Idea: Automatisms attach to tree branches; on branch activation a “default” automatism is chosen (Usefulness, Belief). Missing branch/automatism triggers OR and comprehension. Automatism with success == 1 blocks reflexes (“voluntary control” achieved).
- In JS: Perception tree exists (
_7_perception_tree), node format compatible; active branch from levels 1–3 (BaseID, EmotionID, ActivityID). No “automatism per node” and action-by-node selection yet — layer above tree and CR.
6.2 Awareness process (Go)
- Files:
understanding.go,0_main_psychic.go,mental_automatizm_INFO_functions.go,dreaming.go. - Chain: Per stimulus — consciousnessElementary() (awareness levels 1–2). If a problem remains — consciousnessThinking(cID) in thinking loops. Loops like cycleInfo, dispatcher dispetchConsciousnessThinking() per pulse.
- consciousnessElementary():
- Finds the “pressing” automatism by tree node:
atmtzmActualTreeNodeID = getAutomatizmFromNodeID(detectedActiveLastNodID). - An ignoring automatism counts as no reaction.
- Checks: danger, theme/goal fit (isStimulToForce), effect forecast, Rules (episodic). Decision: run default automatism, alternative, or block and hand off to thinking loops.
- Finds the “pressing” automatism by tree node:
- consciousnessThinking(): thinking loops (info functions infoFunc*), problem dominant, passive reflection/dreams. Mental and motor automatisms start from the loop.
- In JS: Analogue of “elementary” awareness — extended stimuls_consciousness(actual_stimul_ID): input actual_stimul_ID + current terminal tree node + last EM frame (and “response stimulus” flag). Inside — choice: is there an automatism for the node; if yes confirm/run; if no — hand to “thinking loop” (in JS can start as a simple task queue or one heuristic step over EM/Rules).
6.3 Automatism in Go
- Structure: bind to tree node (TreeNodeID), action image (ActionsImageID), Usefulness, Belief (default / tentative / blocked). Motor and mental automatisms exist.
- In JS: Action image exists (AI, action_image). “Conscious automatism” in JS can be: perceptionNodeId + (optional stimulusImageId) → actionImageId, with fields like usefulness/belief and priority vs CR (automatism blocks reflex on success).
6.4 Take from OLD_CODE as ideas only
- Order: pulse → tree activation → pick automatism by node → consciousnessElementary → consciousnessThinking if needed.
- Concepts: default / ignoring / alternative automatism, post-action answer waiting period, “Rules” (episodic frames) for effect forecast and alternative choice.
- Do not port literally: EvolushnStage, sleep/dreams, full set of info functions and loops — implement as needed on EM, tree, and AI in JS.
6.5 Recommended order in JS
- Extend stimuls_consciousness: pass context (terminalNodeId, lastEpisodeFrame, isResponseStimulus).
- Add conscious automatism store: bind to perceptionNodeId (and optional stimulusImageId), actionImageId, usefulness/belief flags.
- In stimuls_consciousness by context: find automatism by node; if found and “default” — run action (via AI/effectors); if not — stub for future “thinking loop” or simple choice by Rules (EM).
- Reflex link: if a successful automatism exists for the node, do not start conditioned/genetic reflex (as in Go: automatism blocks reflex).
- If needed add per-pulse “thinking dispatcher” (simplified dispetchConsciousnessThinking) for a queue of unresolved situations.
Details of old structures (Automatizm, cycleInfo, infoFunc*) can be checked in OLD_CODE/GO/brain/psychic/ when needed.