Unify previous source resolution

This commit is contained in:
2026-08-10 21:20:59 +00:00
parent d9fa1d9328
commit b39b68add7
20 changed files with 406 additions and 76 deletions

View File

@@ -1,6 +1,7 @@
package stage
import (
"bytes"
"context"
"fmt"
"io"
@@ -43,7 +44,7 @@ func hydratePreviousSessionArtifacts(
if env.ArtifactStore == nil {
return nil, fmt.Errorf("artifact store is required")
}
plan, err := previouscache.BuildPlan(ctx, env.Config, paths, requirements, env.ObjectStore)
plan, err := previouscache.Resolve(ctx, env.Config, paths, requirements, env.ObjectStore)
if err != nil {
return nil, err
}
@@ -58,6 +59,10 @@ func hydratePreviousSessionArtifacts(
}
if err := fileops.DownloadAndInstall(record.LocalPath, fileops.WorkspaceFileMode, func(destination io.Writer) error {
if len(record.VerifiedContent) > 0 {
_, err := io.Copy(destination, bytes.NewReader(record.VerifiedContent))
return err
}
return storage.DownloadTo(ctx, env.ObjectStore, record.RemoteKey, destination)
}); err != nil {
return nil, err