Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This has two main goals: 1. Move all validation that does not depend on the task we're annotating from `_AnnotationMapper` and to `DetectorFunctionSpec`. This a) splits the code into more manageable chunks, and b) works better with the agent workflow, because the CLI `function` commands can reject an invalid function spec immediately (rather than waiting until the first request). (Frankly, I don't know why I didn't put this code in `DetectorFunctionSpec` in the first place, given that it implements the restrictions described in the docstring...) Validating the spec upon construction requires that the spec is not modified afterwards. This has always been my intention, but to make it clearer, state it explicitly in the docstring. 2. Restructure the rest of the code into smaller functions. This should not introduce any differences in behavior.
- Loading branch information