|
|
|
|
@@ -19,8 +19,11 @@ func TestRunContinuesAfterCompletedStages(t *testing.T) {
|
|
|
|
|
manifestPath := filepath.Join(workspaceRoot, "work", "sample-campaign", "2026-05-03", "manifest.json")
|
|
|
|
|
|
|
|
|
|
store := &manifest.LocalStore{}
|
|
|
|
|
m := manifest.New("2026-05-03", time.Date(2026, 5, 3, 10, 0, 0, 0, time.UTC))
|
|
|
|
|
m.MarkStageSucceeded("prepare", time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), nil)
|
|
|
|
|
materializePrepareResumeFixture(t, pipelinePath, campaignPath, sessionPath)
|
|
|
|
|
m, err := store.Load(context.Background(), manifestPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("load prepared manifest: %v", err)
|
|
|
|
|
}
|
|
|
|
|
m.MarkStageSucceeded("transcribe", time.Date(2026, 5, 3, 10, 2, 0, 0, time.UTC), nil)
|
|
|
|
|
seedCurrentSemanticEvidence(t, loadConfigForSemanticEvidence(t, pipelinePath, campaignPath, sessionPath), m, "prepare", "transcribe")
|
|
|
|
|
if err := store.Save(context.Background(), manifestPath, m); err != nil {
|
|
|
|
|
@@ -28,12 +31,9 @@ func TestRunContinuesAfterCompletedStages(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
workRoot := filepath.Join(workspaceRoot, "work", "sample-campaign", "2026-05-03")
|
|
|
|
|
mustWriteTestFile(t, filepath.Join(workRoot, "transcripts", "raw", "alice.json"), `{"segments":[]}`)
|
|
|
|
|
mustWriteTestFile(t, filepath.Join(workRoot, "inputs", "speakers.yml"), "match:\n - speaker: Alice\n match: [\"alice\"]\n")
|
|
|
|
|
mustWriteTestFile(t, filepath.Join(workRoot, "inputs", "autocorrect.yml"), "[]\n")
|
|
|
|
|
mustWriteTestFile(t, filepath.Join(workRoot, "inputs", "glossary.yml"), "terms: []\n")
|
|
|
|
|
|
|
|
|
|
var out bytes.Buffer
|
|
|
|
|
err := Run(context.Background(), []string{"2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath}, &out)
|
|
|
|
|
err = Run(context.Background(), []string{"2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath}, &out)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("Run() error = %v", err)
|
|
|
|
|
}
|
|
|
|
|
@@ -56,7 +56,11 @@ func TestRunNoRemainingStagesRecordsSkippedStages(t *testing.T) {
|
|
|
|
|
manifestPath := filepath.Join(workspaceRoot, "work", "sample-campaign", "2026-05-03", "manifest.json")
|
|
|
|
|
|
|
|
|
|
store := &manifest.LocalStore{}
|
|
|
|
|
m := manifest.New("2026-05-03", time.Date(2026, 5, 3, 10, 0, 0, 0, time.UTC))
|
|
|
|
|
materializePrepareResumeFixture(t, pipelinePath, campaignPath, sessionPath)
|
|
|
|
|
m, err := store.Load(context.Background(), manifestPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("load prepared manifest: %v", err)
|
|
|
|
|
}
|
|
|
|
|
for _, name := range []string{"prepare", "transcribe", "merge", "polish", "normalize", "trim", "render", "analyze", "publish", "notify"} {
|
|
|
|
|
m.MarkStageSucceeded(name, time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), nil)
|
|
|
|
|
}
|
|
|
|
|
@@ -67,7 +71,7 @@ func TestRunNoRemainingStagesRecordsSkippedStages(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var out bytes.Buffer
|
|
|
|
|
err := Run(context.Background(), []string{"2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath}, &out)
|
|
|
|
|
err = Run(context.Background(), []string{"2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath}, &out)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("Run() error = %v", err)
|
|
|
|
|
}
|
|
|
|
|
@@ -204,10 +208,13 @@ func TestRunStageForceMarksDownstreamStaleAndRunContinuesFromStale(t *testing.T)
|
|
|
|
|
manifestPath := filepath.Join(workspaceRoot, "work", "sample-campaign", "2026-05-03", "manifest.json")
|
|
|
|
|
workRoot := filepath.Join(workspaceRoot, "work", "sample-campaign", "2026-05-03")
|
|
|
|
|
mustWriteTestFile(t, filepath.Join(workRoot, "transcripts", "base.json"), `{"segments":[]}`)
|
|
|
|
|
mustWriteTestFile(t, filepath.Join(workRoot, "inputs", "glossary.yml"), "terms: []\n")
|
|
|
|
|
|
|
|
|
|
store := &manifest.LocalStore{}
|
|
|
|
|
seed := manifest.New("2026-05-03", time.Date(2026, 5, 3, 10, 0, 0, 0, time.UTC))
|
|
|
|
|
materializePrepareResumeFixture(t, pipelinePath, campaignPath, sessionPath)
|
|
|
|
|
seed, err := store.Load(context.Background(), manifestPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("load prepared manifest: %v", err)
|
|
|
|
|
}
|
|
|
|
|
for _, name := range []string{"prepare", "transcribe", "merge", "polish", "normalize", "trim", "extract", "render", "analyze", "publish", "notify"} {
|
|
|
|
|
seed.MarkStageSucceeded(name, time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), nil)
|
|
|
|
|
}
|
|
|
|
|
@@ -217,7 +224,7 @@ func TestRunStageForceMarksDownstreamStaleAndRunContinuesFromStale(t *testing.T)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var out bytes.Buffer
|
|
|
|
|
err := RunStage(context.Background(), []string{"polish", "2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath, "--force"}, &out)
|
|
|
|
|
err = RunStage(context.Background(), []string{"polish", "2026-05-03", "--config", pipelinePath, "--campaign-file", campaignPath, "--session", sessionPath, "--force"}, &out)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("RunStage(force) error = %v", err)
|
|
|
|
|
}
|
|
|
|
|
|