|
@@ -31,6 +31,11 @@ class PlannerState:
|
|
|
latest_failures: tuple[Mapping[str, Any], ...]
|
|
latest_failures: tuple[Mapping[str, Any], ...]
|
|
|
retired_task_count: int
|
|
retired_task_count: int
|
|
|
changes: tuple[Mapping[str, Any], ...] = ()
|
|
changes: tuple[Mapping[str, Any], ...] = ()
|
|
|
|
|
+ active_total: int = 0
|
|
|
|
|
+ active_has_more: bool = False
|
|
|
|
|
+ accepted_total: int = 0
|
|
|
|
|
+ accepted_has_more: bool = False
|
|
|
|
|
+ context_bundle: Mapping[str, Any] = field(default_factory=dict)
|
|
|
|
|
|
|
|
def to_payload(self) -> dict[str, Any]:
|
|
def to_payload(self) -> dict[str, Any]:
|
|
|
return asdict(self)
|
|
return asdict(self)
|
|
@@ -42,9 +47,9 @@ class WorkerState:
|
|
|
task: Mapping[str, Any]
|
|
task: Mapping[str, Any]
|
|
|
input_summary: Mapping[str, Any]
|
|
input_summary: Mapping[str, Any]
|
|
|
accepted_inputs: tuple[Mapping[str, Any], ...]
|
|
accepted_inputs: tuple[Mapping[str, Any], ...]
|
|
|
- source_handles: tuple[Mapping[str, Any], ...]
|
|
|
|
|
paragraph_targets: tuple[Mapping[str, Any], ...]
|
|
paragraph_targets: tuple[Mapping[str, Any], ...]
|
|
|
workspace_summary: Mapping[str, Any]
|
|
workspace_summary: Mapping[str, Any]
|
|
|
|
|
+ context_bundle: Mapping[str, Any] = field(default_factory=dict)
|
|
|
latest_failure: Mapping[str, Any] | None = None
|
|
latest_failure: Mapping[str, Any] | None = None
|
|
|
|
|
|
|
|
def to_payload(self) -> dict[str, Any]:
|
|
def to_payload(self) -> dict[str, Any]:
|
|
@@ -58,6 +63,8 @@ class ValidatorState:
|
|
|
artifact: Mapping[str, Any]
|
|
artifact: Mapping[str, Any]
|
|
|
evidence_handles: tuple[Mapping[str, Any], ...]
|
|
evidence_handles: tuple[Mapping[str, Any], ...]
|
|
|
accepted_closure: tuple[Mapping[str, Any], ...]
|
|
accepted_closure: tuple[Mapping[str, Any], ...]
|
|
|
|
|
+ required_handles: tuple[str, ...] = ()
|
|
|
|
|
+ context_bundle: Mapping[str, Any] = field(default_factory=dict)
|
|
|
|
|
|
|
|
def to_payload(self) -> dict[str, Any]:
|
|
def to_payload(self) -> dict[str, Any]:
|
|
|
return asdict(self)
|
|
return asdict(self)
|
|
@@ -90,7 +97,7 @@ def strategy_handle(snapshot_id: str, index: int, value: Mapping[str, Any]) -> s
|
|
|
or value.get("sha256")
|
|
or value.get("sha256")
|
|
|
or json.dumps(value, sort_keys=True, default=str)
|
|
or json.dumps(value, sort_keys=True, default=str)
|
|
|
)
|
|
)
|
|
|
- return semantic_handle("strategy", snapshot_id, identity, immutable)
|
|
|
|
|
|
|
+ return semantic_handle("strategy", snapshot_id, index, identity, immutable)
|
|
|
|
|
|
|
|
|
|
|
|
|
def strategy_ref(snapshot_id: str, index: int, value: Mapping[str, Any]) -> str:
|
|
def strategy_ref(snapshot_id: str, index: int, value: Mapping[str, Any]) -> str:
|
|
@@ -165,6 +172,32 @@ def protect_model_value(value: Any, *, namespace: str) -> Any:
|
|
|
)
|
|
)
|
|
|
for identity in item
|
|
for identity in item
|
|
|
]
|
|
]
|
|
|
|
|
+ elif lowered in {
|
|
|
|
|
+ "uri",
|
|
|
|
|
+ "url",
|
|
|
|
|
+ "source_uri",
|
|
|
|
|
+ "artifact_uri",
|
|
|
|
|
+ "raw_artifact_ref",
|
|
|
|
|
+ }:
|
|
|
|
|
+ output[f"{name}_handle"] = reference_handle(item)
|
|
|
|
|
+ elif lowered in {
|
|
|
|
|
+ "account_id",
|
|
|
|
|
+ "branch_id",
|
|
|
|
|
+ "evidence_id",
|
|
|
|
|
+ "execution_id",
|
|
|
|
|
+ "script_build_id",
|
|
|
|
|
+ "artifact_version_id",
|
|
|
|
|
+ "input_snapshot_id",
|
|
|
|
|
+ "record_id",
|
|
|
|
|
+ "run_id",
|
|
|
|
|
+ "source_id",
|
|
|
|
|
+ "strategy_id",
|
|
|
|
|
+ "topic_build_id",
|
|
|
|
|
+ "topic_id",
|
|
|
|
|
+ }:
|
|
|
|
|
+ output[f"{name.removesuffix('_id')}_handle"] = semantic_handle(
|
|
|
|
|
+ name.removesuffix("_id"), namespace, item
|
|
|
|
|
+ )
|
|
|
elif name in {"scope_ref", "write_scope"}:
|
|
elif name in {"scope_ref", "write_scope"}:
|
|
|
output["scope_selector"] = scope_selector(item)
|
|
output["scope_selector"] = scope_selector(item)
|
|
|
elif lowered.endswith("_ref"):
|
|
elif lowered.endswith("_ref"):
|