diff --git a/CHANGELOG.md b/CHANGELOG.md index 98415cbf..5b6aa7ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Show `prompt changed` in text comparisons when a shared case's recorded + prompts differ, even if its pass/fail status stayed the same. + - `skill-up run --dry-run` now prints the planned case executions as cases times configurations times iterations. A benchmark over four cases with `--iteration 5` previously reported only `Would run 4 case(s)` for 40 diff --git a/internal/compare/render_test.go b/internal/compare/render_test.go index f8892d58..6a554d53 100644 --- a/internal/compare/render_test.go +++ b/internal/compare/render_test.go @@ -127,6 +127,11 @@ func TestRecordedConfigurationAndPromptDifferences(t *testing.T) { if len(result.Cases.Unchanged) != 1 || result.Cases.Unchanged[0].PromptChanged == nil || !*result.Cases.Unchanged[0].PromptChanged { t.Fatal("same outcome hid prompt difference") } + tc := result.Cases.Unchanged[0] + want := tc.CaseID + " (" + transitionStatus(tc) + ", prompt changed)" + if text := RenderText(result); !strings.Contains(text, want) || strings.Count(text, ", prompt changed)") != 1 { + t.Fatalf("text comparison should flag only the changed prompt, want %q in:\n%s", want, text) + } for _, format := range []string{"html", "markdown", "text"} { data, err := Render(result, format) if err != nil { diff --git a/internal/compare/text.go b/internal/compare/text.go index fe2d6c80..cbdb410e 100644 --- a/internal/compare/text.go +++ b/internal/compare/text.go @@ -47,7 +47,11 @@ func RenderText(result Result) string { func writeTransitions(b *strings.Builder, label string, transitions []CaseTransition) { fmt.Fprintf(b, "%s (%d):", label, len(transitions)) for _, transition := range transitions { - fmt.Fprintf(b, " %s (%s)", transition.CaseID, transitionStatus(transition)) + status := transitionStatus(transition) + if transition.PromptChanged != nil && *transition.PromptChanged { + status += ", prompt changed" + } + fmt.Fprintf(b, " %s (%s)", transition.CaseID, status) } b.WriteByte('\n') }