Align debug summaries with diagnostics

This commit is contained in:
2026-08-27 16:51:56 +00:00
parent af0119cc1d
commit 2065a8288b
9 changed files with 16 additions and 14 deletions

View File

@@ -12,7 +12,7 @@ own durable output shapes. Concrete production extensions are covered by
The pipeline framework accepts a resolved composition, registries, shared The pipeline framework accepts a resolved composition, registries, shared
dependencies, input bytes, a supplied prompt session, and state/debug dependencies, input bytes, a supplied prompt session, and state/debug
collaborators. It returns logical output files, normalized artifacts, recorded collaborators. It returns logical output files, normalized artifacts, recorded
rejections and warnings, manifest provenance, and checkpoint decisions. The rejections, grouped diagnostics, manifest provenance, and checkpoint decisions. The
CLI owns process arguments, configuration discovery, session resolution, CLI owns process arguments, configuration discovery, session resolution,
physical roots, and placement of returned output files. physical roots, and placement of returned output files.

View File

@@ -97,7 +97,7 @@ owns the operator workflow and stable reason-code meanings.
`internal/core/debugbundle` allocates an explicitly requested per-run bundle `internal/core/debugbundle` allocates an explicitly requested per-run bundle
with `summary/` and `trace/` roots. `SummaryWriter` persists redacted command, with `summary/` and `trace/` roots. `SummaryWriter` persists redacted command,
resolution, run, warning, and failure artifacts. `internal/framework/debug` resolution, run, final grouped diagnostic, and failure artifacts. `internal/framework/debug`
implements the pipeline-facing trace recorder under the trace root. implements the pipeline-facing trace recorder under the trace root.
The CLI allocates a bundle before pipeline resolution and treats requested The CLI allocates a bundle before pipeline resolution and treats requested

View File

@@ -105,8 +105,10 @@ and resolves configuration before module preparation and source parsing. It
then performs any permitted cache lookup, executes the pipeline, and publishes then performs any permitted cache lookup, executes the pipeline, and publishes
logical output files only after a successful runner result. logical output files only after a successful runner result.
On success, the command reports the output bundle path. A warning-bearing run On success, the command reports the output bundle path. A run with actionable
still succeeds and reports its warning count on standard error. Errors and process warnings still succeeds and reports warning-group and occurrence counts
on standard error; advisory and observation findings do not produce a warning
line. Errors and
their exit classes are defined in the [CLI reference](cli.md#output-streams-and-exit-statuses). their exit classes are defined in the [CLI reference](cli.md#output-streams-and-exit-statuses).
## Validation Retries And Terminal Outcomes ## Validation Retries And Terminal Outcomes
@@ -272,7 +274,7 @@ Only a [debug-enabled run](cli.md#run) creates a bundle:
~~~ ~~~
The summary contains redacted invocation and resolution information plus run, The summary contains redacted invocation and resolution information plus run,
warning, checkpoint, chunk-plan, and terminal reporting artifacts. Attempt final grouped diagnostic, checkpoint, chunk-plan, and terminal reporting artifacts. Attempt
terminal records contain bounded attempt kinds, validator outcomes, policy, terminal records contain bounded attempt kinds, validator outcomes, policy,
decision, PromptKit repair count, and usage; they do not contain assistant decision, PromptKit repair count, and usage; they do not contain assistant
responses or complete correction messages. The trace contains allowlisted responses or complete correction messages. The trace contains allowlisted

View File

@@ -593,7 +593,7 @@ output modules. Assert semantic fields and stream choice, not complete prose.
This stage is appropriately sized for one `gpt-5.6-terra` prompt. This stage is appropriately sized for one `gpt-5.6-terra` prompt.
## Stage 11 — Align Debug, Manifest, And Resume Surfaces ## Stage 11 — Align Debug, Manifest, And Resume Surfaces
### Goal ### Goal

View File

@@ -538,7 +538,7 @@ func writePartialSummary(summary *debugbundle.SummaryWriter, output pipeline.Run
return err return err
} }
} }
if err := summary.WriteWarnings(output.Diagnostics); err != nil { if err := summary.WriteDiagnostics(output.Diagnostics); err != nil {
return err return err
} }
return summary.WriteCheckpointEvents(output.CheckpointEvents) return summary.WriteCheckpointEvents(output.CheckpointEvents)

View File

