Skip to content

Stage 5 Quality Gate Report: Data Flow and Extensibility (v0.5.0)

Date: 2026-10-25 Branch: stages-2-7 Status: PASSED

Deliverables Checklist

  • [x] 5.1 Results, Outputs and Data Flow: TaskResult(ok: bool, output: Any = None, error: str | None = None) frozen dataclass, Task.inputs: dict[str, Any] upstream outputs injection, SQLite schema v2 migration with task_outputs table, JSON serialization safety, state restoration across resume (1aa0baa)
  • [x] 5.2 Hooks: Hooks dataclass with on_task_start, on_task_succeeded, on_task_failed, on_task_retry, on_workflow_done callbacks; safe post-persistence invocation where hook exceptions are caught without mutating engine state or failing the run (ce2f09b)
  • [x] 5.3 Builder and Serializer: WorkflowBuilder fluent API with immediate DAG validation on .build(), and workflow_to_dict serializer producing exact round-trip dictionary representations with load_workflow_from_json (28e7956)
  • [x] 5.4 JSON Schema and Validation: Formal workflow.schema.json packaged in wheel and sdist, load_workflow_from_json(..., collect_errors=True) raising WorkflowDefinitionError with .errors containing JSON-pointer paths for all schema issues, ignoring unknown keys for forward compatibility (6c82f8e)
  • [x] 5.5 YAML Support (Optional): load_workflow_from_yaml via optional extra orchestration-engine[yaml] using yaml.safe_load, zero core runtime dependencies maintained (5d77ab9)
  • [x] 5.6 Examples and Release: Added examples/data_flow.py, examples/hooks.py, examples/builder.py, updated README & CHANGELOG, bumped version to 0.5.0, verified all examples against installed wheel, tagged stage-5-done

Architectural Decision Records (ADRs)

Quality Gate Execution Output

=== 1. Checking Ruff ===
All checks passed!
=== 2. Checking Mypy ===
Success: no issues found in 30 source files
=== 3. Running Pytest with Coverage ===
........................................................................ [ 62%]
...........................................                              [100%]
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.12.13-final-0 _______________

Name                                      Stmts   Miss  Cover
-------------------------------------------------------------
src/orchestration_engine/__init__.py         13      2    85%
src/orchestration_engine/builder.py          39      0   100%
src/orchestration_engine/errors.py            7      0   100%
src/orchestration_engine/executor.py         34      4    88%
src/orchestration_engine/loader.py          138      5    96%
src/orchestration_engine/models.py           54      0   100%
src/orchestration_engine/persistence.py      92      9    90%
src/orchestration_engine/readiness.py        57      4    93%
src/orchestration_engine/runner.py          330     49    85%
src/orchestration_engine/scheduler.py        13      0   100%
src/orchestration_engine/status.py           35      1    97%
src/orchestration_engine/transitions.py      31      0   100%
src/orchestration_engine/validation.py       46      1    98%
-------------------------------------------------------------
TOTAL                                       889     75    92%
Required test coverage of 90% reached. Total coverage: 91.56%
115 passed in 6.10s
=== 4. Building Wheel ===
Building source distribution (uv build backend)...
Building wheel from source distribution (uv build backend)...
Successfully built dist/orchestration_engine-0.5.0.tar.gz
Successfully built dist/orchestration_engine-0.5.0-py3-none-any.whl
=== 5. Testing Fresh Venv Wheel Installation & Exports ===
All 25 exports successfully imported from wheel
=== 6. Running Examples Against Installed Wheel ===
Running examples/builder.py...
Serialized Workflow Definition:
{
  "workflow_id": "builder-wf",
  "name": "ETL Workflow",
  "description": "Fluent definition of an extract-transform-load pipeline",
  "default_timeout_seconds": 30.0,
  "tasks": [
    {
      "task_id": "extract",
      "name": "Extract Records",
      "description": "",
      "dependencies": [],
      "retry_policy": {
        "max_attempts": 1,
        "delay_seconds": 1.0
      },
      "timeout_seconds": 10.0
    },
    {
      "task_id": "transform",
      "name": "Transform Records",
      "description": "",
      "dependencies": [
        "extract"
      ],
      "retry_policy": {
        "max_attempts": 3,
        "delay_seconds": 1.0
      },
      "timeout_seconds": 30.0
    },
    {
      "task_id": "load",
      "name": "Load to Destination",
      "description": "",
      "dependencies": [
        "transform"
      ],
      "retry_policy": {
        "max_attempts": 1,
        "delay_seconds": 1.0
      },
      "timeout_seconds": 30.0
    }
  ]
}
Executed workflow successfully with run_id: d1197f237683445ba9bdc7a62259e4ce
Running examples/data_flow.py...
Fetching user data...
Fetching order history...
Summary computed: {'customer': 'Alice', 'order_count': 2, 'total_spent': 40.0}
Workflow completed successfully! run_id: fb3491d858d04552815165a5f5123bdd
Running examples/hooks.py...
[HOOK] Task started: Step One (attempt 1)
Executing business logic for: Step One
[HOOK] Task succeeded: Step One
[HOOK] Task started: Step Two (attempt 1)
Executing business logic for: Step Two
[HOOK] Task succeeded: Step Two
[HOOK] Workflow hooks-wf finished with status succeeded
Run 22e93fa4781f4b1d868708398b0d1e57 complete.
Running examples/run_simple_workflow.py...
Running task: Fetch data (fetch-data)
Running task: Process data (process-data)
Workflow finished with status: succeeded
=== 7. Checking Clean Working Tree ===
=== Quality Gate Passed Successfully! ===