models
models
¶
Core domain models for job execution summaries.
Contains Pydantic v2 models that provide the public contract between the execution engine (baton/runner) and the rest of the system.
JobCompletionSummary replaces the legacy RunSummary dataclass with a validated Pydantic model. The RunSummary alias in core.summary provides backward compatibility.
Classes¶
JobCompletionSummary
¶
Bases: BaseModel
Summary of a completed job run.
Pydantic v2 model tracking key metrics for display at job completion: - Sheet success/failure/skip counts - Validation pass rate - Cost tracking - Duration and retry statistics - Hook execution results
Attributes¶
success_rate
property
¶
Calculate sheet success rate as percentage.
Skipped sheets are excluded from the denominator since they were never attempted (e.g., skip_when_command conditions met).
Functions¶
from_checkpoint
classmethod
¶
Construct a summary from checkpoint state.
Computes rates from sheet states, sums costs and durations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkpoint
|
CheckpointState
|
The checkpoint state to summarize. |
required |
Returns:
| Type | Description |
|---|---|
JobCompletionSummary
|
JobCompletionSummary with computed metrics. |
Source code in src/marianne/core/models.py
to_dict
¶
Convert summary to dictionary for JSON output.