Harden trim integration
All checks were successful
ci/woodpecker/tag/release Pipeline was successful

This commit is contained in:
2026-05-08 15:00:46 +00:00
parent 54f7717de8
commit e6d3b4a46e
3 changed files with 452 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ type ApplyArtifactResult struct {
// ParseArtifactJSON parses and validates a serialized seriatim output artifact.
func ParseArtifactJSON(data []byte) (Artifact, error) {
var decoded any
if err := json.Unmarshal(data, &decoded); err != nil {
return Artifact{}, fmt.Errorf("input JSON is malformed: %w", err)
}
var full schema.Transcript
if err := json.Unmarshal(data, &full); err == nil {
if err := schema.ValidateTranscript(full); err == nil {