Implement real Seriatim merge stage
This commit is contained in:
@@ -59,7 +59,11 @@ func executeStages(ctx context.Context, cfg *config.Config, stages []stage.Stage
|
||||
env.WhisperX = client
|
||||
}
|
||||
if env.Seriatim == nil {
|
||||
env.Seriatim = &seriatim.NoopRunner{}
|
||||
runner, err := buildDefaultSeriatimRunner(env.Config)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("initialize seriatim runner: %w", err)
|
||||
}
|
||||
env.Seriatim = runner
|
||||
}
|
||||
if env.Audita == nil {
|
||||
env.Audita = &audita.NoopRunner{}
|
||||
@@ -179,6 +183,40 @@ func buildDefaultWhisperXClient(cfg *config.Config) (whisperx.Client, error) {
|
||||
return client, nil
|
||||
}
|
||||
|
||||
func buildDefaultSeriatimRunner(cfg *config.Config) (seriatim.Runner, error) {
|
||||
if cfg == nil || cfg.Pipeline == nil {
|
||||
return &seriatim.NoopRunner{}, nil
|
||||
}
|
||||
|
||||
s := cfg.Pipeline.Seriatim
|
||||
if strings.TrimSpace(s.Binary) == "" || strings.TrimSpace(s.Timeout) == "" || strings.TrimSpace(s.OutputSchema) == "" {
|
||||
// Compatibility fallback for tests or internal call paths that bypass config validation/defaults.
|
||||
return &seriatim.NoopRunner{}, nil
|
||||
}
|
||||
|
||||
report := false
|
||||
if s.Report != nil {
|
||||
report = *s.Report
|
||||
}
|
||||
runner, err := seriatim.NewSubprocessRunnerFromConfigValues(
|
||||
s.Binary,
|
||||
s.Timeout,
|
||||
s.OutputSchema,
|
||||
s.CoalesceGap,
|
||||
report,
|
||||
seriatim.EnvConfig{
|
||||
OverlapWordRunGap: s.Env.OverlapWordRunGap,
|
||||
OverlapWordRunReorderWindow: s.Env.OverlapWordRunReorderWindow,
|
||||
BackchannelMaxDuration: s.Env.BackchannelMaxDuration,
|
||||
FillerMaxDuration: s.Env.FillerMaxDuration,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("from pipeline.seriatim: %w", err)
|
||||
}
|
||||
return runner, nil
|
||||
}
|
||||
|
||||
func loadOrCreateManifest(ctx context.Context, store manifest.Store, path, sessionID string) (*manifest.Manifest, error) {
|
||||
exists, err := fileExists(path)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user