Check validation diagnostics without fixing their layout
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# PromptKit request validation review remediation
|
# 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.
|
architectural redesign was identified as necessary.
|
||||||
|
|
||||||
## Review scope and evidence
|
## 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
|
## 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:**
|
**Location:**
|
||||||
[validation_command_test.go](../../integrations/ckprompt/validation_command_test.go),
|
[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
|
**Completion evidence:** The focused test and ckprompt suite pass and still
|
||||||
detect lost or duplicate diagnostics without fixing incidental error decoration
|
detect lost or duplicate diagnostics without fixing incidental error decoration
|
||||||
or line layout. Preserve current production delivery behavior and order.
|
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.
|
||||||
|
|||||||
@@ -388,9 +388,12 @@ func TestValidationCommandRetainsProviderDiagnosticsAndClassifiesFailures(t *tes
|
|||||||
}}))
|
}}))
|
||||||
diagnostics.Reset()
|
diagnostics.Reset()
|
||||||
outcome = failedApp.Execute(context.Background(), []string{"promptkit", "requirements", "validate", "briefing"}, commandkit.Streams{Out: io.Discard, Err: &diagnostics})
|
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())
|
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")
|
builderErr := errors.New("request builder failed")
|
||||||
loaderCalls := 0
|
loaderCalls := 0
|
||||||
|
|||||||
Reference in New Issue
Block a user