From 5f633e3feea71f623e5e378a7df476ff7e811e5e Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 12 Oct 2026 23:43:16 +0000 Subject: [PATCH] Check validation diagnostics without fixing their layout --- docs/roadmap/remediation.md | 12 ++++++++++-- integrations/ckprompt/validation_command_test.go | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md index 6f4aae2..24be987 100644 --- a/docs/roadmap/remediation.md +++ b/docs/roadmap/remediation.md @@ -1,6 +1,6 @@ # PromptKit request validation review remediation -Status: one open finding; R-1 complete. No production-code correction or +Status: complete; R-1 and R-2 addressed. No production-code correction or architectural redesign was identified as necessary. ## Review scope and evidence @@ -81,7 +81,7 @@ including the composed consumer. Production code is unchanged. ## R-2: Replace the complete provider-failure stderr snapshot -Status: open. Severity: low. Category: unnecessary presentation constraint in a test. +Status: complete. Severity: low. Category: unnecessary presentation constraint in a test. **Location:** [validation_command_test.go](../../integrations/ckprompt/validation_command_test.go), @@ -110,3 +110,11 @@ of bytes explicitly supplied by the test's own writer. **Completion evidence:** The focused test and ckprompt suite pass and still detect lost or duplicate diagnostics without fixing incidental error decoration or line layout. Preserve current production delivery behavior and order. + +**Completed:** 2026-10-12. Replaced the failed-stderr snapshot with independent +single-occurrence checks for the synthetic warning and provider error. Retained +operational classification, status, cause identity, and diagnostic payload +checks, and verified complete diagnostic delivery. The focused +`TestValidationCommandRetainsProviderDiagnosticsAndClassifiesFailures` test and +`GOTOOLCHAIN=local go test -count=1 ./...` passed from `integrations/ckprompt`, +including the composed consumer. Production formatting and delivery are unchanged. diff --git a/integrations/ckprompt/validation_command_test.go b/integrations/ckprompt/validation_command_test.go index 249a7b8..25584c1 100644 --- a/integrations/ckprompt/validation_command_test.go +++ b/integrations/ckprompt/validation_command_test.go @@ -388,9 +388,12 @@ func TestValidationCommandRetainsProviderDiagnosticsAndClassifiesFailures(t *tes }})) diagnostics.Reset() outcome = failedApp.Execute(context.Background(), []string{"promptkit", "requirements", "validate", "briefing"}, commandkit.Streams{Out: io.Discard, Err: &diagnostics}) - if outcome.Kind != commandkit.OutcomeOperational || outcome.Status != 1 || !errors.Is(outcome.Cause, providerErr) || !withWarning(outcome.Diagnostics) || diagnostics.String() != "validation warning\nvalidation provider failed\n" { + if outcome.Kind != commandkit.OutcomeOperational || outcome.Status != 1 || !errors.Is(outcome.Cause, providerErr) || !withWarning(outcome.Diagnostics) || outcome.DiagnosticDelivery != commandkit.DeliveryComplete { t.Fatalf("provider failure = %#v, stderr=%q", outcome, diagnostics.String()) } + if strings.Count(diagnostics.String(), "validation warning") != 1 || strings.Count(diagnostics.String(), providerErr.Error()) != 1 { + t.Fatalf("provider diagnostics were lost or duplicated: stderr=%q", diagnostics.String()) + } builderErr := errors.New("request builder failed") loaderCalls := 0