wf-core reorg 2 split the Models
This commit is contained in:
@@ -11,7 +11,8 @@ and user-facing control belong in `wf_mcp`.
|
||||
|
||||
| Package / module | Responsibility |
|
||||
| --- | --- |
|
||||
| `wf_core.model` | Pydantic workflow schema: node definitions, node uses, control-flow nodes, edges, schemas, and node results. |
|
||||
| `wf_core.models` | Pydantic workflow schema package: schemas, condition expressions, executable steps, workflow graph, and node results. |
|
||||
| `wf_core.model` | Compatibility facade for older imports of core model objects. |
|
||||
| `wf_core.run_state` | Serializable execution state: run status, frames, trace entries, interrupt requests, and runtime context. |
|
||||
| `wf_core.runtime` | Public execution interface: execute, resume, and step in sync or async mode. |
|
||||
| `wf_core.runtime.ops` | Executor-only operations used behind `wf_core.runtime`: node execution, state writes, frame movement, foreach, interrupts, indexes, and schema checks. |
|
||||
@@ -20,9 +21,9 @@ and user-facing control belong in `wf_mcp`.
|
||||
| `wf_core.paths` | Graph path parsing, reading, existence checks, and nested state writes. |
|
||||
| `wf_core.tokens` | Importable graph boundary tokens: `START` and `END`. |
|
||||
|
||||
Root modules such as `wf_core.node_exec`, `wf_core.state_ops`, and
|
||||
`wf_core.validate` are compatibility shims. New internal imports should prefer
|
||||
the concern package directly.
|
||||
Root modules such as `wf_core.model`, `wf_core.node_exec`, `wf_core.state_ops`,
|
||||
and `wf_core.validate` are compatibility shims. New internal imports should
|
||||
prefer the concern package directly.
|
||||
|
||||
## Runtime Flow
|
||||
|
||||
@@ -54,7 +55,8 @@ raising at the first failure.
|
||||
## Dependency Rules
|
||||
|
||||
- `wf_core` must not import `wf_authoring` or `wf_mcp`.
|
||||
- `wf_core.model` and `wf_core.run_state` should stay mostly data-only.
|
||||
- `wf_core.models` and `wf_core.run_state` should stay mostly data-only.
|
||||
- `wf_core.model` should stay a thin import facade.
|
||||
- `wf_core.runtime` may import `runtime.ops`, but callers should not need to.
|
||||
- `wf_core.runtime.ops` may use model, run state, paths, conditions, and errors.
|
||||
- `wf_core.validation` may inspect model and path rules, but should not execute
|
||||
@@ -63,9 +65,6 @@ raising at the first failure.
|
||||
|
||||
## What This Cleanup Does Not Solve Yet
|
||||
|
||||
- `wf_core.model` is still a single dense schema file. It is coherent today, but
|
||||
if control-flow schemas grow, split it into `model/schemas.py`,
|
||||
`model/steps.py`, and `model/workflow.py`.
|
||||
- `demo_workflow.py` is still large because it is a fixture/demo, not core
|
||||
runtime. If it becomes a permanent example suite, move it out of `wf_core`.
|
||||
- Foreach is still serial-only. Parallel foreach needs an explicit scheduling
|
||||
@@ -76,4 +75,3 @@ raising at the first failure.
|
||||
- Runtime errors are still ordinary exceptions plus failed run status. A richer
|
||||
error payload can be added later, but should be designed as part of trace/run
|
||||
state rather than scattered exceptions.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user