Preserve partial run results and terminal failure causes

This commit is contained in:
2026-11-20 05:47:41 +00:00
parent 85df36a770
commit a6c6f1e4ab
13 changed files with 451 additions and 108 deletions

View File

@@ -28,6 +28,8 @@ type invocationRuntime struct {
artifactStore artifacts.Store
manifestPath string
manifest *manifest.Manifest
started bool
stageResults []RunStageResult
stageNames []string
executed []string
skipped []string
@@ -159,6 +161,7 @@ func initializeLockedInvocation(runtime *invocationRuntime) error {
if err := validateBoundedPrerequisites(runtime.plan, m); err != nil {
return fmt.Errorf("validate bounded run prerequisites under session lock: %w", err)
}
runtime.started = true
runtime.identity.applyToSessionManifest(m)
applyEffectiveConfigProvenance(m, runtime.cfg)
if err := runtime.manifestStore.Save(runtime.ctx, runtime.manifestPath, m); err != nil {
@@ -176,14 +179,3 @@ func (runtime *invocationRuntime) ensureRunWorkspaceFor(selected stage.Stage) er
}
return nil
}
func (runtime *invocationRuntime) persistTerminalFailure(err error) error {
return persistSessionTerminalFailure(
runtime.ctx,
runtime.manifestStore,
runtime.manifestPath,
runtime.manifest,
err,
runtime.dependencies.now(),
)
}