scope / lineage in frame

more structs to prepare for subgraph
This commit is contained in:
lda
2026-05-24 23:53:52 +07:00 Verified
parent 6afc9a8c9a
commit 12c70513ba
3 changed files with 99 additions and 1 deletions
+16 -1
View File
@@ -4,7 +4,14 @@ from copy import deepcopy
from wf_core.models.workflow import Workflow
from wf_core.paths import set_nested_value
from wf_core.run_state import ExecutionFrame, FrameStatus, RunState, RunStatus
from wf_core.run_state import (
ExecutionFrame,
FrameStatus,
LineageState,
RunState,
RunStatus,
RuntimeScope,
)
from wf_core.runtime.scheduler import add_frame
@@ -19,6 +26,14 @@ def create_run_state(workflow: Workflow, workflow_input: dict[str, object]) -> R
status=RunStatus.PENDING,
workflow_input=dict(workflow_input),
state=state,
scopes={
"root": RuntimeScope(
id="root",
workflow_name=workflow.name,
committed_state=state,
)
},
lineages={"root": LineageState(id="root", scope_id="root")},
current_frame_id="root",
current_node_id=workflow.start,
)