plan + fmt

This commit is contained in:
lda
2026-06-02 17:06:03 +07:00 Verified
parent 19f6fa3e40
commit 5c11aa7cc8
27 changed files with 1273 additions and 3 deletions
@@ -13,6 +13,7 @@
### Task 1: Prove Stateful Proxy Behavior
**Files:**
- Modify: `tests/fixtures/mcp_echo_server.py`
- Modify: `tests/wf_mcp/test_proxy.py`
- Modify: `tests/wf_mcp/test_protocol_relay.py`
@@ -25,6 +26,7 @@
### Task 2: Use FastMCP Stateful Proxy Sessions
**Files:**
- Modify: `src/wf_mcp/proxy/mounts.py`
- [ ] Replace `create_proxy(Client(...))` with `StatefulProxyClient(...)` and `FastMCPProxy(client_factory=client.new_stateful, ...)`.
@@ -34,6 +36,7 @@
### Task 3: Verification
**Files:**
- Test: `tests/wf_mcp/test_proxy.py`
- Test: `tests/wf_mcp/test_protocol_relay.py`
@@ -63,6 +63,7 @@ thin MCP-facing delegation points.
### Task 1: Add A Versioned `RunState` Storage Codec
**Files:**
- Create: `src/wf_core/run_codec.py`
- Modify: `src/wf_core/__init__.py`
- Create: `tests/core/test_run_codec.py`
@@ -225,6 +226,7 @@ Expected: PASS and `0 errors`.
### Task 2: Add Typed Run Records And A File-Backed Run Store
**Files:**
- Create: `src/wf_artifacts/runs/__init__.py`
- Create: `src/wf_artifacts/runs/models.py`
- Create: `src/wf_artifacts/runs/store.py`
@@ -436,6 +438,7 @@ Expected: PASS and `0 errors`.
### Task 3: Pin The Resolved Saved-Child Environment Used By A Run
**Files:**
- Modify: `src/wf_mcp/workflow_surface/saved_subgraphs.py`
- Modify: `src/wf_mcp/broker/service/core.py`
- Test: `tests/wf_mcp/test_saved_subgraphs.py`
@@ -541,6 +544,7 @@ Expected: PASS and `0 errors`.
### Task 4: Replace Process-Local Active Runs With Durable Lifecycle Helpers
**Files:**
- Modify: `src/wf_core/runtime/engine.py`
- Create: `src/wf_mcp/workflow_surface/run_lifecycle.py`
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
@@ -833,6 +837,7 @@ Expected: PASS and `0 errors`.
### Task 5: Block Resume When Pinned External Dependencies Are No Longer Ready
**Files:**
- Modify: `src/wf_mcp/workflow_surface/run_lifecycle.py`
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- Test: `tests/wf_mcp/test_durable_runs.py`
@@ -941,6 +946,7 @@ Expected: PASS and `0 errors`.
### Task 6: Expose Inspect And Bounded Trace Tools
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- Modify: `src/wf_mcp/workflow_surface/tools.py`
- Modify: `src/wf_mcp/broker/artifact_tools.py`
@@ -1027,6 +1033,7 @@ Expected: PASS and `0 errors`.
### Task 7: Documentation, Regression Verification, And Unsupported Policy Notes
**Files:**
- Modify: `docs/current_roadmap.md`
- Modify: `docs/workflow_artifacts.md`
- Modify: `docs/wf_mcp_operator_manual.md`
@@ -124,6 +124,7 @@ Output shape:
## Task 1: Dependency And Plan Reset
**Files:**
- Modify: `pyproject.toml`
- Modify: `uv.lock`
- Modify: `docs/superpowers/plans/2026-05-27-openapi-capability-source.md`
@@ -174,6 +175,7 @@ Expected: prints `openapi_core httpx`.
## Task 2: Remove Generated-Client Runtime Coupling
**Files:**
- Modify: `src/wf_openapi/codegen.py`
- Modify: `src/wf_openapi/executor.py`
- Modify: `tests/openapi/test_codegen_executor.py`
@@ -249,6 +251,7 @@ Expected: generated-client tests that no longer match are removed/replaced; rema
## Task 3: Generic Request Builder
**Files:**
- Create: `src/wf_openapi/request.py`
- Test: `tests/openapi/test_request_builder.py`
@@ -367,6 +370,7 @@ Expected: PASS.
## Task 4: openapi-core Validation Adapter
**Files:**
- Create: `src/wf_openapi/validation.py`
- Test: `tests/openapi/test_validation.py`
@@ -442,6 +446,7 @@ Expected: PASS.
## Task 5: Generic HTTP Executor
**Files:**
- Modify: `src/wf_openapi/executor.py`
- Test: `tests/openapi/test_executor.py`
@@ -522,6 +527,7 @@ Expected: PASS.
## Task 6: Source Integration
**Files:**
- Modify: `src/wf_openapi/source.py`
- Test: `tests/openapi/test_source.py`
@@ -574,6 +580,7 @@ Expected: PASS.
## Task 7: Docs And Final Cleanup
**Files:**
- Create: `docs/openapi_capability_source.md`
- Modify: `docs/current_roadmap.md`
- Delete or rewrite: generated-client-only tests/files if no longer used.
@@ -100,6 +100,7 @@ If top-level `output` is empty, the runtime keeps the legacy same-name fallback:
for every field in `output_schema`, it copies the top-level state field with the
same name when present. That fallback is convenient, but explicit output
projection is clearer for new workflows.
```
- [ ] **Step 2: Run grep check**
@@ -138,6 +139,7 @@ For explicit final output projection from state, use:
```
Do not use `source` at top level. `source` belongs to step output bindings.
```
- [ ] **Step 2: Run grep check**
@@ -51,6 +51,7 @@
### Task 1: Add Generic Next-Actions Unit Tests
**Files:**
- Create: `tests/wf_mcp/workflow_surface/test_next_actions.py`
- [ ] **Step 1: Write failing tests for high-confidence wrapper hints**
@@ -143,6 +144,7 @@ Expected: FAIL with `ModuleNotFoundError: No module named 'wf_mcp.workflow_surfa
### Task 2: Implement `next_actions.py`
**Files:**
- Create: `src/wf_mcp/workflow_surface/next_actions.py`
- [ ] **Step 1: Create the generic models and wrapper-hints constructor**
@@ -332,6 +334,7 @@ Expected: PASS.
### Task 3: Replace Wrapper-Specific MCP Models with Generic Models
**Files:**
- Modify: `src/wf_mcp/workflow_surface/models.py`
- [ ] **Step 1: Import generic next-action models**
@@ -396,6 +399,7 @@ NextActions
### Task 4: Replace Handler Dict Helpers with `NextActions`
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- [ ] **Step 1: Import `NextActions`**
@@ -448,6 +452,7 @@ Expected: PASS except for assertions that still need additive `can_continue` che
### Task 5: Update Integration and Schema Tests
**Files:**
- Modify: `tests/wf_mcp/workflow_surface/test_drafts.py`
- Modify: `tests/wf_mcp/server/test_config.py`
@@ -515,6 +520,7 @@ Expected: PASS.
### Task 6: Add a Small Documentation Note
**Files:**
- Modify: `docs/workflow_capabilities.md`
- [ ] **Step 1: Add an advisory-guidance note**
@@ -543,6 +549,7 @@ Expected: PASS.
### Task 7: Full Verification
**Files:**
- All touched files.
- [ ] **Step 1: Run focused tests**
@@ -179,6 +179,7 @@ delete_deployment for temporary deployments
```
Do not expect a newly saved workflow to appear as a new MCP tool in an existing client session. Use `run_deployment` and `call_capability` as stable front doors.
```
- [ ] **Step 3: Add an explicit live validation example**
@@ -208,6 +209,7 @@ Expected successful shape:
```
If a bound upstream source is down, expect `status="unrunnable"` and a diagnostic with `code="source_unreachable"`.
```
- [ ] **Step 4: Add a cleanup example**
@@ -233,6 +235,7 @@ Expected:
"deleted": true
}
```
```
- [ ] **Step 5: Run grep sanity check**
@@ -305,6 +308,7 @@ arguments:
```
This deletes only the mutable deployment binding. Saved artifacts and durable run records remain.
```
- [ ] **Step 4: Run grep sanity check**
@@ -52,6 +52,7 @@
### Task 1: Add Constructor Unit Tests
**Files:**
- Modify: `tests/wf_mcp/workflow_surface/test_next_actions.py`
- [ ] **Step 1: Add imports**
@@ -172,6 +173,7 @@ Expected: FAIL with `AttributeError` for missing `from_deployment_validation` an
### Task 2: Implement Deployment/Run Constructors
**Files:**
- Modify: `src/wf_mcp/workflow_surface/next_actions.py`
- [ ] **Step 1: Add type-only imports**
@@ -379,6 +381,7 @@ Expected: PASS.
### Task 3: Thread NextActions Through Deployment Validation
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- Modify: `tests/wf_mcp/workflow_surface/test_deployments.py`
@@ -449,6 +452,7 @@ Expected: PASS.
### Task 4: Thread NextActions Through Run Payloads
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- Modify: `tests/wf_mcp/workflow_surface/test_runs.py`
@@ -548,6 +552,7 @@ Expected: PASS.
### Task 5: Update MCP Output Schema Tests
**Files:**
- Modify: `tests/wf_mcp/server/test_config.py`
- Modify: `tests/wf_mcp/server/test_tools.py`
@@ -597,6 +602,7 @@ Expected: PASS.
### Task 6: Update Docs
**Files:**
- Modify: `docs/workflow_capabilities.md`
- [ ] **Step 1: Add deployment/run guidance note**
@@ -626,6 +632,7 @@ Expected: PASS.
### Task 7: Verification
**Files:**
- All touched files.
- [ ] **Step 1: Run focused test set**
@@ -13,6 +13,7 @@
### Task 1: Create `src/wf_api/models.py` with RawWorkflowPlan
**Files:**
- Create: `src/wf_api/models.py`
- [ ] **Step 1: Create the file with the model**
@@ -63,6 +64,7 @@ Expected: `RawWorkflowPlan`
### Task 2: Replace `wf_mcp.models.RawWorkflowPlan` definition with shim
**Files:**
- Modify: `src/wf_mcp/models.py`
- [ ] **Step 1: Replace the RawWorkflowPlan class definition with a re-export**
@@ -95,6 +97,7 @@ Expected: no errors
### Task 3: Update `wf_mcp/__init__.py` to import from shim
**Files:**
- Verify: `src/wf_mcp/__init__.py`
No change needed — `wf_mcp/__init__.py` already imports `RawWorkflowPlan` from `.models`, and the shim re-exports it. Verify this still works.
@@ -109,6 +112,7 @@ Expected: `RawWorkflowPlan`
### Task 4: Add focused tests
**Files:**
- Create: `tests/wf_api/test_raw_workflow_plan_extraction.py`
- [ ] **Step 1: Write the tests**
@@ -148,16 +152,20 @@ Expected: all 3 PASS
### Task 5: Update test imports to use canonical path
**Files:**
- Modify: `tests/wf_mcp/service/conftest.py`
- Modify: `tests/wf_mcp/workflow_surface/test_runs.py`
- [ ] **Step 1: Update `tests/wf_mcp/service/conftest.py`**
Change line 8 from:
```python
from wf_mcp.models import AuthRecord, ConnectionConfig, RawWorkflowPlan
```
to:
```python
from wf_api.models import RawWorkflowPlan
from wf_mcp.models import AuthRecord, ConnectionConfig
@@ -166,10 +174,13 @@ from wf_mcp.models import AuthRecord, ConnectionConfig
- [ ] **Step 2: Update `tests/wf_mcp/workflow_surface/test_runs.py`**
Change line 32 from:
```python
from wf_mcp.models import RawWorkflowPlan
```
to:
```python
from wf_api.models import RawWorkflowPlan
```
@@ -93,6 +93,7 @@ wf_cli -> wf_mcp (OK — config/s
## Task 1: Create `wf_api` package root
**Files:**
- Create: `src/wf_api/__init__.py`
- [ ] **Step 1: Create the package directory**
@@ -136,6 +137,7 @@ These modules have zero `wf_mcp` imports. Moving them is a prerequisite for `wf_
### Task 2a: Move `constants`
**Files:**
- Create: `src/wf_api/constants.py`
- Modify: `src/wf_mcp/workflow_surface/constants.py` → shim
@@ -199,6 +201,7 @@ git commit -m "refactor: move constants to wf_api, leave shim in wf_mcp"
### Task 2b: Move `wrapper_hints`
**Files:**
- Create: `src/wf_api/wrapper_hints.py`
- Modify: `src/wf_mcp/workflow_surface/wrapper_hints.py` → shim
@@ -232,6 +235,7 @@ git commit -m "refactor: move wrapper_hints to wf_api, leave shim"
### Task 2c: Move `refs`
**Files:**
- Create: `src/wf_api/refs.py`
- Modify: `src/wf_mcp/workflow_surface/refs.py` → shim
@@ -265,6 +269,7 @@ git commit -m "refactor: move refs to wf_api, leave shim"
### Task 2d: Move `next_actions`
**Files:**
- Create: `src/wf_api/next_actions.py`
- Modify: `src/wf_mcp/workflow_surface/next_actions.py` → shim
@@ -298,6 +303,7 @@ git commit -m "refactor: move next_actions to wf_api, leave shim"
### Task 2e: Move `runtime_dependencies`
**Files:**
- Create: `src/wf_api/runtime_dependencies.py`
- Modify: `src/wf_mcp/workflow_surface/runtime_dependencies.py` → shim
@@ -323,12 +329,14 @@ git commit -m "refactor: move runtime_dependencies to wf_api, leave shim"
### Task 2f: Move `saved_subgraphs`
**Files:**
- Create: `src/wf_api/saved_subgraphs.py`
- Modify: `src/wf_mcp/workflow_surface/saved_subgraphs.py` → shim
- [ ] **Step 1: Copy `src/wf_mcp/workflow_surface/saved_subgraphs.py` to `src/wf_api/saved_subgraphs.py`**
Update internal imports:
- `from ..models import RawWorkflowPlan``from wf_api.models import RawWorkflowPlan`
- `from .runtime_dependencies import resolve_runtime_dependencies``from wf_api.runtime_dependencies import resolve_runtime_dependencies`
@@ -358,12 +366,14 @@ git commit -m "refactor: move saved_subgraphs to wf_api, leave shim"
### Task 2g: Move `run_lifecycle`
**Files:**
- Create: `src/wf_api/run_lifecycle.py`
- Modify: `src/wf_mcp/workflow_surface/run_lifecycle.py` → shim
- [ ] **Step 1: Copy `src/wf_mcp/workflow_surface/run_lifecycle.py` to `src/wf_api/run_lifecycle.py`**
Update internal import:
- `from .saved_subgraphs import SavedSubgraphTree``from wf_api.saved_subgraphs import SavedSubgraphTree`
- [ ] **Step 2: Replace old file with shim**
@@ -388,6 +398,7 @@ git commit -m "refactor: move run_lifecycle to wf_api, leave shim"
### Task 3a: Move `McpEvent` + `make_event` to `wf_api.events`
**Files:**
- Create: `src/wf_api/events.py`
- Modify: `src/wf_mcp/events/models.py` → shim
@@ -462,6 +473,7 @@ git commit -m "refactor: move McpEvent/make_event to wf_api.events, leave shim"
### Task 3b: Move `matches_query` + `paged_list_payload` to `wf_api.listing`
**Files:**
- Create: `src/wf_api/listing.py`
- Modify: `src/wf_mcp/shared/listing.py` → shim
@@ -569,6 +581,7 @@ git commit -m "refactor: move listing helpers to wf_api.listing, leave shim"
## Task 4: Move `RawWorkflowPlan` and `TraceRange` to `wf_api.models`
**Files:**
- Create: `src/wf_api/models.py`
- Modify: `src/wf_mcp/models.py` → add re-export shim for `RawWorkflowPlan`
- Modify: `src/wf_mcp/workflow_surface/models.py` → update `NextActions` import
@@ -638,10 +651,13 @@ This shadows the local `RawWorkflowPlan` class. Keep the local class definition
- [ ] **Step 3: Update `src/wf_mcp/workflow_surface/models.py` imports**
Change line 7 from:
```python
from .next_actions import NextActionPatchExample, NextActions
```
to:
```python
from wf_api.next_actions import NextActionPatchExample, NextActions
```
@@ -673,6 +689,7 @@ git commit -m "refactor: move RawWorkflowPlan and TraceRange to wf_api.models"
## Task 5: Create `WorkflowApiBackend` protocol
**Files:**
- Create: `src/wf_api/backend.py`
- [ ] **Step 1: Write `src/wf_api/backend.py`**
@@ -792,6 +809,7 @@ git commit -m "feat(wf_api): add WorkflowApiBackend protocol"
## Task 6: Create `WorkflowApi` service
**Files:**
- Create: `src/wf_api/service.py`
- [ ] **Step 1: Write `src/wf_api/service.py`**
@@ -812,6 +830,7 @@ This is the largest step. The body is `WorkflowSurfaceHandlers` from `src/wf_mcp
12. **`_required_capabilities_for_plan(..., service=self.service)`** → `_required_capabilities_for_plan(..., backend=self.backend)`
**Import changes** (top of file):
- Remove: `from ..broker.service.adapters import require_adapter`
- Remove: `from ..events import make_event`
- Remove: `from ..models import RawWorkflowPlan`
@@ -826,6 +845,7 @@ This is the largest step. The body is `WorkflowSurfaceHandlers` from `src/wf_mcp
- Update all `.constants`, `.models`, `.refs`, `.next_actions`, `.saved_subgraphs`, `.run_lifecycle`, `.wrapper_hints` to `wf_api.*`
**Module-level helpers to update:**
- `_available_sources(service: WfMcpService)``_available_sources(backend: WorkflowApiBackend)` — change `service.capability_sources` to `backend.capability_sources`
- `_observed_node_specs(service: WfMcpService)``_observed_node_specs(backend: WorkflowApiBackend)` — change `service.capability_sources` to `backend.capability_sources`
- `_required_capabilities_for_plan(..., service: WfMcpService)``_required_capabilities_for_plan(..., backend: WorkflowApiBackend)` — change `service` references to `backend`
@@ -834,6 +854,7 @@ This is the largest step. The body is `WorkflowSurfaceHandlers` from `src/wf_mcp
- **Remove** `LIVE_SOURCE_CHECK_TIMEOUT_SECONDS` and `_LIVE_SOURCE_CHECK_FAILURES` constants
**`validate_deployment` method change:**
```python
async def validate_deployment(
self,
@@ -874,6 +895,7 @@ git commit -m "feat(wf_api): add WorkflowApi service"
## Task 7: Replace `handlers.py` with shim
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- [ ] **Step 1: Replace entire file with shim**
@@ -906,6 +928,7 @@ git commit -m "refactor: replace handlers.py with shim to wf_api.service"
## Task 8: Create `WfMcpWorkflowApiBackend` adapter
**Files:**
- Create: `src/wf_mcp/broker/service/workflow_api_backend.py`
- [ ] **Step 1: Write `src/wf_mcp/broker/service/workflow_api_backend.py`**
@@ -1111,11 +1134,13 @@ git commit -m "feat(wf_mcp): add WfMcpWorkflowApiBackend adapter"
## Task 9: Update MCP tool registration to use `WorkflowApi`
**Files:**
- Modify: `src/wf_mcp/workflow_surface/tools.py`
- [ ] **Step 1: Update imports in `src/wf_mcp/workflow_surface/tools.py`**
Change:
```python
from wf_mcp.broker.service import WfMcpService
from .handlers import WorkflowSurfaceHandlers
@@ -1127,6 +1152,7 @@ from .models import (
```
To:
```python
from wf_api.service import WorkflowApi
from wf_api.models import TraceRange
@@ -1142,6 +1168,7 @@ from .models import (
- [ ] **Step 2: Update `register_workflow_tools` function body**
Change:
```python
def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None:
"""Register stable workflow tools on the public MCP server surface."""
@@ -1149,6 +1176,7 @@ def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None
```
To:
```python
def register_workflow_tools(server: FastMCP[Any], service: WfMcpService) -> None:
"""Register stable workflow tools on the public MCP server surface."""
@@ -1177,16 +1205,19 @@ git commit -m "refactor: use WorkflowApi in MCP tool registration"
## Task 10: Update `wf_cli.context` to use `WorkflowApi`
**Files:**
- Modify: `src/wf_cli/context.py`
- [ ] **Step 1: Update imports**
Change:
```python
from wf_mcp.workflow_surface import WorkflowSurfaceHandlers
```
To:
```python
from wf_api import WorkflowApi
from wf_mcp.broker.service.workflow_api_backend import WfMcpWorkflowApiBackend
@@ -1195,6 +1226,7 @@ from wf_mcp.broker.service.workflow_api_backend import WfMcpWorkflowApiBackend
- [ ] **Step 2: Update `CliContext` dataclass**
Change:
```python
@dataclass(frozen=True)
class CliContext:
@@ -1204,6 +1236,7 @@ class CliContext:
```
To:
```python
@dataclass(frozen=True)
class CliContext:
@@ -1215,6 +1248,7 @@ class CliContext:
- [ ] **Step 3: Update `load_cli_context` function**
Change:
```python
def load_cli_context(config_path: str | Path) -> CliContext:
resolved_config_path = Path(config_path)
@@ -1228,6 +1262,7 @@ def load_cli_context(config_path: str | Path) -> CliContext:
```
To:
```python
def load_cli_context(config_path: str | Path) -> CliContext:
resolved_config_path = Path(config_path)
@@ -1243,11 +1278,13 @@ def load_cli_context(config_path: str | Path) -> CliContext:
- [ ] **Step 4: Update `src/wf_cli/commands/runs.py`**
Change:
```python
from wf_mcp.workflow_surface import TraceRange
```
To:
```python
from wf_api.models import TraceRange
```
@@ -1272,6 +1309,7 @@ git commit -m "refactor: use WorkflowApi in CLI context"
## Task 11: Add `wf_api` to `pyproject.toml` packages
**Files:**
- Modify: `pyproject.toml`
- [ ] **Step 1: Find the packages list in `pyproject.toml`**
@@ -1281,6 +1319,7 @@ Grep for `packages` or `find` in the `[tool.setuptools]` or `[tool.hatch]` secti
- [ ] **Step 2: Add `src/wf_api` to the packages list**
If using `find`:
```toml
[tool.setuptools.packages.find]
where = ["src"]
@@ -76,6 +76,7 @@ wf_cli -> wf_mcp (OK — config/s
## Task 1: Create `wf_api` package with `WorkflowApiBackend` protocol
**Files:**
- Create: `src/wf_api/__init__.py`
- Create: `src/wf_api/backend.py`
@@ -441,6 +442,7 @@ Expected: `OK`.
## Task 2: Create `WorkflowApi` facade
**Files:**
- Create: `src/wf_api/service.py`
- [ ] **Step 1: Write `src/wf_api/service.py`**
@@ -927,6 +929,7 @@ Expected: `OK`.
## Task 3: Create `WfMcpWorkflowApiBackend` adapter
**Files:**
- Create: `src/wf_mcp/broker/service/workflow_api_backend.py`
- [ ] **Step 1: Write `src/wf_mcp/broker/service/workflow_api_backend.py`**
@@ -1415,6 +1418,7 @@ Expected: `OK`.
## Task 4: Update `wf_cli.context` to use `WorkflowApi`
**Files:**
- Modify: `src/wf_cli/context.py`
- [ ] **Step 1: Update `src/wf_cli/context.py`**
@@ -1486,11 +1490,13 @@ Expected: all pass. CLI commands use `context.handlers.X()` which now calls thro
## Task 5: Update MCP tool registration to use `WorkflowApi`
**Files:**
- Modify: `src/wf_mcp/workflow_surface/tools.py`
- [ ] **Step 1: Update imports in `src/wf_mcp/workflow_surface/tools.py`**
Change lines 10-12 from:
```python
from wf_mcp.broker.service import WfMcpService
@@ -1498,6 +1504,7 @@ from .handlers import WorkflowSurfaceHandlers
```
To:
```python
from wf_api import WorkflowApi
from wf_mcp.broker.service import WfMcpService
@@ -1507,11 +1514,13 @@ from wf_mcp.broker.service.workflow_api_backend import WfMcpWorkflowApiBackend
- [ ] **Step 2: Update `register_workflow_tools` function body**
Change line 39 from:
```python
handlers = WorkflowSurfaceHandlers(service)
```
To:
```python
handlers = WorkflowApi(WfMcpWorkflowApiBackend(service))
```
@@ -1531,6 +1540,7 @@ Expected: all pass.
## Task 6: Add import-direction test
**Files:**
- Create: `tests/wf_api/test_import_direction.py`
- [ ] **Step 1: Create `tests/wf_api/__init__.py`**
@@ -1592,6 +1602,7 @@ Expected: `PASSED`.
## Task 7: Add `CliContext.handlers` type test
**Files:**
- Create: `tests/wf_api/test_cli_context_uses_api.py`
- [ ] **Step 1: Write `tests/wf_api/test_cli_context_uses_api.py`**
@@ -66,6 +66,7 @@
## Task 1: Add Canonical `wf_api.constants`
**Files:**
- Create: `src/wf_api/constants.py`
- [ ] **Step 1: Create `src/wf_api/constants.py`**
@@ -109,6 +110,7 @@ call wf.std.runtime_error
## Task 2: Add Canonical `wf_api.refs`
**Files:**
- Create: `src/wf_api/refs.py`
- [ ] **Step 1: Create `src/wf_api/refs.py`**
@@ -165,6 +167,7 @@ workflow.echo_wrapper.v2
## Task 3: Re-export Helpers From `wf_api`
**Files:**
- Modify: `src/wf_api/__init__.py`
- [ ] **Step 1: Update imports and `__all__`**
@@ -218,6 +221,7 @@ ok demo.personal.echo_tool
## Task 4: Convert Old Workflow-Surface Modules To Shims
**Files:**
- Modify: `src/wf_mcp/workflow_surface/constants.py`
- Modify: `src/wf_mcp/workflow_surface/refs.py`
@@ -290,6 +294,7 @@ call workflow.echo_wrapper.v2
## Task 5: Update Canonical Imports In `WorkflowSurfaceHandlers`
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- [ ] **Step 1: Change constants import**
@@ -351,6 +356,7 @@ WorkflowSurfaceHandlers
## Task 6: Update Ref Tests For Canonical And Shim Imports
**Files:**
- Modify: `tests/wf_mcp/test_workflow_surface_refs.py`
- [ ] **Step 1: Update imports**
@@ -404,6 +410,7 @@ Expected: all tests pass.
## Task 7: Search For Remaining Canonical Import Opportunities
**Files:**
- Inspect only unless the search finds new low-risk direct consumers.
- [ ] **Step 1: Search old imports**
@@ -68,6 +68,7 @@
## Task 1: Create Canonical `wf_api.wrapper_hints`
**Files:**
- Create: `src/wf_api/wrapper_hints.py`
- [ ] **Step 1: Copy existing implementation**
@@ -117,6 +118,7 @@ WrapperAuthoringHints wrapper_hints_for_capability
## Task 2: Create Canonical `wf_api.next_actions`
**Files:**
- Create: `src/wf_api/next_actions.py`
- [ ] **Step 1: Copy existing implementation**
@@ -168,6 +170,7 @@ wf.workflow.run_deployment NextActions
## Task 3: Re-export Guidance Helpers From `wf_api`
**Files:**
- Modify: `src/wf_api/__init__.py`
- [ ] **Step 1: Add imports**
@@ -227,6 +230,7 @@ NextActions WrapperAuthoringHints
## Task 4: Convert Old Workflow-Surface Guidance Modules To Shims
**Files:**
- Modify: `src/wf_mcp/workflow_surface/wrapper_hints.py`
- Modify: `src/wf_mcp/workflow_surface/next_actions.py`
@@ -305,6 +309,7 @@ WrapperAuthoringHints NextActions
## Task 5: Update Production Imports To Canonical Paths
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- Modify: `src/wf_mcp/workflow_surface/models.py`
@@ -375,6 +380,7 @@ WorkflowSurfaceHandlers NextActions
## Task 6: Update Direct Tests And Add Shim Compatibility Tests
**Files:**
- Modify: `tests/wf_mcp/test_workflow_wrapper_hints.py`
- Modify: `tests/wf_mcp/workflow_surface/test_next_actions.py`
@@ -447,6 +453,7 @@ Expected: all pass.
## Task 7: Search For Remaining Canonical Import Opportunities
**Files:**
- Inspect only unless the search finds new low-risk direct consumers.
- [ ] **Step 1: Search old imports**
@@ -83,6 +83,7 @@ This adapter may import `wf_mcp`; `wf_api` must not.
## Task 1: Add `wf_api.operation_context`
**Files:**
- Create: `src/wf_api/operation_context.py`
- [ ] **Step 1: Create `src/wf_api/operation_context.py`**
@@ -224,6 +225,7 @@ WorkflowOperationContext
## Task 2: Re-export Operation Context Types
**Files:**
- Modify: `src/wf_api/__init__.py`
- [ ] **Step 1: Add imports**
@@ -271,6 +273,7 @@ WorkflowOperationContext WorkflowRuntimeRunner
## Task 3: Add MCP Adapter For Operation Context
**Files:**
- Create: `src/wf_mcp/broker/service/workflow_operation_context.py`
- [ ] **Step 1: Create adapter file**
@@ -397,6 +400,7 @@ context_from_service
## Task 4: Add Focused Tests
**Files:**
- Create: `tests/wf_api/test_operation_context.py`
- [ ] **Step 1: Write tests**
@@ -84,6 +84,7 @@ draft preview and artifact creation. If a helper still has live callers in
## Task 1: Create `wf_api.drafts`
**Files:**
- Create: `src/wf_api/drafts.py`
- [ ] **Step 1: Create `WorkflowDraftApi` skeleton**
@@ -179,6 +180,7 @@ Add:
## Task 2: Move Stateless Draft Methods
**Files:**
- Modify: `src/wf_api/drafts.py`
- [ ] **Step 1: Add `validate_draft`**
@@ -225,6 +227,7 @@ Add:
## Task 3: Move Draft Workspace Methods
**Files:**
- Modify: `src/wf_api/drafts.py`
- [ ] **Step 1: Add workspace CRUD and validation methods**
@@ -261,6 +264,7 @@ They should call `self.patch_draft_workspace(...)` inside `WorkflowDraftApi`.
## Task 4: Move Minimal Draft Bootstrap
**Files:**
- Modify: `src/wf_api/drafts.py`
- [ ] **Step 1: Add `create_minimal_draft_workspace`**
@@ -294,6 +298,7 @@ Do not change their behavior.
## Task 5: Move Required-Capability Draft Helpers
**Files:**
- Modify: `src/wf_api/drafts.py`
- [ ] **Step 1: Move `_required_capabilities_for_plan`**
@@ -350,6 +355,7 @@ Move it unchanged.
## Task 6: Wire `WorkflowSurfaceHandlers` To Delegate Draft Methods
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- [ ] **Step 1: Add imports**
@@ -419,6 +425,7 @@ but not required for this slice.
## Task 7: Add Focused Tests
**Files:**
- Create: `tests/wf_api/test_drafts_service.py`
- [ ] **Step 1: Write direct service tests**
@@ -309,6 +309,7 @@ wf explain --input-file validation-output.json
test `NodeSpec` functions.
- Targeted draft editing helpers such as `wf draft step add` are not in v1.
- `wf` does not replace MCP resources/prompts or interactive MCP clients.
```
- [ ] **Step 2: Add CLI doc to docs index**
@@ -393,6 +394,7 @@ wf run trace <run_id> --from 0 --limit 25
- Do not treat wrapper hints as semantic guarantees.
- If validation fails, run `wf explain <code>` or `wf explain --input-file <validation-output.json>`.
- Do not use docs under `docs/superpowers/` as user-facing runtime guidance.
```
- [ ] **Step 2: Do not wire skill installation**
@@ -64,6 +64,7 @@
### Task 1: Add Typer Dependency And Script
**Files:**
- Modify: `pyproject.toml`
- [ ] **Step 1: Add dependency and entrypoint**
@@ -108,6 +109,7 @@ If `uv lock` cannot access the network, stop and report the dependency-lock bloc
### Task 2: Add App Skeleton Tests
**Files:**
- Create: `tests/wf_cli/test_app.py`
- [ ] **Step 1: Write failing Typer app tests**
@@ -160,6 +162,7 @@ Expected: FAIL because `wf_cli` does not exist.
### Task 3: Create Typer App And Command Groups
**Files:**
- Create: `src/wf_cli/__init__.py`
- Create: `src/wf_cli/app.py`
- Create: `src/wf_cli/commands/__init__.py`
@@ -381,6 +384,7 @@ Expected: PASS.
### Task 4: Add JSON IO Tests
**Files:**
- Create: `tests/wf_cli/test_io.py`
- [ ] **Step 1: Write failing IO tests**
@@ -449,6 +453,7 @@ Expected: FAIL because `wf_cli.io` does not exist.
### Task 5: Implement JSON IO Helpers
**Files:**
- Create: `src/wf_cli/io.py`
- [ ] **Step 1: Create IO helpers**
@@ -517,6 +522,7 @@ Expected: PASS.
### Task 6: Add CLI Context Tests
**Files:**
- Create: `tests/wf_cli/test_context.py`
- [ ] **Step 1: Write failing context tests**
@@ -575,6 +581,7 @@ Expected: FAIL because `wf_cli.context` does not exist.
### Task 7: Implement CLI Context Loader
**Files:**
- Create: `src/wf_cli/context.py`
- [ ] **Step 1: Create context loader**
@@ -634,6 +641,7 @@ Expected: PASS.
### Task 8: Run Foundation Verification
**Files:**
- All touched files.
- [ ] **Step 1: Run focused CLI tests**
@@ -42,6 +42,7 @@
### Task 1: Make Global `--config` Available To Commands
**Files:**
- Modify: `src/wf_cli/app.py`
- Modify: `src/wf_cli/context.py`
- Modify: `tests/wf_cli/test_app.py`
@@ -115,6 +116,7 @@ Expected: PASS.
### Task 2: Add CLI Run/Deploy Test Fixture Helpers
**Files:**
- Create: `tests/wf_cli/test_run_deploy.py`
- [ ] **Step 1: Create fixture helpers**
@@ -217,6 +219,7 @@ Expected: FAIL because `deploy validate` does not exist.
### Task 3: Implement `wf deploy validate`
**Files:**
- Modify: `src/wf_cli/commands/deployments.py`
- [ ] **Step 1: Add imports and command**
@@ -279,6 +282,7 @@ Expected: PASS.
### Task 4: Add Run Command Tests
**Files:**
- Modify: `tests/wf_cli/test_run_deploy.py`
- [ ] **Step 1: Add run start test**
@@ -414,6 +418,7 @@ Expected: deploy test passes, run tests fail because run commands do not exist.
### Task 5: Implement Run Commands
**Files:**
- Modify: `src/wf_cli/commands/runs.py`
- [ ] **Step 1: Replace run command module**
@@ -534,6 +539,7 @@ Expected: PASS.
### Task 6: Verify Help And Input Error Behavior
**Files:**
- Modify: `tests/wf_cli/test_app.py`
- Modify: `tests/wf_cli/test_run_deploy.py`
@@ -598,6 +604,7 @@ Expected: PASS.
### Task 7: Verification
**Files:**
- All touched files.
- [ ] **Step 1: Run all CLI tests**
@@ -54,6 +54,7 @@ Legacy imports of `WorkflowSurfaceHandlers` may still work, but only as a thin w
### Task 1: Move TraceRange Out of `backend.py`
**Files:**
- Modify: `src/wf_api/models.py`
- Modify: `src/wf_api/__init__.py`
- Modify: `src/wf_cli/commands/runs.py`
@@ -159,6 +160,7 @@ Expected: tests pass, lint pass, format pass.
### Task 2: Make `WorkflowApi` Compose Domain Services Directly
**Files:**
- Modify: `src/wf_api/service.py`
- Add: `tests/wf_api/test_direct_service.py`
@@ -357,6 +359,7 @@ Expected: direct service tests and domain API tests pass.
### Task 3: Update CLI and MCP Tool Construction
**Files:**
- Modify: `src/wf_cli/context.py`
- Modify: `tests/wf_cli/test_context.py`
- Modify: `src/wf_mcp/workflow_surface/tools.py`
@@ -490,6 +493,7 @@ Expected: CLI and MCP workflow tool tests pass.
### Task 4: Shrink `WorkflowSurfaceHandlers` to Compatibility Shim
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- Modify: `tests/wf_api/test_direct_service.py` or add a small handler shim test
@@ -577,6 +581,7 @@ Expected: old handler tests pass through the shim.
### Task 5: Delete Backend Protocol and Adapter
**Files:**
- Delete: `src/wf_api/backend.py`
- Delete: `src/wf_mcp/broker/service/workflow_api_backend.py`
- Modify: `src/wf_api/__init__.py`
@@ -624,6 +629,7 @@ Expected: tests pass, lint pass, format pass.
### Task 6: Update Active Docs
**Files:**
- Modify: `docs/current_roadmap.md`
- Modify: `docs/wf_mcp_architecture.md`
- Modify: `docs/superpowers/plans/2026-06-01-wf-api-extraction-roadmap.md`
@@ -691,6 +697,7 @@ Expected: no whitespace errors.
### Task 7: Final Verification
**Files:**
- All touched files.
- [ ] **Step 1: Run focused workflow API/MCP/CLI tests**
@@ -84,6 +84,7 @@ Reasons:
## Task 1: Extend Operation Context For Events And Live Checks
**Files:**
- Modify: `src/wf_api/operation_context.py`
- Create: `src/wf_mcp/broker/service/workflow_live_checks.py`
- Modify: `src/wf_mcp/broker/service/workflow_operation_context.py`
@@ -252,6 +253,7 @@ Expected: pass.
## Task 2: Create `wf_api.artifacts`
**Files:**
- Create: `src/wf_api/artifacts.py`
- Modify: `src/wf_api/__init__.py`
- Test: `tests/wf_api/test_artifact_api.py`
@@ -386,6 +388,7 @@ Expected: pass.
## Task 3: Create `wf_api.deployments`
**Files:**
- Create: `src/wf_api/deployments.py`
- Modify: `src/wf_api/__init__.py`
- Test: `tests/wf_api/test_deployment_api.py`
@@ -523,6 +526,7 @@ Expected: pass.
## Task 4: Wire `WorkflowSurfaceHandlers`
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- [ ] **Step 1: Add imports**
@@ -68,6 +68,7 @@ Reasons:
## Task 1: Align Runtime Protocol With Actual Runtime Calls
**Files:**
- Modify: `src/wf_api/operation_context.py`
- Modify: `src/wf_mcp/broker/service/workflow_operation_context.py`
- Test: `tests/wf_api/test_operation_context.py`
@@ -151,6 +152,7 @@ Expected: pass.
## Task 2: Create `wf_api.runs`
**Files:**
- Create: `src/wf_api/runs.py`
- Modify: `src/wf_api/__init__.py`
- Test: `tests/wf_api/test_run_api.py`
@@ -231,6 +233,7 @@ Add `"WorkflowRunApi"` to `__all__`.
## Task 3: Move Run Methods
**Files:**
- Modify: `src/wf_api/runs.py`
- [ ] **Step 1: Move `run_deployment`**
@@ -311,6 +314,7 @@ Preserve current payload shape:
## Task 4: Move Run Helpers
**Files:**
- Modify: `src/wf_api/runs.py`
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
@@ -355,6 +359,7 @@ Remove only helpers with no remaining handler callers.
## Task 5: Wire `WorkflowSurfaceHandlers`
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- [ ] **Step 1: Add import**
@@ -429,6 +434,7 @@ methods still need them.
## Task 6: Add Focused Run API Tests
**Files:**
- Create: `tests/wf_api/test_run_api.py`
- [ ] **Step 1: Cover unrunnable deployment path**
@@ -79,6 +79,7 @@ Temporary private helper duplication is allowed. A later cleanup can promote com
## Task 1: Create `wf_api.capabilities`
**Files:**
- Create: `src/wf_api/capabilities.py`
- Modify: `src/wf_api/__init__.py`
- Test: `tests/wf_api/test_capability_api.py`
@@ -171,6 +172,7 @@ Add `"WorkflowCapabilityApi"` to `__all__`.
## Task 2: Move Discovery And Inspection
**Files:**
- Modify: `src/wf_api/capabilities.py`
- [ ] **Step 1: Move `list_capabilities`**
@@ -240,6 +242,7 @@ Do not import private helpers from `wf_api.artifacts` or `wf_api.runs` in this s
## Task 3: Move Wrapper Capability Projection
**Files:**
- Modify: `src/wf_api/capabilities.py`
- [ ] **Step 1: Add artifact store helper**
@@ -295,6 +298,7 @@ Preserve:
## Task 4: Move Direct Capability Calls
**Files:**
- Modify: `src/wf_api/capabilities.py`
- [ ] **Step 1: Move `call_capability`**
@@ -374,6 +378,7 @@ first make it public. Keeping a local copy is acceptable for this slice.
## Task 5: Move Capability-Backed Draft Bootstrap
**Files:**
- Modify: `src/wf_api/capabilities.py`
- [ ] **Step 1: Move `create_draft_workspace_from_capability`**
@@ -410,6 +415,7 @@ def _draft_name_from_capability(capability_name: str) -> str:
## Task 6: Wire `WorkflowSurfaceHandlers`
**Files:**
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
- [ ] **Step 1: Add import and instance**
@@ -498,6 +504,7 @@ Do not remove imports still needed by method signatures such as `InputBinding`,
## Task 7: Add Focused Capability API Tests
**Files:**
- Create: `tests/wf_api/test_capability_api.py`
- [ ] **Step 1: Cover live source capability listing and inspection**
@@ -56,6 +56,7 @@
## Task 1: Add `wf_api.listing`
**Files:**
- Create: `src/wf_api/listing.py`
- Test: `tests/wf_api/test_listing.py`
- Modify: `src/wf_api/__init__.py`
@@ -172,6 +173,7 @@ Expected: pass.
## Task 2: Route Current Workflow API Listing Calls Through `wf_api.listing`
**Files:**
- Modify: `src/wf_api/capabilities.py`
- Modify: `src/wf_api/artifacts.py`
- Modify: `src/wf_mcp/workflow_surface/handlers.py`
@@ -258,6 +260,7 @@ Expected: pass.
## Task 3: Add Artifact Plan And Artifact Ref Helpers
**Files:**
- Create: `src/wf_api/artifact_plans.py`
- Create: `src/wf_api/artifact_refs.py`
- Test: `tests/wf_api/test_artifact_helpers.py`
@@ -401,6 +404,7 @@ Expected: pass.
## Task 4: Replace Duplicate Artifact Plan/Ref Helpers In Domain APIs
**Files:**
- Modify: `src/wf_api/capabilities.py`
- Modify: `src/wf_api/artifacts.py`
- Modify: `src/wf_api/runs.py`
@@ -471,6 +475,7 @@ Expected: pass.
## Task 5: Add Shared Capability Requirement Helpers
**Files:**
- Create: `src/wf_api/capability_requirements.py`
- Modify: `src/wf_api/drafts.py`
- Modify: `src/wf_api/artifacts.py`
@@ -647,6 +652,7 @@ Expected: pass.
## Task 6: Add Source Snapshot Helper If Duplicated
**Files:**
- Create: `src/wf_api/source_snapshots.py`
- Modify: `src/wf_api/deployments.py`
- Modify: `src/wf_api/runs.py`
@@ -718,6 +724,7 @@ Expected: pass.
## Task 7: Remove Duplicate Private Helpers And Guard Imports
**Files:**
- Modify: `src/wf_api/capabilities.py`
- Modify: `src/wf_api/artifacts.py`
- Modify: `src/wf_api/drafts.py`
@@ -764,6 +771,7 @@ Expected: pass.
## Task 8: Final Verification
**Files:**
- All touched files.
- [ ] **Step 1: Run focused wf_api workflow tests**
@@ -51,6 +51,7 @@ That makes a protocol-specific service decide protocol-neutral workflow persiste
### Task 1: Add Protocol-Neutral Store Bundle
**Files:**
- Create: `src/wf_api/stores.py`
- Modify: `src/wf_api/__init__.py`
- Test: `tests/wf_api/test_stores.py`
@@ -173,6 +174,7 @@ Expected: tests pass, lint pass, format pass.
### Task 2: Move Config Store Construction Through the Bundle
**Files:**
- Modify: `src/wf_mcp/broker/config.py`
- Test: `tests/wf_mcp/test_broker_server.py`
@@ -267,6 +269,7 @@ Expected: tests pass, lint pass, format pass.
### Task 3: Remove Implicit Workflow Store Creation from WfMcpService
**Files:**
- Modify: `src/wf_mcp/broker/service/core.py`
- Modify: `tests/wf_mcp/service/test_catalog.py`
@@ -350,6 +353,7 @@ Expected: tests pass, lint pass, format pass.
### Task 4: Fix Direct Service Tests That Need Workflow Stores
**Files:**
- Modify only tests that fail after Task 3.
- [ ] **Step 1: Run targeted workflow API/service tests**
@@ -410,6 +414,7 @@ Expected: targeted tests pass and no broad fixture churn.
### Task 5: Document the Store Ownership Rule
**Files:**
- Modify: `docs/superpowers/research/2026-06-01-wf-api-extraction-map.md`
- Modify: `docs/current_roadmap.md` if it already has a `wf_api` section
@@ -452,6 +457,7 @@ Expected: no current docs/tests claim `WfMcpService` installs default workflow s
### Task 6: Final Verification
**Files:**
- All touched files.
- [ ] **Step 1: Run focused suite**
@@ -54,6 +54,7 @@ Thin tests that only repeat:
## Task 1: Build A Deletion Ledger Before Editing
**Files:**
- Create: `docs/superpowers/plans/2026-06-02-wf-mcp-workflow-surface-test-thinning-ledger.md`
- [ ] **Step 1: Create the ledger file**
@@ -125,6 +126,7 @@ integration seams.
## Task 2: Thin Artifact Listing Duplicates
**Files:**
- Modify: `tests/wf_mcp/workflow_surface/test_artifacts.py`
- Modify: `docs/superpowers/plans/2026-06-02-wf-mcp-workflow-surface-test-thinning-ledger.md`
- Test: `tests/wf_api/test_artifact_api.py`, `tests/wf_mcp/workflow_surface/test_artifacts.py`
@@ -192,6 +194,7 @@ Expected: pass.
## Task 3: Thin Capability List/Inspect Duplicates Conservatively
**Files:**
- Modify: `tests/wf_mcp/workflow_surface/test_capabilities.py`
- Modify: `docs/superpowers/plans/2026-06-02-wf-mcp-workflow-surface-test-thinning-ledger.md`
- Test: `tests/wf_api/test_capability_api.py`, `tests/wf_mcp/workflow_surface/test_capabilities.py`
@@ -290,6 +293,7 @@ Expected: pass.
## Task 4: Thin Deployment Tests Only Where Purely Duplicated
**Files:**
- Modify: `tests/wf_mcp/workflow_surface/test_deployments.py`
- Modify: `docs/superpowers/plans/2026-06-02-wf-mcp-workflow-surface-test-thinning-ledger.md`
- Test: `tests/wf_api/test_deployment_api.py`, `tests/wf_mcp/workflow_surface/test_deployments.py`
@@ -348,6 +352,7 @@ Expected: pass.
## Task 5: Thin Draft Tests With High Caution
**Files:**
- Modify: `tests/wf_mcp/workflow_surface/test_drafts.py`
- Modify: `docs/superpowers/plans/2026-06-02-wf-mcp-workflow-surface-test-thinning-ledger.md`
- Test: `tests/wf_api/test_drafts_service.py`, `tests/wf_mcp/workflow_surface/test_drafts.py`
@@ -417,6 +422,7 @@ Expected: pass.
## Task 6: Keep Run And Wrapper Tests Mostly Intact
**Files:**
- Modify: `tests/wf_mcp/workflow_surface/test_runs.py`
- Modify: `docs/superpowers/plans/2026-06-02-wf-mcp-workflow-surface-test-thinning-ledger.md`
- Test: `tests/wf_api/test_run_api.py`, `tests/wf_mcp/workflow_surface/test_runs.py`, `tests/wf_mcp/workflow_surface/test_wrappers.py`
@@ -468,6 +474,7 @@ Expected: pass.
## Task 7: Final Review And Verification
**Files:**
- Modify: `docs/superpowers/plans/2026-06-02-wf-mcp-workflow-surface-test-thinning-ledger.md`
- Test: all workflow-surface and wf_api tests
File diff suppressed because it is too large Load Diff
@@ -200,6 +200,7 @@ These members of `WfMcpService` (`src/wf_mcp/broker/service/core.py`) are NOT ac
### Summary Classification
**Protocol-neutral (should move to `wf_api`):**
- All `wf_artifacts` types and functions
- All `wf_platform` types
- All `wf_authoring` types
@@ -210,6 +211,7 @@ These members of `WfMcpService` (`src/wf_mcp/broker/service/core.py`) are NOT ac
- `TraceRange`, `NextActions`, `SavedSubgraphTree`, `resolve_runtime_dependencies`, `wrapper_hints`, `refs`, `run_lifecycle`, `constants`
**MCP-specific (stays in `wf_mcp`):**
- `ConnectionRegistry`, `ConnectionConfig`
- `BackendAdapter`, `require_adapter`
- `AuthRecord`
@@ -225,11 +227,13 @@ These members of `WfMcpService` (`src/wf_mcp/broker/service/core.py`) are NOT ac
Move `WorkflowSurfaceHandlers` to `wf_api.service.WorkflowApi`, keep same constructor accepting `WfMcpService`.
**Pros:**
- Minimal code changes — just move the file, update imports
- Tests keep passing with import-only changes
- No new abstractions
**Cons:**
- `wf_api` would still depend on `WfMcpService` (a `wf_mcp` type)
- Circular dependency risk: `wf_api``wf_mcp``wf_api` (if `wf_mcp` tools import from `wf_api`)
- Doesn't actually decouple from MCP — just relocates the code
@@ -240,6 +244,7 @@ Move `WorkflowSurfaceHandlers` to `wf_api.service.WorkflowApi`, keep same constr
Create `WorkflowApi` that depends on a smaller `WorkflowApiBackend`/ports object instead of all `WfMcpService`, then adapt `WfMcpService` into that backend.
**Pros:**
- Clean dependency direction: `wf_api` → ports/interfaces, `wf_mcp` → adapts `WfMcpService` into ports
- `wf_cli` can also adapt its own backend (or reuse the `wf_mcp` adapter)
- FastAPI later becomes just another adapter over the same ports
@@ -247,6 +252,7 @@ Create `WorkflowApi` that depends on a smaller `WorkflowApiBackend`/ports object
- Incremental: can introduce ports one domain at a time
**Cons:**
- More upfront work — need to define the port interface
- Risk of over-abstracting if ports are too fine-grained
- Need to decide what `WorkflowApiBackend` actually exposes
@@ -256,11 +262,13 @@ Create `WorkflowApi` that depends on a smaller `WorkflowApiBackend`/ports object
Split capabilities/drafts/artifacts/deployments/runs into separate classes before moving packages.
**Pros:**
- Each domain class is smaller and easier to reason about
- Could enable partial extraction (move artifacts first, then drafts, etc.)
- Better separation of concerns regardless of extraction
**Cons:**
- Large refactor with many test changes
- Still coupled to `WfMcpService` until ports are introduced
- May create artificial boundaries — some operations span domains (e.g., `create_artifact_from_workspace` touches both drafts and artifacts)
@@ -54,9 +54,7 @@ class WorkflowRuntimeService:
spec: NodeSpec[Any, Any] = self.source_catalog.get_qualified_spec(
qualified_name
)
node_defs[qualified_name] = spec.to_node_def().model_copy(
update={"name": qualified_name}
)
node_defs[qualified_name] = spec.to_node_def()
nodes = []
for node in plan.nodes: