feature_toggles
Per-channel feature toggles stored in Redis.
Allows authorised users to disable the NCM neurotransmitter subsystem
(cadence post-processing + NCM tools like inject_ncm) or the RAG
subsystem on a per-channel basis via !emotions on/off and
!rag on/off.
NOTE: !emotions off does NOT affect the Sigma Limbic Recursion Core.
The limbic inhale (context injection) and exhale (emotional feedback loop)
always run. Star always knows her emotions. The toggle only disables
the surface layer: cadence text degradation and tool access to NCM.
Redis key scheme
stargazer:toggle:{feature}:{channel_key}
where feature is "emotions" or "rag" and channel_key is
"{platform}:{channel_id}".
- async feature_toggles.is_disabled(redis, feature, channel_key)[source]
Return
Trueif feature is disabled for channel_key.
- async feature_toggles.set_disabled(redis, feature, channel_key, disabled)[source]
Enable or disable feature for channel_key.
- feature_toggles.check_toggle_permission(msg, config)[source]
Return
Trueif the user is allowed to toggle features.Allowed when any of the following are true:
The user is a bot admin (
config.admin_user_ids).The user has server/channel admin privileges (Discord
guild_permissions.administrator; Matrix power level ≥ 50).The channel is a DM.
- Return type:
- Parameters:
msg (IncomingMessage)
config (Config)