@pyric/cli 0.1.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1169) hide show
  1. package/LICENSE +216 -0
  2. package/README.md +156 -0
  3. package/README.md.orig +138 -0
  4. package/dist/assurance/attachment.d.ts +24 -0
  5. package/dist/assurance/attachment.d.ts.map +1 -0
  6. package/dist/assurance/attachment.js +138 -0
  7. package/dist/assurance/attachment.js.map +1 -0
  8. package/dist/assurance/browser.d.ts +7 -0
  9. package/dist/assurance/browser.d.ts.map +1 -0
  10. package/dist/assurance/browser.js +68 -0
  11. package/dist/assurance/browser.js.map +1 -0
  12. package/dist/assurance/campaign.d.ts +41 -0
  13. package/dist/assurance/campaign.d.ts.map +1 -0
  14. package/dist/assurance/campaign.js +364 -0
  15. package/dist/assurance/campaign.js.map +1 -0
  16. package/dist/assurance/capabilities.d.ts +7 -0
  17. package/dist/assurance/capabilities.d.ts.map +1 -0
  18. package/dist/assurance/capabilities.js +295 -0
  19. package/dist/assurance/capabilities.js.map +1 -0
  20. package/dist/assurance/cases.d.ts +14 -0
  21. package/dist/assurance/cases.d.ts.map +1 -0
  22. package/dist/assurance/cases.js +27 -0
  23. package/dist/assurance/cases.js.map +1 -0
  24. package/dist/assurance/generated-capabilities.d.ts +52 -0
  25. package/dist/assurance/generated-capabilities.d.ts.map +1 -0
  26. package/dist/assurance/generated-capabilities.js +329 -0
  27. package/dist/assurance/generated-capabilities.js.map +1 -0
  28. package/dist/assurance/index.d.ts +11 -0
  29. package/dist/assurance/index.d.ts.map +1 -0
  30. package/dist/assurance/index.js +9 -0
  31. package/dist/assurance/index.js.map +1 -0
  32. package/dist/assurance/runner.d.ts +3 -0
  33. package/dist/assurance/runner.d.ts.map +1 -0
  34. package/dist/assurance/runner.js +633 -0
  35. package/dist/assurance/runner.js.map +1 -0
  36. package/dist/assurance/tool-names.d.ts +4 -0
  37. package/dist/assurance/tool-names.d.ts.map +1 -0
  38. package/dist/assurance/tool-names.js +14 -0
  39. package/dist/assurance/tool-names.js.map +1 -0
  40. package/dist/assurance/tools.d.ts +19 -0
  41. package/dist/assurance/tools.d.ts.map +1 -0
  42. package/dist/assurance/tools.js +740 -0
  43. package/dist/assurance/tools.js.map +1 -0
  44. package/dist/assurance/types.d.ts +348 -0
  45. package/dist/assurance/types.d.ts.map +1 -0
  46. package/dist/assurance/types.js +7 -0
  47. package/dist/assurance/types.js.map +1 -0
  48. package/dist/assurance/validation.d.ts +8 -0
  49. package/dist/assurance/validation.d.ts.map +1 -0
  50. package/dist/assurance/validation.js +269 -0
  51. package/dist/assurance/validation.js.map +1 -0
  52. package/dist/bridge/client/bridge.d.ts +133 -0
  53. package/dist/bridge/client/bridge.d.ts.map +1 -0
  54. package/dist/bridge/client/bridge.js +429 -0
  55. package/dist/bridge/client/bridge.js.map +1 -0
  56. package/dist/bridge/client/dispatch.d.ts +41 -0
  57. package/dist/bridge/client/dispatch.d.ts.map +1 -0
  58. package/dist/bridge/client/dispatch.js +111 -0
  59. package/dist/bridge/client/dispatch.js.map +1 -0
  60. package/dist/bridge/client.d.ts +24 -0
  61. package/dist/bridge/client.d.ts.map +1 -0
  62. package/dist/bridge/client.js +26 -0
  63. package/dist/bridge/client.js.map +1 -0
  64. package/dist/bridge/protocol.d.ts +227 -0
  65. package/dist/bridge/protocol.d.ts.map +1 -0
  66. package/dist/bridge/protocol.js +131 -0
  67. package/dist/bridge/protocol.js.map +1 -0
  68. package/dist/bridge/server/audit.d.ts +19 -0
  69. package/dist/bridge/server/audit.d.ts.map +1 -0
  70. package/dist/bridge/server/audit.js +46 -0
  71. package/dist/bridge/server/audit.js.map +1 -0
  72. package/dist/bridge/server/bridge.d.ts +126 -0
  73. package/dist/bridge/server/bridge.d.ts.map +1 -0
  74. package/dist/bridge/server/bridge.js +383 -0
  75. package/dist/bridge/server/bridge.js.map +1 -0
  76. package/dist/bridge/server/headless.d.ts +36 -0
  77. package/dist/bridge/server/headless.d.ts.map +1 -0
  78. package/dist/bridge/server/headless.js +142 -0
  79. package/dist/bridge/server/headless.js.map +1 -0
  80. package/dist/bridge/server/json-schema-to-zod.d.ts +37 -0
  81. package/dist/bridge/server/json-schema-to-zod.d.ts.map +1 -0
  82. package/dist/bridge/server/json-schema-to-zod.js +93 -0
  83. package/dist/bridge/server/json-schema-to-zod.js.map +1 -0
  84. package/dist/bridge/server/local-bridge.d.ts +33 -0
  85. package/dist/bridge/server/local-bridge.d.ts.map +1 -0
  86. package/dist/bridge/server/local-bridge.js +41 -0
  87. package/dist/bridge/server/local-bridge.js.map +1 -0
  88. package/dist/bridge/server/logger.d.ts +28 -0
  89. package/dist/bridge/server/logger.d.ts.map +1 -0
  90. package/dist/bridge/server/logger.js +42 -0
  91. package/dist/bridge/server/logger.js.map +1 -0
  92. package/dist/bridge/server/mcp-contract.d.ts +21 -0
  93. package/dist/bridge/server/mcp-contract.d.ts.map +1 -0
  94. package/dist/bridge/server/mcp-contract.js +62 -0
  95. package/dist/bridge/server/mcp-contract.js.map +1 -0
  96. package/dist/bridge/server/mcp.d.ts +26 -0
  97. package/dist/bridge/server/mcp.d.ts.map +1 -0
  98. package/dist/bridge/server/mcp.js +102 -0
  99. package/dist/bridge/server/mcp.js.map +1 -0
  100. package/dist/bridge/server/peer.d.ts +39 -0
  101. package/dist/bridge/server/peer.d.ts.map +1 -0
  102. package/dist/bridge/server/peer.js +189 -0
  103. package/dist/bridge/server/peer.js.map +1 -0
  104. package/dist/bridge/server/standalone.d.ts +49 -0
  105. package/dist/bridge/server/standalone.d.ts.map +1 -0
  106. package/dist/bridge/server/standalone.js +267 -0
  107. package/dist/bridge/server/standalone.js.map +1 -0
  108. package/dist/bridge/server/tool-metadata.d.ts +38 -0
  109. package/dist/bridge/server/tool-metadata.d.ts.map +1 -0
  110. package/dist/bridge/server/tool-metadata.js +81 -0
  111. package/dist/bridge/server/tool-metadata.js.map +1 -0
  112. package/dist/bridge/server.d.ts +21 -0
  113. package/dist/bridge/server.d.ts.map +1 -0
  114. package/dist/bridge/server.js +18 -0
  115. package/dist/bridge/server.js.map +1 -0
  116. package/dist/cli/database-rules.d.ts +43 -0
  117. package/dist/cli/database-rules.d.ts.map +1 -0
  118. package/dist/cli/database-rules.js +261 -0
  119. package/dist/cli/database-rules.js.map +1 -0
  120. package/dist/cli/dev-runner.d.ts +112 -0
  121. package/dist/cli/dev-runner.d.ts.map +1 -0
  122. package/dist/cli/dev-runner.js +239 -0
  123. package/dist/cli/dev-runner.js.map +1 -0
  124. package/dist/cli/firebase-json.d.ts +66 -0
  125. package/dist/cli/firebase-json.d.ts.map +1 -0
  126. package/dist/cli/firebase-json.js +60 -0
  127. package/dist/cli/firebase-json.js.map +1 -0
  128. package/dist/cli/firestore-indexes.d.ts +21 -0
  129. package/dist/cli/firestore-indexes.d.ts.map +1 -0
  130. package/dist/cli/firestore-indexes.js +39 -0
  131. package/dist/cli/firestore-indexes.js.map +1 -0
  132. package/dist/cli/index.d.ts +56 -0
  133. package/dist/cli/index.d.ts.map +1 -0
  134. package/dist/cli/index.js +379 -0
  135. package/dist/cli/index.js.map +1 -0
  136. package/dist/cli/init.d.ts +50 -0
  137. package/dist/cli/init.d.ts.map +1 -0
  138. package/dist/cli/init.js +182 -0
  139. package/dist/cli/init.js.map +1 -0
  140. package/dist/cli/mcp-proxy.d.ts +10 -0
  141. package/dist/cli/mcp-proxy.d.ts.map +1 -0
  142. package/dist/cli/mcp-proxy.js +129 -0
  143. package/dist/cli/mcp-proxy.js.map +1 -0
  144. package/dist/cli/parse-args.d.ts +20 -0
  145. package/dist/cli/parse-args.d.ts.map +1 -0
  146. package/dist/cli/parse-args.js +69 -0
  147. package/dist/cli/parse-args.js.map +1 -0
  148. package/dist/cli/rules.d.ts +55 -0
  149. package/dist/cli/rules.d.ts.map +1 -0
  150. package/dist/cli/rules.js +199 -0
  151. package/dist/cli/rules.js.map +1 -0
  152. package/dist/cli/scope.d.ts +12 -0
  153. package/dist/cli/scope.d.ts.map +1 -0
  154. package/dist/cli/scope.js +44 -0
  155. package/dist/cli/scope.js.map +1 -0
  156. package/dist/cli/serve.d.ts +122 -0
  157. package/dist/cli/serve.d.ts.map +1 -0
  158. package/dist/cli/serve.js +844 -0
  159. package/dist/cli/serve.js.map +1 -0
  160. package/dist/cli/service-commands.d.ts +8 -0
  161. package/dist/cli/service-commands.d.ts.map +1 -0
  162. package/dist/cli/service-commands.js +58 -0
  163. package/dist/cli/service-commands.js.map +1 -0
  164. package/dist/cli/snapshot.d.ts +22 -0
  165. package/dist/cli/snapshot.d.ts.map +1 -0
  166. package/dist/cli/snapshot.js +139 -0
  167. package/dist/cli/snapshot.js.map +1 -0
  168. package/dist/cli/storage-rules.d.ts +21 -0
  169. package/dist/cli/storage-rules.d.ts.map +1 -0
  170. package/dist/cli/storage-rules.js +121 -0
  171. package/dist/cli/storage-rules.js.map +1 -0
  172. package/dist/cli/verify.d.ts +23 -0
  173. package/dist/cli/verify.d.ts.map +1 -0
  174. package/dist/cli/verify.js +349 -0
  175. package/dist/cli/verify.js.map +1 -0
  176. package/dist/credentials/core/memoize-ttl.d.ts +58 -0
  177. package/dist/credentials/core/memoize-ttl.d.ts.map +1 -0
  178. package/dist/credentials/core/memoize-ttl.js +88 -0
  179. package/dist/credentials/core/memoize-ttl.js.map +1 -0
  180. package/dist/credentials/core/types.d.ts +11 -0
  181. package/dist/credentials/core/types.d.ts.map +1 -0
  182. package/dist/credentials/core/types.js +2 -0
  183. package/dist/credentials/core/types.js.map +1 -0
  184. package/dist/credentials/node/from-adc.d.ts +10 -0
  185. package/dist/credentials/node/from-adc.d.ts.map +1 -0
  186. package/dist/credentials/node/from-adc.js +76 -0
  187. package/dist/credentials/node/from-adc.js.map +1 -0
  188. package/dist/credentials/node/from-service-account.d.ts +24 -0
  189. package/dist/credentials/node/from-service-account.d.ts.map +1 -0
  190. package/dist/credentials/node/from-service-account.js +108 -0
  191. package/dist/credentials/node/from-service-account.js.map +1 -0
  192. package/dist/credentials/node/index.d.ts +7 -0
  193. package/dist/credentials/node/index.d.ts.map +1 -0
  194. package/dist/credentials/node/index.js +7 -0
  195. package/dist/credentials/node/index.js.map +1 -0
  196. package/dist/discover/concurrency.d.ts +42 -0
  197. package/dist/discover/concurrency.d.ts.map +1 -0
  198. package/dist/discover/concurrency.js +113 -0
  199. package/dist/discover/concurrency.js.map +1 -0
  200. package/dist/discover/crawler-adapter.d.ts +48 -0
  201. package/dist/discover/crawler-adapter.d.ts.map +1 -0
  202. package/dist/discover/crawler-adapter.js +92 -0
  203. package/dist/discover/crawler-adapter.js.map +1 -0
  204. package/dist/discover/crawler.d.ts +294 -0
  205. package/dist/discover/crawler.d.ts.map +1 -0
  206. package/dist/discover/crawler.js +764 -0
  207. package/dist/discover/crawler.js.map +1 -0
  208. package/dist/discover/credential-free.d.ts +19 -0
  209. package/dist/discover/credential-free.d.ts.map +1 -0
  210. package/dist/discover/credential-free.js +18 -0
  211. package/dist/discover/credential-free.js.map +1 -0
  212. package/dist/discover/findCollectionGroup.d.ts +44 -0
  213. package/dist/discover/findCollectionGroup.d.ts.map +1 -0
  214. package/dist/discover/findCollectionGroup.js +81 -0
  215. package/dist/discover/findCollectionGroup.js.map +1 -0
  216. package/dist/discover/firestore-source.d.ts +60 -0
  217. package/dist/discover/firestore-source.d.ts.map +1 -0
  218. package/dist/discover/firestore-source.js +11 -0
  219. package/dist/discover/firestore-source.js.map +1 -0
  220. package/dist/discover/index.d.ts +3 -0
  221. package/dist/discover/index.d.ts.map +1 -0
  222. package/dist/discover/index.js +5 -0
  223. package/dist/discover/index.js.map +1 -0
  224. package/dist/discover/merge.d.ts +108 -0
  225. package/dist/discover/merge.d.ts.map +1 -0
  226. package/dist/discover/merge.js +394 -0
  227. package/dist/discover/merge.js.map +1 -0
  228. package/dist/discover/session.d.ts +116 -0
  229. package/dist/discover/session.d.ts.map +1 -0
  230. package/dist/discover/session.js +331 -0
  231. package/dist/discover/session.js.map +1 -0
  232. package/dist/discover/tools.d.ts +58 -0
  233. package/dist/discover/tools.d.ts.map +1 -0
  234. package/dist/discover/tools.js +115 -0
  235. package/dist/discover/tools.js.map +1 -0
  236. package/dist/discover/types.d.ts +190 -0
  237. package/dist/discover/types.d.ts.map +1 -0
  238. package/dist/discover/types.js +12 -0
  239. package/dist/discover/types.js.map +1 -0
  240. package/dist/discover/wire.d.ts +70 -0
  241. package/dist/discover/wire.d.ts.map +1 -0
  242. package/dist/discover/wire.js +309 -0
  243. package/dist/discover/wire.js.map +1 -0
  244. package/dist/functions-rtdb/child.d.ts +52 -0
  245. package/dist/functions-rtdb/child.d.ts.map +1 -0
  246. package/dist/functions-rtdb/child.js +283 -0
  247. package/dist/functions-rtdb/child.js.map +1 -0
  248. package/dist/functions-rtdb/delivery.d.ts +4 -0
  249. package/dist/functions-rtdb/delivery.d.ts.map +1 -0
  250. package/dist/functions-rtdb/delivery.js +2 -0
  251. package/dist/functions-rtdb/delivery.js.map +1 -0
  252. package/dist/functions-rtdb/discovery.d.ts +41 -0
  253. package/dist/functions-rtdb/discovery.d.ts.map +1 -0
  254. package/dist/functions-rtdb/discovery.js +86 -0
  255. package/dist/functions-rtdb/discovery.js.map +1 -0
  256. package/dist/functions-rtdb/event.d.ts +20 -0
  257. package/dist/functions-rtdb/event.d.ts.map +1 -0
  258. package/dist/functions-rtdb/event.js +45 -0
  259. package/dist/functions-rtdb/event.js.map +1 -0
  260. package/dist/functions-rtdb/execution.d.ts +20 -0
  261. package/dist/functions-rtdb/execution.d.ts.map +1 -0
  262. package/dist/functions-rtdb/execution.js +70 -0
  263. package/dist/functions-rtdb/execution.js.map +1 -0
  264. package/dist/functions-rtdb/in-memory-delivery.d.ts +9 -0
  265. package/dist/functions-rtdb/in-memory-delivery.d.ts.map +1 -0
  266. package/dist/functions-rtdb/in-memory-delivery.js +36 -0
  267. package/dist/functions-rtdb/in-memory-delivery.js.map +1 -0
  268. package/dist/functions-rtdb/project.d.ts +7 -0
  269. package/dist/functions-rtdb/project.d.ts.map +1 -0
  270. package/dist/functions-rtdb/project.js +54 -0
  271. package/dist/functions-rtdb/project.js.map +1 -0
  272. package/dist/functions-rtdb/projection.d.ts +14 -0
  273. package/dist/functions-rtdb/projection.d.ts.map +1 -0
  274. package/dist/functions-rtdb/projection.js +65 -0
  275. package/dist/functions-rtdb/projection.js.map +1 -0
  276. package/dist/functions-rtdb/reference-pattern.d.ts +5 -0
  277. package/dist/functions-rtdb/reference-pattern.d.ts.map +1 -0
  278. package/dist/functions-rtdb/reference-pattern.js +14 -0
  279. package/dist/functions-rtdb/reference-pattern.js.map +1 -0
  280. package/dist/functions-rtdb/remote-delivery.d.ts +9 -0
  281. package/dist/functions-rtdb/remote-delivery.d.ts.map +1 -0
  282. package/dist/functions-rtdb/remote-delivery.js +11 -0
  283. package/dist/functions-rtdb/remote-delivery.js.map +1 -0
  284. package/dist/pkg-version.d.ts +2 -0
  285. package/dist/pkg-version.d.ts.map +1 -0
  286. package/dist/pkg-version.js +47 -0
  287. package/dist/pkg-version.js.map +1 -0
  288. package/dist/register/esm-exports.d.ts +26 -0
  289. package/dist/register/esm-exports.d.ts.map +1 -0
  290. package/dist/register/esm-exports.js +61 -0
  291. package/dist/register/esm-exports.js.map +1 -0
  292. package/dist/register/hooks.d.ts +13 -0
  293. package/dist/register/hooks.d.ts.map +1 -0
  294. package/dist/register/hooks.js +15 -0
  295. package/dist/register/hooks.js.map +1 -0
  296. package/dist/register/index.d.ts +5 -0
  297. package/dist/register/index.d.ts.map +1 -0
  298. package/dist/register/index.js +124 -0
  299. package/dist/register/index.js.map +1 -0
  300. package/dist/register/mapping.d.ts +19 -0
  301. package/dist/register/mapping.d.ts.map +1 -0
  302. package/dist/register/mapping.js +35 -0
  303. package/dist/register/mapping.js.map +1 -0
  304. package/dist/remote/index.d.ts +232 -0
  305. package/dist/remote/index.d.ts.map +1 -0
  306. package/dist/remote/index.js +720 -0
  307. package/dist/remote/index.js.map +1 -0
  308. package/dist/rtdb/crawl-snapshot.d.ts +17 -0
  309. package/dist/rtdb/crawl-snapshot.d.ts.map +1 -0
  310. package/dist/rtdb/crawl-snapshot.js +72 -0
  311. package/dist/rtdb/crawl-snapshot.js.map +1 -0
  312. package/dist/rtdb/inspection.d.ts +8 -0
  313. package/dist/rtdb/inspection.d.ts.map +1 -0
  314. package/dist/rtdb/inspection.js +111 -0
  315. package/dist/rtdb/inspection.js.map +1 -0
  316. package/dist/rtdb/load-rules-document.d.ts +25 -0
  317. package/dist/rtdb/load-rules-document.d.ts.map +1 -0
  318. package/dist/rtdb/load-rules-document.js +38 -0
  319. package/dist/rtdb/load-rules-document.js.map +1 -0
  320. package/dist/rtdb/rules-generation-tool.d.ts +4 -0
  321. package/dist/rtdb/rules-generation-tool.d.ts.map +1 -0
  322. package/dist/rtdb/rules-generation-tool.js +35 -0
  323. package/dist/rtdb/rules-generation-tool.js.map +1 -0
  324. package/dist/rtdb/rules-json.d.ts +8 -0
  325. package/dist/rtdb/rules-json.d.ts.map +1 -0
  326. package/dist/rtdb/rules-json.js +17 -0
  327. package/dist/rtdb/rules-json.js.map +1 -0
  328. package/dist/serve/bridge-mount.d.ts +36 -0
  329. package/dist/serve/bridge-mount.d.ts.map +1 -0
  330. package/dist/serve/bridge-mount.js +162 -0
  331. package/dist/serve/bridge-mount.js.map +1 -0
  332. package/dist/serve/bundler.d.ts +110 -0
  333. package/dist/serve/bundler.d.ts.map +1 -0
  334. package/dist/serve/bundler.js +432 -0
  335. package/dist/serve/bundler.js.map +1 -0
  336. package/dist/serve/capture-store.d.ts +27 -0
  337. package/dist/serve/capture-store.d.ts.map +1 -0
  338. package/dist/serve/capture-store.js +47 -0
  339. package/dist/serve/capture-store.js.map +1 -0
  340. package/dist/serve/discovery.d.ts +71 -0
  341. package/dist/serve/discovery.d.ts.map +1 -0
  342. package/dist/serve/discovery.js +158 -0
  343. package/dist/serve/discovery.js.map +1 -0
  344. package/dist/serve/docs-ui/_astro/_slug_.CQYSemvw.css +1 -0
  345. package/dist/serve/docs-ui/docs/_rhythm/index.html +99 -0
  346. package/dist/serve/docs-ui/docs/_rhythm.md +101 -0
  347. package/dist/serve/docs-ui/docs/api-reference/index.html +64 -0
  348. package/dist/serve/docs-ui/docs/api-reference.md +67 -0
  349. package/dist/serve/docs-ui/docs/audit-your-rules/index.html +34 -0
  350. package/dist/serve/docs-ui/docs/audit-your-rules.md +50 -0
  351. package/dist/serve/docs-ui/docs/create-pyric-reference-api/index.html +498 -0
  352. package/dist/serve/docs-ui/docs/create-pyric-reference-api.md +345 -0
  353. package/dist/serve/docs-ui/docs/firestore-rules-limits/index.html +59 -0
  354. package/dist/serve/docs-ui/docs/firestore-rules-limits.md +54 -0
  355. package/dist/serve/docs-ui/docs/how-the-swap-works/index.html +47 -0
  356. package/dist/serve/docs-ui/docs/how-the-swap-works.md +43 -0
  357. package/dist/serve/docs-ui/docs/how-we-know-it-matches-firebase/index.html +131 -0
  358. package/dist/serve/docs-ui/docs/how-we-know-it-matches-firebase.md +169 -0
  359. package/dist/serve/docs-ui/docs/index.html +2 -0
  360. package/dist/serve/docs-ui/docs/index.json +18637 -0
  361. package/dist/serve/docs-ui/docs/overview/index.html +23 -0
  362. package/dist/serve/docs-ui/docs/overview.md +40 -0
  363. package/dist/serve/docs-ui/docs/pyric-admin-app/index.html +19 -0
  364. package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api/index.html +185 -0
  365. package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api.md +206 -0
  366. package/dist/serve/docs-ui/docs/pyric-admin-app.md +27 -0
  367. package/dist/serve/docs-ui/docs/pyric-admin-auth/index.html +24 -0
  368. package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api/index.html +617 -0
  369. package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api.md +441 -0
  370. package/dist/serve/docs-ui/docs/pyric-admin-auth.md +29 -0
  371. package/dist/serve/docs-ui/docs/pyric-admin-database/index.html +26 -0
  372. package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api/index.html +583 -0
  373. package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api.md +597 -0
  374. package/dist/serve/docs-ui/docs/pyric-admin-database.md +31 -0
  375. package/dist/serve/docs-ui/docs/pyric-admin-firestore/index.html +38 -0
  376. package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-error-translation/index.html +57 -0
  377. package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-error-translation.md +95 -0
  378. package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-per-call-delegate/index.html +58 -0
  379. package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-per-call-delegate.md +94 -0
  380. package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-why-mirror-admin-shape/index.html +59 -0
  381. package/dist/serve/docs-ui/docs/pyric-admin-firestore-explanation-why-mirror-admin-shape.md +88 -0
  382. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-run-a-transaction/index.html +53 -0
  383. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-run-a-transaction.md +76 -0
  384. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-seed-and-set-rules/index.html +62 -0
  385. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-seed-and-set-rules.md +96 -0
  386. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-translate-denials/index.html +80 -0
  387. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-translate-denials.md +98 -0
  388. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-use-onsnapshot/index.html +57 -0
  389. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-use-onsnapshot.md +88 -0
  390. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-write-a-batch/index.html +50 -0
  391. package/dist/serve/docs-ui/docs/pyric-admin-firestore-how-to-write-a-batch.md +73 -0
  392. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api/index.html +32 -0
  393. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api.md +30 -0
  394. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-onsnapshot/index.html +68 -0
  395. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-onsnapshot.md +81 -0
  396. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-re-exported-types/index.html +76 -0
  397. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-re-exported-types.md +103 -0
  398. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-sandbox-firestore/index.html +40 -0
  399. package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-sandbox-firestore.md +77 -0
  400. package/dist/serve/docs-ui/docs/pyric-admin-firestore-tutorials-01-first-admin-session/index.html +118 -0
  401. package/dist/serve/docs-ui/docs/pyric-admin-firestore-tutorials-01-first-admin-session.md +166 -0
  402. package/dist/serve/docs-ui/docs/pyric-admin-firestore.md +53 -0
  403. package/dist/serve/docs-ui/docs/pyric-admin-storage/index.html +25 -0
  404. package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api/index.html +317 -0
  405. package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api.md +285 -0
  406. package/dist/serve/docs-ui/docs/pyric-admin-storage.md +30 -0
  407. package/dist/serve/docs-ui/docs/pyric-ai-compat/index.html +436 -0
  408. package/dist/serve/docs-ui/docs/pyric-ai-compat.md +471 -0
  409. package/dist/serve/docs-ui/docs/pyric-ai-reference-api/index.html +5831 -0
  410. package/dist/serve/docs-ui/docs/pyric-ai-reference-api.md +5440 -0
  411. package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api/index.html +159 -0
  412. package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api.md +122 -0
  413. package/dist/serve/docs-ui/docs/pyric-app-compat/index.html +180 -0
  414. package/dist/serve/docs-ui/docs/pyric-app-compat.md +199 -0
  415. package/dist/serve/docs-ui/docs/pyric-app-reference-api/index.html +420 -0
  416. package/dist/serve/docs-ui/docs/pyric-app-reference-api.md +326 -0
  417. package/dist/serve/docs-ui/docs/pyric-auth/index.html +59 -0
  418. package/dist/serve/docs-ui/docs/pyric-auth-compat/index.html +804 -0
  419. package/dist/serve/docs-ui/docs/pyric-auth-compat.md +847 -0
  420. package/dist/serve/docs-ui/docs/pyric-auth-reference-api/index.html +5452 -0
  421. package/dist/serve/docs-ui/docs/pyric-auth-reference-api.md +5271 -0
  422. package/dist/serve/docs-ui/docs/pyric-auth-reference-feature-matrix/index.html +781 -0
  423. package/dist/serve/docs-ui/docs/pyric-auth-reference-feature-matrix.md +198 -0
  424. package/dist/serve/docs-ui/docs/pyric-auth-reference-sandbox-test-driver/index.html +71 -0
  425. package/dist/serve/docs-ui/docs/pyric-auth-reference-sandbox-test-driver.md +108 -0
  426. package/dist/serve/docs-ui/docs/pyric-auth.md +86 -0
  427. package/dist/serve/docs-ui/docs/pyric-cli/index.html +40 -0
  428. package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api/index.html +98 -0
  429. package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api.md +88 -0
  430. package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api/index.html +2355 -0
  431. package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api.md +1554 -0
  432. package/dist/serve/docs-ui/docs/pyric-cli-bridge/index.html +69 -0
  433. package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api/index.html +546 -0
  434. package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api.md +485 -0
  435. package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api/index.html +506 -0
  436. package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api.md +419 -0
  437. package/dist/serve/docs-ui/docs/pyric-cli-bridge.md +99 -0
  438. package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api/index.html +67 -0
  439. package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api.md +59 -0
  440. package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api/index.html +2355 -0
  441. package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api.md +2036 -0
  442. package/dist/serve/docs-ui/docs/pyric-cli-functions-rtdb-compat/index.html +112 -0
  443. package/dist/serve/docs-ui/docs/pyric-cli-functions-rtdb-compat.md +124 -0
  444. package/dist/serve/docs-ui/docs/pyric-cli-how-to-build-a-standalone-binary/index.html +91 -0
  445. package/dist/serve/docs-ui/docs/pyric-cli-how-to-build-a-standalone-binary.md +105 -0
  446. package/dist/serve/docs-ui/docs/pyric-cli-how-to-promote-sandbox-state-to-a-fixture/index.html +52 -0
  447. package/dist/serve/docs-ui/docs/pyric-cli-how-to-promote-sandbox-state-to-a-fixture.md +98 -0
  448. package/dist/serve/docs-ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated/index.html +66 -0
  449. package/dist/serve/docs-ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated.md +100 -0
  450. package/dist/serve/docs-ui/docs/pyric-cli-how-to-serve-persistence-and-multi-tab/index.html +228 -0
  451. package/dist/serve/docs-ui/docs/pyric-cli-how-to-serve-persistence-and-multi-tab.md +179 -0
  452. package/dist/serve/docs-ui/docs/pyric-cli-how-to-use-the-vite-plugin/index.html +341 -0
  453. package/dist/serve/docs-ui/docs/pyric-cli-how-to-use-the-vite-plugin.md +309 -0
  454. package/dist/serve/docs-ui/docs/pyric-cli-how-to-verify-against-a-captured-session/index.html +128 -0
  455. package/dist/serve/docs-ui/docs/pyric-cli-how-to-verify-against-a-captured-session.md +207 -0
  456. package/dist/serve/docs-ui/docs/pyric-cli-reference-cli/index.html +404 -0
  457. package/dist/serve/docs-ui/docs/pyric-cli-reference-cli.md +249 -0
  458. package/dist/serve/docs-ui/docs/pyric-cli-reference-package-and-resolution/index.html +93 -0
  459. package/dist/serve/docs-ui/docs/pyric-cli-reference-package-and-resolution.md +65 -0
  460. package/dist/serve/docs-ui/docs/pyric-cli-reference-verify/index.html +81 -0
  461. package/dist/serve/docs-ui/docs/pyric-cli-reference-verify.md +110 -0
  462. package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api/index.html +10 -0
  463. package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api.md +16 -0
  464. package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api/index.html +1044 -0
  465. package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api.md +952 -0
  466. package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api/index.html +5041 -0
  467. package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api.md +4739 -0
  468. package/dist/serve/docs-ui/docs/pyric-cli-tutorials-server-adoption/index.html +219 -0
  469. package/dist/serve/docs-ui/docs/pyric-cli-tutorials-server-adoption.md +251 -0
  470. package/dist/serve/docs-ui/docs/pyric-cli-tutorials-wire-claude-code/index.html +136 -0
  471. package/dist/serve/docs-ui/docs/pyric-cli-tutorials-wire-claude-code.md +217 -0
  472. package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api/index.html +926 -0
  473. package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api.md +586 -0
  474. package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api/index.html +102 -0
  475. package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api.md +76 -0
  476. package/dist/serve/docs-ui/docs/pyric-cli.md +42 -0
  477. package/dist/serve/docs-ui/docs/pyric-conformance-scores/index.html +180 -0
  478. package/dist/serve/docs-ui/docs/pyric-conformance-scores.md +184 -0
  479. package/dist/serve/docs-ui/docs/pyric-database/index.html +43 -0
  480. package/dist/serve/docs-ui/docs/pyric-database-compat/index.html +1224 -0
  481. package/dist/serve/docs-ui/docs/pyric-database-compat.md +1289 -0
  482. package/dist/serve/docs-ui/docs/pyric-database-explanation-rules-authoring-and-deploy-are-separate/index.html +16 -0
  483. package/dist/serve/docs-ui/docs/pyric-database-explanation-rules-authoring-and-deploy-are-separate.md +23 -0
  484. package/dist/serve/docs-ui/docs/pyric-database-reference-api/index.html +1851 -0
  485. package/dist/serve/docs-ui/docs/pyric-database-reference-api.md +1842 -0
  486. package/dist/serve/docs-ui/docs/pyric-database-reference-constraints/index.html +381 -0
  487. package/dist/serve/docs-ui/docs/pyric-database-reference-constraints.md +168 -0
  488. package/dist/serve/docs-ui/docs/pyric-database-reference-rules-tooling/index.html +218 -0
  489. package/dist/serve/docs-ui/docs/pyric-database-reference-rules-tooling.md +303 -0
  490. package/dist/serve/docs-ui/docs/pyric-database-tutorials-01-author-rtdb-rules-with-constraints/index.html +125 -0
  491. package/dist/serve/docs-ui/docs/pyric-database-tutorials-01-author-rtdb-rules-with-constraints.md +171 -0
  492. package/dist/serve/docs-ui/docs/pyric-database.md +26 -0
  493. package/dist/serve/docs-ui/docs/pyric-explanation-versioning-and-compatibility/index.html +40 -0
  494. package/dist/serve/docs-ui/docs/pyric-explanation-versioning-and-compatibility.md +68 -0
  495. package/dist/serve/docs-ui/docs/pyric-firestore/index.html +48 -0
  496. package/dist/serve/docs-ui/docs/pyric-firestore-compat/index.html +868 -0
  497. package/dist/serve/docs-ui/docs/pyric-firestore-compat.md +939 -0
  498. package/dist/serve/docs-ui/docs/pyric-firestore-explanation-rules-tooling-is-separate/index.html +92 -0
  499. package/dist/serve/docs-ui/docs/pyric-firestore-explanation-rules-tooling-is-separate.md +70 -0
  500. package/dist/serve/docs-ui/docs/pyric-firestore-explanation-target-symbol-opacity/index.html +59 -0
  501. package/dist/serve/docs-ui/docs/pyric-firestore-explanation-target-symbol-opacity.md +91 -0
  502. package/dist/serve/docs-ui/docs/pyric-firestore-explanation-two-backends-one-surface/index.html +43 -0
  503. package/dist/serve/docs-ui/docs/pyric-firestore-explanation-two-backends-one-surface.md +58 -0
  504. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-migrate-from-firebase-firestore/index.html +58 -0
  505. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-migrate-from-firebase-firestore.md +86 -0
  506. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-pick-a-backend/index.html +52 -0
  507. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-pick-a-backend.md +83 -0
  508. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-run-a-transaction/index.html +42 -0
  509. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-run-a-transaction.md +59 -0
  510. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-onsnapshot/index.html +66 -0
  511. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-onsnapshot.md +96 -0
  512. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-sandbox-ops/index.html +61 -0
  513. package/dist/serve/docs-ui/docs/pyric-firestore-how-to-use-sandbox-ops.md +92 -0
  514. package/dist/serve/docs-ui/docs/pyric-firestore-reference-api/index.html +3623 -0
  515. package/dist/serve/docs-ui/docs/pyric-firestore-reference-api.md +3399 -0
  516. package/dist/serve/docs-ui/docs/pyric-firestore-reference-feature-matrix/index.html +80 -0
  517. package/dist/serve/docs-ui/docs/pyric-firestore-reference-feature-matrix.md +66 -0
  518. package/dist/serve/docs-ui/docs/pyric-firestore-reference-getfirestore/index.html +46 -0
  519. package/dist/serve/docs-ui/docs/pyric-firestore-reference-getfirestore.md +73 -0
  520. package/dist/serve/docs-ui/docs/pyric-firestore-reference-query-constraints/index.html +80 -0
  521. package/dist/serve/docs-ui/docs/pyric-firestore-reference-query-constraints.md +129 -0
  522. package/dist/serve/docs-ui/docs/pyric-firestore-reference-sandbox-ops/index.html +58 -0
  523. package/dist/serve/docs-ui/docs/pyric-firestore-reference-sandbox-ops.md +88 -0
  524. package/dist/serve/docs-ui/docs/pyric-firestore-reference-tool-factories/index.html +51 -0
  525. package/dist/serve/docs-ui/docs/pyric-firestore-reference-tool-factories.md +71 -0
  526. package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-01-write-a-sandbox-demo/index.html +130 -0
  527. package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-01-write-a-sandbox-demo.md +180 -0
  528. package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-02-swap-to-prod-backend/index.html +59 -0
  529. package/dist/serve/docs-ui/docs/pyric-firestore-tutorials-02-swap-to-prod-backend.md +92 -0
  530. package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api/index.html +30 -0
  531. package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api.md +30 -0
  532. package/dist/serve/docs-ui/docs/pyric-firestore.md +72 -0
  533. package/dist/serve/docs-ui/docs/pyric-messaging-compat/index.html +300 -0
  534. package/dist/serve/docs-ui/docs/pyric-messaging-compat.md +321 -0
  535. package/dist/serve/docs-ui/docs/pyric-messaging-reference-api/index.html +508 -0
  536. package/dist/serve/docs-ui/docs/pyric-messaging-reference-api.md +374 -0
  537. package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api/index.html +482 -0
  538. package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api.md +348 -0
  539. package/dist/serve/docs-ui/docs/pyric-rules/index.html +87 -0
  540. package/dist/serve/docs-ui/docs/pyric-rules-compat/index.html +328 -0
  541. package/dist/serve/docs-ui/docs/pyric-rules-compat.md +347 -0
  542. package/dist/serve/docs-ui/docs/pyric-rules-explanation-agent-failure-modes/index.html +50 -0
  543. package/dist/serve/docs-ui/docs/pyric-rules-explanation-agent-failure-modes.md +78 -0
  544. package/dist/serve/docs-ui/docs/pyric-rules-explanation-lint-vs-validate-vs-simulate-vs-test/index.html +79 -0
  545. package/dist/serve/docs-ui/docs/pyric-rules-explanation-lint-vs-validate-vs-simulate-vs-test.md +69 -0
  546. package/dist/serve/docs-ui/docs/pyric-rules-explanation-runtime-budget-and-shared-gates/index.html +67 -0
  547. package/dist/serve/docs-ui/docs/pyric-rules-explanation-runtime-budget-and-shared-gates.md +75 -0
  548. package/dist/serve/docs-ui/docs/pyric-rules-explanation-sentinel-expression-engine/index.html +49 -0
  549. package/dist/serve/docs-ui/docs/pyric-rules-explanation-sentinel-expression-engine.md +74 -0
  550. package/dist/serve/docs-ui/docs/pyric-rules-explanation-simulator-vs-rules-test-api/index.html +95 -0
  551. package/dist/serve/docs-ui/docs/pyric-rules-explanation-simulator-vs-rules-test-api.md +80 -0
  552. package/dist/serve/docs-ui/docs/pyric-rules-explanation-the-2-plus-modules-extension/index.html +58 -0
  553. package/dist/serve/docs-ui/docs/pyric-rules-explanation-the-2-plus-modules-extension.md +79 -0
  554. package/dist/serve/docs-ui/docs/pyric-rules-explanation-value-wrappers-design/index.html +63 -0
  555. package/dist/serve/docs-ui/docs/pyric-rules-explanation-value-wrappers-design.md +84 -0
  556. package/dist/serve/docs-ui/docs/pyric-rules-explanation-why-this-package-exists/index.html +34 -0
  557. package/dist/serve/docs-ui/docs/pyric-rules-explanation-why-this-package-exists.md +43 -0
  558. package/dist/serve/docs-ui/docs/pyric-rules-how-to-compare-rulesets-for-weakening/index.html +55 -0
  559. package/dist/serve/docs-ui/docs/pyric-rules-how-to-compare-rulesets-for-weakening.md +77 -0
  560. package/dist/serve/docs-ui/docs/pyric-rules-how-to-inspect-rules-via-the-ast/index.html +90 -0
  561. package/dist/serve/docs-ui/docs/pyric-rules-how-to-inspect-rules-via-the-ast.md +129 -0
  562. package/dist/serve/docs-ui/docs/pyric-rules-how-to-lint-rules-source/index.html +55 -0
  563. package/dist/serve/docs-ui/docs/pyric-rules-how-to-lint-rules-source.md +84 -0
  564. package/dist/serve/docs-ui/docs/pyric-rules-how-to-pin-request-time/index.html +49 -0
  565. package/dist/serve/docs-ui/docs/pyric-rules-how-to-pin-request-time.md +64 -0
  566. package/dist/serve/docs-ui/docs/pyric-rules-how-to-register-tools-with-an-agent/index.html +61 -0
  567. package/dist/serve/docs-ui/docs/pyric-rules-how-to-register-tools-with-an-agent.md +87 -0
  568. package/dist/serve/docs-ui/docs/pyric-rules-how-to-resolve-module-imports/index.html +93 -0
  569. package/dist/serve/docs-ui/docs/pyric-rules-how-to-resolve-module-imports.md +105 -0
  570. package/dist/serve/docs-ui/docs/pyric-rules-how-to-simulate-rules-locally/index.html +89 -0
  571. package/dist/serve/docs-ui/docs/pyric-rules-how-to-simulate-rules-locally.md +134 -0
  572. package/dist/serve/docs-ui/docs/pyric-rules-how-to-test-rules-against-firebase/index.html +66 -0
  573. package/dist/serve/docs-ui/docs/pyric-rules-how-to-test-rules-against-firebase.md +102 -0
  574. package/dist/serve/docs-ui/docs/pyric-rules-reference-api/index.html +2629 -0
  575. package/dist/serve/docs-ui/docs/pyric-rules-reference-api.md +2213 -0
  576. package/dist/serve/docs-ui/docs/pyric-rules-reference-ast/index.html +85 -0
  577. package/dist/serve/docs-ui/docs/pyric-rules-reference-ast.md +121 -0
  578. package/dist/serve/docs-ui/docs/pyric-rules-reference-conformance-gaps/index.html +277 -0
  579. package/dist/serve/docs-ui/docs/pyric-rules-reference-conformance-gaps.md +360 -0
  580. package/dist/serve/docs-ui/docs/pyric-rules-reference-errors/index.html +76 -0
  581. package/dist/serve/docs-ui/docs/pyric-rules-reference-errors.md +123 -0
  582. package/dist/serve/docs-ui/docs/pyric-rules-reference-lint-rules/index.html +148 -0
  583. package/dist/serve/docs-ui/docs/pyric-rules-reference-lint-rules.md +159 -0
  584. package/dist/serve/docs-ui/docs/pyric-rules-reference-simulator-context/index.html +66 -0
  585. package/dist/serve/docs-ui/docs/pyric-rules-reference-simulator-context.md +104 -0
  586. package/dist/serve/docs-ui/docs/pyric-rules-reference-stdlib-modules/index.html +241 -0
  587. package/dist/serve/docs-ui/docs/pyric-rules-reference-stdlib-modules.md +143 -0
  588. package/dist/serve/docs-ui/docs/pyric-rules-reference-test-case-schema/index.html +94 -0
  589. package/dist/serve/docs-ui/docs/pyric-rules-reference-test-case-schema.md +121 -0
  590. package/dist/serve/docs-ui/docs/pyric-rules-reference-validator-findings/index.html +87 -0
  591. package/dist/serve/docs-ui/docs/pyric-rules-reference-validator-findings.md +117 -0
  592. package/dist/serve/docs-ui/docs/pyric-rules-reference-value-wrappers/index.html +102 -0
  593. package/dist/serve/docs-ui/docs/pyric-rules-reference-value-wrappers.md +152 -0
  594. package/dist/serve/docs-ui/docs/pyric-rules.md +93 -0
  595. package/dist/serve/docs-ui/docs/pyric-sandbox/index.html +67 -0
  596. package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api/index.html +120 -0
  597. package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api.md +110 -0
  598. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-every-op-is-a-request/index.html +141 -0
  599. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-every-op-is-a-request.md +161 -0
  600. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-identity-is-a-context/index.html +66 -0
  601. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-identity-is-a-context.md +110 -0
  602. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-internal-adapter-protocol/index.html +71 -0
  603. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-internal-adapter-protocol.md +111 -0
  604. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-listener-re-evaluation/index.html +56 -0
  605. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-listener-re-evaluation.md +82 -0
  606. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-local-backend-vs-firestore-offline/index.html +64 -0
  607. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-local-backend-vs-firestore-offline.md +56 -0
  608. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-adapters-are-siblings/index.html +92 -0
  609. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-adapters-are-siblings.md +90 -0
  610. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-this-package-exists/index.html +69 -0
  611. package/dist/serve/docs-ui/docs/pyric-sandbox-explanation-why-this-package-exists.md +57 -0
  612. package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api/index.html +202 -0
  613. package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api.md +134 -0
  614. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-multiple-isolated-sandboxes/index.html +63 -0
  615. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-multiple-isolated-sandboxes.md +89 -0
  616. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-observe-events/index.html +159 -0
  617. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-observe-events.md +168 -0
  618. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-pick-an-adapter/index.html +79 -0
  619. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-pick-an-adapter.md +75 -0
  620. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-replay-events/index.html +88 -0
  621. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-replay-events.md +92 -0
  622. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-reset-between-tests/index.html +68 -0
  623. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-reset-between-tests.md +92 -0
  624. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-seed-data-and-rules/index.html +91 -0
  625. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-seed-data-and-rules.md +122 -0
  626. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-switch-users/index.html +50 -0
  627. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-switch-users.md +78 -0
  628. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-use-admin-reads/index.html +54 -0
  629. package/dist/serve/docs-ui/docs/pyric-sandbox-how-to-use-admin-reads.md +85 -0
  630. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api/index.html +5019 -0
  631. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api.md +4060 -0
  632. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-divergences/index.html +125 -0
  633. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-divergences.md +151 -0
  634. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-error-codes/index.html +110 -0
  635. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-error-codes.md +118 -0
  636. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-internal-protocol/index.html +72 -0
  637. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-internal-protocol.md +109 -0
  638. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-and-context/index.html +90 -0
  639. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-and-context.md +140 -0
  640. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-event/index.html +146 -0
  641. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-sandbox-event.md +204 -0
  642. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-snapshot-and-admin/index.html +53 -0
  643. package/dist/serve/docs-ui/docs/pyric-sandbox-reference-snapshot-and-admin.md +89 -0
  644. package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-01-your-first-sandbox-session/index.html +115 -0
  645. package/dist/serve/docs-ui/docs/pyric-sandbox-tutorials-01-your-first-sandbox-session.md +176 -0
  646. package/dist/serve/docs-ui/docs/pyric-sandbox.md +69 -0
  647. package/dist/serve/docs-ui/docs/pyric-storage/index.html +65 -0
  648. package/dist/serve/docs-ui/docs/pyric-storage-compat/index.html +676 -0
  649. package/dist/serve/docs-ui/docs/pyric-storage-compat.md +699 -0
  650. package/dist/serve/docs-ui/docs/pyric-storage-explanation-implementation-scope/index.html +52 -0
  651. package/dist/serve/docs-ui/docs/pyric-storage-explanation-implementation-scope.md +85 -0
  652. package/dist/serve/docs-ui/docs/pyric-storage-explanation-session-archive-use-case/index.html +58 -0
  653. package/dist/serve/docs-ui/docs/pyric-storage-explanation-session-archive-use-case.md +82 -0
  654. package/dist/serve/docs-ui/docs/pyric-storage-explanation-why-indexeddb/index.html +50 -0
  655. package/dist/serve/docs-ui/docs/pyric-storage-explanation-why-indexeddb.md +82 -0
  656. package/dist/serve/docs-ui/docs/pyric-storage-how-to-enforce-rules/index.html +120 -0
  657. package/dist/serve/docs-ui/docs/pyric-storage-how-to-enforce-rules.md +127 -0
  658. package/dist/serve/docs-ui/docs/pyric-storage-how-to-list-and-delete/index.html +53 -0
  659. package/dist/serve/docs-ui/docs/pyric-storage-how-to-list-and-delete.md +86 -0
  660. package/dist/serve/docs-ui/docs/pyric-storage-how-to-switch-backends/index.html +43 -0
  661. package/dist/serve/docs-ui/docs/pyric-storage-how-to-switch-backends.md +65 -0
  662. package/dist/serve/docs-ui/docs/pyric-storage-how-to-test-rule-expressions/index.html +70 -0
  663. package/dist/serve/docs-ui/docs/pyric-storage-how-to-test-rule-expressions.md +88 -0
  664. package/dist/serve/docs-ui/docs/pyric-storage-reference-api/index.html +2120 -0
  665. package/dist/serve/docs-ui/docs/pyric-storage-reference-api.md +1687 -0
  666. package/dist/serve/docs-ui/docs/pyric-storage-reference-conformance-gaps/index.html +137 -0
  667. package/dist/serve/docs-ui/docs/pyric-storage-reference-conformance-gaps.md +171 -0
  668. package/dist/serve/docs-ui/docs/pyric-storage-reference-error-codes/index.html +37 -0
  669. package/dist/serve/docs-ui/docs/pyric-storage-reference-error-codes.md +57 -0
  670. package/dist/serve/docs-ui/docs/pyric-storage-reference-rules-subset/index.html +96 -0
  671. package/dist/serve/docs-ui/docs/pyric-storage-reference-rules-subset.md +134 -0
  672. package/dist/serve/docs-ui/docs/pyric-storage-reference-storage-options/index.html +39 -0
  673. package/dist/serve/docs-ui/docs/pyric-storage-reference-storage-options.md +61 -0
  674. package/dist/serve/docs-ui/docs/pyric-storage.md +67 -0
  675. package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api/index.html +638 -0
  676. package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api.md +430 -0
  677. package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api/index.html +813 -0
  678. package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api.md +634 -0
  679. package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api/index.html +1708 -0
  680. package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api.md +1300 -0
  681. package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api/index.html +177 -0
  682. package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api.md +111 -0
  683. package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api/index.html +1542 -0
  684. package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api.md +903 -0
  685. package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api/index.html +1024 -0
  686. package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api.md +640 -0
  687. package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api/index.html +2753 -0
  688. package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api.md +2171 -0
  689. package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api/index.html +1005 -0
  690. package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api.md +693 -0
  691. package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api/index.html +1388 -0
  692. package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api.md +1340 -0
  693. package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api/index.html +131 -0
  694. package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api.md +76 -0
  695. package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api/index.html +648 -0
  696. package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api.md +508 -0
  697. package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api/index.html +1457 -0
  698. package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api.md +1029 -0
  699. package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api/index.html +2476 -0
  700. package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api.md +1919 -0
  701. package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api/index.html +1241 -0
  702. package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api.md +817 -0
  703. package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api/index.html +2289 -0
  704. package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api.md +1489 -0
  705. package/dist/serve/docs-ui/docs/read-a-denial/index.html +40 -0
  706. package/dist/serve/docs-ui/docs/read-a-denial.md +62 -0
  707. package/dist/serve/docs-ui/docs/receive-messages/index.html +28 -0
  708. package/dist/serve/docs-ui/docs/receive-messages.md +43 -0
  709. package/dist/serve/docs-ui/docs/rtdb-rules-in-typescript/index.html +67 -0
  710. package/dist/serve/docs-ui/docs/rtdb-rules-in-typescript.md +101 -0
  711. package/dist/serve/docs-ui/docs/rules-patterns/index.html +68 -0
  712. package/dist/serve/docs-ui/docs/rules-patterns.md +104 -0
  713. package/dist/serve/docs-ui/docs/rules-standard-library/index.html +87 -0
  714. package/dist/serve/docs-ui/docs/rules-standard-library.md +93 -0
  715. package/dist/serve/docs-ui/docs/run-ai-logic-locally/index.html +27 -0
  716. package/dist/serve/docs-ui/docs/run-ai-logic-locally.md +43 -0
  717. package/dist/serve/docs-ui/docs/secure-it-with-rules/index.html +69 -0
  718. package/dist/serve/docs-ui/docs/secure-it-with-rules.md +101 -0
  719. package/dist/serve/docs-ui/docs/see-whats-happening/index.html +73 -0
  720. package/dist/serve/docs-ui/docs/see-whats-happening.md +77 -0
  721. package/dist/serve/docs-ui/docs/set-up-the-project/index.html +14 -0
  722. package/dist/serve/docs-ui/docs/set-up-the-project.md +19 -0
  723. package/dist/serve/docs-ui/docs/set-up-your-agent/index.html +42 -0
  724. package/dist/serve/docs-ui/docs/set-up-your-agent.md +86 -0
  725. package/dist/serve/docs-ui/docs/shape-your-data/index.html +44 -0
  726. package/dist/serve/docs-ui/docs/shape-your-data.md +88 -0
  727. package/dist/serve/docs-ui/docs/ship-to-production/index.html +36 -0
  728. package/dist/serve/docs-ui/docs/ship-to-production.md +80 -0
  729. package/dist/serve/docs-ui/docs/sign-in-and-manage-users/index.html +31 -0
  730. package/dist/serve/docs-ui/docs/sign-in-and-manage-users.md +50 -0
  731. package/dist/serve/docs-ui/docs/simulate-and-lint/index.html +95 -0
  732. package/dist/serve/docs-ui/docs/simulate-and-lint.md +99 -0
  733. package/dist/serve/docs-ui/docs/skills/index.html +20 -0
  734. package/dist/serve/docs-ui/docs/skills.md +34 -0
  735. package/dist/serve/docs-ui/docs/start-building/index.html +32 -0
  736. package/dist/serve/docs-ui/docs/start-building.md +64 -0
  737. package/dist/serve/docs-ui/docs/store-and-query-data/index.html +16 -0
  738. package/dist/serve/docs-ui/docs/store-and-query-data.md +33 -0
  739. package/dist/serve/docs-ui/docs/store-files/index.html +13 -0
  740. package/dist/serve/docs-ui/docs/store-files.md +25 -0
  741. package/dist/serve/docs-ui/docs/sync-realtime-data/index.html +15 -0
  742. package/dist/serve/docs-ui/docs/sync-realtime-data.md +27 -0
  743. package/dist/serve/docs-ui/docs/test-in-node/index.html +74 -0
  744. package/dist/serve/docs-ui/docs/test-in-node.md +100 -0
  745. package/dist/serve/docs-ui/docs/ui/index.html +76 -0
  746. package/dist/serve/docs-ui/docs/ui-auth-authsigninhelper/index.html +194 -0
  747. package/dist/serve/docs-ui/docs/ui-auth-authsigninhelper.md +114 -0
  748. package/dist/serve/docs-ui/docs/ui-auth-authusers/index.html +263 -0
  749. package/dist/serve/docs-ui/docs/ui-auth-authusers.md +183 -0
  750. package/dist/serve/docs-ui/docs/ui-firestore-collectionlist/index.html +92 -0
  751. package/dist/serve/docs-ui/docs/ui-firestore-collectionlist.md +79 -0
  752. package/dist/serve/docs-ui/docs/ui-firestore-deletewithconfirm/index.html +128 -0
  753. package/dist/serve/docs-ui/docs/ui-firestore-deletewithconfirm.md +104 -0
  754. package/dist/serve/docs-ui/docs/ui-firestore-documenteditor/index.html +154 -0
  755. package/dist/serve/docs-ui/docs/ui-firestore-documenteditor.md +117 -0
  756. package/dist/serve/docs-ui/docs/ui-firestore-documentlist/index.html +132 -0
  757. package/dist/serve/docs-ui/docs/ui-firestore-documentlist.md +92 -0
  758. package/dist/serve/docs-ui/docs/ui-firestore-documentpreview/index.html +159 -0
  759. package/dist/serve/docs-ui/docs/ui-firestore-documentpreview.md +84 -0
  760. package/dist/serve/docs-ui/docs/ui-firestore-querybuilder/index.html +104 -0
  761. package/dist/serve/docs-ui/docs/ui-firestore-querybuilder.md +103 -0
  762. package/dist/serve/docs-ui/docs/ui-firestore-referencepicker/index.html +113 -0
  763. package/dist/serve/docs-ui/docs/ui-firestore-referencepicker.md +93 -0
  764. package/dist/serve/docs-ui/docs/ui-primitives-badge/index.html +56 -0
  765. package/dist/serve/docs-ui/docs/ui-primitives-badge.md +40 -0
  766. package/dist/serve/docs-ui/docs/ui-primitives-confirmdialog/index.html +140 -0
  767. package/dist/serve/docs-ui/docs/ui-primitives-confirmdialog.md +108 -0
  768. package/dist/serve/docs-ui/docs/ui-primitives-copybutton/index.html +58 -0
  769. package/dist/serve/docs-ui/docs/ui-primitives-copybutton.md +37 -0
  770. package/dist/serve/docs-ui/docs/ui-primitives-jsonview/index.html +58 -0
  771. package/dist/serve/docs-ui/docs/ui-primitives-jsonview.md +47 -0
  772. package/dist/serve/docs-ui/docs/ui-primitives-segmentedcontrol/index.html +70 -0
  773. package/dist/serve/docs-ui/docs/ui-primitives-segmentedcontrol.md +50 -0
  774. package/dist/serve/docs-ui/docs/ui-primitives-toast/index.html +87 -0
  775. package/dist/serve/docs-ui/docs/ui-primitives-toast.md +82 -0
  776. package/dist/serve/docs-ui/docs/ui-primitives-virtuallist/index.html +85 -0
  777. package/dist/serve/docs-ui/docs/ui-primitives-virtuallist.md +54 -0
  778. package/dist/serve/docs-ui/docs/ui-storage/index.html +150 -0
  779. package/dist/serve/docs-ui/docs/ui-storage-deleteselectionwithconfirm/index.html +126 -0
  780. package/dist/serve/docs-ui/docs/ui-storage-deleteselectionwithconfirm.md +88 -0
  781. package/dist/serve/docs-ui/docs/ui-storage-objectbrowser/index.html +137 -0
  782. package/dist/serve/docs-ui/docs/ui-storage-objectbrowser.md +90 -0
  783. package/dist/serve/docs-ui/docs/ui-storage-objectinspector/index.html +139 -0
  784. package/dist/serve/docs-ui/docs/ui-storage-objectinspector.md +93 -0
  785. package/dist/serve/docs-ui/docs/ui-storage-pathbreadcrumb/index.html +72 -0
  786. package/dist/serve/docs-ui/docs/ui-storage-pathbreadcrumb.md +57 -0
  787. package/dist/serve/docs-ui/docs/ui-storage-rules-aware-affordances/index.html +60 -0
  788. package/dist/serve/docs-ui/docs/ui-storage-rules-aware-affordances.md +52 -0
  789. package/dist/serve/docs-ui/docs/ui-storage-uploaddropzone/index.html +93 -0
  790. package/dist/serve/docs-ui/docs/ui-storage-uploaddropzone.md +78 -0
  791. package/dist/serve/docs-ui/docs/ui-storage-usestoragerulesgate/index.html +144 -0
  792. package/dist/serve/docs-ui/docs/ui-storage-usestoragerulesgate.md +101 -0
  793. package/dist/serve/docs-ui/docs/ui-storage.md +165 -0
  794. package/dist/serve/docs-ui/docs/ui-traffic/index.html +88 -0
  795. package/dist/serve/docs-ui/docs/ui-traffic-ruleheatmap/index.html +79 -0
  796. package/dist/serve/docs-ui/docs/ui-traffic-ruleheatmap.md +60 -0
  797. package/dist/serve/docs-ui/docs/ui-traffic-trafficdetail/index.html +78 -0
  798. package/dist/serve/docs-ui/docs/ui-traffic-trafficdetail.md +59 -0
  799. package/dist/serve/docs-ui/docs/ui-traffic-trafficlog/index.html +118 -0
  800. package/dist/serve/docs-ui/docs/ui-traffic-trafficlog.md +69 -0
  801. package/dist/serve/docs-ui/docs/ui-traffic-trafficstats/index.html +51 -0
  802. package/dist/serve/docs-ui/docs/ui-traffic-trafficstats.md +46 -0
  803. package/dist/serve/docs-ui/docs/ui-traffic.md +102 -0
  804. package/dist/serve/docs-ui/docs/ui.md +90 -0
  805. package/dist/serve/docs-ui/docs/watch-and-review/index.html +25 -0
  806. package/dist/serve/docs-ui/docs/watch-and-review.md +40 -0
  807. package/dist/serve/docs-ui/docs/what-your-agent-can-do/index.html +81 -0
  808. package/dist/serve/docs-ui/docs/what-your-agent-can-do.md +78 -0
  809. package/dist/serve/docs-ui/docs/whats-experimental/index.html +22 -0
  810. package/dist/serve/docs-ui/docs/whats-experimental.md +33 -0
  811. package/dist/serve/docs-ui/docs/whats-possible/index.html +63 -0
  812. package/dist/serve/docs-ui/docs/whats-possible.md +53 -0
  813. package/dist/serve/docs-ui/docs/which-data-service/index.html +8 -0
  814. package/dist/serve/docs-ui/docs/which-data-service.md +11 -0
  815. package/dist/serve/docs-ui/docs/write-a-rules-test-suite/index.html +85 -0
  816. package/dist/serve/docs-ui/docs/write-a-rules-test-suite.md +119 -0
  817. package/dist/serve/docs-ui/index.html +1 -0
  818. package/dist/serve/docs-ui/llms.txt +308 -0
  819. package/dist/serve/entries/ai.d.ts +4 -0
  820. package/dist/serve/entries/ai.d.ts.map +1 -0
  821. package/dist/serve/entries/ai.js +184 -0
  822. package/dist/serve/entries/ai.js.map +1 -0
  823. package/dist/serve/entries/app-backend.d.ts +2 -0
  824. package/dist/serve/entries/app-backend.d.ts.map +1 -0
  825. package/dist/serve/entries/app-backend.js +4 -0
  826. package/dist/serve/entries/app-backend.js.map +1 -0
  827. package/dist/serve/entries/app-client.d.ts +5 -0
  828. package/dist/serve/entries/app-client.d.ts.map +1 -0
  829. package/dist/serve/entries/app-client.js +23 -0
  830. package/dist/serve/entries/app-client.js.map +1 -0
  831. package/dist/serve/entries/app-session-store.d.ts +14 -0
  832. package/dist/serve/entries/app-session-store.d.ts.map +1 -0
  833. package/dist/serve/entries/app-session-store.js +37 -0
  834. package/dist/serve/entries/app-session-store.js.map +1 -0
  835. package/dist/serve/entries/app.d.ts +2 -0
  836. package/dist/serve/entries/app.d.ts.map +1 -0
  837. package/dist/serve/entries/app.js +10 -0
  838. package/dist/serve/entries/app.js.map +1 -0
  839. package/dist/serve/entries/auth-helper-core.d.ts +52 -0
  840. package/dist/serve/entries/auth-helper-core.d.ts.map +1 -0
  841. package/dist/serve/entries/auth-helper-core.js +118 -0
  842. package/dist/serve/entries/auth-helper-core.js.map +1 -0
  843. package/dist/serve/entries/auth-helper-dom.d.ts +14 -0
  844. package/dist/serve/entries/auth-helper-dom.d.ts.map +1 -0
  845. package/dist/serve/entries/auth-helper-dom.js +116 -0
  846. package/dist/serve/entries/auth-helper-dom.js.map +1 -0
  847. package/dist/serve/entries/auth-helper-runtime.d.ts +5 -0
  848. package/dist/serve/entries/auth-helper-runtime.d.ts.map +1 -0
  849. package/dist/serve/entries/auth-helper-runtime.js +11 -0
  850. package/dist/serve/entries/auth-helper-runtime.js.map +1 -0
  851. package/dist/serve/entries/auth.d.ts +77 -0
  852. package/dist/serve/entries/auth.d.ts.map +1 -0
  853. package/dist/serve/entries/auth.js +201 -0
  854. package/dist/serve/entries/auth.js.map +1 -0
  855. package/dist/serve/entries/bridge-url.d.ts +25 -0
  856. package/dist/serve/entries/bridge-url.d.ts.map +1 -0
  857. package/dist/serve/entries/bridge-url.js +30 -0
  858. package/dist/serve/entries/bridge-url.js.map +1 -0
  859. package/dist/serve/entries/database.d.ts +46 -0
  860. package/dist/serve/entries/database.d.ts.map +1 -0
  861. package/dist/serve/entries/database.js +80 -0
  862. package/dist/serve/entries/database.js.map +1 -0
  863. package/dist/serve/entries/firestore.d.ts +104 -0
  864. package/dist/serve/entries/firestore.d.ts.map +1 -0
  865. package/dist/serve/entries/firestore.js +202 -0
  866. package/dist/serve/entries/firestore.js.map +1 -0
  867. package/dist/serve/entries/init.d.ts +2 -0
  868. package/dist/serve/entries/init.d.ts.map +1 -0
  869. package/dist/serve/entries/init.js +40 -0
  870. package/dist/serve/entries/init.js.map +1 -0
  871. package/dist/serve/entries/keepalive.d.ts +20 -0
  872. package/dist/serve/entries/keepalive.d.ts.map +1 -0
  873. package/dist/serve/entries/keepalive.js +38 -0
  874. package/dist/serve/entries/keepalive.js.map +1 -0
  875. package/dist/serve/entries/messaging-sw.d.ts +10 -0
  876. package/dist/serve/entries/messaging-sw.d.ts.map +1 -0
  877. package/dist/serve/entries/messaging-sw.js +36 -0
  878. package/dist/serve/entries/messaging-sw.js.map +1 -0
  879. package/dist/serve/entries/messaging.d.ts +11 -0
  880. package/dist/serve/entries/messaging.d.ts.map +1 -0
  881. package/dist/serve/entries/messaging.js +53 -0
  882. package/dist/serve/entries/messaging.js.map +1 -0
  883. package/dist/serve/entries/runtime.d.ts +46 -0
  884. package/dist/serve/entries/runtime.d.ts.map +1 -0
  885. package/dist/serve/entries/runtime.js +435 -0
  886. package/dist/serve/entries/runtime.js.map +1 -0
  887. package/dist/serve/entries/session-store.d.ts +48 -0
  888. package/dist/serve/entries/session-store.d.ts.map +1 -0
  889. package/dist/serve/entries/session-store.js +82 -0
  890. package/dist/serve/entries/session-store.js.map +1 -0
  891. package/dist/serve/entries/storage.d.ts +25 -0
  892. package/dist/serve/entries/storage.d.ts.map +1 -0
  893. package/dist/serve/entries/storage.js +61 -0
  894. package/dist/serve/entries/storage.js.map +1 -0
  895. package/dist/serve/entries/tab-sync-wiring.d.ts +88 -0
  896. package/dist/serve/entries/tab-sync-wiring.d.ts.map +1 -0
  897. package/dist/serve/entries/tab-sync-wiring.js +217 -0
  898. package/dist/serve/entries/tab-sync-wiring.js.map +1 -0
  899. package/dist/serve/entries/worker-runtime.d.ts +10 -0
  900. package/dist/serve/entries/worker-runtime.d.ts.map +1 -0
  901. package/dist/serve/entries/worker-runtime.js +59 -0
  902. package/dist/serve/entries/worker-runtime.js.map +1 -0
  903. package/dist/serve/init-payload.d.ts +21 -0
  904. package/dist/serve/init-payload.d.ts.map +1 -0
  905. package/dist/serve/init-payload.js +2 -0
  906. package/dist/serve/init-payload.js.map +1 -0
  907. package/dist/serve/namespace.d.ts +73 -0
  908. package/dist/serve/namespace.d.ts.map +1 -0
  909. package/dist/serve/namespace.js +470 -0
  910. package/dist/serve/namespace.js.map +1 -0
  911. package/dist/serve/open-browser.d.ts +23 -0
  912. package/dist/serve/open-browser.d.ts.map +1 -0
  913. package/dist/serve/open-browser.js +58 -0
  914. package/dist/serve/open-browser.js.map +1 -0
  915. package/dist/serve/rules.d.ts +77 -0
  916. package/dist/serve/rules.d.ts.map +1 -0
  917. package/dist/serve/rules.js +202 -0
  918. package/dist/serve/rules.js.map +1 -0
  919. package/dist/serve/sandbox-marker.d.ts +9 -0
  920. package/dist/serve/sandbox-marker.d.ts.map +1 -0
  921. package/dist/serve/sandbox-marker.js +31 -0
  922. package/dist/serve/sandbox-marker.js.map +1 -0
  923. package/dist/serve/server.d.ts +135 -0
  924. package/dist/serve/server.d.ts.map +1 -0
  925. package/dist/serve/server.js +328 -0
  926. package/dist/serve/server.js.map +1 -0
  927. package/dist/serve/standalone-assets.d.ts +67 -0
  928. package/dist/serve/standalone-assets.d.ts.map +1 -0
  929. package/dist/serve/standalone-assets.js +134 -0
  930. package/dist/serve/standalone-assets.js.map +1 -0
  931. package/dist/serve/state-store.d.ts +45 -0
  932. package/dist/serve/state-store.d.ts.map +1 -0
  933. package/dist/serve/state-store.js +120 -0
  934. package/dist/serve/state-store.js.map +1 -0
  935. package/dist/serve/studio/disk-project-store.d.ts +9 -0
  936. package/dist/serve/studio/disk-project-store.d.ts.map +1 -0
  937. package/dist/serve/studio/disk-project-store.js +173 -0
  938. package/dist/serve/studio/disk-project-store.js.map +1 -0
  939. package/dist/serve/studio/disk-workspace.d.ts +14 -0
  940. package/dist/serve/studio/disk-workspace.d.ts.map +1 -0
  941. package/dist/serve/studio/disk-workspace.js +152 -0
  942. package/dist/serve/studio/disk-workspace.js.map +1 -0
  943. package/dist/serve/studio/index.d.ts +10 -0
  944. package/dist/serve/studio/index.d.ts.map +1 -0
  945. package/dist/serve/studio/index.js +9 -0
  946. package/dist/serve/studio/index.js.map +1 -0
  947. package/dist/serve/studio/routes.d.ts +40 -0
  948. package/dist/serve/studio/routes.d.ts.map +1 -0
  949. package/dist/serve/studio/routes.js +182 -0
  950. package/dist/serve/studio/routes.js.map +1 -0
  951. package/dist/serve/studio/store-types.d.ts +45 -0
  952. package/dist/serve/studio/store-types.d.ts.map +1 -0
  953. package/dist/serve/studio/store-types.js +11 -0
  954. package/dist/serve/studio/store-types.js.map +1 -0
  955. package/dist/serve/studio-ui/assets/RulesCodeEditor-BZpD57II.js +23 -0
  956. package/dist/serve/studio-ui/assets/index-Bsa-TQNK.css +1 -0
  957. package/dist/serve/studio-ui/assets/index-DGaVuOhE.js +1211 -0
  958. package/dist/serve/studio-ui/assets/seed-CTmn6YuO.js +2 -0
  959. package/dist/serve/studio-ui/index.html +32 -0
  960. package/dist/serve/studio-ui/pyric-logo.svg +76 -0
  961. package/dist/serve/vite-plugin.d.ts +57 -0
  962. package/dist/serve/vite-plugin.d.ts.map +1 -0
  963. package/dist/serve/vite-plugin.js +658 -0
  964. package/dist/serve/vite-plugin.js.map +1 -0
  965. package/dist/serve/worker/client/admin-firestore.d.ts +18 -0
  966. package/dist/serve/worker/client/admin-firestore.d.ts.map +1 -0
  967. package/dist/serve/worker/client/admin-firestore.js +26 -0
  968. package/dist/serve/worker/client/admin-firestore.js.map +1 -0
  969. package/dist/serve/worker/client/ai.d.ts +31 -0
  970. package/dist/serve/worker/client/ai.d.ts.map +1 -0
  971. package/dist/serve/worker/client/ai.js +89 -0
  972. package/dist/serve/worker/client/ai.js.map +1 -0
  973. package/dist/serve/worker/client/auth.d.ts +168 -0
  974. package/dist/serve/worker/client/auth.d.ts.map +1 -0
  975. package/dist/serve/worker/client/auth.js +322 -0
  976. package/dist/serve/worker/client/auth.js.map +1 -0
  977. package/dist/serve/worker/client/connection.d.ts +80 -0
  978. package/dist/serve/worker/client/connection.d.ts.map +1 -0
  979. package/dist/serve/worker/client/connection.js +148 -0
  980. package/dist/serve/worker/client/connection.js.map +1 -0
  981. package/dist/serve/worker/client/core.d.ts +109 -0
  982. package/dist/serve/worker/client/core.d.ts.map +1 -0
  983. package/dist/serve/worker/client/core.js +248 -0
  984. package/dist/serve/worker/client/core.js.map +1 -0
  985. package/dist/serve/worker/client/disconnect.d.ts +7 -0
  986. package/dist/serve/worker/client/disconnect.d.ts.map +1 -0
  987. package/dist/serve/worker/client/disconnect.js +26 -0
  988. package/dist/serve/worker/client/disconnect.js.map +1 -0
  989. package/dist/serve/worker/client/firestore-reads.d.ts +49 -0
  990. package/dist/serve/worker/client/firestore-reads.d.ts.map +1 -0
  991. package/dist/serve/worker/client/firestore-reads.js +139 -0
  992. package/dist/serve/worker/client/firestore-reads.js.map +1 -0
  993. package/dist/serve/worker/client/firestore-refs.d.ts +54 -0
  994. package/dist/serve/worker/client/firestore-refs.d.ts.map +1 -0
  995. package/dist/serve/worker/client/firestore-refs.js +167 -0
  996. package/dist/serve/worker/client/firestore-refs.js.map +1 -0
  997. package/dist/serve/worker/client/firestore-writes.d.ts +70 -0
  998. package/dist/serve/worker/client/firestore-writes.d.ts.map +1 -0
  999. package/dist/serve/worker/client/firestore-writes.js +169 -0
  1000. package/dist/serve/worker/client/firestore-writes.js.map +1 -0
  1001. package/dist/serve/worker/client/handles.d.ts +73 -0
  1002. package/dist/serve/worker/client/handles.d.ts.map +1 -0
  1003. package/dist/serve/worker/client/handles.js +4 -0
  1004. package/dist/serve/worker/client/handles.js.map +1 -0
  1005. package/dist/serve/worker/client/messaging.d.ts +16 -0
  1006. package/dist/serve/worker/client/messaging.d.ts.map +1 -0
  1007. package/dist/serve/worker/client/messaging.js +60 -0
  1008. package/dist/serve/worker/client/messaging.js.map +1 -0
  1009. package/dist/serve/worker/client/presence.d.ts +43 -0
  1010. package/dist/serve/worker/client/presence.d.ts.map +1 -0
  1011. package/dist/serve/worker/client/presence.js +132 -0
  1012. package/dist/serve/worker/client/presence.js.map +1 -0
  1013. package/dist/serve/worker/client/rtdb.d.ts +36 -0
  1014. package/dist/serve/worker/client/rtdb.d.ts.map +1 -0
  1015. package/dist/serve/worker/client/rtdb.js +241 -0
  1016. package/dist/serve/worker/client/rtdb.js.map +1 -0
  1017. package/dist/serve/worker/client/rules.d.ts +24 -0
  1018. package/dist/serve/worker/client/rules.d.ts.map +1 -0
  1019. package/dist/serve/worker/client/rules.js +44 -0
  1020. package/dist/serve/worker/client/rules.js.map +1 -0
  1021. package/dist/serve/worker/client/service-worker-connection.d.ts +3 -0
  1022. package/dist/serve/worker/client/service-worker-connection.d.ts.map +1 -0
  1023. package/dist/serve/worker/client/service-worker-connection.js +53 -0
  1024. package/dist/serve/worker/client/service-worker-connection.js.map +1 -0
  1025. package/dist/serve/worker/client/snapshots.d.ts +32 -0
  1026. package/dist/serve/worker/client/snapshots.d.ts.map +1 -0
  1027. package/dist/serve/worker/client/snapshots.js +46 -0
  1028. package/dist/serve/worker/client/snapshots.js.map +1 -0
  1029. package/dist/serve/worker/client/storage.d.ts +64 -0
  1030. package/dist/serve/worker/client/storage.d.ts.map +1 -0
  1031. package/dist/serve/worker/client/storage.js +125 -0
  1032. package/dist/serve/worker/client/storage.js.map +1 -0
  1033. package/dist/serve/worker/client/studio.d.ts +32 -0
  1034. package/dist/serve/worker/client/studio.d.ts.map +1 -0
  1035. package/dist/serve/worker/client/studio.js +61 -0
  1036. package/dist/serve/worker/client/studio.js.map +1 -0
  1037. package/dist/serve/worker/client.d.ts +43 -0
  1038. package/dist/serve/worker/client.d.ts.map +1 -0
  1039. package/dist/serve/worker/client.js +44 -0
  1040. package/dist/serve/worker/client.js.map +1 -0
  1041. package/dist/serve/worker/entry.d.ts +40 -0
  1042. package/dist/serve/worker/entry.d.ts.map +1 -0
  1043. package/dist/serve/worker/entry.js +144 -0
  1044. package/dist/serve/worker/entry.js.map +1 -0
  1045. package/dist/serve/worker/host/admin-firestore.d.ts +17 -0
  1046. package/dist/serve/worker/host/admin-firestore.d.ts.map +1 -0
  1047. package/dist/serve/worker/host/admin-firestore.js +92 -0
  1048. package/dist/serve/worker/host/admin-firestore.js.map +1 -0
  1049. package/dist/serve/worker/host/connection.d.ts +40 -0
  1050. package/dist/serve/worker/host/connection.d.ts.map +1 -0
  1051. package/dist/serve/worker/host/connection.js +153 -0
  1052. package/dist/serve/worker/host/connection.js.map +1 -0
  1053. package/dist/serve/worker/host/core.d.ts +159 -0
  1054. package/dist/serve/worker/host/core.d.ts.map +1 -0
  1055. package/dist/serve/worker/host/core.js +296 -0
  1056. package/dist/serve/worker/host/core.js.map +1 -0
  1057. package/dist/serve/worker/host/dispatch.d.ts +34 -0
  1058. package/dist/serve/worker/host/dispatch.d.ts.map +1 -0
  1059. package/dist/serve/worker/host/dispatch.js +267 -0
  1060. package/dist/serve/worker/host/dispatch.js.map +1 -0
  1061. package/dist/serve/worker/host/firestore-reads.d.ts +17 -0
  1062. package/dist/serve/worker/host/firestore-reads.d.ts.map +1 -0
  1063. package/dist/serve/worker/host/firestore-reads.js +108 -0
  1064. package/dist/serve/worker/host/firestore-reads.js.map +1 -0
  1065. package/dist/serve/worker/host/firestore-writes.d.ts +37 -0
  1066. package/dist/serve/worker/host/firestore-writes.d.ts.map +1 -0
  1067. package/dist/serve/worker/host/firestore-writes.js +409 -0
  1068. package/dist/serve/worker/host/firestore-writes.js.map +1 -0
  1069. package/dist/serve/worker/host/presence.d.ts +38 -0
  1070. package/dist/serve/worker/host/presence.d.ts.map +1 -0
  1071. package/dist/serve/worker/host/presence.js +280 -0
  1072. package/dist/serve/worker/host/presence.js.map +1 -0
  1073. package/dist/serve/worker/host/rtdb.d.ts +18 -0
  1074. package/dist/serve/worker/host/rtdb.d.ts.map +1 -0
  1075. package/dist/serve/worker/host/rtdb.js +128 -0
  1076. package/dist/serve/worker/host/rtdb.js.map +1 -0
  1077. package/dist/serve/worker/host/rules.d.ts +17 -0
  1078. package/dist/serve/worker/host/rules.d.ts.map +1 -0
  1079. package/dist/serve/worker/host/rules.js +118 -0
  1080. package/dist/serve/worker/host/rules.js.map +1 -0
  1081. package/dist/serve/worker/host/storage.d.ts +19 -0
  1082. package/dist/serve/worker/host/storage.d.ts.map +1 -0
  1083. package/dist/serve/worker/host/storage.js +260 -0
  1084. package/dist/serve/worker/host/storage.js.map +1 -0
  1085. package/dist/serve/worker/host/studio.d.ts +13 -0
  1086. package/dist/serve/worker/host/studio.d.ts.map +1 -0
  1087. package/dist/serve/worker/host/studio.js +30 -0
  1088. package/dist/serve/worker/host/studio.js.map +1 -0
  1089. package/dist/serve/worker/host/subscriptions.d.ts +21 -0
  1090. package/dist/serve/worker/host/subscriptions.d.ts.map +1 -0
  1091. package/dist/serve/worker/host/subscriptions.js +162 -0
  1092. package/dist/serve/worker/host/subscriptions.js.map +1 -0
  1093. package/dist/serve/worker/host-ai.d.ts +59 -0
  1094. package/dist/serve/worker/host-ai.d.ts.map +1 -0
  1095. package/dist/serve/worker/host-ai.js +158 -0
  1096. package/dist/serve/worker/host-ai.js.map +1 -0
  1097. package/dist/serve/worker/host-auth.d.ts +47 -0
  1098. package/dist/serve/worker/host-auth.d.ts.map +1 -0
  1099. package/dist/serve/worker/host-auth.js +464 -0
  1100. package/dist/serve/worker/host-auth.js.map +1 -0
  1101. package/dist/serve/worker/host-context.d.ts +220 -0
  1102. package/dist/serve/worker/host-context.d.ts.map +1 -0
  1103. package/dist/serve/worker/host-context.js +45 -0
  1104. package/dist/serve/worker/host-context.js.map +1 -0
  1105. package/dist/serve/worker/host-events.d.ts +21 -0
  1106. package/dist/serve/worker/host-events.d.ts.map +1 -0
  1107. package/dist/serve/worker/host-events.js +87 -0
  1108. package/dist/serve/worker/host-events.js.map +1 -0
  1109. package/dist/serve/worker/host-messaging.d.ts +60 -0
  1110. package/dist/serve/worker/host-messaging.d.ts.map +1 -0
  1111. package/dist/serve/worker/host-messaging.js +226 -0
  1112. package/dist/serve/worker/host-messaging.js.map +1 -0
  1113. package/dist/serve/worker/host.d.ts +36 -0
  1114. package/dist/serve/worker/host.d.ts.map +1 -0
  1115. package/dist/serve/worker/host.js +39 -0
  1116. package/dist/serve/worker/host.js.map +1 -0
  1117. package/dist/serve/worker/index.d.ts +22 -0
  1118. package/dist/serve/worker/index.d.ts.map +1 -0
  1119. package/dist/serve/worker/index.js +61 -0
  1120. package/dist/serve/worker/index.js.map +1 -0
  1121. package/dist/serve/worker/presence-timing.d.ts +14 -0
  1122. package/dist/serve/worker/presence-timing.d.ts.map +1 -0
  1123. package/dist/serve/worker/presence-timing.js +14 -0
  1124. package/dist/serve/worker/presence-timing.js.map +1 -0
  1125. package/dist/serve/worker/protocol.d.ts +1150 -0
  1126. package/dist/serve/worker/protocol.d.ts.map +1 -0
  1127. package/dist/serve/worker/protocol.js +228 -0
  1128. package/dist/serve/worker/protocol.js.map +1 -0
  1129. package/dist/serve/worker/serve-init.d.ts +201 -0
  1130. package/dist/serve/worker/serve-init.d.ts.map +1 -0
  1131. package/dist/serve/worker/serve-init.js +579 -0
  1132. package/dist/serve/worker/serve-init.js.map +1 -0
  1133. package/dist/serve/worker/service-worker-channel.d.ts +23 -0
  1134. package/dist/serve/worker/service-worker-channel.d.ts.map +1 -0
  1135. package/dist/serve/worker/service-worker-channel.js +9 -0
  1136. package/dist/serve/worker/service-worker-channel.js.map +1 -0
  1137. package/dist/serve/worker/service-worker-relay.d.ts +22 -0
  1138. package/dist/serve/worker/service-worker-relay.d.ts.map +1 -0
  1139. package/dist/serve/worker/service-worker-relay.js +63 -0
  1140. package/dist/serve/worker/service-worker-relay.js.map +1 -0
  1141. package/dist/serve/writer-lock.d.ts +32 -0
  1142. package/dist/serve/writer-lock.d.ts.map +1 -0
  1143. package/dist/serve/writer-lock.js +43 -0
  1144. package/dist/serve/writer-lock.js.map +1 -0
  1145. package/dist/verify/cases.d.ts +37 -0
  1146. package/dist/verify/cases.d.ts.map +1 -0
  1147. package/dist/verify/cases.js +173 -0
  1148. package/dist/verify/cases.js.map +1 -0
  1149. package/dist/verify/fixture.d.ts +100 -0
  1150. package/dist/verify/fixture.d.ts.map +1 -0
  1151. package/dist/verify/fixture.js +156 -0
  1152. package/dist/verify/fixture.js.map +1 -0
  1153. package/dist/verify/index.d.ts +102 -0
  1154. package/dist/verify/index.d.ts.map +1 -0
  1155. package/dist/verify/index.js +318 -0
  1156. package/dist/verify/index.js.map +1 -0
  1157. package/dist/verify/tools.d.ts +7 -0
  1158. package/dist/verify/tools.d.ts.map +1 -0
  1159. package/dist/verify/tools.js +83 -0
  1160. package/dist/verify/tools.js.map +1 -0
  1161. package/dist/version/compat-target.d.ts +18 -0
  1162. package/dist/version/compat-target.d.ts.map +1 -0
  1163. package/dist/version/compat-target.js +18 -0
  1164. package/dist/version/compat-target.js.map +1 -0
  1165. package/dist/vite.d.ts +12 -0
  1166. package/dist/vite.d.ts.map +1 -0
  1167. package/dist/vite.js +16 -0
  1168. package/dist/vite.js.map +1 -0
  1169. package/package.json +133 -0
