1.3 KiB
1.3 KiB
Stage: trim
Purpose
Produce a final-trimmed transcript. By default, the stage generates bounds and applies a bounds-driven trim.
Inputs
transcripts/final.json
Outputs
transcripts/final.trimmed.json(or configured trim output path)- when trim enabled:
artifacts/session_bounds.json
Key Behavior
When trim.enabled=true:
- runs Scriptorium bounds artifact generation;
- optionally runs render-debug output generation;
- validates bounds payload against transcript;
- derives keep selector;
- either copies unchanged transcript or runs Seriatim trim;
- validates trimmed transcript and materializes bounds output.
When trim.enabled=false:
- copies normalized transcript to trimmed output.
Invariants
- normalized transcript is required input.
- bounds output exists only in enabled trim path.
- render-debug output is diagnostic and not a declared stage output.
Related Contracts And Tests
- Scriptorium owns bounds generation and debug-render subprocess behavior.
- Seriatim owns transcript trimming behavior.
- Configuration owns trim fields and defaults.
- Implementation and tests:
internal/stage/trim.go,internal/stage/trim_test.go