Review transcript trim architecture
This commit is contained in:
@@ -329,14 +329,6 @@ func (trimStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*Stag
|
||||
AbsolutePath: finalBoundsOutputPath,
|
||||
},
|
||||
}
|
||||
if renderOutputPath != "" {
|
||||
outputs = append(outputs, artifacts.Ref{
|
||||
Kind: "session_bounds_render",
|
||||
Category: "artifacts",
|
||||
SessionID: sessionID,
|
||||
AbsolutePath: renderOutputPath,
|
||||
})
|
||||
}
|
||||
|
||||
return &StageResult{
|
||||
Outputs: outputs,
|
||||
|
||||
@@ -112,6 +112,33 @@ func TestTrimStageRecordsLogAndGeneratedConfigRefs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrimStageRenderDebugDiagnosticsAreNotStageOutputs(t *testing.T) {
|
||||
env, m, scr, _ := setupTrimEnv(t)
|
||||
paths := env.ArtifactStore.SessionPaths(m.SessionID)
|
||||
writeFile(t, filepath.Join(paths.TranscriptsDir, "processed.json"), `{"segments":[{"id":1},{"id":2}]}`)
|
||||
scr.BoundsBody = `{"trim_action":"trim","start_segment_id":1,"end_segment_id":2}`
|
||||
|
||||
cfg := *env.Config.Pipeline.Trim
|
||||
cfg.Bounds.RenderDebug = true
|
||||
env.Config.Pipeline.Trim = &cfg
|
||||
|
||||
result, err := (trimStage{}).Run(context.Background(), env, m)
|
||||
if err != nil {
|
||||
t.Fatalf("trim.Run() error = %v", err)
|
||||
}
|
||||
if len(scr.RenderRequests) != 1 {
|
||||
t.Fatalf("scriptorium render requests = %d, want 1", len(scr.RenderRequests))
|
||||
}
|
||||
for _, out := range result.Outputs {
|
||||
if out.Kind == "session_bounds_render" {
|
||||
t.Fatalf("render diagnostics should not be stage outputs: %#v", result.Outputs)
|
||||
}
|
||||
}
|
||||
if result.Metadata["bounds_render_output_path"] == nil {
|
||||
t.Fatalf("bounds_render_output_path metadata missing: %#v", result.Metadata)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrimStageFailsWhenProcessedTranscriptMissing(t *testing.T) {
|
||||
env, m, _, _ := setupTrimEnv(t)
|
||||
_, err := (trimStage{}).Run(context.Background(), env, m)
|
||||
|
||||
Reference in New Issue
Block a user