Finalize structured diagnostic aggregation
This commit is contained in:
@@ -86,8 +86,8 @@ func TestRunnerProcessesSeriatimInputWithProductionDNDNPCPipeline(t *testing.T)
|
||||
}
|
||||
}
|
||||
}
|
||||
if !hasNPCWarning(output.Warnings, "duplicate_npc_collapsed") {
|
||||
t.Fatalf("warnings = %#v, want name-only consolidation warning", output.Warnings)
|
||||
if !hasNPCWarning(output.Diagnostics, "duplicate_npc_collapsed") {
|
||||
t.Fatalf("diagnostics = %#v, want name-only consolidation advisory", output.Diagnostics)
|
||||
}
|
||||
if output.Manifest.ValidationStatus != "approved" || len(output.Manifest.ArtifactLanes) != 1 {
|
||||
t.Fatalf("manifest = %#v, want approved NPC lane", output.Manifest)
|
||||
@@ -213,8 +213,8 @@ func TestProductionNPCNormalizationRetryUsesFinalSafeProposal(t *testing.T) {
|
||||
if client.requestCount(npcnormalize.PromptID) != test.wantCalls || len(output.NormalizeOutputs) != 1 {
|
||||
t.Fatalf("normalization calls = %d output = %#v, want %d accepted result", client.requestCount(npcnormalize.PromptID), output.NormalizeOutputs, test.wantCalls)
|
||||
}
|
||||
if got := hasWarningReason(output.Warnings, npcnormalize.ReasonCodeNPCSemanticReconciliationExhausted); got != test.wantExhaustion {
|
||||
t.Fatalf("warnings = %#v, exhaustion = %t, want %t", output.Warnings, got, test.wantExhaustion)
|
||||
if got := hasWarningReason(output.Diagnostics, npcnormalize.ReasonCodeNPCSemanticReconciliationExhausted); got != test.wantExhaustion {
|
||||
t.Fatalf("diagnostics = %#v, exhaustion = %t, want %t", output.Diagnostics, got, test.wantExhaustion)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -355,18 +355,18 @@ func readNPCFixture(t *testing.T) []byte {
|
||||
return raw
|
||||
}
|
||||
|
||||
func hasNPCWarning(warnings []contracts.Warning, reason string) bool {
|
||||
for _, warning := range warnings {
|
||||
if warning.ReasonCode == reason && strings.HasPrefix(warning.Scope, "npcs[") {
|
||||
func hasNPCWarning(diagnostics contracts.DiagnosticCollection, reason string) bool {
|
||||
for _, group := range diagnostics.Groups {
|
||||
if group.ReasonCode == reason && len(group.Samples) > 0 && strings.HasPrefix(group.Samples[0].Scope, "npcs[") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func hasWarningReason(warnings []contracts.Warning, reason string) bool {
|
||||
for _, warning := range warnings {
|
||||
if warning.ReasonCode == reason {
|
||||
func hasWarningReason(diagnostics contracts.DiagnosticCollection, reason string) bool {
|
||||
for _, group := range diagnostics.Groups {
|
||||
if group.ReasonCode == reason {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user