← Back to the demo list
Consciousness Levels 2–3 and Waiting for a Reply
infofunctions.js · conscience_level_2/3.js
awaitingAutomatismEpisodeFeedback
What it is: a flag on the understanding cycle object. After info_automatismWithEpisodeFeedbackAndExpireCycle starts a motor automatism (runActionImage) and opens an EM frame waiting for the operator reply.

The cycle is marked expired and removed from the “main” queue, but stays running with awaitingAutomatismEpisodeFeedback = true and automatismOperatorAnswerReceived = false until the response stimulus closes the frame. The dispatcher keeps calling runOneStep to process the level 2 reply pipeline after frame close via closeLastFrame.

Related globals: EpisodicMemory_waitingAutomatismCycleId, EpisodicMemory_pendingFeedbackAutomatizmId — which automatism is waiting for feedback in the frame.

Operator Reply After Automatism
Closing the frame with the response stimulus during waiting sets a “reply received” indicator in the info-picture; on the cycle it sets automatismOperatorAnswerReceived. Then closeLastFrame triggers processing that leads to conscience_level_2_operatorAnswerPipeline (once, guarded by operatorAnswerPipelineConsumed).
Level 2 — Operator Reply (Pipeline)
Level 2 after automatism — not mixed with goal setting in the same tick: the call uses _operatorAnswerCycleOnly from runOneStep.

Based on numeric effect of the closed frame: AbstractImages_applyEpisodeEffectToSemanticContextAbstractions — averaging clone significance when the frame matches semanticStructure; when effect > 0MentalAutomatizms_tryCreateFromSemanticStructureRule.

Then adjust goal usefulness (Goals_applyWaitingPeriodEffectToGoalUsefulness) and detectors (negativeMotorEffect, positiveActionEffect, lowAutomatismUsefulness).
Level 3 — Rules and Motor Gate
Attempt order: default mental automatism → shortcut via AbstractImages_findRuleFrameMatchingContext → semantics + the best episodic rule with the same stimulus → teacher fallback (mirrors, regular OD).

Success leads to info_automatismWithEpisodeFeedbackAndExpireCycle — motor again + waiting for an EM frame.
mental → shortcut → EM (effect>0) → teacher
Gate before motorconscience_level_3_semanticStructureFrameAllowsMotor: for shortcuts and the mental path, the motor runs only if the frame is “positive” (teacher), or there is an operator reply for the OD, or an episodic frame with numeric effect > 0. Otherwise the motor does not start from this frame.
While awaitingAutomatismEpisodeFeedback && !automatismOperatorAnswerReceived, the full level 3 is skipped — otherwise the “rule not found” path could trigger again.