reducer path to strengthen too

This commit is contained in:
lda
2026-05-21 04:19:50 +07:00 Verified
parent 444b5735c1
commit d089e28c15
9 changed files with 201 additions and 38 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ from __future__ import annotations
from wf_authoring import WorkflowBuilder
from wf_authoring.dsl import PathExpr
from wf_core import JoinNode, Workflow
from wf_core.paths import GraphSourcePath
from .models import (
DraftChooseStep,
@@ -81,7 +82,7 @@ def _add_step(builder: WorkflowBuilder, step_id: str, step: DraftStep):
).entry
if isinstance(step, DraftMatchStep):
return builder.match(
PathExpr(step.match.value),
PathExpr(GraphSourcePath.parse(step.match.value)),
{case.equals: case.then for case in step.match.cases},
id=step_id,
default=step.match.default,
+2 -6
View File
@@ -3,7 +3,7 @@ from __future__ import annotations
from collections.abc import Mapping
from wf_core import ReducerRef, Workflow
from wf_platform import CapabilityRef, NodeSpecInventory
from wf_platform import NodeSpecInventory
from .models import ArtifactKind, JsonObject, RequiredCapability, WorkflowArtifact
from .references import normalize_plan_node_refs
@@ -99,12 +99,8 @@ def _required_reducers_from_plan(plan: JsonObject) -> dict[str, RequiredCapabili
reducer = ReducerRef.model_validate(reducer_payload)
except ValueError:
continue
try:
reducer_ref = CapabilityRef.parse(reducer.name)
except ValueError:
continue
requirements[reducer.name] = RequiredCapability(
ref=reducer_ref,
ref=reducer.ref,
kind="reducer",
)
return requirements