@@ -0,0 +1,75 @@
1
+ # The runtime budget and shared gates
2
+
3
+ Firestore rules have two kinds of limits. Compilation limits fail loudly: a `400 INVALID_ARGUMENT` at deploy. The runtime evaluation budget fails silently: a `403 PERMISSION_DENIED` that looks identical to a denied rule.
4
+
5
+ The compile-time limits have exact values. The runtime limits do not. Everything on this page is researched and observed behavior discovered by Pyric's tooling, and it explains why the linter's thresholds look the way they do.
6
+
7
+ ## The exact limits
8
+
9
+ Three hard caps that Firebase enforces at deploy time:
10
+
11
+ - **256 KB source.** Exact byte limit. Anything longer is rejected outright.
12
+ - **Chain depth 98.** A flat `a && b && c && … && z` chain of length 99 or more refuses to compile. The limit is on chain depth, not total nodes: `(a && b) && (c && d)` has chain depth 1 of `&&`-of-`&&`s. Wrapping reduces depth.
13
+ - **11 let bindings per function.** A function with 12 lets fails to compile.
14
+
15
+ These were verified in production by deliberately building rulesets that crossed each threshold by one. The linter encodes the exact values; you get a clear error when you approach or hit them.
16
+
17
+ ## The hard limit
18
+
19
+ Beyond those three caps, every rule evaluation runs against a runtime budget. If the budget is exhausted, the engine denies the request with no diagnostic. The request looks identical to one your `allow` rule rejected. The exhaustion is silent, and silent failures are the worst kind to debug.
20
+
21
+ The budget is not a simple "you can evaluate N expressions" rule. Empirically:
22
+
23
+ - **One function call with 98 expressions** passes reliably (5/5 in our production tests).
24
+ - **Two function calls with 120 total expressions** passes reliably (5/5).
25
+ - **Two function calls with 130 total** is **flaky** (2/5 pass).
26
+ - **Three function calls with 60 total expressions** is **flaky** (2/5 pass).
27
+ - **Three function calls with 90 total** is mostly stable (4/5).
28
+
29
+ The pattern: function-call overhead dominates. Each call eats a non-trivial chunk of the budget. Three thin calls can fail where one fat call would succeed.
30
+
31
+ Reverse-engineering: `available = base − (call_count × call_overhead)`. We don't know `base` or `call_overhead` exactly. Firestore's evaluation has a non-deterministic flaky zone where the same ruleset will sometimes pass and sometimes fail. The linter's thresholds are deliberately conservative inside the flaky zone:
32
+
33
+ | Function calls in rule | Warn at | Error at |
34
+ |---|---|---|
35
+ | 1 or 2 | 100 expressions | 120 |
36
+ | 3 | 60 | 90 |
37
+ | 4+ | 40 | 60 |
38
+
39
+ These over-flag. Some rules in the flaky zone work in practice. The alternative is under-flagging and shipping rules that work in dev and fail under load.
40
+
41
+ ## Shared gates
42
+
43
+ Even with a single rule sitting comfortably inside its budget, two rules in the same match block can collectively blow it. This is the "shared gate" problem, and the linter's `SHARED_GATE` warning exists because it took an entire weekend of chess debugging to figure out.
44
+
45
+ The scenario: two `allow update` rules whose conditions both start with the same first expression, say `request.auth.uid == resource.data.host`. The engine evaluates each rule against the request. Even though only one rule actually applies, the prefix evaluation happens in both. If each rule's body is near the budget on its own, their combined evaluation crosses the line.
46
+
47
+ The fix is to give each rule a unique first expression, a discriminator. Instead of:
48
+
49
+ ```rules
50
+ allow update: if request.auth.uid == resource.data.host && validBigCheckA();
51
+ allow update: if request.auth.uid == resource.data.host && validBigCheckB();
52
+ ```
53
+
54
+ route on something distinct:
55
+
56
+ ```rules
57
+ allow update: if request.resource.data.moveType == 'A' && validBigCheckA();
58
+ allow update: if request.resource.data.moveType == 'B' && validBigCheckB();
59
+ ```
60
+
61
+ Now each rule short-circuits before its heavy body runs, and the engine doesn't end up evaluating both bodies in parallel.
62
+
63
+ The linter detects `SHARED_GATE` by computing a structural fingerprint of every rule's first expression and grouping by fingerprint. Two or more rules with the same fingerprint produce a warning.
64
+
65
+ ## Get-call costs
66
+
67
+ A separate hard limit applies to document reads from rules (`get(...)` and `exists(...)`): 10 per rule. The linter's `GET_COUNT` rule warns at 5 and errors at 10. Firestore caches same-path calls within a single rule evaluation, but only for the same path: `get(users/$(uid))` and `get(users/$(otherUid))` are two reads, not one.
68
+
69
+ `GET_DUPLICATION` catches a related agent failure mode: a helper function that internally calls `get()`, invoked multiple times from the same rule. The agent thinks it's calling a tidy abstraction; the engine sees N reads. The fix is to wrap the calls in a function that caches via a `let`.
70
+
71
+ ## Why the linter sometimes blocks the deploy
72
+
73
+ Most lint warnings are advisory. A handful are not: `SOURCE_SIZE`, `CHAIN_DEPTH` (above the band), `LET_LIMIT`, `GET_COUNT` (above 10), `PERMISSIVE_RULE`, `RECURSIVE_WILDCARD_OPEN`, `HALLUCINATED_METHOD`, `INVALID_OPERATOR`. Treat `severity: 'error'` as a hard gate before `firebase deploy`. The choice is deliberate: these are the categories where the cost of shipping the bad rule is high (a deploy that fails compilation; a publicly-readable database) and the cost of demanding a fix is low (the linter tells you exactly what's wrong).
74
+
75
+ `RULES_WEAKENED` is `warning`, not `error`. There are legitimate reasons to remove a predicate: a refactor, a dedupe, an intentional broadening. The signal is "review this", not "block the deploy".
@@ -0,0 +1,49 @@
1
+ <!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>The sentinel expression engine ($expr) · Pyric Studio</title><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.CQYSemvw.css"></head> <body> <header class="studio__bar"> <div class="studio__bar-inner"> <a class="studio__brand" href="/__pyric/ui/" aria-label="Pyric Studio">Pyric</a> <nav class="studio__nav" aria-label="Studio tabs"> <a class="studio__nav-tab" href="/__pyric/ui/"> Home </a><a class="studio__nav-tab" href="/__pyric/ui/firestore"> Firestore </a><a class="studio__nav-tab" href="/__pyric/ui/auth"> Auth </a><a class="studio__nav-tab" href="/__pyric/ui/rtdb"> RTDB </a><a class="studio__nav-tab" href="/__pyric/ui/storage"> Storage </a><a class="studio__nav-tab" href="/__pyric/ui/traffic"> Traffic </a><a class="studio__nav-tab" href="/__pyric/ui/settings"> Settings </a><a class="studio__nav-tab" href="/__pyric/ui/docs" aria-current="page"> Docs </a> </nav> </div> </header> <div class="docs-shell"> <details class="docs-nav-drawer"> <summary>Navigate</summary> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <script type="module">let i=null;function d(t){return i||(i=fetch(t).then(e=>e.json())),i}function l(t,e){return t.title.toLowerCase().includes(e)||t.excerpt.toLowerCase().includes(e)?!0:t.headings.some(r=>r.text.toLowerCase().includes(e))}function u(t,e,r){if(e.innerHTML="",t.length===0){e.hidden=!1;{const n=document.createElement("li");n.className="docs-search-empty",n.textContent="No matches",e.appendChild(n)}return}e.hidden=!1;for(const n of t.slice(0,8)){const s=document.createElement("li"),c=document.createElement("a");c.href=n.path;const o=document.createElement("span");o.className="docs-search-result-title",o.textContent=n.title;const a=document.createElement("span");a.className="docs-search-result-meta",a.textContent=[n.group,n.section].filter(Boolean).join(" / "),c.append(o,a),s.appendChild(c),e.appendChild(s)}}document.querySelectorAll(".docs-search").forEach(t=>{const e=t.dataset.indexUrl,r=t.querySelector(".docs-search-input"),n=t.querySelector(".docs-search-results");r.addEventListener("input",async()=>{const s=r.value.trim().toLowerCase();if(!s){n.hidden=!0,n.innerHTML="";return}const{pages:c}=await d(e);r.value.trim().toLowerCase()===s&&u(c.filter(o=>l(o,s)),n)}),r.addEventListener("focus",()=>{d(e),n.childElementCount>0&&(n.hidden=!1)}),r.addEventListener("keydown",s=>{s.key==="Escape"&&(r.value="",n.hidden=!0,n.innerHTML="",r.blur())}),r.addEventListener("blur",()=>{window.setTimeout(()=>{n.hidden=!0},150)})});document.addEventListener("keydown",t=>{if(!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="k")return;const e=[...document.querySelectorAll(".docs-search-input")].find(r=>r.offsetParent!==null);e&&(t.preventDefault(),e.focus(),e.select())});</script> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/"> Overview </a><details class="docs-nav-group"> <summary>Run locally</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/how-the-swap-works/"> How the swap works </a> </li><li> <a href="/__pyric/ui/docs/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Develop with Firebase APIs</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/sign-in-and-manage-users/"> Sign in and manage users </a> </li><li> <a href="/__pyric/ui/docs/store-and-query-data/"> Store and query data </a> </li><li> <a href="/__pyric/ui/docs/sync-realtime-data/"> Sync realtime data </a> </li><li> <a href="/__pyric/ui/docs/store-files/"> Store files </a> </li><li> <a href="/__pyric/ui/docs/receive-messages/"> Receive messages </a> </li><li> <a href="/__pyric/ui/docs/run-ai-logic-locally/"> Run AI Logic locally </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated/"> Run an RTDB function locally </a> </li><li> <a href="/__pyric/ui/docs/which-data-service/"> Which data service? </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Inspect and correct</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <h2 class="docs-nav-heading"> Inspect the sandbox </h2> <ul> <li> <a href="/__pyric/ui/docs/see-whats-happening/"> Traffic &amp; rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/shape-your-data/"> Seed, snapshot, replay </a> </li><li> <a href="/__pyric/ui/docs/watch-and-review/"> Review agent activity </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading"> Correct Security Rules </h2> <ul> <li> <a href="/__pyric/ui/docs/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/rules-patterns/"> Rules patterns </a> </li><li> <a href="/__pyric/ui/docs/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/whats-possible/"> Case studies </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading"> Work with an agent </h2> <ul> <li> <a href="/__pyric/ui/docs/what-your-agent-can-do/"> Work through an agent </a> </li><li> <a href="/__pyric/ui/docs/skills/"> Agent skills </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Verify the boundary</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-how-to-verify-against-a-captured-session/"> Verify a captured session </a> </li><li> <a href="/__pyric/ui/docs/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Ship unchanged</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/set-up-the-project/"> Set up the Firebase project </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/how-we-know-it-matches-firebase/"> Conformance </a> </li><li> <a href="/__pyric/ui/docs/whats-experimental/"> What&#39;s experimental </a> </li><li> <a href="/__pyric/ui/docs/pyric-conformance-scores/"> Conformance scores </a> </li><li> <a href="/__pyric/ui/docs/pyric-app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-compat/"> Rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-functions-rtdb-compat/"> Functions · RTDB </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" open> <summary>Reference</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli/"> @pyric/cli </a> </li><li> <a href="/__pyric/ui/docs/pyric-explanation-versioning-and-compatibility/"> pyric </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore/"> pyric / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules/" aria-current="true"> pyric / rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox/"> pyric / sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage/"> pyric / storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth/"> pyric / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database/"> pyric / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-app/"> pyric-admin / app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore/"> pyric-admin / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth/"> pyric-admin / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database/"> pyric-admin / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage/"> pyric-admin / storage </a> </li><li> <a href="/__pyric/ui/docs/ui/"> @pyric/ui </a> </li><li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div> </div> </details> </nav> </details> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/" id="nav-group-overview"> Overview </a><details class="docs-nav-group" id="nav-group-run-locally"> <summary>Run locally</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/how-the-swap-works/"> How the swap works </a> </li><li> <a href="/__pyric/ui/docs/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-develop-with-firebase-apis"> <summary>Develop with Firebase APIs</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/sign-in-and-manage-users/"> Sign in and manage users </a> </li><li> <a href="/__pyric/ui/docs/store-and-query-data/"> Store and query data </a> </li><li> <a href="/__pyric/ui/docs/sync-realtime-data/"> Sync realtime data </a> </li><li> <a href="/__pyric/ui/docs/store-files/"> Store files </a> </li><li> <a href="/__pyric/ui/docs/receive-messages/"> Receive messages </a> </li><li> <a href="/__pyric/ui/docs/run-ai-logic-locally/"> Run AI Logic locally </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated/"> Run an RTDB function locally </a> </li><li> <a href="/__pyric/ui/docs/which-data-service/"> Which data service? </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-inspect-and-correct"> <summary>Inspect and correct</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <h2 class="docs-nav-heading" id="nav-section-inspect-and-correct-inspect-the-sandbox"> Inspect the sandbox </h2> <ul> <li> <a href="/__pyric/ui/docs/see-whats-happening/"> Traffic &amp; rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/shape-your-data/"> Seed, snapshot, replay </a> </li><li> <a href="/__pyric/ui/docs/watch-and-review/"> Review agent activity </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading" id="nav-section-inspect-and-correct-correct-security-rules"> Correct Security Rules </h2> <ul> <li> <a href="/__pyric/ui/docs/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/rules-patterns/"> Rules patterns </a> </li><li> <a href="/__pyric/ui/docs/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/whats-possible/"> Case studies </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading" id="nav-section-inspect-and-correct-work-with-an-agent"> Work with an agent </h2> <ul> <li> <a href="/__pyric/ui/docs/what-your-agent-can-do/"> Work through an agent </a> </li><li> <a href="/__pyric/ui/docs/skills/"> Agent skills </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-verify-the-boundary"> <summary>Verify the boundary</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-how-to-verify-against-a-captured-session/"> Verify a captured session </a> </li><li> <a href="/__pyric/ui/docs/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-ship-unchanged"> <summary>Ship unchanged</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/set-up-the-project/"> Set up the Firebase project </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-conformance"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/how-we-know-it-matches-firebase/"> Conformance </a> </li><li> <a href="/__pyric/ui/docs/whats-experimental/"> What&#39;s experimental </a> </li><li> <a href="/__pyric/ui/docs/pyric-conformance-scores/"> Conformance scores </a> </li><li> <a href="/__pyric/ui/docs/pyric-app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-compat/"> Rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-functions-rtdb-compat/"> Functions · RTDB </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" id="nav-group-reference" open> <summary>Reference</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli/"> @pyric/cli </a> </li><li> <a href="/__pyric/ui/docs/pyric-explanation-versioning-and-compatibility/"> pyric </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore/"> pyric / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules/" aria-current="true"> pyric / rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox/"> pyric / sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage/"> pyric / storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth/"> pyric / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database/"> pyric / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-app/"> pyric-admin / app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore/"> pyric-admin / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth/"> pyric-admin / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database/"> pyric-admin / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage/"> pyric-admin / storage </a> </li><li> <a href="/__pyric/ui/docs/ui/"> @pyric/ui </a> </li><li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div> </div> </details> </nav> <main class="doc-main"> <nav class="docs-breadcrumbs" aria-label="Breadcrumb"> <ol> <li> <a href="/__pyric/ui/docs/pyric-rules/">pyric / rules</a> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span>Explanation</span> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span aria-current="page">Sentinel expression engine</span> </li> </ol> </nav> <article class="prose"> <h1 id="the-sentinel-expression-engine-expr">The sentinel expression engine (<code>$expr</code>)</h1>
2
+ <p>Firestore writes are usually concrete: <code>{ count: 5, owner: 'alice' }</code>. But sometimes you want a write whose value depends on the document at write time: “increment <code>count</code> by one if it’s less than 100”, “set <code>lastSeen</code> to the current request time”, “merge this list with the existing one and dedupe”. The Firestore SDK offers a handful of <code>FieldValue</code> sentinels for the most common cases (<code>increment</code>, <code>arrayUnion</code>, <code>serverTimestamp</code>), but anything outside that small set requires a transaction.</p>
3
+ <p>The sentinel expression engine extends that surface. It defines a tiny expression DSL that can appear anywhere in a write payload, wrapped as <code>{ $expr: '...' }</code>. At commit time, every wrapper is resolved against the current document, <em>before</em> the write hits the data plane. The result is a fully-concrete payload that Firestore stores normally.</p>
4
+ <p>The engine is small (a hand-written lexer, parser, evaluator) and intentionally separate from the Firestore rules grammar. It powers <code>pyric/sandbox</code>’s declarative transactions. This page explains the model.</p>
5
+ <h2 id="the-shape">The shape</h2>
6
+ <p>A wrapper is an object whose <em>only</em> key is <code>$expr</code> and whose value is a string:</p>
7
+ <pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">{ </span><span style="color:#E06C75">count</span><span style="color:#ABB2BF">: { </span><span style="color:#E06C75">$expr</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'doc.count + 1'</span><span style="color:#ABB2BF"> } }</span></span></code></pre>
8
+ <p>Anything else (extra keys alongside <code>$expr</code>, non-string <code>$expr</code> values, nested wrappers without proper shape) is rejected with <code>ExpressionWalkError</code>. The strict shape is deliberate: it makes the wrapper instantly recognisable when scanning a payload, and it prevents accidental collisions with field names.</p>
9
+ <h2 id="the-walker">The walker</h2>
10
+ <p><code>resolveExpressionsInData(data, env)</code> walks the payload tree once:</p>
11
+ <ul>
12
+ <li>For each plain object, it checks “is this a wrapper?”. If yes, evaluate the expression against <code>env</code> and use the result as the value.</li>
13
+ <li>For each non-wrapper object, recurse into its values.</li>
14
+ <li>For each array, preserve length and order; recurse into each element.</li>
15
+ <li>Leaves (primitives, <code>null</code>, sentinel passthroughs) are unchanged.</li>
16
+ </ul>
17
+ <p>The walker doesn’t recurse into eval results. If a <code>$expr</code> resolves to an object that itself contains a <code>$expr</code> key, that nested key is treated as data, not another wrapper. Without this rule, you’d have wrappers chained through document reads in non-obvious ways.</p>
18
+ <h2 id="the-dsl">The DSL</h2>
19
+ <p>The expression language has just enough surface to be useful and small enough to be safe:</p>
20
+ <ul>
21
+ <li><strong>Identifiers</strong> read from <code>env</code>: <code>doc</code>, <code>now</code>, <code>auth</code>. The environment is supplied by the caller; sandbox transactions populate it with the document under the write, the server time, and the auth context.</li>
22
+ <li><strong>Member access</strong>: <code>doc.count</code>, <code>auth.uid</code>.</li>
23
+ <li><strong>Numeric arithmetic</strong>: <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>%</code>.</li>
24
+ <li><strong>Comparison</strong>: <code>==</code>, <code>!=</code>, <code>&#x3C;</code>, <code>&#x3C;=</code>, <code>></code>, <code>>=</code>.</li>
25
+ <li><strong>Logical</strong>: <code>&#x26;&#x26;</code>, <code>||</code>, <code>!</code>.</li>
26
+ <li><strong>Ternary</strong>: <code>cond ? then : else</code>.</li>
27
+ <li><strong>Built-ins</strong>: a curated set. <code>min</code>, <code>max</code>, <code>concat</code>, <code>length</code>, plus deliberate omissions like <code>eval</code> and <code>fetch</code>.</li>
28
+ </ul>
29
+ <p>No I/O. No loops. No assignment. No function definitions. The DSL is intentionally not Turing-complete; the expression has to terminate in bounded time.</p>
30
+ <h2 id="why-a-separate-parser">Why a separate parser</h2>
31
+ <p>The rules grammar (the one in <code>FirestoreRules.ohm</code>) is much larger: imports, services, match blocks, allow statements, <code>is</code> expressions, path literals. Reusing it for <code>$expr</code> would buy nothing (rules-grammar features like <code>match</code> and <code>allow</code> are meaningless inside a payload) and would carry every rules-grammar quirk into the DSL. Worst case, a typo in <code>$expr</code> would produce an opaque parser error that mentioned <code>allow read: if</code>.</p>
32
+ <p>A hand-written lexer and parser stay small (a few hundred lines), produce focused error messages with <code>line:column</code> positions, and let us evolve the DSL without disturbing the rules language.</p>
33
+ <h2 id="error-model">Error model</h2>
34
+ <p>Three classes of failure, each with a distinct error type:</p>
35
+ <ul>
36
+ <li><strong><code>ExpressionWalkError</code></strong>: wrong wrapper shape. The walker found <code>$expr</code> alongside other keys, or with a non-string value. Carries a dotted <code>path</code> to the offending leaf.</li>
37
+ <li><strong><code>ExpressionLexError</code></strong>: the expression string contained characters the lexer doesn’t recognise. Carries a position.</li>
38
+ <li><strong><code>ExpressionParseError</code></strong>: the token stream didn’t form a valid expression. Carries a position.</li>
39
+ <li><strong><code>EvalError</code></strong>: the expression parsed but failed at runtime (missing identifier, type mismatch).</li>
40
+ </ul>
41
+ <p>The four types let tool authors translate each failure into a precise diagnostic: shape errors point at the payload, lex/parse errors point at the expression string, eval errors point at the runtime context.</p>
42
+ <h2 id="when-to-reach-for-expr">When to reach for <code>$expr</code></h2>
43
+ <p>The sandbox layer uses <code>$expr</code> in its declarative transaction API:</p>
44
+ <pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">await</span><span style="color:#E5C07B"> sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">firestore</span><span style="color:#ABB2BF">(</span><span style="color:#98C379">'/notes/n1'</span><span style="color:#ABB2BF">).</span><span style="color:#61AFEF">set</span><span style="color:#ABB2BF">({</span></span>
45
+ <span class="line"><span style="color:#E06C75"> count</span><span style="color:#ABB2BF">: { </span><span style="color:#E06C75">$expr</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'doc.count + 1'</span><span style="color:#ABB2BF"> },</span></span>
46
+ <span class="line"><span style="color:#E06C75"> lastSeen</span><span style="color:#ABB2BF">: { </span><span style="color:#E06C75">$expr</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'now'</span><span style="color:#ABB2BF"> },</span></span>
47
+ <span class="line"><span style="color:#ABB2BF">}, { </span><span style="color:#E06C75">merge</span><span style="color:#ABB2BF">: </span><span style="color:#D19A66">true</span><span style="color:#ABB2BF"> });</span></span></code></pre>
48
+ <p>Outside the sandbox, you generally don’t need it. The production Firestore data plane has <code>FieldValue.increment</code> and <code>FieldValue.serverTimestamp</code> for the common cases. The engine exists because the sandbox needs a way to express <em>any</em> depends-on-current-state write without each write becoming a four-step transaction.</p>
49
+ <p>If you’re building tooling that operates on <code>$expr</code>-bearing payloads (for example, a UI that displays pending writes), you’ll want <code>resolveExpressionsInData</code> and <code>tokenize</code> / <code>parse</code> to inspect the expressions before they resolve. Both are exported for that reason.</p> </article> </main> <aside class="doc-toc" aria-label="On this page"> <h2 class="doc-toc-heading">On this page</h2> <ul> <li data-depth="2"> <a href="#the-shape">The shape</a> </li><li data-depth="2"> <a href="#the-walker">The walker</a> </li><li data-depth="2"> <a href="#the-dsl">The DSL</a> </li><li data-depth="2"> <a href="#why-a-separate-parser">Why a separate parser</a> </li><li data-depth="2"> <a href="#error-model">Error model</a> </li><li data-depth="2"> <a href="#when-to-reach-for-expr">When to reach for $expr</a> </li> </ul> </aside> </div> <script type="module">const a=document.querySelector("[data-api-symbol-filter]"),d=[...document.querySelectorAll("[data-api-symbol-group]")],n=document.querySelector("[data-api-symbol-empty]");a?.addEventListener("input",()=>{const t=a.value.trim().toLowerCase();let o=0;for(const i of d){let e=0;i.querySelectorAll("[data-api-symbol]").forEach(l=>{const r=!t||(l.dataset.apiSymbol??"").includes(t);l.hidden=!r,r&&e++}),i.hidden=e===0,o+=e}n&&(n.hidden=o>0)});</script> <script type="module">const s=new Map;document.querySelectorAll('.doc-toc a[href^="#"]').forEach(t=>s.set(decodeURIComponent(t.hash.slice(1)),t));if(s.size>0){const t=new Set,n=()=>{let o=null;for(const e of s.keys())if(t.has(e)){o=e;break}s.forEach((e,c)=>e.classList.toggle("active",c===o))},r=new IntersectionObserver(o=>{for(const e of o)e.isIntersecting?t.add(e.target.id):t.delete(e.target.id);n()},{rootMargin:"-72px 0px -60% 0px"});s.forEach((o,e)=>{const c=document.getElementById(e);c&&r.observe(c)})}</script> <script type="module">document.querySelector('.studio__nav [aria-current="page"]')?.scrollIntoView({block:"nearest",inline:"center"});</script> </body> </html>
@@ -0,0 +1,74 @@
1
+ # The sentinel expression engine (`$expr`)
2
+
3
+ Firestore writes are usually concrete: `{ count: 5, owner: 'alice' }`. But sometimes you want a write whose value depends on the document at write time: "increment `count` by one if it's less than 100", "set `lastSeen` to the current request time", "merge this list with the existing one and dedupe". The Firestore SDK offers a handful of `FieldValue` sentinels for the most common cases (`increment`, `arrayUnion`, `serverTimestamp`), but anything outside that small set requires a transaction.
4
+
5
+ The sentinel expression engine extends that surface. It defines a tiny expression DSL that can appear anywhere in a write payload, wrapped as `{ $expr: '...' }`. At commit time, every wrapper is resolved against the current document, *before* the write hits the data plane. The result is a fully-concrete payload that Firestore stores normally.
6
+
7
+ The engine is small (a hand-written lexer, parser, evaluator) and intentionally separate from the Firestore rules grammar. It powers `pyric/sandbox`'s declarative transactions. This page explains the model.
8
+
9
+ ## The shape
10
+
11
+ A wrapper is an object whose *only* key is `$expr` and whose value is a string:
12
+
13
+ ```ts
14
+ { count: { $expr: 'doc.count + 1' } }
15
+ ```
16
+
17
+ Anything else (extra keys alongside `$expr`, non-string `$expr` values, nested wrappers without proper shape) is rejected with `ExpressionWalkError`. The strict shape is deliberate: it makes the wrapper instantly recognisable when scanning a payload, and it prevents accidental collisions with field names.
18
+
19
+ ## The walker
20
+
21
+ `resolveExpressionsInData(data, env)` walks the payload tree once:
22
+
23
+ - For each plain object, it checks "is this a wrapper?". If yes, evaluate the expression against `env` and use the result as the value.
24
+ - For each non-wrapper object, recurse into its values.
25
+ - For each array, preserve length and order; recurse into each element.
26
+ - Leaves (primitives, `null`, sentinel passthroughs) are unchanged.
27
+
28
+ The walker doesn't recurse into eval results. If a `$expr` resolves to an object that itself contains a `$expr` key, that nested key is treated as data, not another wrapper. Without this rule, you'd have wrappers chained through document reads in non-obvious ways.
29
+
30
+ ## The DSL
31
+
32
+ The expression language has just enough surface to be useful and small enough to be safe:
33
+
34
+ - **Identifiers** read from `env`: `doc`, `now`, `auth`. The environment is supplied by the caller; sandbox transactions populate it with the document under the write, the server time, and the auth context.
35
+ - **Member access**: `doc.count`, `auth.uid`.
36
+ - **Numeric arithmetic**: `+`, `-`, `*`, `/`, `%`.
37
+ - **Comparison**: `==`, `!=`, `<`, `<=`, `>`, `>=`.
38
+ - **Logical**: `&&`, `||`, `!`.
39
+ - **Ternary**: `cond ? then : else`.
40
+ - **Built-ins**: a curated set. `min`, `max`, `concat`, `length`, plus deliberate omissions like `eval` and `fetch`.
41
+
42
+ No I/O. No loops. No assignment. No function definitions. The DSL is intentionally not Turing-complete; the expression has to terminate in bounded time.
43
+
44
+ ## Why a separate parser
45
+
46
+ The rules grammar (the one in `FirestoreRules.ohm`) is much larger: imports, services, match blocks, allow statements, `is` expressions, path literals. Reusing it for `$expr` would buy nothing (rules-grammar features like `match` and `allow` are meaningless inside a payload) and would carry every rules-grammar quirk into the DSL. Worst case, a typo in `$expr` would produce an opaque parser error that mentioned `allow read: if`.
47
+
48
+ A hand-written lexer and parser stay small (a few hundred lines), produce focused error messages with `line:column` positions, and let us evolve the DSL without disturbing the rules language.
49
+
50
+ ## Error model
51
+
52
+ Three classes of failure, each with a distinct error type:
53
+
54
+ - **`ExpressionWalkError`**: wrong wrapper shape. The walker found `$expr` alongside other keys, or with a non-string value. Carries a dotted `path` to the offending leaf.
55
+ - **`ExpressionLexError`**: the expression string contained characters the lexer doesn't recognise. Carries a position.
56
+ - **`ExpressionParseError`**: the token stream didn't form a valid expression. Carries a position.
57
+ - **`EvalError`**: the expression parsed but failed at runtime (missing identifier, type mismatch).
58
+
59
+ The four types let tool authors translate each failure into a precise diagnostic: shape errors point at the payload, lex/parse errors point at the expression string, eval errors point at the runtime context.
60
+
61
+ ## When to reach for `$expr`
62
+
63
+ The sandbox layer uses `$expr` in its declarative transaction API:
64
+
65
+ ```ts
66
+ await sandbox.firestore('/notes/n1').set({
67
+ count: { $expr: 'doc.count + 1' },
68
+ lastSeen: { $expr: 'now' },
69
+ }, { merge: true });
70
+ ```
71
+
72
+ Outside the sandbox, you generally don't need it. The production Firestore data plane has `FieldValue.increment` and `FieldValue.serverTimestamp` for the common cases. The engine exists because the sandbox needs a way to express *any* depends-on-current-state write without each write becoming a four-step transaction.
73
+
74
+ If you're building tooling that operates on `$expr`-bearing payloads (for example, a UI that displays pending writes), you'll want `resolveExpressionsInData` and `tokenize` / `parse` to inspect the expressions before they resolve. Both are exported for that reason.
@@ -0,0 +1,95 @@
1
+ <!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Simulator vs Rules Test API · Pyric Studio</title><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.CQYSemvw.css"></head> <body> <header class="studio__bar"> <div class="studio__bar-inner"> <a class="studio__brand" href="/__pyric/ui/" aria-label="Pyric Studio">Pyric</a> <nav class="studio__nav" aria-label="Studio tabs"> <a class="studio__nav-tab" href="/__pyric/ui/"> Home </a><a class="studio__nav-tab" href="/__pyric/ui/firestore"> Firestore </a><a class="studio__nav-tab" href="/__pyric/ui/auth"> Auth </a><a class="studio__nav-tab" href="/__pyric/ui/rtdb"> RTDB </a><a class="studio__nav-tab" href="/__pyric/ui/storage"> Storage </a><a class="studio__nav-tab" href="/__pyric/ui/traffic"> Traffic </a><a class="studio__nav-tab" href="/__pyric/ui/settings"> Settings </a><a class="studio__nav-tab" href="/__pyric/ui/docs" aria-current="page"> Docs </a> </nav> </div> </header> <div class="docs-shell"> <details class="docs-nav-drawer"> <summary>Navigate</summary> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <script type="module">let i=null;function d(t){return i||(i=fetch(t).then(e=>e.json())),i}function l(t,e){return t.title.toLowerCase().includes(e)||t.excerpt.toLowerCase().includes(e)?!0:t.headings.some(r=>r.text.toLowerCase().includes(e))}function u(t,e,r){if(e.innerHTML="",t.length===0){e.hidden=!1;{const n=document.createElement("li");n.className="docs-search-empty",n.textContent="No matches",e.appendChild(n)}return}e.hidden=!1;for(const n of t.slice(0,8)){const s=document.createElement("li"),c=document.createElement("a");c.href=n.path;const o=document.createElement("span");o.className="docs-search-result-title",o.textContent=n.title;const a=document.createElement("span");a.className="docs-search-result-meta",a.textContent=[n.group,n.section].filter(Boolean).join(" / "),c.append(o,a),s.appendChild(c),e.appendChild(s)}}document.querySelectorAll(".docs-search").forEach(t=>{const e=t.dataset.indexUrl,r=t.querySelector(".docs-search-input"),n=t.querySelector(".docs-search-results");r.addEventListener("input",async()=>{const s=r.value.trim().toLowerCase();if(!s){n.hidden=!0,n.innerHTML="";return}const{pages:c}=await d(e);r.value.trim().toLowerCase()===s&&u(c.filter(o=>l(o,s)),n)}),r.addEventListener("focus",()=>{d(e),n.childElementCount>0&&(n.hidden=!1)}),r.addEventListener("keydown",s=>{s.key==="Escape"&&(r.value="",n.hidden=!0,n.innerHTML="",r.blur())}),r.addEventListener("blur",()=>{window.setTimeout(()=>{n.hidden=!0},150)})});document.addEventListener("keydown",t=>{if(!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="k")return;const e=[...document.querySelectorAll(".docs-search-input")].find(r=>r.offsetParent!==null);e&&(t.preventDefault(),e.focus(),e.select())});</script> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/"> Overview </a><details class="docs-nav-group"> <summary>Run locally</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/how-the-swap-works/"> How the swap works </a> </li><li> <a href="/__pyric/ui/docs/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Develop with Firebase APIs</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/sign-in-and-manage-users/"> Sign in and manage users </a> </li><li> <a href="/__pyric/ui/docs/store-and-query-data/"> Store and query data </a> </li><li> <a href="/__pyric/ui/docs/sync-realtime-data/"> Sync realtime data </a> </li><li> <a href="/__pyric/ui/docs/store-files/"> Store files </a> </li><li> <a href="/__pyric/ui/docs/receive-messages/"> Receive messages </a> </li><li> <a href="/__pyric/ui/docs/run-ai-logic-locally/"> Run AI Logic locally </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated/"> Run an RTDB function locally </a> </li><li> <a href="/__pyric/ui/docs/which-data-service/"> Which data service? </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Inspect and correct</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <h2 class="docs-nav-heading"> Inspect the sandbox </h2> <ul> <li> <a href="/__pyric/ui/docs/see-whats-happening/"> Traffic &amp; rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/shape-your-data/"> Seed, snapshot, replay </a> </li><li> <a href="/__pyric/ui/docs/watch-and-review/"> Review agent activity </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading"> Correct Security Rules </h2> <ul> <li> <a href="/__pyric/ui/docs/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/rules-patterns/"> Rules patterns </a> </li><li> <a href="/__pyric/ui/docs/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/whats-possible/"> Case studies </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading"> Work with an agent </h2> <ul> <li> <a href="/__pyric/ui/docs/what-your-agent-can-do/"> Work through an agent </a> </li><li> <a href="/__pyric/ui/docs/skills/"> Agent skills </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Verify the boundary</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-how-to-verify-against-a-captured-session/"> Verify a captured session </a> </li><li> <a href="/__pyric/ui/docs/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Ship unchanged</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/set-up-the-project/"> Set up the Firebase project </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/how-we-know-it-matches-firebase/"> Conformance </a> </li><li> <a href="/__pyric/ui/docs/whats-experimental/"> What&#39;s experimental </a> </li><li> <a href="/__pyric/ui/docs/pyric-conformance-scores/"> Conformance scores </a> </li><li> <a href="/__pyric/ui/docs/pyric-app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-compat/"> Rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-functions-rtdb-compat/"> Functions · RTDB </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" open> <summary>Reference</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli/"> @pyric/cli </a> </li><li> <a href="/__pyric/ui/docs/pyric-explanation-versioning-and-compatibility/"> pyric </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore/"> pyric / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules/" aria-current="true"> pyric / rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox/"> pyric / sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage/"> pyric / storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth/"> pyric / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database/"> pyric / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-app/"> pyric-admin / app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore/"> pyric-admin / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth/"> pyric-admin / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database/"> pyric-admin / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage/"> pyric-admin / storage </a> </li><li> <a href="/__pyric/ui/docs/ui/"> @pyric/ui </a> </li><li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div> </div> </details> </nav> </details> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/" id="nav-group-overview"> Overview </a><details class="docs-nav-group" id="nav-group-run-locally"> <summary>Run locally</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/how-the-swap-works/"> How the swap works </a> </li><li> <a href="/__pyric/ui/docs/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-develop-with-firebase-apis"> <summary>Develop with Firebase APIs</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/sign-in-and-manage-users/"> Sign in and manage users </a> </li><li> <a href="/__pyric/ui/docs/store-and-query-data/"> Store and query data </a> </li><li> <a href="/__pyric/ui/docs/sync-realtime-data/"> Sync realtime data </a> </li><li> <a href="/__pyric/ui/docs/store-files/"> Store files </a> </li><li> <a href="/__pyric/ui/docs/receive-messages/"> Receive messages </a> </li><li> <a href="/__pyric/ui/docs/run-ai-logic-locally/"> Run AI Logic locally </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-how-to-run-rtdb-onvaluecreated/"> Run an RTDB function locally </a> </li><li> <a href="/__pyric/ui/docs/which-data-service/"> Which data service? </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-inspect-and-correct"> <summary>Inspect and correct</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <h2 class="docs-nav-heading" id="nav-section-inspect-and-correct-inspect-the-sandbox"> Inspect the sandbox </h2> <ul> <li> <a href="/__pyric/ui/docs/see-whats-happening/"> Traffic &amp; rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/shape-your-data/"> Seed, snapshot, replay </a> </li><li> <a href="/__pyric/ui/docs/watch-and-review/"> Review agent activity </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading" id="nav-section-inspect-and-correct-correct-security-rules"> Correct Security Rules </h2> <ul> <li> <a href="/__pyric/ui/docs/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/rules-patterns/"> Rules patterns </a> </li><li> <a href="/__pyric/ui/docs/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/whats-possible/"> Case studies </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading" id="nav-section-inspect-and-correct-work-with-an-agent"> Work with an agent </h2> <ul> <li> <a href="/__pyric/ui/docs/what-your-agent-can-do/"> Work through an agent </a> </li><li> <a href="/__pyric/ui/docs/skills/"> Agent skills </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-verify-the-boundary"> <summary>Verify the boundary</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-how-to-verify-against-a-captured-session/"> Verify a captured session </a> </li><li> <a href="/__pyric/ui/docs/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-ship-unchanged"> <summary>Ship unchanged</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/set-up-the-project/"> Set up the Firebase project </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-conformance"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/how-we-know-it-matches-firebase/"> Conformance </a> </li><li> <a href="/__pyric/ui/docs/whats-experimental/"> What&#39;s experimental </a> </li><li> <a href="/__pyric/ui/docs/pyric-conformance-scores/"> Conformance scores </a> </li><li> <a href="/__pyric/ui/docs/pyric-app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-compat/"> Rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-functions-rtdb-compat/"> Functions · RTDB </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" id="nav-group-reference" open> <summary>Reference</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli/"> @pyric/cli </a> </li><li> <a href="/__pyric/ui/docs/pyric-explanation-versioning-and-compatibility/"> pyric </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore/"> pyric / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules/" aria-current="true"> pyric / rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox/"> pyric / sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage/"> pyric / storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth/"> pyric / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-database/"> pyric / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-app/"> pyric-admin / app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore/"> pyric-admin / firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth/"> pyric-admin / auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database/"> pyric-admin / database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage/"> pyric-admin / storage </a> </li><li> <a href="/__pyric/ui/docs/ui/"> @pyric/ui </a> </li><li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div> </div> </details> </nav> <main class="doc-main"> <nav class="docs-breadcrumbs" aria-label="Breadcrumb"> <ol> <li> <a href="/__pyric/ui/docs/pyric-rules/">pyric / rules</a> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span>Explanation</span> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span aria-current="page">Simulator vs Rules Test API</span> </li> </ol> </nav> <article class="prose"> <h1 id="simulator-vs-rules-test-api">Simulator vs Rules Test API</h1>
2
+ <p>Two surfaces evaluate rules against test cases. Underneath, they share a case shape and a result vocabulary; they disagree on tradeoffs. Choosing between them is a deliberate decision, not an implementation detail.</p>
3
+ <h2 id="the-shared-surface">The shared surface</h2>
4
+ <p>The public front door only fronts one of the two: <code>firestoreRules(source).simulate(cases)</code> runs the local simulator, takes <code>FirestoreCase[]</code>, and returns a <code>SimulationSummary</code> (<code>{ passed, failed, unsupported, cases: CaseResult[] }</code>) that never carries a thrown-error branch, since a parse failure already threw <code>RulesCompileError</code> at construction.</p>
5
+ <p>The Rules Test API has no public front door yet. Both engines still share their case and result vocabulary one level down, on <code>pyric/rules/internal</code>: <code>TestFirestoreRulesHandler.execute</code> (the Rules Test API client) and the internal <code>SimulateFirestoreRulesHandler.simulate</code> both take a rules source and a list of <code>TestCase</code> objects (the same shape as the public <code>FirestoreCase</code>), and both return a <code>TestFirestoreRulesResult</code>:</p>
6
+ <pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> TestFirestoreRulesResult</span><span style="color:#56B6C2"> =</span></span>
7
+ <span class="line"><span style="color:#ABB2BF"> | { </span><span style="color:#E06C75">success</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">true</span><span style="color:#ABB2BF">; </span><span style="color:#E06C75">data</span><span style="color:#ABB2BF">: { </span><span style="color:#E06C75">passed</span><span style="color:#ABB2BF">; </span><span style="color:#E06C75">failed</span><span style="color:#ABB2BF">; </span><span style="color:#E06C75">unsupported</span><span style="color:#ABB2BF">; </span><span style="color:#E06C75">results</span><span style="color:#ABB2BF"> } }</span></span>
8
+ <span class="line"><span style="color:#ABB2BF"> | { </span><span style="color:#E06C75">success</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">false</span><span style="color:#ABB2BF">; </span><span style="color:#E06C75">error</span><span style="color:#ABB2BF">: { </span><span style="color:#E06C75">code</span><span style="color:#ABB2BF">; </span><span style="color:#E06C75">message</span><span style="color:#ABB2BF">; </span><span style="color:#E06C75">recoverable</span><span style="color:#ABB2BF"> } };</span></span></code></pre>
9
+ <p>Each <code>TestResult</code> in <code>results</code> carries <code>description</code>, <code>expectation</code>, <code>state</code>, and <code>debugMessages</code>. The <code>state</code> is <code>'PASSED' | 'FAILED' | 'UNSUPPORTED'</code>.</p>
10
+ <p>The shared internal shape is a feature. You can swap one internal handler for the other, or route the same test suite to both, without rewriting any test-case code. See <a href="../pyric-rules-how-to-test-rules-against-firebase/">How to test rules against the Firebase Rules Test API</a> for the escalation pattern built on the public <code>simulate</code> plus the internal test-API client.</p>
11
+ <h2 id="what-they-disagree-on">What they disagree on</h2>
12
+ <div class="table-scroll">
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+ <table><thead><tr><th>Axis</th><th>Local simulator</th><th>Rules Test API</th></tr></thead><tbody><tr><td>Where it runs</td><td>In-process</td><td>Google’s servers</td></tr><tr><td>Latency per call</td><td>Sub-millisecond</td><td>Tens to hundreds of milliseconds</td></tr><tr><td>Credentials required</td><td>None</td><td><code>ProjectScope</code> with <code>firebaserules.releases.test</code></td></tr><tr><td>Parity with production</td><td>Close, not bit-for-bit</td><td>Bit-for-bit</td></tr><tr><td>Returns <code>UNSUPPORTED</code>?</td><td>Yes, when it hits an unimplemented feature</td><td>Never</td></tr><tr><td>Side effects</td><td>None</td><td>None (the API evaluates, it doesn’t deploy)</td></tr><tr><td>Cost</td><td>Free</td><td>Costs of the Cloud API call</td></tr></tbody></table></div>
58
+ <h2 id="when-the-simulator-returns-unsupported">When the simulator returns <code>UNSUPPORTED</code></h2>
59
+ <p>The local simulator implements most of the rules language: literals, identifiers, member access, method calls, all the binary and unary operators, function definitions with let bindings, all the standard built-ins (<code>get</code>, <code>exists</code>, <code>getAfter</code>, <code>existsAfter</code>, <code>debug</code>, <code>request.auth</code>, <code>request.resource</code>, <code>resource</code>, path literals, the type-test <code>is</code> operator). It does <strong>not</strong> implement every namespace method on every wrapper type. <code>duration.value(...).abs()</code> works, some less-common <code>bytes</code> arithmetic does not.</p>
60
+ <p>When the evaluator hits a method or operation it doesn’t model, it throws <code>UnsupportedError</code> rather than guessing. The handler catches that and surfaces it as an abstention: <code>state: 'UNSUPPORTED'</code> internally, <code>unsupported: true</code> on the public <code>CaseResult</code>. The semantics is “the gap is on my side, not yours”. An unsupported case is <strong>not</strong> counted as a failure: <code>failed</code> and <code>unsupported</code> are separate counters on both the internal result and the public <code>SimulationSummary</code>.</p>
61
+ <p>The right response to <code>UNSUPPORTED</code> depends on context:</p>
62
+ <ul>
63
+ <li><strong>Agent loops</strong> can treat <code>UNSUPPORTED</code> as “don’t know, ask the API”. A common pattern is to run locally first, then escalate only the unsupported subset to the live API.</li>
64
+ <li><strong>CI</strong> can treat <code>UNSUPPORTED</code> as a build-time signal: “this rule uses a feature the simulator doesn’t model, so switch this case to the live API or restructure the rule”.</li>
65
+ <li><strong>Local development</strong> can ignore <code>UNSUPPORTED</code> until the rule is otherwise correct, then verify against the API once.</li>
66
+ </ul>
67
+ <h2 id="when-the-simulator-is-wrong">When the simulator is wrong</h2>
68
+ <p>It does happen. The simulator is a re-implementation of the rules engine, not a transcription. Areas where production has surprised us:</p>
69
+ <ul>
70
+ <li><strong>Timestamp precision</strong>: <code>request.time</code> in production has nanosecond precision; our <code>Timestamp</code> wrapper carries it, but agents that round to milliseconds in their test data can produce <code>request.time != data.createdAt</code> when production would say they’re equal.</li>
71
+ <li><strong>Map field access on absent keys</strong>: production’s behaviour on <code>request.resource.data.maybeAbsent.subfield</code> has edge cases around the absent-vs-null distinction that we approximate. Tests that depend on this should run against the live API.</li>
72
+ <li><strong><code>getAfter()</code> projection corners</strong>: we project the post-write document using <code>projectAfterState</code>, which mirrors the admin SDK’s merge semantics. Production’s projection is implementation-defined.</li>
73
+ </ul>
74
+ <p>When the simulator and the API disagree, we treat the API as authoritative and fix the simulator. The integration test suite (<code>parity-stress-integration.test.ts</code>) deliberately runs both against the same cases to catch drift.</p>
75
+ <h2 id="when-to-prefer-each">When to prefer each</h2>
76
+ <p><strong>Reach for the simulator first</strong> when:</p>
77
+ <ul>
78
+ <li>You’re iterating on a rule and want fast feedback.</li>
79
+ <li>You don’t have credentials (browser sandbox, local dev, untrusted CI).</li>
80
+ <li>You’re testing hundreds of cases and the API would be cost-prohibitive.</li>
81
+ </ul>
82
+ <p><strong>Reach for the test API</strong> when:</p>
83
+ <ul>
84
+ <li>The simulator returned <code>UNSUPPORTED</code> for cases you need verdicts on.</li>
85
+ <li>You’re at the end of a deploy pipeline and want absolute parity.</li>
86
+ <li>You’re investigating a production discrepancy.</li>
87
+ </ul>
88
+ <p>The fastest agent loops use simulator-first with <code>UNSUPPORTED</code> escalation:</p>
89
+ <pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> local</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> firestoreRules</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">source</span><span style="color:#ABB2BF">).</span><span style="color:#61AFEF">simulate</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">testCases</span><span style="color:#ABB2BF">);</span></span>
90
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> escalate</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> local</span><span style="color:#ABB2BF">.</span><span style="color:#E5C07B">cases</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">filter</span><span style="color:#ABB2BF">((</span><span style="color:#E06C75;font-style:italic">c</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> c</span><span style="color:#ABB2BF">.</span><span style="color:#E06C75">unsupported</span><span style="color:#ABB2BF">).</span><span style="color:#61AFEF">map</span><span style="color:#ABB2BF">((</span><span style="color:#E06C75;font-style:italic">c</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> c</span><span style="color:#ABB2BF">.</span><span style="color:#E06C75">case</span><span style="color:#ABB2BF">);</span></span>
91
+ <span class="line"><span style="color:#C678DD">if</span><span style="color:#ABB2BF"> (</span><span style="color:#E5C07B">escalate</span><span style="color:#ABB2BF">.</span><span style="color:#E06C75">length</span><span style="color:#56B6C2"> ></span><span style="color:#D19A66"> 0</span><span style="color:#ABB2BF">) {</span></span>
92
+ <span class="line"><span style="color:#C678DD"> const</span><span style="color:#E5C07B"> remote</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> await</span><span style="color:#E5C07B"> api</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">execute</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">scope</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">source</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">escalate</span><span style="color:#ABB2BF">);</span></span>
93
+ <span class="line"><span style="color:#7F848E;font-style:italic"> // merge remote.data.results back into local.cases by matching case</span></span>
94
+ <span class="line"><span style="color:#ABB2BF">}</span></span></code></pre>
95
+ <p>Local-first keeps the inner loop in sub-millisecond territory; the API is only paid when the simulator genuinely can’t decide.</p> </article> </main> <aside class="doc-toc" aria-label="On this page"> <h2 class="doc-toc-heading">On this page</h2> <ul> <li data-depth="2"> <a href="#the-shared-surface">The shared surface</a> </li><li data-depth="2"> <a href="#what-they-disagree-on">What they disagree on</a> </li><li data-depth="2"> <a href="#when-the-simulator-returns-unsupported">When the simulator returns UNSUPPORTED</a> </li><li data-depth="2"> <a href="#when-the-simulator-is-wrong">When the simulator is wrong</a> </li><li data-depth="2"> <a href="#when-to-prefer-each">When to prefer each</a> </li> </ul> </aside> </div> <script type="module">const a=document.querySelector("[data-api-symbol-filter]"),d=[...document.querySelectorAll("[data-api-symbol-group]")],n=document.querySelector("[data-api-symbol-empty]");a?.addEventListener("input",()=>{const t=a.value.trim().toLowerCase();let o=0;for(const i of d){let e=0;i.querySelectorAll("[data-api-symbol]").forEach(l=>{const r=!t||(l.dataset.apiSymbol??"").includes(t);l.hidden=!r,r&&e++}),i.hidden=e===0,o+=e}n&&(n.hidden=o>0)});</script> <script type="module">const s=new Map;document.querySelectorAll('.doc-toc a[href^="#"]').forEach(t=>s.set(decodeURIComponent(t.hash.slice(1)),t));if(s.size>0){const t=new Set,n=()=>{let o=null;for(const e of s.keys())if(t.has(e)){o=e;break}s.forEach((e,c)=>e.classList.toggle("active",c===o))},r=new IntersectionObserver(o=>{for(const e of o)e.isIntersecting?t.add(e.target.id):t.delete(e.target.id);n()},{rootMargin:"-72px 0px -60% 0px"});s.forEach((o,e)=>{const c=document.getElementById(e);c&&r.observe(c)})}</script> <script type="module">document.querySelector('.studio__nav [aria-current="page"]')?.scrollIntoView({block:"nearest",inline:"center"});</script> </body> </html>
@@ -0,0 +1,80 @@
1
+ # Simulator vs Rules Test API
2
+
3
+ Two surfaces evaluate rules against test cases. Underneath, they share a case shape and a result vocabulary; they disagree on tradeoffs. Choosing between them is a deliberate decision, not an implementation detail.
4
+
5
+ ## The shared surface
6
+
7
+ The public front door only fronts one of the two: `firestoreRules(source).simulate(cases)` runs the local simulator, takes `FirestoreCase[]`, and returns a `SimulationSummary` (`{ passed, failed, unsupported, cases: CaseResult[] }`) that never carries a thrown-error branch, since a parse failure already threw `RulesCompileError` at construction.
8
+
9
+ The Rules Test API has no public front door yet. Both engines still share their case and result vocabulary one level down, on `pyric/rules/internal`: `TestFirestoreRulesHandler.execute` (the Rules Test API client) and the internal `SimulateFirestoreRulesHandler.simulate` both take a rules source and a list of `TestCase` objects (the same shape as the public `FirestoreCase`), and both return a `TestFirestoreRulesResult`:
10
+
11
+ ```ts
12
+ type TestFirestoreRulesResult =
13
+ | { success: true; data: { passed; failed; unsupported; results } }
14
+ | { success: false; error: { code; message; recoverable } };
15
+ ```
16
+
17
+ Each `TestResult` in `results` carries `description`, `expectation`, `state`, and `debugMessages`. The `state` is `'PASSED' | 'FAILED' | 'UNSUPPORTED'`.
18
+
19
+ The shared internal shape is a feature. You can swap one internal handler for the other, or route the same test suite to both, without rewriting any test-case code. See [How to test rules against the Firebase Rules Test API](../pyric-rules-how-to-test-rules-against-firebase/) for the escalation pattern built on the public `simulate` plus the internal test-API client.
20
+
21
+ ## What they disagree on
22
+
23
+ | Axis | Local simulator | Rules Test API |
24
+ |---|---|---|
25
+ | Where it runs | In-process | Google's servers |
26
+ | Latency per call | Sub-millisecond | Tens to hundreds of milliseconds |
27
+ | Credentials required | None | `ProjectScope` with `firebaserules.releases.test` |
28
+ | Parity with production | Close, not bit-for-bit | Bit-for-bit |
29
+ | Returns `UNSUPPORTED`? | Yes, when it hits an unimplemented feature | Never |
30
+ | Side effects | None | None (the API evaluates, it doesn't deploy) |
31
+ | Cost | Free | Costs of the Cloud API call |
32
+
33
+ ## When the simulator returns `UNSUPPORTED`
34
+
35
+ The local simulator implements most of the rules language: literals, identifiers, member access, method calls, all the binary and unary operators, function definitions with let bindings, all the standard built-ins (`get`, `exists`, `getAfter`, `existsAfter`, `debug`, `request.auth`, `request.resource`, `resource`, path literals, the type-test `is` operator). It does **not** implement every namespace method on every wrapper type. `duration.value(...).abs()` works, some less-common `bytes` arithmetic does not.
36
+
37
+ When the evaluator hits a method or operation it doesn't model, it throws `UnsupportedError` rather than guessing. The handler catches that and surfaces it as an abstention: `state: 'UNSUPPORTED'` internally, `unsupported: true` on the public `CaseResult`. The semantics is "the gap is on my side, not yours". An unsupported case is **not** counted as a failure: `failed` and `unsupported` are separate counters on both the internal result and the public `SimulationSummary`.
38
+
39
+ The right response to `UNSUPPORTED` depends on context:
40
+
41
+ - **Agent loops** can treat `UNSUPPORTED` as "don't know, ask the API". A common pattern is to run locally first, then escalate only the unsupported subset to the live API.
42
+ - **CI** can treat `UNSUPPORTED` as a build-time signal: "this rule uses a feature the simulator doesn't model, so switch this case to the live API or restructure the rule".
43
+ - **Local development** can ignore `UNSUPPORTED` until the rule is otherwise correct, then verify against the API once.
44
+
45
+ ## When the simulator is wrong
46
+
47
+ It does happen. The simulator is a re-implementation of the rules engine, not a transcription. Areas where production has surprised us:
48
+
49
+ - **Timestamp precision**: `request.time` in production has nanosecond precision; our `Timestamp` wrapper carries it, but agents that round to milliseconds in their test data can produce `request.time != data.createdAt` when production would say they're equal.
50
+ - **Map field access on absent keys**: production's behaviour on `request.resource.data.maybeAbsent.subfield` has edge cases around the absent-vs-null distinction that we approximate. Tests that depend on this should run against the live API.
51
+ - **`getAfter()` projection corners**: we project the post-write document using `projectAfterState`, which mirrors the admin SDK's merge semantics. Production's projection is implementation-defined.
52
+
53
+ When the simulator and the API disagree, we treat the API as authoritative and fix the simulator. The integration test suite (`parity-stress-integration.test.ts`) deliberately runs both against the same cases to catch drift.
54
+
55
+ ## When to prefer each
56
+
57
+ **Reach for the simulator first** when:
58
+
59
+ - You're iterating on a rule and want fast feedback.
60
+ - You don't have credentials (browser sandbox, local dev, untrusted CI).
61
+ - You're testing hundreds of cases and the API would be cost-prohibitive.
62
+
63
+ **Reach for the test API** when:
64
+
65
+ - The simulator returned `UNSUPPORTED` for cases you need verdicts on.
66
+ - You're at the end of a deploy pipeline and want absolute parity.
67
+ - You're investigating a production discrepancy.
68
+
69
+ The fastest agent loops use simulator-first with `UNSUPPORTED` escalation:
70
+
71
+ ```ts
72
+ const local = firestoreRules(source).simulate(testCases);
73
+ const escalate = local.cases.filter((c) => c.unsupported).map((c) => c.case);
74
+ if (escalate.length > 0) {
75
+ const remote = await api.execute(scope, source, escalate);
76
+ // merge remote.data.results back into local.cases by matching case
77
+ }
78
+ ```
79
+
80
+ Local-first keeps the inner loop in sub-millisecond territory; the API is only paid when the simulator genuinely can't decide.