Expand description
Belief state module: maintains per-tool confidence and task-level uncertainty, updated each turn via Bayesian beta-distribution updates.
Implements the proactive uncertainty awareness from Active Inference (Section 2.1 of CHUMP_TO_COMPLEX.md). The belief state drives Expected Free Energy scoring and epistemic escalation.
Part of the Synthetic Consciousness Framework, Section 2.
Structs§
- EFEScore
- Expected Free Energy components for a candidate tool call.
- Task
Belief - Task-level belief state: overall confidence in the current task trajectory.
- Tool
Belief - Per-tool reliability belief, modeled as a Beta(alpha, beta) distribution. Alpha = successes + 1 prior, Beta = failures + 1 prior.
Functions§
- belief_
state_ enabled - Returns
falsewhenCHUMP_BYPASS_BELIEF_STATE=1(ortrue). - context_
summary - Format belief state summary for context injection.
Returns an empty string when
CHUMP_BYPASS_BELIEF_STATE=1(no injection). - decay_
turn - Decay task freshness (call once per turn).
No-op when
CHUMP_BYPASS_BELIEF_STATE=1. - metrics_
json - JSON metrics for the health endpoint.
- nudge_
trajectory - Adjust trajectory confidence by a delta (positive = increase, negative = decrease).
Used by the perception layer to lower confidence when input is highly ambiguous.
No-op when
CHUMP_BYPASS_BELIEF_STATE=1. - restore_
from_ snapshot - Restore belief state from a snapshot (used by speculative execution rollback).
- score_
tools - Score a set of candidate tools by Expected Free Energy. Returns scores sorted by G ascending (lowest G = best choice).
- score_
tools_ except - Score all known tools except
excluded, sorted by EFE ascending (best first). - should_
escalate_ epistemic - Should the agent escalate to the human due to epistemic uncertainty?
Returns
false(no escalation) whenCHUMP_BYPASS_BELIEF_STATE=1. Otherwise returns true when task uncertainty is very high (> threshold). - snapshot_
inner - Snapshot the full inner state for speculative execution forking.
- task_
belief - Get the current task belief state.
- tool_
belief - Get belief for a specific tool.
- tool_
reliability - Reliability of a single tool from the Beta mean. Returns 0.5 (prior) if unknown.
- update_
tool_ belief - Record a tool call outcome and update beliefs.
No-op when
CHUMP_BYPASS_BELIEF_STATE=1.