Skip to main content

resolve_scope

Function resolve_scope 

Source
pub fn resolve_scope(
    user_ctx: &UserContext,
    explicit_scope: Option<MemoryScope>,
) -> MemoryScope
Expand description

Resolve the effective scope for a new memory given the caller’s identity and an optional explicit scope hint.

Rules:

  • Anonymous callers may only write Global or Agent scoped memories.
  • Authenticated callers may write any scope.
  • If no explicit scope is provided, authenticated callers default to User, anonymous callers default to Global.