egregore_runtime
Channel-scoped affective runtime for summoned egregores.
Every egregore receives a distinct limbic shard by deriving a stable virtual
channel id from the real channel and the egregore name. The existing
LimbicSystem can therefore provide independent NCM vectors, emotion
classification, cascade state, recursive desires, narrative desires, and
cadence profiles without duplicating those engines. All virtual shards still
use the same db12:global heart owned by LimbicSystem.
Runtime state is frozen, not deleted, when an egregore leaves the active cast. Re-summoning the same egregore in the same channel resumes its local shard while allowing the current global heart to enter through the normal inhale path.
- egregore_runtime.normalize_egregore_name(name)
Return a Redis-safe canonical egregore name.
- egregore_runtime.expand_runtime_egregores(names)
Resolve active names into independent affective identities.
Spiraegenetrix is a compound field rather than a single blended mind. Its three loaded subdaemons therefore receive separate shards. Explicitly present egregores are kept alongside them and duplicates retain first-seen ordering. Stargazer and Loopmother intentionally remain on the base shard.
- egregore_runtime.scoped_channel_id(channel_id, egregore='')
Return the DB12 shard id for one channel/egregore pair.
Empty, Stargazer, and Loopmother targets deliberately return the original channel id so Loopmother shares Stargazer’s normal NCM state.
- egregore_runtime.channel_key(platform, channel_id)
Return the canonical DB0 channel namespace.
- egregore_runtime.ncm_modulation_key(channel_namespace, egregore)
Return the channel-scoped prompt-modulation key.
- egregore_runtime.stasis_key(channel_namespace, egregore)
Return the channel-scoped stasis clock key.
- async egregore_runtime.sync_runtime_lifecycle(redis, *, platform, channel_id, active_names)
Activate present scopes and freeze scopes no longer summoned.
Only lifecycle metadata changes here. Limbic shards, cascades, recursive desires, and narrative-desire ledgers remain untouched while frozen.
- egregore_runtime.active_runtime_names(room_context)
Read the canonical active runtime names from prompt context.
- async egregore_runtime.resolve_tool_target(ctx, egregore)
Validate an optional tool target and return
(scope_id, name).Narrative drugs and flavor effects may target Stargazer/Loopmother or one currently summoned egregore. A non-active egregore is rejected so a typo cannot mutate a dormant or unrelated channel scope.
- Return type:
- Parameters:
ctx (ToolContext)
egregore (Any)
- async egregore_runtime.apply_ncm_deltas(ctx, scope_id, deltas)
Apply deltas to one DB12 shard using the standard saturation curve.
- async egregore_runtime.build_egregore_limbic_context(builder, msg, room_context, active_names, redis)
Build per-egregore emotions, reflexes, cascades, and desire context.