Description
We have Z99/Quote specified as the type of some error type keys (examples below), but it's not clear whether this has been done consistently. Getting these types right is a prerequisite to doing some further work on errors.
- Clarify and specify our criteria for using Z99/Quote as the type of error type keys.
- Based on those criteria, update error-type ZObjects as needed (i.e., adding or removing the use of Z99/Quote).
- E.g., consider adding quoting to: Z537K1 (debatable, but leave for now), Z508K2 (already quoted), Z518K2 (okay as is), Z531K1 (already quoted)
- Update utility code (which creates Z5/Error ZObjects) as needed.
- Update all other relevant function-schemata code & tests as needed.
- Update all relevant orchestrator code & tests as needed.
- Update all relevant evaluator code & tests as needed.
- Update all relevant wikilambda code & tests as needed.
Possible criteria for quoting error type keys (taken mostly from discussions on slack):
- Quote where we suspect the input is invalid in some way
- But do not quote Z1K1 by itself. If its value is in doubt, quote the entire object that contains it.
- Quote resolvable keys that might be ingested as the input to a function
- Quote when resolving a value might cause a catastrophe (e.g. infinite recursion)
- Quote the values of any key that might get a value containing Z7, Z9, or Z18. (See also T323158).
- Quote more things if it lets us make backend APIs more consistent
Examples of possible inconsistency
- Some error type keys called object or whole object are declared as type Z99/Quote, but others are not. (Currently only true for "object type mismatch", and that's okay.)
- Z507K1/function call of Z507/error_in_evaluation is not declared as Z99/Quote, but the method createZErrorInstance() in errorFormatter.js (function-schemata) does quote values of Z507K1/function call. (T349026) (Corrected)
- createZErrorInstance() also quotes values of Z507K2/propagated error, but other keys named propagated error are not quoted anywhere, or declared to be Z99/Quote. (Corrected)
Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
- The uses of Z99/Quote in error types should be consistent.
- Error-creation/handling code should be consistent with error type declarations .
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