Description
Currently, we do not place many restrictions on the output of the evaluator. For example, if a type converter produces something weird, the evaluator will happily return it (as long as it's valid JSON).
The orchestrator implicitly catches such errors with ZWrapper.create, which recursively checks the form of an object.
But ZWrapper.create is not normally run on the Z22K2/Metadata of envelopes, which are treated as a special kind of object. Currently, we make an extra call to ZWrapper.create simply to catch these kinds of bugs, but we shouldn't have to do that.
Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
- make stronger post-conditions on the evaluator's output, obviating the need for this extra check, OR
- explicitly check that Z22K2s coming from the evaluator are in valid normal form (instead of the janky ZWrapper.create version)
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Back-end_Task/Bug_completion_checklist