| 228 | } |
| 229 | |
| 230 | bool is_text_batch_path(const std::filesystem::path & path) { |
| 231 | const auto ext = lowercase_extension(path); |
| 232 | return ext == ".txt" || ext == ".md" || ext == ".json"; |
| 233 | } |
| 234 | |
| 235 | void validate_unique_batch_ids( |
| 236 | const std::vector<std::unordered_map<std::string, std::string>> & items, |
| 237 | const std::string & step_id) { |
| 238 | std::unordered_set<std::string> ids; |
| 239 | for (const auto & item : items) { |
| 240 | const auto it = item.find("id"); |
| 241 | if (it == item.end()) { |
| 242 | throw std::runtime_error("workflow batch item missing id: " + step_id); |
| 243 | } |
| 244 | if (!ids.insert(it->second).second) { |
| 245 | throw std::runtime_error("workflow batch item id collision in " + step_id + ": " + it->second); |
| 246 | } |
no test coverage detected