Replace restore phase globals

This commit is contained in:
2026-09-05 18:05:18 +00:00
parent f51b9bb046
commit 85663f5bc9
7 changed files with 93 additions and 185 deletions

View File

@@ -27,7 +27,7 @@ func TestRestoreThenRunStageForceAnalyzeUsesRestoredDurableState(t *testing.T) {
seedRestoreObject(fake, sessionPrefix+"transcripts/full.json", []byte(`{"segments":[1,2,3]}`+"\n"))
seedRestoreObject(fake, sessionPrefix+"artifacts/session_recap.md", []byte("# restored recap\n"))
restoreWithStoreAndRealPhases(t, fake)
executeRestore := restoreCommandExecutor(fake)
executor := func(ctx context.Context, cfg *config.Config, plan BoundedPlan, opts RunOptions) (*RunSummary, error) {
if opts.Env == nil {
@@ -39,7 +39,7 @@ func TestRestoreThenRunStageForceAnalyzeUsesRestoredDurableState(t *testing.T) {
var stdout bytes.Buffer
var stderr bytes.Buffer
restoreCode := Execute(
restoreCode := executeRestore(
[]string{
"session", "restore", cfg.Session.SessionID,
"--config", pipelinePath,
@@ -164,11 +164,11 @@ previous_session_id: 2026-04-26
seedRestoreObject(fakeStore, sessionPrefix+"transcripts/final.trimmed.json", []byte(`{"segments":[]}`+"\n"))
seedRestorePreviousCurrent(t, fakeStore, cfg, "# previous recap\n")
restoreWithStoreAndRealPhases(t, fakeStore)
executeRestore := restoreCommandExecutor(fakeStore)
var stdout bytes.Buffer
var stderr bytes.Buffer
restoreCode := Execute(
restoreCode := executeRestore(
[]string{
"session", "restore", cfg.Session.SessionID,
"--config", pipelinePath,