1- // SPDX-License-Identifier: PMPL-1.0-or-later
1+ // SPDX-License-Identifier: MPL-2.0
22// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+ // hypatia: allow code_safety/obj_magic
4+ // hypatia: allow code_safety/json_decode_no_validation
35//
46// VeriSimDB ReScript Client — Search operations.
7+
58//
69// This module provides multi-modal search capabilities against VeriSimDB,
710// including full-text search, vector similarity search, spatial radius and
@@ -74,12 +77,10 @@ let text = async (
7477 params : textSearchParams ,
7578): result <array <VeriSimTypes .searchResult >, VeriSimError .t > => {
7679 try {
77- // hypatia: allow code_safety/obj_magic -- SDK record-to-JSON mapping
7880 let body = params -> Obj .magic -> JSON .stringify -> JSON .parseExn
7981 let resp = await VeriSimClient .doPost (client , "/api/v1/search/text" , body )
8082 if resp .ok {
8183 let json = await VeriSimClient .jsonBody (resp )
82- // hypatia: allow code_safety/json_decode_no_validation -- Trusting server-side schema enforcement
8384 Ok (json -> Obj .magic )
8485 } else {
8586 Error (VeriSimError .fromStatus (resp .status ))
@@ -100,12 +101,10 @@ let vector = async (
100101 params : vectorSearchParams ,
101102): result <array <VeriSimTypes .searchResult >, VeriSimError .t > => {
102103 try {
103- // hypatia: allow code_safety/obj_magic
104104 let body = params -> Obj .magic -> JSON .stringify -> JSON .parseExn
105105 let resp = await VeriSimClient .doPost (client , "/api/v1/search/vector" , body )
106106 if resp .ok {
107107 let json = await VeriSimClient .jsonBody (resp )
108- // hypatia: allow code_safety/json_decode_no_validation
109108 Ok (json -> Obj .magic )
110109 } else {
111110 Error (VeriSimError .fromStatus (resp .status ))
@@ -126,12 +125,10 @@ let spatialRadius = async (
126125 params : spatialRadiusParams ,
127126): result <array <VeriSimTypes .searchResult >, VeriSimError .t > => {
128127 try {
129- // hypatia: allow code_safety/obj_magic
130128 let body = params -> Obj .magic -> JSON .stringify -> JSON .parseExn
131129 let resp = await VeriSimClient .doPost (client , "/api/v1/search/spatial/radius" , body )
132130 if resp .ok {
133131 let json = await VeriSimClient .jsonBody (resp )
134- // hypatia: allow code_safety/json_decode_no_validation
135132 Ok (json -> Obj .magic )
136133 } else {
137134 Error (VeriSimError .fromStatus (resp .status ))
@@ -152,12 +149,10 @@ let spatialBounds = async (
152149 params : spatialBoundsParams ,
153150): result <array <VeriSimTypes .searchResult >, VeriSimError .t > => {
154151 try {
155- // hypatia: allow code_safety/obj_magic
156152 let body = params -> Obj .magic -> JSON .stringify -> JSON .parseExn
157153 let resp = await VeriSimClient .doPost (client , "/api/v1/search/spatial/bounds" , body )
158154 if resp .ok {
159155 let json = await VeriSimClient .jsonBody (resp )
160- // hypatia: allow code_safety/json_decode_no_validation
161156 Ok (json -> Obj .magic )
162157 } else {
163158 Error (VeriSimError .fromStatus (resp .status ))
@@ -178,12 +173,10 @@ let nearest = async (
178173 params : nearestParams ,
179174): result <array <VeriSimTypes .searchResult >, VeriSimError .t > => {
180175 try {
181- // hypatia: allow code_safety/obj_magic
182176 let body = params -> Obj .magic -> JSON .stringify -> JSON .parseExn
183177 let resp = await VeriSimClient .doPost (client , "/api/v1/search/nearest" , body )
184178 if resp .ok {
185179 let json = await VeriSimClient .jsonBody (resp )
186- // hypatia: allow code_safety/json_decode_no_validation
187180 Ok (json -> Obj .magic )
188181 } else {
189182 Error (VeriSimError .fromStatus (resp .status ))
@@ -204,12 +197,10 @@ let related = async (
204197 params : relatedParams ,
205198): result <array <VeriSimTypes .searchResult >, VeriSimError .t > => {
206199 try {
207- // hypatia: allow code_safety/obj_magic
208200 let body = params -> Obj .magic -> JSON .stringify -> JSON .parseExn
209201 let resp = await VeriSimClient .doPost (client , "/api/v1/search/related" , body )
210202 if resp .ok {
211203 let json = await VeriSimClient .jsonBody (resp )
212- // hypatia: allow code_safety/json_decode_no_validation
213204 Ok (json -> Obj .magic )
214205 } else {
215206 Error (VeriSimError .fromStatus (resp .status ))
0 commit comments