subgraph model & validation

This commit is contained in:
lda
2026-05-25 01:12:41 +07:00 Verified
parent c06df7613b
commit 2af0b3357f
16 changed files with 285 additions and 35 deletions
@@ -56,11 +56,19 @@ class SubgraphNode(BaseModel):
id: str
type: Literal["subgraph"]
workflow: WorkflowRef
input_schema: SchemaRef
output_schema: SchemaRef
input: list[InputBinding] = Field(default_factory=list)
output: list[OutputBinding] = Field(default_factory=list)
outcomes: list[str] = Field(default_factory=lambda: ["ok"])
```
Current implementation status: `wf_core` has a first placeholder
`SubgraphNode`, but `workflow` is still a plain string reference. The placeholder
also carries `input_schema` and `output_schema` so validation can check parent
bindings before native execution exists. Runtime execution intentionally raises
until a later slice adds child scope/frame execution.
`WorkflowRef` should be structural, not a dotted string parser:
```python