@@ -603,7 +603,7 @@ func TestRunWarningsRemainSuccessfulAndReachDurableSurfaces(t *testing.T) {
} }
bundle := onlyChildDir(t, roots.debug) bundle := onlyChildDir(t, roots.debug)
var diagnostics contracts.DiagnosticCollection var diagnostics contracts.DiagnosticCollection
readStateTestSummaryJSON(t, bundle, "warnings.json", &diagnostics) readStateTestSummaryJSON(t, bundle, "final-diagnostics.json", &diagnostics)
if len(diagnostics.Groups) != 1 || diagnostics.Groups[0].ReasonCode != "contract-warning" { if len(diagnostics.Groups) != 1 || diagnostics.Groups[0].ReasonCode != "contract-warning" {
t.Fatalf("debug diagnostics = %#v", diagnostics) t.Fatalf("debug diagnostics = %#v", diagnostics)
} }

View File

@@ -464,7 +464,7 @@ func TestRunRetainsPartialPipelineOutcomeInFailureSummary(t *testing.T) {
t.Fatalf("partial manifest = %#v", manifest) t.Fatalf("partial manifest = %#v", manifest)
} }
var diagnostics contracts.DiagnosticCollection var diagnostics contracts.DiagnosticCollection
readStateTestSummaryJSON(t, bundlePath, "warnings.json", &diagnostics) readStateTestSummaryJSON(t, bundlePath, "final-diagnostics.json", &diagnostics)
if len(diagnostics.Groups) != 1 || diagnostics.Groups[0].ReasonCode != "partial-warning" { if len(diagnostics.Groups) != 1 || diagnostics.Groups[0].ReasonCode != "partial-warning" {
t.Fatalf("partial diagnostics = %#v", diagnostics) t.Fatalf("partial diagnostics = %#v", diagnostics)
} }

View File

@@ -110,7 +110,7 @@ func TestSummaryWriterWritesEverySummaryArtifact(t *testing.T) {
if err := summary.WriteRunReport(RunReport{RunID: bundle.RunID(), PipelineID: "test"}); err != nil { if err := summary.WriteRunReport(RunReport{RunID: bundle.RunID(), PipelineID: "test"}); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if err := summary.WriteWarnings(contracts.DiagnosticCollection{}); err != nil { if err := summary.WriteDiagnostics(contracts.DiagnosticCollection{}); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if err := summary.WriteError("failed"); err != nil { if err := summary.WriteError("failed"); err != nil {
@@ -126,7 +126,7 @@ func TestSummaryWriterWritesEverySummaryArtifact(t *testing.T) {
ArtifactRunManifest, ArtifactRunManifest,
ArtifactChunkPlan, ArtifactChunkPlan,
ArtifactRunReport, ArtifactRunReport,
ArtifactWarnings, ArtifactDiagnostics,
ArtifactErrorLog, ArtifactErrorLog,
} { } {
info, err := os.Stat(filepath.Join(bundle.SummaryRoot(), name)) info, err := os.Stat(filepath.Join(bundle.SummaryRoot(), name))

View File

@@ -20,7 +20,7 @@ const (
ArtifactRunManifest = "run-manifest.json" ArtifactRunManifest = "run-manifest.json"
ArtifactChunkPlan = "chunk-plan.json" ArtifactChunkPlan = "chunk-plan.json"
ArtifactRunReport = "run-report.json" ArtifactRunReport = "run-report.json"
ArtifactWarnings = "warnings.json" ArtifactDiagnostics = "final-diagnostics.json"
ArtifactErrorLog = "error.log" ArtifactErrorLog = "error.log"
) )
@@ -101,8 +101,8 @@ func (w *SummaryWriter) WriteChunkPlan(v artifacts.ChunkPlanSummary) error {
return w.writeJSON(ArtifactChunkPlan, v) return w.writeJSON(ArtifactChunkPlan, v)
} }
func (w *SummaryWriter) WriteRunReport(v RunReport) error { return w.writeJSON(ArtifactRunReport, v) } func (w *SummaryWriter) WriteRunReport(v RunReport) error { return w.writeJSON(ArtifactRunReport, v) }
func (w *SummaryWriter) WriteWarnings(v contracts.DiagnosticCollection) error { func (w *SummaryWriter) WriteDiagnostics(v contracts.DiagnosticCollection) error {
return w.writeJSON(ArtifactWarnings, v) return w.writeJSON(ArtifactDiagnostics, contracts.CloneDiagnosticCollection(v))
} }
func (w *SummaryWriter) WriteError(message string) error { func (w *SummaryWriter) WriteError(message string) error {
return w.writeBytes(ArtifactErrorLog, []byte(message+"\n")) return w.writeBytes(ArtifactErrorLog, []byte(message+"\n"))