(filePath string, frontmatter map[string]any, isWorkflowFile, isAgentFile bool)
| 217 | } |
| 218 | |
| 219 | func validateIncludedFrontmatterWithFallback(filePath string, frontmatter map[string]any, isWorkflowFile, isAgentFile bool) error { |
| 220 | if isAgentFile || strings.HasPrefix(filePath, BuiltinPathPrefix) { |
| 221 | return nil |
| 222 | } |
| 223 | validationErr := ValidateIncludedFileFrontmatterWithSchemaAndLocation(frontmatter, filePath) |
| 224 | if validationErr == nil || isWorkflowFile { |
| 225 | return validationErr |
| 226 | } |
| 227 | |
| 228 | includeLog.Printf("Validation failed for non-workflow file %s, applying relaxed validation", filePath) |
| 229 | applyRelaxedIncludedFrontmatterValidation(filePath, frontmatter, isAgentFile) |
| 230 | return validationErr |
| 231 | } |
| 232 | |
| 233 | func applyRelaxedIncludedFrontmatterValidation(filePath string, frontmatter map[string]any, isAgentFile bool) { |
| 234 | if len(frontmatter) == 0 { |
no test coverage detected