runner: keep export handoffs nonterminal through recovery

This commit is contained in:
2026-10-20 21:19:26 +01:00
parent ca78b24f47
commit ec3eda9e05
28 changed files with 370 additions and 82 deletions
+25
View File
@@ -0,0 +1,25 @@
package tui
import (
"strings"
"testing"
"git.a-wan.net/alan/pipelines/internal/protocol"
)
func TestExportWaitRendersRecoveryNotHumanDecision(t *testing.T) {
run := &protocol.RunDetail{RunSummary: protocol.RunSummary{ID: 7, Status: "waiting", ExportPendingSequence: 2, CurrentStage: "worker"}, Graph: protocol.Graph{Stages: []protocol.Stage{{Key: "worker", Type: "model", Edges: map[string]string{"success": "next", "error": "#failure"}}}}}
frame := strings.Join(waitingLines(run), "\n")
if !strings.Contains(frame, "Waiting for session export") || strings.Contains(frame, "person") || strings.Contains(frame, "Decide:") {
t.Fatalf("export wait offered a human choice:\n%s", frame)
}
m := Model{runDetail: run}
_, options, _ := m.waitingStage()
if len(options) != 0 {
t.Fatal("model-stage edges exposed as human options")
}
updated, _ := m.openDecision()
if updated.(Model).decisionOpen {
t.Fatal("opened decision for export wait")
}
}