Reject unsupported session state before execution and restore

This commit is contained in:
2026-11-29 23:57:16 +00:00
parent 8bc3ae56cb
commit 816453b444
16 changed files with 172 additions and 49 deletions

View File

@@ -7,6 +7,7 @@ import (
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
"gitea.maximumdirect.net/eric/narratio/internal/config"
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
"go.maximumdirect.net/commandkit"
)
@@ -59,6 +60,10 @@ func restoreSessionState(ctx context.Context, cfg *config.Config, opts RestorePl
if err != nil {
return diagnostic, fmt.Errorf("restore: %w", err)
}
manifestPath := artifacts.SessionManifestPathForCampaign(cfg.Pipeline.Workspace.Root, cfg.Session.Campaign, cfg.Session.SessionID)
if _, _, err := loadManifestAtPathIfPresent(ctx, &manifest.LocalStore{}, manifestPath); err != nil {
return diagnostic, fmt.Errorf("restore: %w", err)
}
if opts.DryRun {
plan, err := deps.buildRestorePlan(ctx, cfg, current, objectStore, RestorePlanOptions{
IncludeAudio: opts.IncludeAudio,
@@ -97,6 +102,9 @@ func restoreSessionState(ctx context.Context, cfg *config.Config, opts RestorePl
}
}
}()
if _, _, err := loadManifestAtPathIfPresent(ctx, &manifest.LocalStore{}, manifestPath); err != nil {
return diagnostic, fmt.Errorf("restore: %w", err)
}
// Classification and installation share the same transition lock as a
// runner. This prevents a runner from making reuse decisions against state