Terminalize handled invocation failures

This commit is contained in:
2026-08-10 19:34:46 +00:00
parent a1ceb457e9
commit ee747243fe
6 changed files with 341 additions and 74 deletions

View File

@@ -121,6 +121,15 @@ func (m *Manifest) MarkStageFailed(name string, at time.Time, message string) {
m.UpdatedAt = at
}
// RecordFailure records an invocation failure without changing session progress.
func (m *Manifest) RecordFailure(at time.Time, message string) {
if m == nil {
return
}
m.LastError = &ErrorRecord{Message: strings.TrimSpace(message), At: timePtr(at)}
m.UpdatedAt = at
}
// MarkStageSkipped marks a stage as skipped and records the skip reason.
func (m *Manifest) MarkStageSkipped(name string, at time.Time, reason string) {
s := m.ensureStage(name, at)

View File

@@ -21,6 +21,12 @@ type Store interface {
Save(ctx context.Context, path string, m *Manifest) error
}
// RunStore persists invocation-scoped run manifests.
type RunStore interface {
CreateRun(ctx context.Context, sessionID, campaign, runID string, force bool, requestedStages []string) (*RunManifest, error)
SaveRun(ctx context.Context, path string, m *RunManifest) error
}
// LocalStore stores manifests as JSON on the local filesystem.
type LocalStore struct{}