Commit ab203d3
fix(workflows): reject bool/.inf catalog priority in workflow & step catalog loaders
The WorkflowRegistry and StepRegistry catalog-config loaders coerced priority
with int() inside except (TypeError, ValueError), missing two guards the base
CatalogStackBase loader already has:
- bool is an int subclass, so 'priority: true' was silently coerced to 1;
- int(float('inf')) raises OverflowError (not caught), so 'priority: .inf'
crashed with an uncaught traceback.
Add the explicit bool check and OverflowError to both loaders, and add
OverflowError to the two _coerce_priority helpers used by 'catalog add' (they
return 0 on an uncoercible existing priority instead of crashing).
Parametrized tests on both TestWorkflowCatalog and TestStepCatalog reject
priority true/false/.inf (fail before: bool coerced to 1 / inf OverflowError).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent faeb956 commit ab203d3
2 files changed
Lines changed: 72 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
367 | 377 | | |
368 | | - | |
369 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
370 | 381 | | |
371 | 382 | | |
372 | 383 | | |
373 | | - | |
| 384 | + | |
374 | 385 | | |
375 | 386 | | |
376 | 387 | | |
| |||
685 | 696 | | |
686 | 697 | | |
687 | 698 | | |
688 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
689 | 702 | | |
690 | 703 | | |
691 | 704 | | |
| |||
1007 | 1020 | | |
1008 | 1021 | | |
1009 | 1022 | | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1010 | 1032 | | |
1011 | | - | |
1012 | | - | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
1013 | 1036 | | |
1014 | 1037 | | |
1015 | 1038 | | |
1016 | | - | |
| 1039 | + | |
1017 | 1040 | | |
1018 | 1041 | | |
1019 | 1042 | | |
| |||
1314 | 1337 | | |
1315 | 1338 | | |
1316 | 1339 | | |
1317 | | - | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1318 | 1343 | | |
1319 | 1344 | | |
1320 | 1345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5232 | 5232 | | |
5233 | 5233 | | |
5234 | 5234 | | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
5235 | 5255 | | |
5236 | 5256 | | |
5237 | 5257 | | |
| |||
5755 | 5775 | | |
5756 | 5776 | | |
5757 | 5777 | | |
| 5778 | + | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
| 5783 | + | |
| 5784 | + | |
| 5785 | + | |
| 5786 | + | |
| 5787 | + | |
| 5788 | + | |
| 5789 | + | |
| 5790 | + | |
| 5791 | + | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
| 5796 | + | |
5758 | 5797 | | |
5759 | 5798 | | |
5760 | 5799 | | |
| |||
0 commit comments