@venizia/ignis-atlas 0.1.0-1

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 (436) hide show
  1. package/LICENSE.md +104 -0
  2. package/README.md +144 -0
  3. package/dist/cjs/cli/modes.d.ts +29 -0
  4. package/dist/cjs/cli/modes.d.ts.map +1 -0
  5. package/dist/cjs/cli/modes.js +70 -0
  6. package/dist/cjs/cli/modes.js.map +1 -0
  7. package/dist/cjs/cli.d.ts +3 -0
  8. package/dist/cjs/cli.d.ts.map +1 -0
  9. package/dist/cjs/cli.js +60 -0
  10. package/dist/cjs/cli.js.map +1 -0
  11. package/dist/cjs/common/constants.d.ts +22 -0
  12. package/dist/cjs/common/constants.d.ts.map +1 -0
  13. package/dist/cjs/common/constants.js +32 -0
  14. package/dist/cjs/common/constants.js.map +1 -0
  15. package/dist/cjs/common/index.d.ts +3 -0
  16. package/dist/cjs/common/index.d.ts.map +1 -0
  17. package/dist/cjs/common/index.js +19 -0
  18. package/dist/cjs/common/index.js.map +1 -0
  19. package/dist/cjs/common/logger.d.ts +21 -0
  20. package/dist/cjs/common/logger.d.ts.map +1 -0
  21. package/dist/cjs/common/logger.js +50 -0
  22. package/dist/cjs/common/logger.js.map +1 -0
  23. package/dist/cjs/common/types.d.ts +5 -0
  24. package/dist/cjs/common/types.d.ts.map +1 -0
  25. package/dist/cjs/common/types.js +3 -0
  26. package/dist/cjs/common/types.js.map +1 -0
  27. package/dist/cjs/corpus/chunker.d.ts +12 -0
  28. package/dist/cjs/corpus/chunker.d.ts.map +1 -0
  29. package/dist/cjs/corpus/chunker.js +298 -0
  30. package/dist/cjs/corpus/chunker.js.map +1 -0
  31. package/dist/cjs/corpus/common/index.d.ts +2 -0
  32. package/dist/cjs/corpus/common/index.d.ts.map +1 -0
  33. package/dist/cjs/corpus/common/index.js +18 -0
  34. package/dist/cjs/corpus/common/index.js.map +1 -0
  35. package/dist/cjs/corpus/common/types.d.ts +37 -0
  36. package/dist/cjs/corpus/common/types.d.ts.map +1 -0
  37. package/dist/cjs/corpus/common/types.js +3 -0
  38. package/dist/cjs/corpus/common/types.js.map +1 -0
  39. package/dist/cjs/corpus/frontmatter.d.ts +13 -0
  40. package/dist/cjs/corpus/frontmatter.d.ts.map +1 -0
  41. package/dist/cjs/corpus/frontmatter.js +31 -0
  42. package/dist/cjs/corpus/frontmatter.js.map +1 -0
  43. package/dist/cjs/corpus/index.d.ts +6 -0
  44. package/dist/cjs/corpus/index.d.ts.map +1 -0
  45. package/dist/cjs/corpus/index.js +22 -0
  46. package/dist/cjs/corpus/index.js.map +1 -0
  47. package/dist/cjs/corpus/loader.d.ts +16 -0
  48. package/dist/cjs/corpus/loader.d.ts.map +1 -0
  49. package/dist/cjs/corpus/loader.js +72 -0
  50. package/dist/cjs/corpus/loader.js.map +1 -0
  51. package/dist/cjs/corpus/roots.d.ts +9 -0
  52. package/dist/cjs/corpus/roots.d.ts.map +1 -0
  53. package/dist/cjs/corpus/roots.js +30 -0
  54. package/dist/cjs/corpus/roots.js.map +1 -0
  55. package/dist/cjs/index.d.ts +2 -0
  56. package/dist/cjs/index.d.ts.map +1 -0
  57. package/dist/cjs/index.js +18 -0
  58. package/dist/cjs/index.js.map +1 -0
  59. package/dist/cjs/protocol/common/constants.d.ts +9 -0
  60. package/dist/cjs/protocol/common/constants.d.ts.map +1 -0
  61. package/dist/cjs/protocol/common/constants.js +13 -0
  62. package/dist/cjs/protocol/common/constants.js.map +1 -0
  63. package/dist/cjs/protocol/common/index.d.ts +4 -0
  64. package/dist/cjs/protocol/common/index.d.ts.map +1 -0
  65. package/dist/cjs/protocol/common/index.js +20 -0
  66. package/dist/cjs/protocol/common/index.js.map +1 -0
  67. package/dist/cjs/protocol/common/rpc-error.d.ts +9 -0
  68. package/dist/cjs/protocol/common/rpc-error.d.ts.map +1 -0
  69. package/dist/cjs/protocol/common/rpc-error.js +12 -0
  70. package/dist/cjs/protocol/common/rpc-error.js.map +1 -0
  71. package/dist/cjs/protocol/common/types.d.ts +32 -0
  72. package/dist/cjs/protocol/common/types.d.ts.map +1 -0
  73. package/dist/cjs/protocol/common/types.js +3 -0
  74. package/dist/cjs/protocol/common/types.js.map +1 -0
  75. package/dist/cjs/protocol/index.d.ts +3 -0
  76. package/dist/cjs/protocol/index.d.ts.map +1 -0
  77. package/dist/cjs/protocol/index.js +19 -0
  78. package/dist/cjs/protocol/index.js.map +1 -0
  79. package/dist/cjs/protocol/transport.d.ts +28 -0
  80. package/dist/cjs/protocol/transport.d.ts.map +1 -0
  81. package/dist/cjs/protocol/transport.js +155 -0
  82. package/dist/cjs/protocol/transport.js.map +1 -0
  83. package/dist/cjs/search/common/constants.d.ts +23 -0
  84. package/dist/cjs/search/common/constants.d.ts.map +1 -0
  85. package/dist/cjs/search/common/constants.js +56 -0
  86. package/dist/cjs/search/common/constants.js.map +1 -0
  87. package/dist/cjs/search/common/index.d.ts +3 -0
  88. package/dist/cjs/search/common/index.d.ts.map +1 -0
  89. package/dist/cjs/search/common/index.js +19 -0
  90. package/dist/cjs/search/common/index.js.map +1 -0
  91. package/dist/cjs/search/common/types.d.ts +18 -0
  92. package/dist/cjs/search/common/types.d.ts.map +1 -0
  93. package/dist/cjs/search/common/types.js +3 -0
  94. package/dist/cjs/search/common/types.js.map +1 -0
  95. package/dist/cjs/search/index.d.ts +4 -0
  96. package/dist/cjs/search/index.d.ts.map +1 -0
  97. package/dist/cjs/search/index.js +20 -0
  98. package/dist/cjs/search/index.js.map +1 -0
  99. package/dist/cjs/search/planner.d.ts +13 -0
  100. package/dist/cjs/search/planner.d.ts.map +1 -0
  101. package/dist/cjs/search/planner.js +58 -0
  102. package/dist/cjs/search/planner.js.map +1 -0
  103. package/dist/cjs/search/store.d.ts +37 -0
  104. package/dist/cjs/search/store.d.ts.map +1 -0
  105. package/dist/cjs/search/store.js +141 -0
  106. package/dist/cjs/search/store.js.map +1 -0
  107. package/dist/cjs/server/freshness.d.ts +40 -0
  108. package/dist/cjs/server/freshness.d.ts.map +1 -0
  109. package/dist/cjs/server/freshness.js +85 -0
  110. package/dist/cjs/server/freshness.js.map +1 -0
  111. package/dist/cjs/server.d.ts +12 -0
  112. package/dist/cjs/server.d.ts.map +1 -0
  113. package/dist/cjs/server.js +65 -0
  114. package/dist/cjs/server.js.map +1 -0
  115. package/dist/cjs/tools/common/index.d.ts +2 -0
  116. package/dist/cjs/tools/common/index.d.ts.map +1 -0
  117. package/dist/cjs/tools/common/index.js +18 -0
  118. package/dist/cjs/tools/common/index.js.map +1 -0
  119. package/dist/cjs/tools/common/schemas.d.ts +23 -0
  120. package/dist/cjs/tools/common/schemas.d.ts.map +1 -0
  121. package/dist/cjs/tools/common/schemas.js +37 -0
  122. package/dist/cjs/tools/common/schemas.js.map +1 -0
  123. package/dist/cjs/tools/get.tool.d.ts +6 -0
  124. package/dist/cjs/tools/get.tool.d.ts.map +1 -0
  125. package/dist/cjs/tools/get.tool.js +115 -0
  126. package/dist/cjs/tools/get.tool.js.map +1 -0
  127. package/dist/cjs/tools/index.d.ts +4 -0
  128. package/dist/cjs/tools/index.d.ts.map +1 -0
  129. package/dist/cjs/tools/index.js +20 -0
  130. package/dist/cjs/tools/index.js.map +1 -0
  131. package/dist/cjs/tools/search.tool.d.ts +6 -0
  132. package/dist/cjs/tools/search.tool.d.ts.map +1 -0
  133. package/dist/cjs/tools/search.tool.js +58 -0
  134. package/dist/cjs/tools/search.tool.js.map +1 -0
  135. package/dist/corpus/changelogs/2025-12-16-initial-architecture.md +145 -0
  136. package/dist/corpus/changelogs/2025-12-16-model-repo-datasource-refactor.md +300 -0
  137. package/dist/corpus/changelogs/2025-12-17-refactor.md +90 -0
  138. package/dist/corpus/changelogs/2025-12-18-performance-optimizations.md +130 -0
  139. package/dist/corpus/changelogs/2025-12-18-repository-validation-security.md +255 -0
  140. package/dist/corpus/changelogs/2025-12-26-nested-relations-and-generics.md +86 -0
  141. package/dist/corpus/changelogs/2025-12-26-transaction-support.md +57 -0
  142. package/dist/corpus/changelogs/2025-12-29-dynamic-binding-registration.md +104 -0
  143. package/dist/corpus/changelogs/2025-12-29-snowflake-uid-helper.md +100 -0
  144. package/dist/corpus/changelogs/2025-12-30-repository-enhancements.md +214 -0
  145. package/dist/corpus/changelogs/2025-12-31-json-path-filtering-array-operators.md +214 -0
  146. package/dist/corpus/changelogs/2025-12-31-string-id-custom-generator.md +137 -0
  147. package/dist/corpus/changelogs/2026-01-02-default-filter-and-repository-mixins.md +421 -0
  148. package/dist/corpus/changelogs/2026-01-05-range-queries-content-range.md +184 -0
  149. package/dist/corpus/changelogs/2026-01-06-basic-authentication.md +103 -0
  150. package/dist/corpus/changelogs/2026-01-07-controller-route-customization.md +190 -0
  151. package/dist/corpus/changelogs/2026-01-11-logger-optimization-hf-logger.md +254 -0
  152. package/dist/corpus/changelogs/2026-02-06-socket-io-integration-fix.md +541 -0
  153. package/dist/corpus/changelogs/2026-02-10-websocket-heartbeat-payload.md +173 -0
  154. package/dist/corpus/changelogs/2026-02-11-crypto-refactor-ecdh.md +217 -0
  155. package/dist/corpus/changelogs/2026-02-11-websocket-encrypted-delivery.md +209 -0
  156. package/dist/corpus/changelogs/2026-02-11-websocket-generic-types.md +134 -0
  157. package/dist/corpus/changelogs/2026-02-16-authorization-system.md +378 -0
  158. package/dist/corpus/changelogs/2026-02-26-core-helpers-decoupling.md +145 -0
  159. package/dist/corpus/changelogs/2026-02-27-jwks-authentication.md +391 -0
  160. package/dist/corpus/changelogs/2026-03-02-model-authorize-settings.md +155 -0
  161. package/dist/corpus/changelogs/2026-03-04-jwt-payload-field-codecs.md +219 -0
  162. package/dist/corpus/changelogs/2026-03-06-filter-offset-skip-fix.md +88 -0
  163. package/dist/corpus/changelogs/2026-03-10-kafka-helpers-refactor.md +225 -0
  164. package/dist/corpus/changelogs/2026-03-12-kafka-helpers-enhancement.md +169 -0
  165. package/dist/corpus/changelogs/2026-03-15-grpc-controller-system.md +281 -0
  166. package/dist/corpus/changelogs/2026-03-30-row-level-locking.md +134 -0
  167. package/dist/corpus/changelogs/2026-03-31-typescript-6-and-toolchain.md +100 -0
  168. package/dist/corpus/changelogs/2026-04-23-error-response-extra-fields.md +131 -0
  169. package/dist/corpus/changelogs/2026-05-05-refresh-token-endpoint.md +116 -0
  170. package/dist/corpus/changelogs/2026-05-08-crud-route-toggles-and-typed-responses.md +136 -0
  171. package/dist/corpus/changelogs/2026-05-20-relation-scope-default-limit.md +133 -0
  172. package/dist/corpus/changelogs/2026-05-21-mass-mutation-guards.md +102 -0
  173. package/dist/corpus/changelogs/2026-05-22-casbin-adapter-schema-qualification.md +72 -0
  174. package/dist/corpus/changelogs/2026-05-25-per-model-default-limit.md +68 -0
  175. package/dist/corpus/changelogs/2026-05-27-casbin-domain-matching-function.md +90 -0
  176. package/dist/corpus/changelogs/2026-06-02-authorize-scoped-rbac.md +105 -0
  177. package/dist/corpus/changelogs/2026-06-14-validation-codes-and-error-hardening.md +124 -0
  178. package/dist/corpus/changelogs/2026-06-18-auth-user-information-endpoint.md +69 -0
  179. package/dist/corpus/changelogs/2026-06-25-redis-helpers-refactor.md +199 -0
  180. package/dist/corpus/changelogs/2026-07-05-unified-repository-connectors.md +206 -0
  181. package/dist/corpus/changelogs/2026-07-08-typesense-advanced-search.md +72 -0
  182. package/dist/corpus/changelogs/2026-07-11-connectors-consistency-hardening.md +192 -0
  183. package/dist/corpus/changelogs/2026-07-11-postgres-driver-seam-supabase.md +146 -0
  184. package/dist/corpus/changelogs/2026-07-12-core-consolidation-dedup.md +127 -0
  185. package/dist/corpus/changelogs/2026-07-13-hardening-round.md +99 -0
  186. package/dist/corpus/changelogs/2026-07-14-driver-class-bundling.md +100 -0
  187. package/dist/corpus/changelogs/2026-07-16-error-catalog-and-structured-message.md +64 -0
  188. package/dist/corpus/changelogs/2026-07-16-secrets-vault-integration.md +72 -0
  189. package/dist/corpus/changelogs/2026-07-17-error-module-redesign.md +202 -0
  190. package/dist/corpus/changelogs/2026-07-17-logger-correctness-pass.md +46 -0
  191. package/dist/corpus/changelogs/2026-07-17-secrets-bundler-invisible-peers.md +30 -0
  192. package/dist/corpus/changelogs/2026-07-18-dependency-refresh.md +55 -0
  193. package/dist/corpus/changelogs/2026-07-18-logger-overhaul.md +104 -0
  194. package/dist/corpus/changelogs/2026-07-18-repository-read-retry.md +74 -0
  195. package/dist/corpus/changelogs/2026-07-20-casbin-custom-grants.md +72 -0
  196. package/dist/corpus/changelogs/2026-07-20-casbin-single-wave-extraction.md +58 -0
  197. package/dist/corpus/changelogs/2026-07-20-error-from-error-client.md +66 -0
  198. package/dist/corpus/changelogs/2026-07-21-casbin-connector-resolution-fix.md +36 -0
  199. package/dist/corpus/changelogs/2026-07-25-error-logging.md +129 -0
  200. package/dist/corpus/changelogs/2026-07-25-ignis-filter-package.md +75 -0
  201. package/dist/corpus/changelogs/2026-07-26-search-and-mail-error-codes.md +58 -0
  202. package/dist/corpus/changelogs/2026-08-01-relational-connector-lift.md +403 -0
  203. package/dist/corpus/changelogs/2026-08-02-sqlite-and-pglite-connectors.md +177 -0
  204. package/dist/corpus/changelogs/2026-08-05-search-dialect-relational-parity.md +90 -0
  205. package/dist/corpus/changelogs/2026-08-06-aes-pbkdf2-and-key-rotation.md +131 -0
  206. package/dist/corpus/changelogs/2026-08-07-default-query-by.md +62 -0
  207. package/dist/corpus/changelogs/2026-08-07-nested-fields-and-order-validation.md +75 -0
  208. package/dist/corpus/changelogs/2026-08-07-typesense-multi-search-transport.md +97 -0
  209. package/dist/corpus/changelogs/2026-08-12-json-log-arguments.md +69 -0
  210. package/dist/corpus/changelogs/2026-08-13-browser-pure-kernel.md +130 -0
  211. package/dist/corpus/changelogs/2026-08-18-esm-builds-and-one-default-stack.md +104 -0
  212. package/dist/corpus/changelogs/2026-08-18-opaque-uid-helper.md +43 -0
  213. package/dist/corpus/changelogs/2026-08-19-browser-bff-multi-tab.md +88 -0
  214. package/dist/corpus/changelogs/2026-08-19-service-authentication-phase-1.md +157 -0
  215. package/dist/corpus/changelogs/2026-08-21-service-authentication-strategy.md +127 -0
  216. package/dist/corpus/changelogs/2026-08-22-logger-color-off-outside-development.md +48 -0
  217. package/dist/corpus/changelogs/2026-08-24-query-wrapper-schemas.md +77 -0
  218. package/dist/corpus/changelogs/2026-08-29-casbin-domain-hierarchy.md +66 -0
  219. package/dist/corpus/changelogs/2026-08-30-authorize-no-enforcer-fails-closed.md +60 -0
  220. package/dist/corpus/changelogs/2026-08-30-crypto-hashing.md +158 -0
  221. package/dist/corpus/changelogs/2026-08-30-policy-definition-extra-variants.md +62 -0
  222. package/dist/corpus/changelogs/2026-08-30-row-scope-filter.md +221 -0
  223. package/dist/corpus/changelogs/2026-08-30-search-connector-health-and-import-contract.md +46 -0
  224. package/dist/corpus/changelogs/2026-08-30-tree-and-recursive-sql.md +188 -0
  225. package/dist/corpus/changelogs/2026-08-30-typed-where-clauses.md +114 -0
  226. package/dist/corpus/changelogs/2026-08-31-entity-id-brand.md +70 -0
  227. package/dist/corpus/changelogs/2026-08-31-event-bus-retry.md +143 -0
  228. package/dist/corpus/changelogs/2026-08-31-policy-domain-split-release-b.md +54 -0
  229. package/dist/corpus/changelogs/2026-08-31-policy-domain-split.md +175 -0
  230. package/dist/corpus/changelogs/2026-08-31-scope-filter-boot-checks.md +77 -0
  231. package/dist/corpus/changelogs/2026-09-02-bundle-safe-helpers.md +71 -0
  232. package/dist/corpus/changelogs/2026-09-02-decorator-artifact-registration.md +119 -0
  233. package/dist/corpus/changelogs/2026-09-03-deprecated-boot-api-removed.md +133 -0
  234. package/dist/corpus/changelogs/2026-09-04-dependency-floors-raised.md +61 -0
  235. package/dist/corpus/changelogs/2026-09-05-boot-checks.md +57 -0
  236. package/dist/corpus/changelogs/2026-09-05-core-drops-boot-dependency.md +44 -0
  237. package/dist/corpus/changelogs/2026-09-05-list-response-contract.md +74 -0
  238. package/dist/corpus/changelogs/2026-09-06-bun-serve-options.md +51 -0
  239. package/dist/corpus/changelogs/2026-09-06-ignis-atlas.md +54 -0
  240. package/dist/corpus/changelogs/2026-09-06-repository-inheritance-and-quiet-cli.md +46 -0
  241. package/dist/corpus/changelogs/2026-09-06-shared-singletons-across-module-copies.md +43 -0
  242. package/dist/corpus/changelogs/index.md +135 -0
  243. package/dist/corpus/changelogs/planned-schema-migrator.md +553 -0
  244. package/dist/corpus/changelogs/template.md +64 -0
  245. package/dist/corpus/wiki/best-practices/api-usage-examples.md +617 -0
  246. package/dist/corpus/wiki/best-practices/architectural-patterns.md +437 -0
  247. package/dist/corpus/wiki/best-practices/architecture-decisions.md +524 -0
  248. package/dist/corpus/wiki/best-practices/code-style-standards/advanced-patterns.md +283 -0
  249. package/dist/corpus/wiki/best-practices/code-style-standards/constants-configuration.md +240 -0
  250. package/dist/corpus/wiki/best-practices/code-style-standards/control-flow.md +280 -0
  251. package/dist/corpus/wiki/best-practices/code-style-standards/documentation.md +241 -0
  252. package/dist/corpus/wiki/best-practices/code-style-standards/function-patterns.md +178 -0
  253. package/dist/corpus/wiki/best-practices/code-style-standards/index.md +114 -0
  254. package/dist/corpus/wiki/best-practices/code-style-standards/naming-conventions.md +200 -0
  255. package/dist/corpus/wiki/best-practices/code-style-standards/route-definitions.md +205 -0
  256. package/dist/corpus/wiki/best-practices/code-style-standards/tooling.md +168 -0
  257. package/dist/corpus/wiki/best-practices/code-style-standards/type-safety.md +199 -0
  258. package/dist/corpus/wiki/best-practices/common-pitfalls.md +447 -0
  259. package/dist/corpus/wiki/best-practices/contribution-workflow.md +211 -0
  260. package/dist/corpus/wiki/best-practices/data-modeling.md +548 -0
  261. package/dist/corpus/wiki/best-practices/deployment-strategies.md +736 -0
  262. package/dist/corpus/wiki/best-practices/error-handling.md +604 -0
  263. package/dist/corpus/wiki/best-practices/index.md +206 -0
  264. package/dist/corpus/wiki/best-practices/performance-optimization.md +437 -0
  265. package/dist/corpus/wiki/best-practices/security-guidelines.md +523 -0
  266. package/dist/corpus/wiki/best-practices/testing-strategies.md +639 -0
  267. package/dist/corpus/wiki/best-practices/troubleshooting-tips.md +227 -0
  268. package/dist/corpus/wiki/extensions/atlas/index.md +65 -0
  269. package/dist/corpus/wiki/extensions/components/api-reference.md +268 -0
  270. package/dist/corpus/wiki/extensions/components/authentication/api.md +643 -0
  271. package/dist/corpus/wiki/extensions/components/authentication/errors.md +211 -0
  272. package/dist/corpus/wiki/extensions/components/authentication/index.md +171 -0
  273. package/dist/corpus/wiki/extensions/components/authentication/usage.md +464 -0
  274. package/dist/corpus/wiki/extensions/components/authorization/api.md +1509 -0
  275. package/dist/corpus/wiki/extensions/components/authorization/errors.md +397 -0
  276. package/dist/corpus/wiki/extensions/components/authorization/getting-started.md +227 -0
  277. package/dist/corpus/wiki/extensions/components/authorization/index.md +155 -0
  278. package/dist/corpus/wiki/extensions/components/authorization/usage.md +587 -0
  279. package/dist/corpus/wiki/extensions/components/health-check.md +227 -0
  280. package/dist/corpus/wiki/extensions/components/index.md +26 -0
  281. package/dist/corpus/wiki/extensions/components/mail/api.md +773 -0
  282. package/dist/corpus/wiki/extensions/components/mail/errors.md +190 -0
  283. package/dist/corpus/wiki/extensions/components/mail/index.md +182 -0
  284. package/dist/corpus/wiki/extensions/components/mail/usage.md +370 -0
  285. package/dist/corpus/wiki/extensions/components/request-tracker.md +152 -0
  286. package/dist/corpus/wiki/extensions/components/socket-io/api.md +728 -0
  287. package/dist/corpus/wiki/extensions/components/socket-io/errors.md +119 -0
  288. package/dist/corpus/wiki/extensions/components/socket-io/index.md +116 -0
  289. package/dist/corpus/wiki/extensions/components/socket-io/usage.md +429 -0
  290. package/dist/corpus/wiki/extensions/components/static-asset/api.md +593 -0
  291. package/dist/corpus/wiki/extensions/components/static-asset/errors.md +159 -0
  292. package/dist/corpus/wiki/extensions/components/static-asset/index.md +160 -0
  293. package/dist/corpus/wiki/extensions/components/static-asset/usage.md +253 -0
  294. package/dist/corpus/wiki/extensions/components/template/api-page.md +125 -0
  295. package/dist/corpus/wiki/extensions/components/template/errors-page.md +100 -0
  296. package/dist/corpus/wiki/extensions/components/template/index.md +104 -0
  297. package/dist/corpus/wiki/extensions/components/template/setup-page.md +134 -0
  298. package/dist/corpus/wiki/extensions/components/template/single-page.md +132 -0
  299. package/dist/corpus/wiki/extensions/components/template/usage-page.md +127 -0
  300. package/dist/corpus/wiki/extensions/components/websocket/api.md +416 -0
  301. package/dist/corpus/wiki/extensions/components/websocket/errors.md +128 -0
  302. package/dist/corpus/wiki/extensions/components/websocket/index.md +127 -0
  303. package/dist/corpus/wiki/extensions/components/websocket/usage.md +257 -0
  304. package/dist/corpus/wiki/extensions/helpers/cron/index.md +116 -0
  305. package/dist/corpus/wiki/extensions/helpers/crypto/index.md +136 -0
  306. package/dist/corpus/wiki/extensions/helpers/crypto/reference.md +544 -0
  307. package/dist/corpus/wiki/extensions/helpers/env/index.md +119 -0
  308. package/dist/corpus/wiki/extensions/helpers/error/index.md +373 -0
  309. package/dist/corpus/wiki/extensions/helpers/index.md +63 -0
  310. package/dist/corpus/wiki/extensions/helpers/inversion/index.md +142 -0
  311. package/dist/corpus/wiki/extensions/helpers/inversion/reference.md +531 -0
  312. package/dist/corpus/wiki/extensions/helpers/kafka/admin.md +210 -0
  313. package/dist/corpus/wiki/extensions/helpers/kafka/compile-binary.md +125 -0
  314. package/dist/corpus/wiki/extensions/helpers/kafka/consumer.md +422 -0
  315. package/dist/corpus/wiki/extensions/helpers/kafka/examples.md +154 -0
  316. package/dist/corpus/wiki/extensions/helpers/kafka/index.md +84 -0
  317. package/dist/corpus/wiki/extensions/helpers/kafka/producer.md +408 -0
  318. package/dist/corpus/wiki/extensions/helpers/kafka/schema-registry.md +194 -0
  319. package/dist/corpus/wiki/extensions/helpers/logger/hf-logger.md +220 -0
  320. package/dist/corpus/wiki/extensions/helpers/logger/index.md +156 -0
  321. package/dist/corpus/wiki/extensions/helpers/logger/pino.md +107 -0
  322. package/dist/corpus/wiki/extensions/helpers/logger/reference.md +938 -0
  323. package/dist/corpus/wiki/extensions/helpers/network/api.md +1067 -0
  324. package/dist/corpus/wiki/extensions/helpers/network/index.md +189 -0
  325. package/dist/corpus/wiki/extensions/helpers/queue/index.md +165 -0
  326. package/dist/corpus/wiki/extensions/helpers/queue/reference.md +490 -0
  327. package/dist/corpus/wiki/extensions/helpers/redis/index.md +159 -0
  328. package/dist/corpus/wiki/extensions/helpers/redis/reference.md +784 -0
  329. package/dist/corpus/wiki/extensions/helpers/secrets/index.md +136 -0
  330. package/dist/corpus/wiki/extensions/helpers/socket-io/api.md +618 -0
  331. package/dist/corpus/wiki/extensions/helpers/socket-io/index.md +167 -0
  332. package/dist/corpus/wiki/extensions/helpers/storage/api.md +1021 -0
  333. package/dist/corpus/wiki/extensions/helpers/storage/index.md +162 -0
  334. package/dist/corpus/wiki/extensions/helpers/template/index.md +69 -0
  335. package/dist/corpus/wiki/extensions/helpers/template/single-page.md +126 -0
  336. package/dist/corpus/wiki/extensions/helpers/types/index.md +143 -0
  337. package/dist/corpus/wiki/extensions/helpers/types/reference.md +708 -0
  338. package/dist/corpus/wiki/extensions/helpers/uid/index.md +259 -0
  339. package/dist/corpus/wiki/extensions/helpers/websocket/api.md +888 -0
  340. package/dist/corpus/wiki/extensions/helpers/websocket/index.md +139 -0
  341. package/dist/corpus/wiki/extensions/helpers/worker-thread/index.md +142 -0
  342. package/dist/corpus/wiki/extensions/helpers/worker-thread/reference.md +434 -0
  343. package/dist/corpus/wiki/extensions/index.md +46 -0
  344. package/dist/corpus/wiki/guides/core-concepts/application/bootstrapping.md +274 -0
  345. package/dist/corpus/wiki/guides/core-concepts/application/index.md +239 -0
  346. package/dist/corpus/wiki/guides/core-concepts/components-guide.md +513 -0
  347. package/dist/corpus/wiki/guides/core-concepts/components.md +155 -0
  348. package/dist/corpus/wiki/guides/core-concepts/dependency-injection.md +336 -0
  349. package/dist/corpus/wiki/guides/core-concepts/grpc-controllers.md +296 -0
  350. package/dist/corpus/wiki/guides/core-concepts/persistent/datasources.md +195 -0
  351. package/dist/corpus/wiki/guides/core-concepts/persistent/index.md +132 -0
  352. package/dist/corpus/wiki/guides/core-concepts/persistent/models.md +331 -0
  353. package/dist/corpus/wiki/guides/core-concepts/persistent/pglite.md +218 -0
  354. package/dist/corpus/wiki/guides/core-concepts/persistent/postgres-drivers.md +207 -0
  355. package/dist/corpus/wiki/guides/core-concepts/persistent/repositories.md +311 -0
  356. package/dist/corpus/wiki/guides/core-concepts/persistent/search-meilisearch.md +195 -0
  357. package/dist/corpus/wiki/guides/core-concepts/persistent/search-typesense.md +443 -0
  358. package/dist/corpus/wiki/guides/core-concepts/persistent/sqlite.md +296 -0
  359. package/dist/corpus/wiki/guides/core-concepts/persistent/transactions.md +238 -0
  360. package/dist/corpus/wiki/guides/core-concepts/rest-controllers.md +465 -0
  361. package/dist/corpus/wiki/guides/core-concepts/secrets-vault.md +177 -0
  362. package/dist/corpus/wiki/guides/core-concepts/services.md +389 -0
  363. package/dist/corpus/wiki/guides/get-started/5-minute-quickstart.md +163 -0
  364. package/dist/corpus/wiki/guides/get-started/philosophy.md +135 -0
  365. package/dist/corpus/wiki/guides/get-started/setup.md +136 -0
  366. package/dist/corpus/wiki/guides/index.md +82 -0
  367. package/dist/corpus/wiki/guides/migrations/boot-api-removal-migration.md +79 -0
  368. package/dist/corpus/wiki/guides/migrations/redis-helpers-migration.md +178 -0
  369. package/dist/corpus/wiki/guides/migrations/scoped-rbac-migration.md +300 -0
  370. package/dist/corpus/wiki/guides/migrations/unified-connectors-migration.md +114 -0
  371. package/dist/corpus/wiki/guides/reference/glossary.md +250 -0
  372. package/dist/corpus/wiki/guides/tutorials/building-a-crud-api.md +704 -0
  373. package/dist/corpus/wiki/guides/tutorials/complete-installation.md +440 -0
  374. package/dist/corpus/wiki/guides/tutorials/ecommerce-api.md +1442 -0
  375. package/dist/corpus/wiki/guides/tutorials/realtime-chat.md +1571 -0
  376. package/dist/corpus/wiki/guides/tutorials/testing.md +264 -0
  377. package/dist/corpus/wiki/index.md +5 -0
  378. package/dist/corpus/wiki/public/apple-touch-icon.png +0 -0
  379. package/dist/corpus/wiki/public/logo.svg +1 -0
  380. package/dist/corpus/wiki/public/og-image.png +0 -0
  381. package/dist/corpus/wiki/public/site.webmanifest +11 -0
  382. package/dist/corpus/wiki/references/base/application.md +482 -0
  383. package/dist/corpus/wiki/references/base/bootstrapping.md +351 -0
  384. package/dist/corpus/wiki/references/base/components.md +883 -0
  385. package/dist/corpus/wiki/references/base/connectors.md +121 -0
  386. package/dist/corpus/wiki/references/base/controllers.md +1022 -0
  387. package/dist/corpus/wiki/references/base/datasources-reference.md +598 -0
  388. package/dist/corpus/wiki/references/base/datasources.md +165 -0
  389. package/dist/corpus/wiki/references/base/dependency-injection.md +423 -0
  390. package/dist/corpus/wiki/references/base/filter-system/application-usage.md +215 -0
  391. package/dist/corpus/wiki/references/base/filter-system/array-operators.md +135 -0
  392. package/dist/corpus/wiki/references/base/filter-system/comparison-operators.md +110 -0
  393. package/dist/corpus/wiki/references/base/filter-system/default-filter.md +267 -0
  394. package/dist/corpus/wiki/references/base/filter-system/fields-order-pagination.md +244 -0
  395. package/dist/corpus/wiki/references/base/filter-system/index.md +149 -0
  396. package/dist/corpus/wiki/references/base/filter-system/json-filtering.md +122 -0
  397. package/dist/corpus/wiki/references/base/filter-system/list-operators.md +56 -0
  398. package/dist/corpus/wiki/references/base/filter-system/logical-operators.md +148 -0
  399. package/dist/corpus/wiki/references/base/filter-system/null-operators.md +80 -0
  400. package/dist/corpus/wiki/references/base/filter-system/pattern-matching.md +105 -0
  401. package/dist/corpus/wiki/references/base/filter-system/quick-reference.md +172 -0
  402. package/dist/corpus/wiki/references/base/filter-system/range-operators.md +53 -0
  403. package/dist/corpus/wiki/references/base/filter-system/tips.md +154 -0
  404. package/dist/corpus/wiki/references/base/filter-system/use-cases.md +394 -0
  405. package/dist/corpus/wiki/references/base/grpc-controllers.md +1020 -0
  406. package/dist/corpus/wiki/references/base/index.md +112 -0
  407. package/dist/corpus/wiki/references/base/middlewares.md +543 -0
  408. package/dist/corpus/wiki/references/base/models-reference.md +886 -0
  409. package/dist/corpus/wiki/references/base/models.md +154 -0
  410. package/dist/corpus/wiki/references/base/providers.md +728 -0
  411. package/dist/corpus/wiki/references/base/repositories/advanced.md +627 -0
  412. package/dist/corpus/wiki/references/base/repositories/index.md +152 -0
  413. package/dist/corpus/wiki/references/base/repositories/mixins.md +103 -0
  414. package/dist/corpus/wiki/references/base/repositories/relations.md +379 -0
  415. package/dist/corpus/wiki/references/base/repositories/soft-deletable.md +307 -0
  416. package/dist/corpus/wiki/references/base/secrets.md +267 -0
  417. package/dist/corpus/wiki/references/base/services.md +417 -0
  418. package/dist/corpus/wiki/references/configuration/environment-variables.md +498 -0
  419. package/dist/corpus/wiki/references/configuration/index.md +132 -0
  420. package/dist/corpus/wiki/references/index.md +172 -0
  421. package/dist/corpus/wiki/references/quick-reference.md +594 -0
  422. package/dist/corpus/wiki/references/utilities/date.md +50 -0
  423. package/dist/corpus/wiki/references/utilities/duration.md +85 -0
  424. package/dist/corpus/wiki/references/utilities/index.md +81 -0
  425. package/dist/corpus/wiki/references/utilities/jsx-reference.md +298 -0
  426. package/dist/corpus/wiki/references/utilities/jsx.md +131 -0
  427. package/dist/corpus/wiki/references/utilities/module.md +110 -0
  428. package/dist/corpus/wiki/references/utilities/parse.md +55 -0
  429. package/dist/corpus/wiki/references/utilities/performance.md +54 -0
  430. package/dist/corpus/wiki/references/utilities/promise.md +54 -0
  431. package/dist/corpus/wiki/references/utilities/request.md +85 -0
  432. package/dist/corpus/wiki/references/utilities/retry.md +148 -0
  433. package/dist/corpus/wiki/references/utilities/schema.md +69 -0
  434. package/dist/corpus/wiki/references/utilities/statuses-reference.md +360 -0
  435. package/dist/corpus/wiki/references/utilities/statuses.md +122 -0
  436. package/package.json +74 -0
