Enforce requested adapter output paths
This commit is contained in:
@@ -200,7 +200,10 @@ func (trimStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Stag
|
||||
if renderRes.ValidationFailed {
|
||||
return nil, fmt.Errorf("trim: scriptorium bounds render returned validation_failed=true")
|
||||
}
|
||||
finalRenderOutputPath := coalesceString(renderRes.OutputPath, renderReq.OutputPath)
|
||||
finalRenderOutputPath, err := authoritativeOutputPath(renderReq.OutputPath, renderRes.OutputPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("trim: %w", err)
|
||||
}
|
||||
if err := requireNonEmptyFile(finalRenderOutputPath, "bounds render output"); err != nil {
|
||||
return nil, fmt.Errorf("trim: %w", err)
|
||||
}
|
||||
@@ -242,7 +245,7 @@ func (trimStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Stag
|
||||
return nil, fmt.Errorf(
|
||||
"trim: scriptorium bounds validation failed (prompt_id=%q, output_path=%q, exit_code=%d, stdout_log=%q, stderr_log=%q): %w",
|
||||
boundsReq.PromptID,
|
||||
coalesceString(boundsRes.OutputPath, boundsReq.OutputPath),
|
||||
boundsReq.OutputPath,
|
||||
boundsRes.ExitCode,
|
||||
coalesceString(boundsRes.StdoutLogPath, boundsReq.StdoutLogPath),
|
||||
coalesceString(boundsRes.StderrLogPath, boundsReq.StderrLogPath),
|
||||
@@ -255,7 +258,10 @@ func (trimStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Stag
|
||||
return nil, fmt.Errorf("trim: scriptorium bounds run returned validation_failed=true")
|
||||
}
|
||||
|
||||
finalBoundsOutputPath := coalesceString(boundsRes.OutputPath, boundsReq.OutputPath)
|
||||
finalBoundsOutputPath, err := authoritativeOutputPath(boundsReq.OutputPath, boundsRes.OutputPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("trim: %w", err)
|
||||
}
|
||||
if err := requireNonEmptyFile(finalBoundsOutputPath, "session bounds output"); err != nil {
|
||||
return nil, fmt.Errorf("trim: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user