Harden output cache and debug state integration

This commit is contained in:
2026-07-18 13:00:04 +00:00
parent 26142f0e05
commit 8cb11e60e4
5 changed files with 575 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ type Options struct {
Now func() time.Time
UserCacheDir func() (string, error)
ChunkPlanStoreFactory pipeline.ChunkPlanStoreFactory
DebugRecorderFactory func(string) (pipeline.DebugRecorder, error)
}
type LLMClientFactory func(ctx context.Context, cfg config.Config, profileID string) (contracts.StructuredLLMClient, []artifacts.LLMProfileManifest, error)
@@ -96,6 +97,9 @@ func normalizeOptions(opts Options) (Options, error) {
if opts.ChunkPlanStoreFactory == nil {
opts.ChunkPlanStoreFactory = chunkplan.NewFilesystemStore
}
if opts.DebugRecorderFactory == nil {
opts.DebugRecorderFactory = frameworkdebug.NewFilesystemRecorder
}
if isEmptyCatalog(opts.Catalog) && isEmptyRegistries(opts.Registries) {
components, err := newProductionComponents()
if err != nil {
@@ -220,7 +224,7 @@ func runPipelineCommand(args []string, stdout, stderr io.Writer, opts Options) i
return 1
}
runID, debugPath, summary = bundle.RunID(), bundle.Path(), bundle.Summary()
debugRecorder, err = frameworkdebug.NewFilesystemRecorder(bundle.TraceRoot())
debugRecorder, err = opts.DebugRecorderFactory(bundle.TraceRoot())
if err != nil {
return failPipelineCommand(stderr, summary, debugPath, fmt.Errorf("create debug recorder: %w", err), true)
}