@@ -0,0 +1,221 @@
1
+ ---
2
+ title: A Row Scope Every Query Carries, Denied by Default When It Cannot Be Resolved
3
+ description: A new @model settings.scopeFilter ANDs a per-request row scope into every relational read and write - including restore() and every relation loaded via include - and refuses to guess when the scope cannot be resolved. A third state, ScopeFilters.UNRESTRICTED, lets a caller bypass scoping for one call. Search repositories are not covered.
4
+ ---
5
+
6
+ # Changelog - 2026-08-30
7
+
8
+ ## Row Scope Filter
9
+
10
+ <Badge type="tip" text="New Feature" /> <Badge type="danger" text="Security" />
11
+
12
+ **In one line.** A `scopeFilter` on a relational `@model` narrows every read and write to the rows the current caller may see, and matches zero rows when it cannot tell who the caller is.
13
+
14
+ ## The problem it solves
15
+
16
+ A multi-tenant app scopes every query by hand: `WHERE merchantId IN (...)` on every `find`, every `update`, every `delete`. Forget it once and one tenant's data leaks into another's response - silently, because a missing `WHERE` clause does not throw. `defaultFilter` already lets a model narrow its own queries, but it has an escape hatch (`shouldSkipDefaultFilter`) that soft-delete's `restore()` deliberately uses to reach past `deletedAt: null`. Reusing `defaultFilter` for tenant scoping would hand `restore()` that same escape hatch - a caller could restore a row that belongs to someone else.
17
+
18
+ `scopeFilter` is a second, separate filter with no shared escape hatch:
19
+
20
+ ```typescript
21
+ @model({
22
+ type: 'entity',
23
+ settings: {
24
+ scopeFilter: {
25
+ resolve: () => currentTenantWhere(),
26
+ },
27
+ },
28
+ })
29
+ class Order extends BasePostgresEntity {
30
+ // ...
31
+ }
32
+ ```
33
+
34
+ ## What changed
35
+
36
+ - **New `scopeFilter` model setting.** `resolve()` returns the current caller's `where`, re-evaluated on every call - so it can read the active request.
37
+ - **ANDed into every read and write**, including `restore()` - the exact path a tenant-scoped `defaultFilter` cannot cover.
38
+ - **Reaches relations loaded through `include`, at every nesting depth.** A scoped `Merchant` that includes `products` no longer hands back another tenant's products, even when `products` is reached through a relation of a relation.
39
+ - **Never removable by `shouldSkipDefaultFilter`**, on the parent or on an included relation. That flag still bypasses `defaultFilter` alone, which is what makes soft-delete's `restore()` safe to keep using it.
40
+ - **Denies by default when `resolve()` returns `null` or `undefined`.** No request context, no tenant, a background job with no scope wired up - all match zero rows unless the model opts into `onMissing: 'allow'`.
41
+ - **A throwing `resolve()` propagates.** The query fails loudly instead of running unscoped - on the parent and on every included relation.
42
+ - **New `ScopeFilters.UNRESTRICTED`.** A third `resolve()` return value for a caller who should see everything on this one call - see "A third state" below.
43
+
44
+ ## Options
45
+
46
+ | Option | Type | Default | Meaning |
47
+ |---|---|---|---|
48
+ | `resolve` | `() => TWhere \| typeof ScopeFilters.UNRESTRICTED \| null \| undefined` | required | Returns the current caller's scope `where`; `ScopeFilters.UNRESTRICTED` to apply no scope on this call; or `null`/`undefined` when the scope cannot be determined at all. |
49
+ | `onMissing` | `'deny' \| 'allow'` | `'deny'` | What happens when `resolve()` returns null/undefined. `'deny'` matches zero rows. `'allow'` runs the query unscoped - an explicit, reviewed opt-out for migrations and background jobs, never inferable from a request. |
50
+
51
+ ## A third state: unrestricted for one call
52
+
53
+ A `where`, and `null`/`undefined`, are not enough for a real multi-tenant application. Its resolver usually has an internal-operator branch:
54
+
55
+ ```typescript
56
+ resolve: () => {
57
+ if (isAlwaysAllowedOperator()) {
58
+ return { userMerchantIds: [] }; // meant "everything" - but a real filter, so it MATCHES NOTHING
59
+ }
60
+ if (activeMerchantHeader()) {
61
+ return { userMerchantIds: [activeMerchantHeader()] };
62
+ }
63
+ return { userMerchantIds: currentUsersMerchantIds() };
64
+ },
65
+ ```
66
+
67
+ `onMissing: 'allow'` cannot express that branch. `onMissing` is declared once, on the model's static `settings` - it cannot depend on which user is calling. Setting it to `'allow'` to serve an operator would also unscope every ordinary user whose `resolve()` happens to return nothing, turning a configuration slip into a data leak.
68
+
69
+ `ScopeFilters.UNRESTRICTED` is the explicit third value. Return it, and this one call runs with no scope at all:
70
+
71
+ ```typescript
72
+ import { ScopeFilters } from '@venizia/ignis-kernel';
73
+
74
+ resolve: () => {
75
+ if (isAlwaysAllowedOperator()) {
76
+ return ScopeFilters.UNRESTRICTED;
77
+ }
78
+ if (activeMerchantHeader()) {
79
+ return { userMerchantIds: [activeMerchantHeader()] };
80
+ }
81
+ return { userMerchantIds: currentUsersMerchantIds() };
82
+ },
83
+ ```
84
+
85
+ | `resolve()` returns | Behavior |
86
+ |---|---|
87
+ | a `TWhere` | ANDed into the query, as always |
88
+ | `ScopeFilters.UNRESTRICTED` | no scope applied, for this call only |
89
+ | `null` / `undefined` | `onMissing` - denies by default |
90
+
91
+ The order matters, and it is the whole safety property: `ScopeFilters.UNRESTRICTED` is checked by exact symbol identity, before the null/undefined branch. A resolver that forgets a `return` on some branch produces `undefined` - not the symbol - and still lands in deny. `ScopeFilters.UNRESTRICTED` is a `Symbol.for(...)`, deliberately: no JSON body, query string, or header can ever produce it, so the bypass can only come from code the application wrote and reviewed. It is re-evaluated on every call, exactly like a `where` - a resolver can return it once and a scoped `where` the next time.
92
+
93
+ ## Included relations are scoped too
94
+
95
+ `include` no longer bypasses `scopeFilter`. Each relation resolves its **own** `scopeFilter` from its **own** `@model` settings - a parent's scope never cascades to a child, and a child with no `scopeFilter` stays exactly as unscoped as it was before this change.
96
+
97
+ ```typescript
98
+ @model({ settings: { scopeFilter: { resolve: () => currentTenantWhere() } } })
99
+ class Merchant extends BasePostgresEntity {
100
+ static override relations = () => [{ name: 'products', type: RelationTypes.MANY, schema: Product.schema }];
101
+ }
102
+
103
+ @model({ settings: { scopeFilter: { resolve: () => currentTenantWhere() } } })
104
+ class Product extends BasePostgresEntity {
105
+ // ...
106
+ }
107
+
108
+ // merchantRepository.find({ filter: { include: [{ relation: 'products' }] } })
109
+ // only returns `products` rows Product's OWN scopeFilter permits - not every row that
110
+ // merely shares a `merchantId` with an in-scope Merchant.
111
+ ```
112
+
113
+ If `Product` above had no `scopeFilter` at all, its rows under `include` would be exactly as unscoped as before this change - scoping one model in a relation graph never scopes its neighbors.
114
+
115
+ The same rules as the parent apply at every relation, and at every nesting depth (a relation of a relation):
116
+
117
+ - `shouldSkipDefaultFilter` on an `include` entry still bypasses only that relation's `defaultFilter`, never its `scopeFilter`.
118
+ - `onMissing: 'deny'` (the default) removes every row of that relation when its own `resolve()` cannot determine a scope; `'allow'` leaves it unscoped.
119
+ - A throwing `resolve()` on any included relation fails the whole query, the same as a throwing `resolve()` on the parent.
120
+
121
+ ## Who is affected
122
+
123
+ - **Models with no `scopeFilter` setting**, whether queried directly or reached only through another model's `include`. No action needed - `find`, `count`, `update`, `delete`, and `restore` produce byte-identical SQL to before this change.
124
+ - **Models adding `scopeFilter` for the first time.** `restore()` on a row outside the resolved scope now reports zero rows updated instead of restoring it.
125
+ - **Models used as relation targets.** If a model already had `scopeFilter` before this change, rows it returned under someone else's `include` were NOT scoped - they are now. Audit any `include` of a scoped model that relied on seeing every related row regardless of tenant.
126
+ - **Background jobs and migrations running against a scoped model.** They see zero rows once `scopeFilter` is added, unless the model declares `onMissing: 'allow'`.
127
+
128
+ ## What is NOT scoped
129
+
130
+ **`scopeFilter` covers relational repositories only.** Search repositories (Typesense, Meilisearch) do not read this setting at all - `find`, `search`, `count`, and every write on a search repository run exactly as before, with no row scope applied.
131
+
132
+ This is a deliberate scope decision, not an oversight: search repositories compile filters through a different pipeline (`buildQuery` / `compileEffectiveWhere`, string `filterBy` expressions), and covering it is separate work. If your application mirrors a scoped relational entity into a search index, you must scope your search queries yourself - a `scopeFilter` on the relational model gives you nothing there.
133
+
134
+ ## Write paths: filter-shaped scope only
135
+
136
+ **`scopeFilter` covers `update` and `delete`, never `create`.** Scope is a `where` clause AND-ed
137
+ into the query, and an `INSERT` has no `where` to AND into - so there is nothing to filter. This is
138
+ structural, not an omission.
139
+
140
+ > [!WARNING]
141
+ > **Nothing stops a caller creating a row owned by somebody else.** Validating ownership at insert
142
+ > time stays your application's job: the framework has no channel to know whether a `userId` in a
143
+ > payload is the caller. A model with `scopeFilter` is NOT protected against a request that posts a
144
+ > foreign `userId`.
145
+
146
+ For `update` and `delete`, the scope is a `where` comparing a column (`merchantId`, `tenantId`)
147
+ against values the resolver already knows. Most tenant-scoped updates are exactly that shape, and
148
+ `scopeFilter` covers them completely.
149
+
150
+ ### The trap on the scoped side: a write that takes someone else's id
151
+
152
+ Because `update` and `delete` ARE scoped, an administrative method that legitimately targets
153
+ another user's rows silently stops working:
154
+
155
+ ```typescript
156
+ // Admin deletes an account and cleans up that user's configuration.
157
+ await userConfigurationRepository.deleteAllForUser({ userId: victimId });
158
+ ```
159
+
160
+ With `scopeFilter` active, that `deleteBy` narrows to the ADMIN's own rows. It deletes nothing,
161
+ throws nothing, and **reports success** - the caller reads a clean result while the target's rows
162
+ stay behind. No type error, no failing test, no log line.
163
+
164
+ > [!IMPORTANT]
165
+ > When you add `scopeFilter` to a model, audit every `updateById` / `updateAll` / `deleteBy` call
166
+ > that takes **another principal's id as an argument**. Those are exactly the calls that break, and
167
+ > they break quietly.
168
+
169
+ The fix is a method on the repository itself, passing `dangerouslySkipScopeFilter` - written and
170
+ reviewed where the escape is visible, rather than a flag in the request context that any layer
171
+ could set.
172
+
173
+ It does not cover ownership that is resolved per row, or through a polymorphic reference. Some rows carry no tenant column at all - only a `principalType` and `principalId` pair, where the owner lives in a different table chosen by `principalType` at runtime. That check is per-row, asynchronous, and reads the payload - three properties `resolve(): TWhere` was never built to express.
174
+
175
+ If your write path looks like that, `scopeFilter` gives you nothing there. Your application still has to run its own ownership check before the write. `scopeFilter` neither performs that check nor detects that you skipped it - no type error, no failing test, no log line will tell you.
176
+
177
+ This is a deliberate gap for now, not an oversight - the same way search repositories are excluded above. No hook or escape hatch exists for the per-row case: the shape of that check differs enough between applications that building a seam before its shape is known would guess wrong.
178
+
179
+ ## Adopting it where an ownership guard already exists
180
+
181
+ > [!WARNING]
182
+ > **Replace the guard, do not run it alongside.** Two sources of truth for one rule is the trap,
183
+ > and it is a quiet one: AND-ing the same predicate twice is idempotent, so results stay correct
184
+ > and nothing looks wrong. The redundancy does not add safety - it **hides divergence** until the
185
+ > day the two disagree. A subclass that overrides one but not the other drifts with no compile
186
+ > error and no failing test.
187
+
188
+ That rules out the obvious "move one entity family at a time while the guards stay" plan. Migrate a
189
+ family by removing its guard in the same change that adds `scopeFilter`, or leave the family alone.
190
+
191
+ ## `scopeFilter` narrows; an ownership guard throws - and that difference decides what each covers
192
+
193
+ `scopeFilter` injects a `where`. A hand-written guard loads the row and throws `403`/`404`. The two
194
+ have **opposite failure profiles**, and neither is strictly better:
195
+
196
+ | | `scopeFilter` (inject a `where`) | Guard (load the row, throw) |
197
+ |---|---|---|
198
+ | A handler that forgets | **still scoped** - the repository does it | **a hole** - nothing runs |
199
+ | `create` | **not covered** - an `INSERT` has no `where` | **covered** - it asserts on the payload |
200
+ | Admin targeting another principal | **silently narrows**, reports success | **throws** - cannot silently succeed |
201
+ | Indirect / per-row ownership | **not expressible** - `resolve()` is synchronous | expressible - it may query |
202
+ | Cost per operation | none - one more `where` clause | a read before every write |
203
+
204
+ Read the first and third rows together: `scopeFilter` removes the class of bug where somebody forgot
205
+ to check, and introduces the class where a legitimate cross-principal write quietly does nothing. A
206
+ guard is the mirror image. Choose per model, and expect to keep guards on `create` regardless.
207
+
208
+ ## Details
209
+
210
+ - **The escape hatch is `dangerouslySkipScopeFilter`**, and it cannot come from the wire. It is a parameter on internal repository methods, never a field on `IExtraOptions` or any filter schema - no controller, no query string, and no request body can set it. It exists for one framework-internal case (a filter `find()` already scoped, re-entering `findWithCoreAPI`) and for administrative repository code written and reviewed at the call site.
211
+ - **`onMissing: 'deny'` compiles to a real, deterministic SQL condition** - an empty `inq` (`WHERE id IN ()` shaped), which every relational dialect already reduces to a literal `false`. It is not "return an empty array after the fact"; the database itself matches nothing.
212
+ - **`shouldSkipDefaultFilter: true` still only removes `defaultFilter`.** A model combining `scopeFilter` (tenant) with `defaultFilter` (soft-delete) keeps the tenant scope even when a caller skips the soft-delete filter to read deleted rows.
213
+
214
+ | File | Package |
215
+ |------|---------|
216
+ | `src/helpers/inversion/common/types.ts` | kernel |
217
+ | `src/base/repositories/common/constants.ts` | kernel |
218
+ | `src/relational/core/repositories/core/base.ts` | connectors |
219
+ | `src/relational/core/repositories/core/readable.ts` | connectors |
220
+ | `src/relational/core/repositories/dialect/filter.ts` | connectors |
221
+ | `src/relational/core/repositories/common/scope-filter.ts` | connectors |
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: "getHealth() Never Throws, Imports Keep Progress, and collectionExists() Never Lies About Absence"
3
+ description: "Meilisearch's health probe used to throw instead of resolving { ok: false }, breaking ping(). Typesense's importDocuments() dropped partial progress on an already-shaped error, and its collectionExists() reported every failure as absence. All three now hold the ISearchConnector contract."
4
+ ---
5
+
6
+ # Changelog - 2026-08-30
7
+
8
+ ## `getHealth()` Never Throws, Imports Keep Progress, and `collectionExists()` Never Lies About Absence
9
+
10
+ <Badge type="warning" text="Behavior Change" /> <Badge type="info" text="Bug Fix" />
11
+
12
+ **In one line.** Meilisearch and Typesense now both hold the `ISearchConnector` contract they always claimed to: a health probe never throws, every failed import carries partial progress, and a collection-existence check never reports absence for a failure it could not classify.
13
+
14
+ ## The problem it solves
15
+
16
+ `ISearchConnector.getHealth()` promises `Promise<{ ok: boolean }>` - a resolved value, never a rejection. `BaseSearchConnector.ping()` trusts that promise: it just reads `.ok` off the result. Meilisearch's `getHealth()` routed its probe through the connector's generic engine-call wrapper, which turns a failure into a sanitized `503`. A down engine made `ping()` throw instead of returning `false`.
17
+
18
+ Typesense's `importDocuments()` had its own comment promising to "attach partial progress so callers can decide to resume or retry." It kept that promise for a raw engine failure, but not for a failure that arrived as an `ApplicationError` mid-import - that branch did a bare `throw error`, dropping the counts.
19
+
20
+ Typesense's `collectionExists()` wrapped its engine call in a blanket try/catch and returned `false` on any error at all - a network blip looked identical to a genuine absence. That matters because `ensureCollection()` reads a `false` as "go create it." Reporting "does not exist" when the truth is "could not check" is the wrong shape: a transient fault gets acted on as if it were a confirmed absence, instead of surfacing as the infrastructure problem it is. Meilisearch never had this bug - its `collectionExists()` already tolerated only a real not-found. Typesense now matches it.
21
+
22
+ ## What changed
23
+
24
+ - **Meilisearch `getHealth()` no longer throws.** It now mirrors Typesense: try/catch around the probe, log a warning, resolve `{ ok: false }` on any failure.
25
+ - **Typesense `importDocuments()` attaches progress to every failure, not just raw engine errors.** An `ApplicationError` raised mid-import now gets `{ totalCount, processedCount, successCount, failCount }` merged onto its own `extra.details` before being rethrown - the SAME error, with its own `statusCode` / `messageCode` intact.
26
+ - **Typesense `collectionExists()` now surfaces a genuine failure instead of reporting absence.** It routes through the same `runEngineCall` every other verb uses; the Typesense SDK's own `exists()` already resolves `false` for a real absence and only ever rejects on an infrastructure failure, so there is no not-found case left to tolerate here - every throw is real and reaches the caller as a sanitized `503`.
27
+
28
+ ## Who is affected
29
+
30
+ - **Anyone calling `ping()` or `getHealth()` as a liveness probe.** Both now resolve, never throw, on either engine. No action needed - this only removes a way the call could break.
31
+ - **Anyone catching a Typesense `importDocuments()` failure and reading `error.extra.details`.** `details` is now populated whether the underlying failure was a raw engine error or an already-shaped `ApplicationError` (a `409` conflict, for example).
32
+ - **Meilisearch imports.** Unaffected - `MeilisearchConnector.importDocuments()` already merged progress onto both error shapes.
33
+ - **Anyone calling Typesense `collection.exists()` (directly, or via `ensureCollection()`) while the engine is unreachable.** It now throws a sanitized `503` instead of resolving `false`. If your code called `ensureCollection()` expecting it to quietly retry as a create on any hiccup, it now surfaces the failure instead - the correct behavior, since the collection's real state was never confirmed absent.
34
+
35
+ ## The contract going forward
36
+
37
+ - `getHealth()` never throws, on either engine - a probe failure always resolves `{ ok: false }`.
38
+ - Every `importDocuments()` failure carries partial progress in `error.extra.details`, regardless of whether the underlying error was already framework-shaped.
39
+ - `collectionExists()` never reports absence for a failure it could not classify - only a genuine not-found resolves `false`; everything else surfaces.
40
+
41
+ These three pull in opposite directions on purpose, and that is the point: a probe whose job is to detect failure must never throw (`getHealth`), while a query whose `false` triggers a write must never lie about absence (`collectionExists`). Each fix picked the shape its own caller needed, not a shared default.
42
+
43
+ ## See also
44
+
45
+ - [Connectors Consistency Hardening](/changelogs/2026-07-11-connectors-consistency-hardening) - the review that first aligned Typesense and Meilisearch error shapes
46
+ - [One Transport for Every Typesense Search](/changelogs/2026-08-07-typesense-multi-search-transport) - the same connector's other recent contract-tightening pass
@@ -0,0 +1,188 @@
1
+ ---
2
+ title: "Tree Utilities Join helpers, and RecursiveTreeSql Bounds Every Recursive Walk in kernel"
3
+ description: "TreeWalker and TreeBuilder bring pure in-memory tree walking and building to @venizia/ignis-helpers. RecursiveTreeSql builds a bounded, injection-safe WITH RECURSIVE query in @venizia/ignis-kernel, with maxDepth mandatory and validated at runtime."
4
+ ---
5
+
6
+ # Changelog - 2026-08-30
7
+
8
+ ## Tree Utilities Join helpers
9
+
10
+ <Badge type="tip" text="New Feature" />
11
+
12
+ **In one line.** `TreeWalker` and `TreeBuilder` bring pure, dependency-free tree walking and building to `@venizia/ignis-helpers`.
13
+
14
+ ### The problem it solves
15
+
16
+ Two copies of the same tree algorithms existed side by side, and neither covered what the other did. One knew how to prune a walk at a boundary and measure height; the other knew how to build a tree from an async source and guard against cycles. Picking one meant giving up the other's capability.
17
+
18
+ ### What changed
19
+
20
+ `modules/tree/` adds two focused classes instead of one do-everything one:
21
+
22
+ - **`TreeWalker`** - static methods over a tree you already have: `walk`, `walkAsync`, `height`, `heightWhere`, `count`, `collectLeaves`.
23
+ - **`TreeBuilder`** - static methods that build a tree, or read one back with the path attached: `build`, `leaves`, `nonLeaves`, `print`.
24
+
25
+ ```typescript
26
+ import { TreeBuilder, TreeWalker } from '@venizia/ignis-helpers';
27
+
28
+ const tree = await TreeBuilder.build({
29
+ rootValue: rootCategory,
30
+ getChildren: category => fetchChildCategories(category.id),
31
+ getKey: category => category.id,
32
+ });
33
+
34
+ TreeWalker.walk({
35
+ root: tree,
36
+ onVisit: (node, depth) => console.log(node.value.name, depth),
37
+ });
38
+ ```
39
+
40
+ `walk` and `walkAsync` stay two methods, not one method with a mode flag - a synchronous walk returns `void`, an asynchronous one returns `Promise<void>`, and collapsing them would force every synchronous caller to `await` a value that was never a promise.
41
+
42
+ ### Three behaviors carried over on purpose
43
+
44
+ Each of these looks like it could be "fixed" to match intuition. Don't - each was paid for in production.
45
+
46
+ | Behavior | What it means |
47
+ |---|---|
48
+ | `shouldPrune(node, depth)` returning `true` | `node` is still visited - `onVisit` still runs. Only its children are skipped. Measuring depth to a boundary needs the boundary node counted. |
49
+ | `build` sees a repeated `getKey` | Skips that branch. Does not throw. Real hierarchies contain legitimate diamonds - the same node reachable through two parents - and a diamond is not a cycle. |
50
+ | `leaves({ includePath: true })` | Returns the root-to-leaf chain alongside each leaf, so building something like a nested order-line view costs one traversal instead of two. |
51
+
52
+ ### Who is affected
53
+
54
+ - **New code.** Import `TreeWalker`/`TreeBuilder` from `@venizia/ignis-helpers` instead of hand-writing tree traversal.
55
+ - **Everyone else.** No change - this is a new module, nothing existing moved or renamed.
56
+
57
+ ### Details
58
+
59
+ - Pure: `Map`, `Set`, and arrays only. No Drizzle, no DI container, no I/O - that purity is why it lives in `helpers` and not `kernel`.
60
+ - `TreeBuilder.build`'s `getChildren` may return a plain array or a promise; the build is always asynchronous even when a given fetcher is not, because real callers fetch children from a repository.
61
+ - `RecursiveTreeSql`, the SQL-emitting counterpart for a database-backed tree walk, lives in `@venizia/ignis-kernel` - see the next section.
62
+
63
+ | File | Package |
64
+ |------|---------|
65
+ | `src/modules/tree/common/types.ts` | helpers |
66
+ | `src/modules/tree/walk.ts` | helpers |
67
+ | `src/modules/tree/builder.ts` | helpers |
68
+
69
+ ## RecursiveTreeSql - A Bounded, Injection-Safe WITH RECURSIVE Builder
70
+
71
+ <Badge type="tip" text="New Feature" /> <Badge type="danger" text="Security" />
72
+
73
+ **In one line.** `RecursiveTreeSql.walk()` builds a `WITH RECURSIVE` fragment that walks an adjacency-list table up or down from a root row, with a mandatory depth bound and validated identifiers.
74
+
75
+ ### The problem it solves
76
+
77
+ A recursive query that walks a parent chain needs its own depth guard, hand-written, every time. Fourteen call sites remembered. One did not - it walked a merchant's parent chain with no bound and no cycle guard, and hung a production process the moment the data contained `A -> B -> A`.
78
+
79
+ A rule that fifteen call sites must each remember correctly is a rule that will eventually be forgotten once. Making the depth bound a required parameter turns "remember to add one" into "the code will not compile without one."
80
+
81
+ ### What changed
82
+
83
+ ```typescript
84
+ import { RecursiveTreeDirections, RecursiveTreeSql } from '@venizia/ignis';
85
+
86
+ const walk = RecursiveTreeSql.walk({
87
+ name: 'category_ancestors',
88
+ table: categoriesTable,
89
+ rootId: categoryId,
90
+ direction: RecursiveTreeDirections.UP,
91
+ maxDepth: 20,
92
+ });
93
+
94
+ // walk is a Drizzle SQL fragment - write your own SELECT around it:
95
+ const rows = await db.execute(sql`${walk} SELECT * FROM category_ancestors`);
96
+ ```
97
+
98
+ | Option | Type | Default | Meaning |
99
+ |---|---|---|---|
100
+ | `name` | `string` | - | CTE name your own `SELECT` references afterward. |
101
+ | `table` | `unknown` | - | A Drizzle table. Checked at runtime with `is(table, Table)`, and also picks the SQL dialect - see below. |
102
+ | `rootId` | `string` | - | The row to start from. Bound as an ordinary parameter, never spliced into SQL text. |
103
+ | `direction` | `'UP' \| 'DOWN'` | - | `DOWN` follows `parentColumn -> idColumn` (descendants). `UP` follows the reverse (ancestors). |
104
+ | `maxDepth` | `number` | - (required) | Recursion bound, counted in **edges**. Must be a positive integer - `<= 0` throws. |
105
+ | `idColumn` | `string` | `'id'` | |
106
+ | `parentColumn` | `string` | `'parent_id'` | |
107
+ | `columns` | `string[]` | `[]` | Extra columns carried into every row of the walk. |
108
+ | `recursiveFilter` | `SQL` | - | ANDed into the recursive term's `WHERE` clause. Build it with Drizzle's own `sql` tag. |
109
+ | `trackPath` | `boolean` | `false` | Emits `path` and `is_cycle`; stops expanding a row once it re-visits an id already in its own path. **The two columns come back in different shapes per engine - see below.** |
110
+ | `startDepth` | `number` | `0` | Depth value assigned to the root row. |
111
+
112
+ ### `maxDepth` is mandatory, and `0` is rejected too
113
+
114
+ `maxDepth` has no `?` and no default - a caller who forgets it gets a compile error. That alone is not enough: `0` type-checks as a valid `number` but produces a recursive term that runs zero times, so the query silently returns nothing. `RecursiveTreeSql.walk` checks this at runtime and throws for `maxDepth <= 0`, turning a query that looks like it ran but returned nothing into an error that says why.
115
+
116
+ **It counts edges, not rows.** The root sits at `depth 0`, so `maxDepth: N` returns up to **N+1** rows. Measured against a real Postgres on a five-node chain:
117
+
118
+ | `maxDepth` | Rows | Deepest `depth` |
119
+ |---|---|---|
120
+ | `1` | 2 | 1 |
121
+ | `2` | 3 | 2 |
122
+ | `4` | 5 | 4 |
123
+ | `5` | 5 | 4 (chain exhausted) |
124
+
125
+ Worth stating because "depth" and "how many levels I want back" are the same word to most callers and differ by one. Asking for `maxDepth: 1` to get the row and its parent is right; expecting one row is not.
126
+
127
+ ### `table` stays `unknown`, checked at runtime
128
+
129
+ `table` is typed `unknown`, not a tightened Drizzle generic. `kernel` cannot see an application's own schema, and a type that pretends to know the shape of a table it has never seen is worse than `unknown` - it looks safe and is not. At runtime, `RecursiveTreeSql.walk` checks `is(table, Table)` and throws `getError` naming what actually arrived when the check fails.
130
+
131
+ `table` also picks the SQL dialect. `walk` checks `is(table, PgTable)` and `is(table, SQLiteTable)` and compiles the matching form - there is no separate `engine` option, so there is no way for an option to disagree with the schema you called it with. A table belonging to neither (MySQL, for example) throws the same way an invalid table does.
132
+
133
+ ### Identifiers are the injection surface here, not values
134
+
135
+ `rootId`, `maxDepth`, and `startDepth` are ordinary bound parameters - Drizzle parameterizes them automatically. `name`, `idColumn`, `parentColumn`, and every entry of `columns` are different: they become SQL identifiers, and an identifier cannot be parameterized the way a value can. Each one is checked against a strict allowlist (letters, digits, and underscores, not starting with a digit) before it reaches a query template, and `sql.identifier` quotes it on top of that. A caller who passes `idColumn: 'id"; DROP TABLE users; --'` gets a thrown error naming the field and the value, not a query that runs.
136
+
137
+ ### Cycle safety
138
+
139
+ ```typescript
140
+ const walk = RecursiveTreeSql.walk({
141
+ name: 'merchant_chain',
142
+ table: merchantsTable,
143
+ rootId: merchantId,
144
+ direction: RecursiveTreeDirections.UP,
145
+ maxDepth: 50,
146
+ trackPath: true,
147
+ });
148
+ ```
149
+
150
+ `maxDepth` alone already guarantees the walk terminates, with or without `trackPath` - it is an unconditional bound on the recursion. `trackPath: true` adds a cycle-detection idiom on top: a `path` value and an `is_cycle` flag, with `AND NOT r.is_cycle` in the recursive term so a row already flagged cyclic is never expanded again. On the exact production shape that used to hang - `A -> B -> A` - the walk now returns three rows, the third flagged `is_cycle: true`, instead of never returning.
151
+
152
+ Postgres and SQLite express `path` differently, because SQLite has no array type:
153
+
154
+ | Engine | `path` | Membership test |
155
+ |---|---|---|
156
+ | Postgres | native array (`ARRAY[...]`) | `= ANY(path)` |
157
+ | SQLite | text, each id wrapped in a `char(31)` delimiter | `instr(path, char(31) \|\| id \|\| char(31)) > 0` |
158
+
159
+ `char(31)` is the ASCII Unit Separator - a control character that does not occur in ordinary UUIDs, serial ids, slugs, or emails. Wrapping every id on both sides, rather than joining with a plain separator, stops a partial match: without it, an id of `1` would look like it appeared inside `12`. The SQLite form is exact as long as no id value ever contains that byte. `RecursiveTreeSql` does not validate or escape id values for this - it is a real, if narrow, gap: an id containing `char(31)` could produce a false-negative cycle match.
160
+
161
+ **Both emitted columns reach your code in a different shape per engine.** The generated SQL is correct on each, but the rows are not interchangeable:
162
+
163
+ | Column | Postgres | SQLite |
164
+ |---|---|---|
165
+ | `path` | `string[]` - a real array | `string` - ids joined and wrapped by `char(31)` |
166
+ | `is_cycle` | `boolean` (`true`/`false`) | `number` (`1`/`0`) - SQLite has no boolean literal |
167
+
168
+ So `row.path.length` and `row.is_cycle === true` both work on Postgres and both fail on SQLite - the first throws, the second is quietly always `false`. Read `is_cycle` truthily, and split `path` on `String.fromCharCode(31)` when the engine is SQLite. Stated here because nothing in the type signature shows it: `walk()` returns a `SQL`, and the row shape is whatever the driver hands back.
169
+
170
+ ### Who is affected
171
+
172
+ - **New code walking a parent/child hierarchy in SQL.** Use `RecursiveTreeSql.walk` instead of hand-writing a `WITH RECURSIVE` query and its own depth guard.
173
+ - **Everyone else.** No change - this is a new export, nothing existing moved.
174
+
175
+ ### Details
176
+
177
+ - Supports Postgres and SQLite, selected from `table` - no `engine` option to pass or get wrong. `trackPath`'s cycle guard differs by engine because SQLite has no array type - see Cycle safety above for the exact difference and its one semantic gap.
178
+ - `RecursiveTreeDirections` (`UP`/`DOWN`) follows the repo's const-class convention, not a bare object literal.
179
+ - `import { RecursiveTreeSql } from '@venizia/ignis'` resolves - `core-server` re-exports `kernel` wholesale, so no new dependency is needed to reach it from an application already on `@venizia/ignis`.
180
+ - The in-memory counterpart for a tree you build without a database - `TreeWalker`/`TreeBuilder` - lives in `@venizia/ignis-helpers`, see the section above.
181
+
182
+ | File | Package |
183
+ |------|---------|
184
+ | `src/base/repositories/sqls/recursive-tree.ts` | kernel |
185
+
186
+ ## See also
187
+
188
+ - [Casbin Single-Wave Extraction - Recursive CTE Replaces the Second Query Wave](./2026-07-20-casbin-single-wave-extraction) - an earlier hand-written recursive CTE in the authorization path.
@@ -0,0 +1,114 @@
1
+ ---
2
+ title: "Where Clauses Now Type-Check the Value, Not Just the Column"
3
+ description: "TWhere<T> already rejected a column name that didn't exist on T. It did not check the value against that column's type at all - every value was any. It does now."
4
+ ---
5
+
6
+ # Changelog - 2026-08-30
7
+
8
+ ## Where Clauses Now Type-Check the Value, Not Just the Column
9
+
10
+ <Badge type="warning" text="Breaking Change" /> <Badge type="tip" text="Enhancement" />
11
+
12
+ **In one line.** `TWhere<T>` now checks that a where-clause value fits its column's type. A column name that doesn't exist on `T` was already rejected; a value of the wrong type for a real column was not.
13
+
14
+ ## The problem it solves
15
+
16
+ `TWhere<T>` was defined as `{ [key in keyof T]?: any } & { and?; or? }`. The `[key in keyof T]` part did limit which columns you could name. It did not check what you put in them - every column's value was typed `any`.
17
+
18
+ ```typescript
19
+ type Product = { id: number; status: string; price: number | null };
20
+
21
+ // `status` is a string column. This compiled clean.
22
+ const where: TWhere<Product> = { status: 123 };
23
+ ```
24
+
25
+ Nothing logged the mismatch, and TypeScript had no way to catch it either - `any` accepts anything.
26
+
27
+ ## What changed
28
+
29
+ - **`TWhereOperators<V>`** - the 25 field operators from `QueryOperators` (`eq`, `gt`, `like`, `in`, `between`, `contains`, ...), each typed against the column's own value type `V`.
30
+ - **`TWhereValue<V>`** - a column's condition is a bare scalar (`status: 'active'`), a bare `null` (`deletedAt: null`, the common way to write `IS NULL`), or an operator object (`price: { gte: 10 }`).
31
+ - **`TWhere<T>`** - now `{ [key in keyof T]?: TWhereValue<T[key]> }`, so a key must be a real column of `T` and its value must fit that column.
32
+
33
+ ```typescript
34
+ import type { TWhere } from '@venizia/ignis-filter';
35
+
36
+ type Product = { id: number; status: string; price: number | null };
37
+
38
+ const valid: TWhere<Product> = { status: 'active', price: { gte: 10 } };
39
+
40
+ // @ts-expect-error - 123 is not a valid value for a string column.
41
+ const wrongType: TWhere<Product> = { status: 123 };
42
+ ```
43
+
44
+ A column name that doesn't exist on `T` (`{ stat: 'active' }`) was already rejected before this
45
+ change - that part of the mapped type was never the problem. Only the value side was `any`.
46
+
47
+ | Type | Shape | Notes |
48
+ |---|---|---|
49
+ | `TWhereOperators<V>` | `{ eq?: V; gt?: V; in?: V[]; between?: [V, V]; ... }` | Mirrors `QueryOperators` field-by-field. |
50
+ | `TWhereValue<V>` | `V \| null \| TWhereOperators<V>` | `null` is mandatory - it is how a caller writes `IS NULL`. |
51
+ | `TWhere<T>` | `{ [K in keyof T]?: TWhereValue<T[K]> } & { and?; or? }` | Unchanged shape, tightened values. |
52
+
53
+ ## One column type gets an exception: `isoTimestamp`
54
+
55
+ `TWhereValue<V>` above says a where-clause value must match the column's own read type. One column
56
+ breaks that rule on purpose. `isoTimestamp` (`packages/connectors/src/relational/{postgres,sqlite}/models/common/columns.ts`)
57
+ reads back as `string`, but its `toDriver` already accepts a `Date` and converts it before the value
58
+ reaches the driver. Refusing a `Date` in a filter would have made the type contradict a conversion
59
+ the column itself performs - `{ effectiveFrom: { lte: new Date() } }` has always run correctly; only
60
+ the type could not see it.
61
+
62
+ ```typescript
63
+ type Contract = { id: number; effectiveFrom: TIsoTimestamp };
64
+
65
+ // effectiveFrom is built with isoTimestamp (its type is TIsoTimestamp, shown below) -
66
+ // this now compiles, and always ran correctly.
67
+ const where: TWhere<Contract> = { effectiveFrom: { lte: new Date() } };
68
+ ```
69
+
70
+ The exception is narrow: it lives on a branded type, not on `string` itself.
71
+
72
+ ```typescript
73
+ export type TIsoTimestamp = string & { readonly isoTimestampBrand: unique symbol };
74
+
75
+ type TWidenIsoTimestamp<V> = V extends TIsoTimestamp ? V | Date : V;
76
+
77
+ export type TWhereValue<V> = TWidenIsoTimestamp<V> | null | TWhereOperators<TWidenIsoTimestamp<V>>;
78
+ ```
79
+
80
+ `isoTimestamp`'s column now declares `data: string | TIsoTimestamp` - it used to be bare `string`. A
81
+ plain `text` column still declares `data: string` alone, so `TWidenIsoTimestamp` leaves it untouched:
82
+ comparing it against a `Date` stays a compile error. Reading a branded column back is unaffected -
83
+ `TIsoTimestamp` is a subtype of `string`, so `.toUpperCase()`, string concatenation, and
84
+ `$inferInsert` accepting a plain string literal all keep working exactly as before.
85
+
86
+ `TIsoTimestamp` lives in `filter`, not `connectors`. `filter` has no dependency on `connectors`, and
87
+ the brand is a pure type with no runtime import, so the dependency points the same way it already
88
+ does: `connectors` imports the type from `filter`.
89
+
90
+ ## Who is affected
91
+
92
+ - **Relational and search connectors, `core-server`, `core-worker`, `boot`.** All rebuilt clean against the new type. Three internal call sites in `packages/connectors` (`updateById`, `deleteById`, `restoreById`, `findById`) build `{ id: opts.id }` against a generic `DataObject` the compiler cannot fully resolve; each now carries an explicit `TWhere<DataObject>` cast with a one-line comment, since the generic's constraint is too deeply nested for `tsc` to verify on its own.
93
+ - **Every downstream caller with a wrong-typed value for a real column.** That code compiled before. It will not compile now, and the fix is to correct the where clause, not to widen the type back.
94
+ - **Every `isoTimestamp` column now accepts a `Date` directly**, bare or inside an operator (`gt`, `gte`, `lt`, `lte`, `between`). No call site needs to change, but no call site needs its `.toISOString()` anymore either - see the vert note below.
95
+ - **JSON and JSONB columns are not covered.** A `metadata` or `jValue` column is still declared `any` in application schemas, so `TWhereValue<any>` accepts anything under it. A typo inside a JSON path stays silent before and after this change - dot-path key typing needs the application to declare `$type<>()` on its jsonb columns first, and is separate future work.
96
+
97
+ ## Details
98
+
99
+ - Operators come from `QueryOperators` in `packages/filter/src/common/operators.ts` - 25 field operators plus `and`/`or`/`not`. Every operator in that list has a matching field in `TWhereOperators<V>`; none were invented.
100
+ - `between`/`notBetween` are now typed as a `[V, V]` tuple. A test that intentionally sends the wrong arity to prove the *runtime* guard still fires (`postgres-query-operators-between.test.ts`) casts the literal `as any` - the type system and the runtime guard are answering different questions: what `tsc` can prove, versus what a wire caller can actually send.
101
+ - `examples/vert`'s `comprehensive-operator-test.service.ts` compared `createdAt` against a `Date` value and was fixed at the call site with `.toISOString()`. `createdAt` is an `isoTimestamp` column (`generateTzColumnDefs()`), so that fix still works but is no longer required - it now falls under the exception above and accepts the `Date` directly. The call site was left as-is; both forms compile.
102
+
103
+ | File | Package |
104
+ |------|---------|
105
+ | `src/common/types.ts` | filter |
106
+ | `src/relational/core/repositories/core/persistable.ts` | connectors |
107
+ | `src/relational/core/repositories/core/readable.ts` | connectors |
108
+ | `src/relational/core/repositories/core/soft-deletable.ts` | connectors |
109
+ | `src/relational/postgres/models/common/columns.ts` | connectors |
110
+ | `src/relational/sqlite/models/common/columns.ts` | connectors |
111
+ | `src/__tests__/filter-builder/postgres-query-operators-between.test.ts` | core-server |
112
+ | `src/__tests__/filter-builder/where-type-safety.test.ts` | core-server |
113
+ | `src/__tests__/filter-builder/iso-timestamp-where.test.ts` | core-server |
114
+ | `src/services/tests/comprehensive-operator-test.service.ts` | examples/vert |
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: TEntityId Makes a String Id Impossible to Confuse With a String
3
+ description: An opt-in branded string type so passing a name, code or email where an entity id belongs is a compile error instead of a silent lookup that returns nothing.
4
+ ---
5
+
6
+ # Changelog - 2026-08-31
7
+
8
+ ## TEntityId
9
+
10
+ <Badge type="tip" text="New Feature" />
11
+
12
+ **In one line.** `TEntityId` is a `string` a plain `string` will not assign to, so the compiler catches an id/name mix-up that today fails silently at runtime.
13
+
14
+ ## The bug it catches
15
+
16
+ Every string id in a codebase has the same type as every other string. The compiler sees no difference between these two:
17
+
18
+ ```typescript
19
+ const merchant = { id: 'M1', name: 'Cua hang A' };
20
+
21
+ await merchantRepository.findById({ id: merchant.name });
22
+ ```
23
+
24
+ That compiles. It runs. It returns nothing, and the caller reads the empty result as "no such merchant" rather than "I passed the wrong field". The same shape covers passing a `storeId` where a `merchantId` belongs, or a slug where an id belongs - all of them are `string`, so nothing objects.
25
+
26
+ With `TEntityId` on the column, the second line is a compile error at the call site.
27
+
28
+ ## How to use it
29
+
30
+ ```typescript
31
+ import { toEntityId } from '@venizia/ignis-kernel';
32
+ import type { TEntityId } from '@venizia/ignis-kernel';
33
+
34
+ // Opt a column in
35
+ merchantId: text('merchant_id').$type<TEntityId>().notNull(),
36
+
37
+ // The only way to produce one
38
+ const id = toEntityId({ value: request.params.merchantId });
39
+ ```
40
+
41
+ A `TEntityId` still behaves as a string everywhere a string is accepted - concatenation, `toUpperCase()`, template literals, `JSON.stringify`. Only the direction *into* the type is restricted.
42
+
43
+ ## It validates nothing, and that is the point
44
+
45
+ > [!IMPORTANT]
46
+ > `toEntityId` is a cast with a non-empty check. It does not verify the row exists, match a format, or check a prefix.
47
+
48
+ The value is making the conversion **visible at each boundary**. Every place a raw string becomes an id is now a line you can grep for, rather than an implicit widening nobody wrote down. An empty string is refused because an id of `''` collapses a `where` clause to no condition - a filter that silently matches everything is worse than one that throws.
49
+
50
+ ## The cost is real, and it is not optional
51
+
52
+ Drizzle derives both `$inferSelect` and `$inferInsert` from the same column type. Branding a column therefore rejects **every literal** written against it until each one converts:
53
+
54
+ ```typescript
55
+ await merchantRepository.create({ data: { merchantId: 'M1' } }); // no longer compiles
56
+ await merchantRepository.create({ data: { merchantId: toEntityId({ value: 'M1' }) } });
57
+ ```
58
+
59
+ Seeds, fixtures, test data and path params all pay this. That is why the type is **opt-in per column** rather than applied across the framework.
60
+
61
+ The obvious escape - `TEntityId | string` - was measured and does not work: a union restores the literals but makes a plain `string` assignable again, which erases the entire guarantee. There is no version of this that catches the bug without rejecting the literals.
62
+
63
+ ## Who is affected
64
+
65
+ - **Nobody, unless they opt in.** No IGNIS type changes, no column is branded by default, and no existing code needs updating. This release only makes the type available.
66
+ - **A codebase adopting it** should brand one entity family first and convert its call sites, rather than branding everything at once.
67
+
68
+ | File | Package |
69
+ |------|---------|
70
+ | `src/base/models/common/types.ts` | kernel |