+59
-17
stack/jmap/CLAUDE.md
+59
-17
stack/jmap/CLAUDE.md
···+4. Use `Jmap_invocation.response_to_json` to safely extract response data from packed responses···+- Response parsing stores raw JSON with Echo witness, then `response_to_json` provides type-safe access+The implementation uses Echo witness for all invocations/responses, storing `Ezjsonm.value` directly:+Non-Echo witness cases (Get, Query, etc.) immediately fail with descriptive error messages if called, ensuring that any misuse is caught immediately rather than silently corrupting data with unsafe casts.+When full typed witnesses are implemented in the future, proper serialization functions will be added to support them safely.
+41
-8
stack/jmap/jmap-core/jmap_invocation.ml
+41
-8
stack/jmap/jmap-core/jmap_invocation.ml
···+failwith "to_json: QueryChanges witness not supported - use Echo witness with pre-serialized JSON"
+3
stack/jmap/jmap-core/jmap_invocation.mli
+3
stack/jmap/jmap-core/jmap_invocation.mli
+163
stack/jmap/jmap-mail/jmap_email.ml
+163
stack/jmap/jmap-mail/jmap_email.ml
······+| Some mbvb -> ("maxBodyValueBytes", Jmap_core.Jmap_primitives.UnsignedInt.to_json mbvb) :: fields···
+3
stack/jmap/jmap-mail/jmap_email.mli
+3
stack/jmap/jmap-mail/jmap_email.mli
·········
+109
-17
stack/jmap/test/test_fastmail.ml
+109
-17
stack/jmap/test/test_fastmail.ml
···