1 Commits

Author SHA1 Message Date
c6632d5576 Bugfix in the seriatim adapter
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
2026-05-27 08:09:22 -05:00
10 changed files with 41 additions and 18 deletions

View File

@@ -198,7 +198,7 @@ Rules:
| `pipeline.render.format` | string | No | `markdown` (only supported value) | | `pipeline.render.format` | string | No | `markdown` (only supported value) |
| `pipeline.render.title` | string | No | empty (falls back to `session.title` when set) | | `pipeline.render.title` | string | No | empty (falls back to `session.title` when set) |
| `pipeline.render.include_timestamps` | bool | No | `true` | | `pipeline.render.include_timestamps` | bool | No | `true` |
| `pipeline.render.include_segment_ids` | bool | No | `false` | | `pipeline.render.include_segment_ids` | bool | No | `true` |
| `pipeline.render.include_metadata` | bool | No | `false` | | `pipeline.render.include_metadata` | bool | No | `false` |
| `pipeline.scriptorium.binary` | string | No | `scriptorium` | | `pipeline.scriptorium.binary` | string | No | `scriptorium` |
| `pipeline.scriptorium.config_path` | string | No | empty | | `pipeline.scriptorium.config_path` | string | No | empty |

View File

@@ -577,9 +577,9 @@ func buildRenderArgs(req RenderRequest, format string) []string {
"--input-file", req.InputTranscriptPath, "--input-file", req.InputTranscriptPath,
"--output-file", req.OutputRenderedPath, "--output-file", req.OutputRenderedPath,
"--format", format, "--format", format,
"--include-timestamps", strconv.FormatBool(req.IncludeTimestamps), "--include-timestamps=" + strconv.FormatBool(req.IncludeTimestamps),
"--include-segment-ids", strconv.FormatBool(req.IncludeSegmentIDs), "--include-segment-ids=" + strconv.FormatBool(req.IncludeSegmentIDs),
"--include-metadata", strconv.FormatBool(req.IncludeMetadata), "--include-metadata=" + strconv.FormatBool(req.IncludeMetadata),
} }
if strings.TrimSpace(req.Title) != "" { if strings.TrimSpace(req.Title) != "" {
args = append(args, "--title", req.Title) args = append(args, "--title", req.Title)

View File

@@ -628,9 +628,9 @@ func TestSubprocessRunnerRenderSuccessInvocationAndProvenance(t *testing.T) {
"--input-file", req.InputTranscriptPath, "--input-file", req.InputTranscriptPath,
"--output-file", req.OutputRenderedPath, "--output-file", req.OutputRenderedPath,
"--format", req.Format, "--format", req.Format,
"--include-timestamps", "true", "--include-timestamps=true",
"--include-segment-ids", "false", "--include-segment-ids=true",
"--include-metadata", "true", "--include-metadata=false",
"--title", req.Title, "--title", req.Title,
} }
if strings.Join(rec.Args, "\n") != strings.Join(wantArgs, "\n") { if strings.Join(rec.Args, "\n") != strings.Join(wantArgs, "\n") {
@@ -946,8 +946,8 @@ func renderReqForTest(t *testing.T) RenderRequest {
Format: "markdown", Format: "markdown",
Title: "Session 42", Title: "Session 42",
IncludeTimestamps: true, IncludeTimestamps: true,
IncludeSegmentIDs: false, IncludeSegmentIDs: true,
IncludeMetadata: true, IncludeMetadata: false,
GeneratedConfigPath: filepath.Join(dir, "seriatim.render.generated.yml"), GeneratedConfigPath: filepath.Join(dir, "seriatim.render.generated.yml"),
StdoutLogPath: filepath.Join(dir, "seriatim.render.stdout.log"), StdoutLogPath: filepath.Join(dir, "seriatim.render.stdout.log"),
StderrLogPath: filepath.Join(dir, "seriatim.render.stderr.log"), StderrLogPath: filepath.Join(dir, "seriatim.render.stderr.log"),

View File

@@ -216,7 +216,7 @@ type RenderConfig struct {
Format string `yaml:"format"` Format string `yaml:"format"`
Title string `yaml:"title"` Title string `yaml:"title"`
IncludeTimestamps *bool `yaml:"include_timestamps"` IncludeTimestamps *bool `yaml:"include_timestamps"`
IncludeSegmentIDs bool `yaml:"include_segment_ids"` IncludeSegmentIDs *bool `yaml:"include_segment_ids"`
IncludeMetadata bool `yaml:"include_metadata"` IncludeMetadata bool `yaml:"include_metadata"`
} }

View File

@@ -44,7 +44,7 @@ const (
DefaultRenderFormat = "markdown" DefaultRenderFormat = "markdown"
DefaultRenderTitle = "" DefaultRenderTitle = ""
DefaultRenderTimestamps = true DefaultRenderTimestamps = true
DefaultRenderSegmentIDs = false DefaultRenderSegmentIDs = true
DefaultRenderMetadata = false DefaultRenderMetadata = false
DefaultNormalizeOutputPath = artifactmodel.TranscriptPathFinal DefaultNormalizeOutputPath = artifactmodel.TranscriptPathFinal

View File

@@ -527,6 +527,9 @@ func applyRenderDefaults(cfg **RenderConfig) {
if (*cfg).IncludeTimestamps == nil { if (*cfg).IncludeTimestamps == nil {
(*cfg).IncludeTimestamps = boolPtr(DefaultRenderTimestamps) (*cfg).IncludeTimestamps = boolPtr(DefaultRenderTimestamps)
} }
if (*cfg).IncludeSegmentIDs == nil {
(*cfg).IncludeSegmentIDs = boolPtr(DefaultRenderSegmentIDs)
}
} }
func applyNormalizeDefaults(cfg *NormalizeConfig) { func applyNormalizeDefaults(cfg *NormalizeConfig) {

View File

@@ -30,8 +30,8 @@ func TestRenderLoadAndValidate(t *testing.T) {
if cfg.Pipeline.Render.IncludeTimestamps == nil || !*cfg.Pipeline.Render.IncludeTimestamps { if cfg.Pipeline.Render.IncludeTimestamps == nil || !*cfg.Pipeline.Render.IncludeTimestamps {
t.Fatalf("render.include_timestamps = %#v, want true", cfg.Pipeline.Render.IncludeTimestamps) t.Fatalf("render.include_timestamps = %#v, want true", cfg.Pipeline.Render.IncludeTimestamps)
} }
if cfg.Pipeline.Render.IncludeSegmentIDs { if cfg.Pipeline.Render.IncludeSegmentIDs == nil || !*cfg.Pipeline.Render.IncludeSegmentIDs {
t.Fatalf("render.include_segment_ids = true, want false") t.Fatalf("render.include_segment_ids = %#v, want true", cfg.Pipeline.Render.IncludeSegmentIDs)
} }
if cfg.Pipeline.Render.IncludeMetadata { if cfg.Pipeline.Render.IncludeMetadata {
t.Fatalf("render.include_metadata = true, want false") t.Fatalf("render.include_metadata = true, want false")
@@ -59,14 +59,26 @@ func TestRenderLoadAndValidate(t *testing.T) {
if cfg.Pipeline.Render.IncludeTimestamps == nil || *cfg.Pipeline.Render.IncludeTimestamps { if cfg.Pipeline.Render.IncludeTimestamps == nil || *cfg.Pipeline.Render.IncludeTimestamps {
t.Fatalf("render.include_timestamps = %#v, want false", cfg.Pipeline.Render.IncludeTimestamps) t.Fatalf("render.include_timestamps = %#v, want false", cfg.Pipeline.Render.IncludeTimestamps)
} }
if !cfg.Pipeline.Render.IncludeSegmentIDs { if cfg.Pipeline.Render.IncludeSegmentIDs == nil || !*cfg.Pipeline.Render.IncludeSegmentIDs {
t.Fatalf("render.include_segment_ids = false, want true") t.Fatalf("render.include_segment_ids = %#v, want true", cfg.Pipeline.Render.IncludeSegmentIDs)
} }
if !cfg.Pipeline.Render.IncludeMetadata { if !cfg.Pipeline.Render.IncludeMetadata {
t.Fatalf("render.include_metadata = false, want true") t.Fatalf("render.include_metadata = false, want true")
} }
}, },
}, },
{
name: "explicit segment ids false overrides default",
renderYAML: `render:
include_segment_ids: false
`,
assert: func(t *testing.T, cfg *Config) {
t.Helper()
if cfg.Pipeline.Render.IncludeSegmentIDs == nil || *cfg.Pipeline.Render.IncludeSegmentIDs {
t.Fatalf("render.include_segment_ids = %#v, want false", cfg.Pipeline.Render.IncludeSegmentIDs)
}
},
},
{ {
name: "invalid render format fails", name: "invalid render format fails",
renderYAML: `render: renderYAML: `render:

View File

@@ -312,6 +312,9 @@ func validateRender(cfg *RenderConfig) error {
if cfg.IncludeTimestamps == nil { if cfg.IncludeTimestamps == nil {
return fmt.Errorf("pipeline.render.include_timestamps must be set (defaults should populate this)") return fmt.Errorf("pipeline.render.include_timestamps must be set (defaults should populate this)")
} }
if cfg.IncludeSegmentIDs == nil {
return fmt.Errorf("pipeline.render.include_segment_ids must be set (defaults should populate this)")
}
format := strings.TrimSpace(cfg.Format) format := strings.TrimSpace(cfg.Format)
if format != "markdown" { if format != "markdown" {
return fmt.Errorf("pipeline.render.format must be markdown") return fmt.Errorf("pipeline.render.format must be markdown")

View File

@@ -69,7 +69,10 @@ func (renderStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*St
} }
title := resolveRenderTitle(renderCfg, env.Config.Session) title := resolveRenderTitle(renderCfg, env.Config.Session)
includeTimestamps := renderCfg.IncludeTimestamps == nil || *renderCfg.IncludeTimestamps includeTimestamps := renderCfg.IncludeTimestamps == nil || *renderCfg.IncludeTimestamps
includeSegmentIDs := renderCfg.IncludeSegmentIDs includeSegmentIDs := config.DefaultRenderSegmentIDs
if renderCfg.IncludeSegmentIDs != nil {
includeSegmentIDs = *renderCfg.IncludeSegmentIDs
}
includeMetadata := renderCfg.IncludeMetadata includeMetadata := renderCfg.IncludeMetadata
meta := map[string]any{ meta := map[string]any{
@@ -237,11 +240,12 @@ func renderConfigOrDefault(cfg *config.RenderConfig) *config.RenderConfig {
} }
enabled := true enabled := true
includeTimestamps := true includeTimestamps := true
includeSegmentIDs := config.DefaultRenderSegmentIDs
return &config.RenderConfig{ return &config.RenderConfig{
Enabled: &enabled, Enabled: &enabled,
Format: config.DefaultRenderFormat, Format: config.DefaultRenderFormat,
IncludeTimestamps: &includeTimestamps, IncludeTimestamps: &includeTimestamps,
IncludeSegmentIDs: config.DefaultRenderSegmentIDs, IncludeSegmentIDs: &includeSegmentIDs,
IncludeMetadata: config.DefaultRenderMetadata, IncludeMetadata: config.DefaultRenderMetadata,
} }
} }

View File

@@ -165,6 +165,7 @@ func setupRenderEnv(t *testing.T) (*Env, *manifest.Manifest, *seriatim.FakeRunne
enabled := true enabled := true
includeTimestamps := true includeTimestamps := true
includeSegmentIDs := false
seriatimReport := false seriatimReport := false
cfg := &config.Config{ cfg := &config.Config{
PipelinePath: pipelinePath, PipelinePath: pipelinePath,
@@ -183,7 +184,7 @@ func setupRenderEnv(t *testing.T) (*Env, *manifest.Manifest, *seriatim.FakeRunne
Format: "markdown", Format: "markdown",
Title: "Pipeline Title", Title: "Pipeline Title",
IncludeTimestamps: &includeTimestamps, IncludeTimestamps: &includeTimestamps,
IncludeSegmentIDs: false, IncludeSegmentIDs: &includeSegmentIDs,
IncludeMetadata: false, IncludeMetadata: false,
}, },
}, },