05ae530442
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers. Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent. Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
56 lines
1.7 KiB
Go
56 lines
1.7 KiB
Go
package cli_test
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
"strings"
|
|
"testing"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/pipeline"
|
|
"git.a-wan.net/alan/pipelines/internal/runinspect"
|
|
)
|
|
|
|
func TestDebugIncludesPinnedDefinitionAndRecordedFailure(t *testing.T) {
|
|
run, store, _ := setup(t)
|
|
ctx := context.Background()
|
|
source := pipeline.Template([]string{"original-worker"}, true)
|
|
if _, err := store.Submit(ctx, "workflow", source); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
items, err := store.List(ctx)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
definition, err := store.Get(ctx, items[0].ID, 1)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
id, _, err := store.CreateRun(ctx, definition, "debug-check", t.TempDir(), false, nil, map[string]any{"prompt": "original task for diagnosis"})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if err = store.FinishRun(ctx, id, "failed", "error", "recorded provider failure", nil); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if _, err = store.Submit(ctx, "workflow", pipeline.Template([]string{"new-worker"}, true)); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
output, err := run("debug", fmt.Sprint(id), "--json")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
var debug runinspect.Debug
|
|
if err = json.Unmarshal([]byte(output), &debug); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, expected := range []string{"original task for diagnosis", "recorded provider failure", "original-worker", "Exact immutable pipeline definition", "bounded and credential-redacted OpenCode session evidence"} {
|
|
if !strings.Contains(debug.Prompt, expected) {
|
|
t.Fatal("missing debug context", expected, debug.Prompt)
|
|
}
|
|
}
|
|
if strings.Contains(debug.Prompt, "new-worker") {
|
|
t.Fatal("debug used latest definition instead of pinned version")
|
|
}
|
|
}
|