Skip to main content

Module task_scope

Module task_scope 

Source
Expand description

Scope gating for incoming A2A tasks and bus events.

Agents must only act on work that falls within their declared scope. This module centralises the “is this task/event for me?” check so every intake path (SSE, polling, bus broadcast) applies the same rules.

§Scope dimensions

DimensionWhere it comes fromReject if
target_agenttask metadata target_agent_namenon-empty AND ≠ worker agent name
target_workertask metadata target_worker_idnon-empty AND ≠ worker ID
workspacetask workspace_id / metadatanot in worker’s registered set*

* An empty/absent workspace ID is treated as a global broadcast (virtual task) and is always accepted.

Functions§

check_task_scope
Whether a task is within scope for a given worker.