← Back to the demo list
Gestalt and Insights
gestalt.js · level 4

Gestalt in Beast — a record of an unresolved problem (goal image, branch, situation, tested automatizms, status). Insight — linking the goal with a candidate solution; part of the insights arrives when an EM frame is closed and from the resonance buffer.

Frame Close: Gestalt_onEpisodeFeedbackClosed
Called from closeLastFrame after computing effect (before clearing waiting globals). A signature of the closed episode is pushed to the buffer: the waiting cycle, goalImageId, branch, situation, automatism, OD, effect, kind (positive_feedback / non_positive). If the waiting cycle had a goal, the Gestalt for goalImageId is found or created: the automatism is appended; when effect > 0 branch/situation are refined and status becomes PARTIAL or, for a strong effect, successful close; when effect ≤ 0 it creates a re-interpretation insight.
Resonance Buffer (GestaltResonanceBuffer)
FIFO signatures of successful and other closes (buffer is length-limited; old entries are evicted). Used for cross-cycle analogy: success in one context can resonate with an open Gestalt of another task.
Level 4: Buffer Processing
In Gestalt_onConsciousnessTick, the master open Gestalt runs Gestalt_processResonanceBufferForCycle: for entries with effect > 0 a score is computed against the Gestalt (goal, branch, situation…). If the score passes the threshold — an analogy insight is registered; automatismIds and analogyPool are updated and status can move NEW → STARTED, etc.
Goal Statuses (Gestalt)
0 — created 1 — started 2 — partial (EM feedback) 3 — successful close

The threshold for a “strong” positive effect that switches into the success status is configured in gestalt.js (EFFECT_STRONG_CLOSE).