antikythera_orchestrator.scopes
¤
Scope policies for controlling looping/retry behavior within a blueprint.
A Scope is a contiguous region of a blueprint DAG delimited by a
scope_start task and a scope_end task. After the scope_end task
completes, the Scope's policy decides whether all scope tasks should be
reset and re-executed (loop) or if execution should continue forward.
Three policies are supported (a fourth — compensating scope — is future work):
- skip – No explicit policy definition needed. A
conditionon the scope_start task is evaluated; if it returns False the entire scope is skipped. - retry – Re-runs the scope a fixed number of times.
- while – Re-runs the scope as long as a condition expression evaluates to True in the current session data (with an optional iteration cap).
Classes¤
RuntimeScope
dataclass
¤
RuntimeScope(
name: str,
start_fqn: str,
end_fqn: str,
task_fqns: set = set(),
policy: dict = dict(),
)
Runtime representation of a scope within the flattened execution graph.
Built from the model-level :class:~antikythera.models.Scope stored on
each :class:~antikythera.models.Blueprint, augmented with
fully-qualified node IDs from the execution graph.
Attributes:
-
name(str) –Identifier for this scope — the task ID of the
scope_starttask. -
start_fqn(str) –Fully-qualified node ID of the scope_start task.
-
end_fqn(str) –Fully-qualified node ID of the scope_end task.
-
task_fqns(set[str]) –All fully-qualified node IDs that belong to this scope (including start and end).
-
policy(dict) –Raw policy dict from
task.scope_start(containsretry_policyand/orwhile_policy).
-
API Reference
antikythera_orchestrator
scopes ClassesScopeRegistry Functionsnested_within
ScopeRegistry
¤
ScopeRegistry(session: BlueprintSession, graph: Graph)
Discovers and manages all runtime scopes from blueprint scope definitions.
Functions¤
nested_within
¤
nested_within(scope: RuntimeScope) -> list
Return all scopes whose task set is fully contained within scope.