Validate AI catalog definition size against authored source
What does this MR do and why?
The definition column on ai_catalog_item_versions stores both the parsed flow config and the raw YAML it was parsed from (under yaml_definition), so the persisted JSON is roughly twice the size of the source file. Validating only that JSON against the 64KB limit meant a flow whose YAML sat well under 64KB could be rejected with an error saying it exceeded 64KB - the number in the message bore no relation to anything the author could see or control.
This adds a separate size validation for the authored source. YAML_DEFINITION_SIZE_LIMIT is half of DEFINITION_SIZE_LIMIT and applies only to items carrying a yaml_definition key (flows and third-party flows), so those authors get an error naming a 32KB limit they can act on. Schema validation is skipped when that check fails, so one clear error is reported rather than two competing size errors.
The existing 64KB size_limit on JsonSchemaValidator is unchanged and still applies to every item type, keeping validated definitions within the recommended maximum for storing JSON in the database.
Halving is sound for the two YAML-backed schemas because flow_v2 and third_party_flow_v1 both set additionalProperties: false over a fixed key set. Within those constraints YAML indentation costs more than JSON punctuation, so the parsed hash comes out consistently smaller than the source it was parsed from.
References
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.