From 2eae2a4af2856291658bfb5d62d713adf5cdba0a Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Fri, 27 Nov 2026 04:03:24 +0000 Subject: [PATCH] Explain native preflight failures --- docs/roadmap/remediation.md | 7 ++++++- internal/cli/preflight.go | 3 +++ internal/cli/preflight_test.go | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md index 366b125..eb6305b 100644 --- a/docs/roadmap/remediation.md +++ b/docs/roadmap/remediation.md @@ -17,7 +17,12 @@ success criteria. No implementation fixes were made during this review. ## R1 — Present actionable native smoke errors -**Priority:** P2. **Stage:** 7. **Status:** Open. +**Priority:** P2. **Stage:** 7. **Status:** Complete. + +**Completion:** Native smoke errors now appear beside their profile and safe +observations while the original cause remains attached. The missing-model CLI +regression passes in ordinary, quiet, and debug modes; preflight tests pass with +Go 1.27.4. **Locations:** `internal/cli/preflight.go:38` and `:53`; `internal/framework/llm/smoke.go:72`. diff --git a/internal/cli/preflight.go b/internal/cli/preflight.go index 54ea930..c9156a8 100644 --- a/internal/cli/preflight.go +++ b/internal/cli/preflight.go @@ -52,6 +52,9 @@ func runPreflight(inv commandkit.Invocation, input processInput) commandkit.Outc func verificationLine(result llm.ProfileVerification) string { line := fmt.Sprintf("Profile %q: %s", result.ProfileID, result.Status) + if result.Err != nil { + line += ": " + result.Err.Error() + } if result.Report == nil { return line + "; smoke usage: unknown" } diff --git a/internal/cli/preflight_test.go b/internal/cli/preflight_test.go index 4d6f456..63925af 100644 --- a/internal/cli/preflight_test.go +++ b/internal/cli/preflight_test.go @@ -197,3 +197,29 @@ func TestPreflightUsagePreservesUnknownAndCompleteness(t *testing.T) { } } } + +func TestPreflightExplainsNativePreparationError(t *testing.T) { + dir := t.TempDir() + for name, body := range map[string]string{ + "config.yml": "version: 3\nllm: {proposal_profile: selected}\npipeline: {stages: [{module: grammar}]}\nreporting: {enabled: false}\n", + "prompts.yml": "profiles: [{id: selected, endpoint: 'http://example.invalid/v1'}]\n", + "transcript.json": `[{"speaker":"A","start":0,"end":1,"text":"hello"}]`, + } { + if err := os.WriteFile(filepath.Join(dir, name), []byte(body), 0600); err != nil { + t.Fatal(err) + } + } + app, err := buildApplication() + if err != nil { + t.Fatal(err) + } + for _, flags := range [][]string{nil, {"--quiet"}, {"--debug"}} { + var out, diagnostic bytes.Buffer + args := append([]string{"preflight"}, flags...) + args = append(args, "--config", filepath.Join(dir, "config.yml"), "--output", filepath.Join(dir, "out.json"), filepath.Join(dir, "transcript.json")) + result := app.Execute(context.Background(), args, commandkit.Streams{Out: &out, Err: &diagnostic}) + if result.Status != 1 || result.Cause == nil || !strings.Contains(diagnostic.String(), `Profile "selected"`) || !strings.Contains(diagnostic.String(), "model is required") { + t.Fatalf("status=%d cause=%v diagnostic=%s", result.Status, result.Cause, diagnostic.String()) + } + } +}