@@ agent/python/scope.py
+class ScopeGuard:
+ def allow(self, channel_id: str) -> bool:
+ return channel_id in self._ids
+ def require(self, channel_id: str, action: str) -> None:
+ if not self.allow(channel_id):
+ raise ScopeError(
+ f"blocked {action} on {channel_id}: outside scope {self.scope!r}"
+ )