Problem
Sources/FCPKitDSL/Defaults.swift:63-67 unconditionally emits a Missing Analysis smart collection containing <match-analysis-type>:
SmartCollection(
name: "Missing Analysis",
match: "all",
matchAnalysisType: [MatchAnalysisType(rule: "isMissing", value: "any")]
),
match-analysis-type does not exist in the FCPXML 1.13 DTD. It was added in 1.14:
$ grep -c match-analysis-type FCPXMLv1_13.dtd # 0
$ grep -c match-analysis-type FCPXMLv1_14.dtd # 5
So every DSL document exported at version 1.13 is invalid, regardless of its content.
Reproduced
Any Document exported with FCPXMLVersion("1.13"), validated against Final Cut's own 1.13 DTD:
$ xmllint --noout --dtdvalid FCPXMLv1_13.dtd out.xml
out.xml:53: element smart-collection: validity error : Element smart-collection content
does not follow the DTD, expecting (match-text | match-ratings | ... | match-markers)*,
got (match-analysis-type )
out.xml:54: element match-analysis-type: validity error : No declaration for element match-analysis-type
out.xml:54: element match-analysis-type: validity error : No declaration for attribute rule
out.xml:54: element match-analysis-type: validity error : No declaration for attribute value
The same document at 1.14 validates clean.
Why this has gone unnoticed
FCPXMLVersion.supportedGeneration is "1.13" (Sources/FCPKit/FCPXMLVersion.swift:38), but the fcpxml-dsl CLI defaults to "1.14" (FCPXMLDSLCommand.swift:75). The common path exports 1.14 and validates.
- The library default and the CLI default therefore disagree, and only the library default is broken.
Expected
The default smart collections must be version-aware: emit Missing Analysis only when the target version is 1.14 or later, or drop it from the defaults entirely. Per AGENTS.md, "version differences must not be flattened accidentally."
Tests
- A minimal document exported at 1.13 DTD-validates against
FCPXMLv1_13.dtd.
- The same document at 1.14 still emits
Missing Analysis, so 1.14 output is unchanged.
- Add 1.13 to whatever DTD-validation gate exists so this cannot regress silently.
Note for whoever picks this up
xmllint --dtdvalid fails with xmlSAX2ResolveEntity when the DTD is referenced by its absolute path inside the FCP app bundle. Copy the DTD to the working directory and reference it by bare filename.
Found while auditing readiness for the demo video (#35-#40); not caused by that work.
Problem
Sources/FCPKitDSL/Defaults.swift:63-67unconditionally emits aMissing Analysissmart collection containing<match-analysis-type>:match-analysis-typedoes not exist in the FCPXML 1.13 DTD. It was added in 1.14:So every DSL document exported at version 1.13 is invalid, regardless of its content.
Reproduced
Any
Documentexported withFCPXMLVersion("1.13"), validated against Final Cut's own 1.13 DTD:The same document at 1.14 validates clean.
Why this has gone unnoticed
FCPXMLVersion.supportedGenerationis"1.13"(Sources/FCPKit/FCPXMLVersion.swift:38), but thefcpxml-dslCLI defaults to"1.14"(FCPXMLDSLCommand.swift:75). The common path exports 1.14 and validates.Expected
The default smart collections must be version-aware: emit
Missing Analysisonly when the target version is 1.14 or later, or drop it from the defaults entirely. PerAGENTS.md, "version differences must not be flattened accidentally."Tests
FCPXMLv1_13.dtd.Missing Analysis, so 1.14 output is unchanged.Note for whoever picks this up
xmllint --dtdvalidfails withxmlSAX2ResolveEntitywhen the DTD is referenced by its absolute path inside the FCP app bundle. Copy the DTD to the working directory and reference it by bare filename.Found while auditing readiness for the demo video (#35-#40); not caused by that work.