Thread Scope Resolver (src/thread_scope.rs)

ironclaw · crates/loop/ironclaw_loop_host/src/thread_scope.rs · rust · Apache-2.0
auth, database, infra, lang:rust, tag:concurrency, tag:multi-tenancy, tag:isolation

Resolves and enforces canonical owner-scoping for multi-user thread operations. Use this to ensure consistent isolation across different subsystems in a multi-tenant loop host.

// Source: https://github.com/nearai/ironclaw | License: Apache-2.0 | Copyright 2026 NEAR AI
// Provided via justclaw.it.com; keep this notice with the code.
//! Canonical per-caller thread-scope resolution.
//!
//! Multi-user WebChat pins each run to its authenticated caller, and the
//! loop host writes that run's thread under `owners/<caller>`. Every
//! subsequent read/write for the run must resolve the SAME owner — the
//! loop host's thread ports, runner completion-evidence reads, and any
//! composition-side durable thread append that is keyed by a
//! [`LoopRunContext`](ironclaw_loop_contracts::LoopRunContext).
//!
//! [`ThreadScopeResolver::resolve`] is the single definition of that
//! owner-rewrite rule. Both subsystems call it, so the rule cannot drift
//! between them — a seco

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key