Finalize structured diagnostic aggregation

This commit is contained in:
2026-08-27 16:40:17 +00:00
parent 480680b257
commit 4dbbf68051
112 changed files with 656 additions and 893 deletions

View File

@@ -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
}
}