Unify optional interaction capture and warnings

This commit is contained in:
2026-11-16 03:43:29 +00:00
parent ffe0e3491e
commit cea7e44232
22 changed files with 450 additions and 367 deletions

View File

@@ -47,13 +47,20 @@ func executePipeline(ctx context.Context, loaded *processInputs, prepared *prepa
item.CaptureProposalExchange = true
}
}
debugPath := prepared.DebugPath()
var interactions structuredoutput.InteractionSink
var writer *llm.DiagnosticsWriter
if debug != nil {
writer = llm.NewDiagnosticsWriter(debug.Path())
interactions = writer
}
output, runErr := runner.New(modules.NewFactory()).Run(ctx, runner.RunInput{
Config: cfg, Transcript: normalized, ModuleSpecs: specs,
ProposalDiagnosticsDir: debugPath, ValidationDiagnosticsDir: debugPath,
CaptureCandidates: debugPath != "", ReportDiagnosticError: warn,
Interactions: interactions, CaptureCandidates: debug != nil,
})
if debug != nil {
for _, warning := range writer.Warnings() {
warn(warning)
}
warn(debug.WriteJSONArtifact(diagnostics.ArtifactLLMExecution, processreport.BuildLLMExecution(observer.Snapshot())))
warn(debug.WriteJSONArtifact(diagnostics.ArtifactCorrectionLedger, processreport.BuildCorrectionLedger(processreport.CorrectionLedgerInput{RunDirectoryPath: debug.Path(), RunOutput: &output})))
}