Use native prepared previews and correct diagnostic references

This commit is contained in:
2026-11-26 04:08:40 +00:00
parent fcd7cffd18
commit b790cc73ca
9 changed files with 81 additions and 107 deletions

View File

@@ -21,7 +21,6 @@ func (n *NoopRunner) RunArtifact(ctx context.Context, req RunArtifactRequest) (A
}
return ArtifactResult{
OutputPath: req.OutputPath,
StdoutLogPath: req.StdoutLogPath,
StderrLogPath: req.StderrLogPath,
GeneratedConfigPath: req.GeneratedConfigPath,
CommandMode: CommandModeRun,
@@ -41,7 +40,6 @@ func (n *NoopRunner) RenderArtifact(ctx context.Context, req RenderArtifactReque
}
return ArtifactResult{
OutputPath: req.OutputPath,
StdoutLogPath: req.StdoutLogPath,
StderrLogPath: req.StderrLogPath,
GeneratedConfigPath: req.GeneratedConfigPath,
CommandMode: CommandModeRender,
@@ -78,9 +76,6 @@ func (f *FakeRunner) RunArtifact(ctx context.Context, req RunArtifactRequest) (A
if res.OutputPath == "" {
res.OutputPath = req.OutputPath
}
if res.StdoutLogPath == "" {
res.StdoutLogPath = req.StdoutLogPath
}
if res.StderrLogPath == "" {
res.StderrLogPath = req.StderrLogPath
}
@@ -119,9 +114,6 @@ func (f *FakeRunner) RenderArtifact(ctx context.Context, req RenderArtifactReque
if res.OutputPath == "" {
res.OutputPath = req.OutputPath
}
if res.StdoutLogPath == "" {
res.StdoutLogPath = req.StdoutLogPath
}
if res.StderrLogPath == "" {
res.StderrLogPath = req.StderrLogPath
}
@@ -161,11 +153,6 @@ func materializeRunPlaceholders(req RunArtifactRequest) error {
return fmt.Errorf("write generated config %q: %w", req.GeneratedConfigPath, err)
}
}
if req.StdoutLogPath != "" {
if err := fileops.WriteFileAtomic(req.StdoutLogPath, []byte("scriptorium noop/fake run stdout placeholder\n"), fileops.WorkspaceFileMode); err != nil {
return fmt.Errorf("write stdout log %q: %w", req.StdoutLogPath, err)
}
}
if req.StderrLogPath != "" {
if err := fileops.WriteFileAtomic(req.StderrLogPath, []byte("scriptorium noop/fake run stderr placeholder\n"), fileops.WorkspaceFileMode); err != nil {
return fmt.Errorf("write stderr log %q: %w", req.StderrLogPath, err)
@@ -176,7 +163,7 @@ func materializeRunPlaceholders(req RunArtifactRequest) error {
func materializeRenderPlaceholders(req RenderArtifactRequest) error {
if req.OutputPath != "" {
if err := fileops.WriteFileAtomic(req.OutputPath, []byte("{\"schema\":\"scriptorium.render.v1\",\"placeholder\":true}\n"), fileops.WorkspaceFileMode); err != nil {
if err := fileops.WriteFileAtomic(req.OutputPath, []byte("{\"placeholder\":true}\n"), fileops.WorkspaceFileMode); err != nil {
return fmt.Errorf("write render output %q: %w", req.OutputPath, err)
}
}
@@ -192,11 +179,6 @@ func materializeRenderPlaceholders(req RenderArtifactRequest) error {
return fmt.Errorf("write generated config %q: %w", req.GeneratedConfigPath, err)
}
}
if req.StdoutLogPath != "" {
if err := fileops.WriteFileAtomic(req.StdoutLogPath, []byte("scriptorium noop/fake render stdout placeholder\n"), fileops.WorkspaceFileMode); err != nil {
return fmt.Errorf("write stdout log %q: %w", req.StdoutLogPath, err)
}
}
if req.StderrLogPath != "" {
if err := fileops.WriteFileAtomic(req.StderrLogPath, []byte("scriptorium noop/fake render stderr placeholder\n"), fileops.WorkspaceFileMode); err != nil {
return fmt.Errorf("write stderr log %q: %w", req.StderrLogPath, err)