feat(pipeline): PipelineEngine checkpoint, audit, and resume (#245 layer 1)#246
Merged
miguelgfierro merged 1 commit intoMay 28, 2026
Conversation
…yer 1) First layer of the unification proposal in #245. Port-based PipelineEngine gains the same checkpoint + audit machinery StatePipeline already has, plus resume via run(run_id=...). - PipelineEngine accepts checkpointer + audit_log kwargs - run_id flows into PipelineResult; auto-generated when not supplied - After every successful node: checkpoint written and audit entry recorded - Failed (non-skipped) nodes only audit; resume re-runs them - Skipped nodes neither audit nor checkpoint (no work happened) - run(run_id=...) loads the latest checkpoint, restores context.results for completed nodes, and continues from successors - Resume without checkpointer raises PipelineError; unknown run_id raises - Module-level _serialize_value helper makes checkpoint state and audit snapshots JSON-safe (Pydantic -> model_dump, primitives passthrough, fallback str()) No changes to StatePipeline. No new public types. PipelineEventHandler unchanged (protocol unification is deferred to a later layer). Tests: 13 new in tests/unit/pipeline/test_pipeline_engine_lifecycle.py. Full suite: 1544 passed. Refs: #245
This was referenced May 28, 2026
ancongui
pushed a commit
that referenced
this pull request
May 31, 2026
…-lifecycle feat(pipeline): PipelineEngine checkpoint, audit, and resume (#245 layer 1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First layer of the unification proposal in #245 — stacked on top of #232.
What this lands
Port-based `PipelineEngine` gains the same checkpointing + audit machinery that `StatePipeline` already has, plus resume via `run(run_id=...)`. They were pipeline-wide concerns living in the wrong place; this lifts them to the engine where both modes (eventually) share them.
New surface
```python
engine = PipelineEngine(
dag,
checkpointer=FileCheckpointer("./ckpt"), # NEW (optional)
audit_log=FileAuditLog("./audit"), # NEW (optional)
event_handler=handler,
)
result = await engine.run(inputs=...)
Resume after failure:
result = await engine.run(run_id=result.run_id)
```
Semantics
What this does NOT do
Implementation notes
Tests
13 new tests in `tests/unit/pipeline/test_pipeline_engine_lifecycle.py` covering:
Full unit suite: 1544 passed, 21 warnings, 0 failures.
Refs