candor-ts 0.5.8 → 0.5.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 (2) hide show
  1. package/package.json +1 -1
  2. package/scan-core.mjs +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "candor-ts",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
4
4
  "description": "candor for TypeScript — per-function side effects, transitively, with a policy gate (candor-spec 0.5)",
5
5
  "type": "module",
6
6
  "dependencies": {
package/scan-core.mjs CHANGED
@@ -79,9 +79,17 @@ export const KAPPA_RULES = [
79
79
  [/^mongoose$/,
80
80
  /^(find|save|create|insertMany|updateOne|updateMany|replaceOne|deleteOne|deleteMany|aggregate|countDocuments|estimatedDocumentCount|distinct|exec|bulkWrite)/,
81
81
  "Db"],
82
- [/^(sequelize|drizzle-orm)$/,
83
- /^(find|create|update|destroy|upsert|count|max|min|sum|query|select|insert|delete|execute|transaction)/,
82
+ // Sequelize is EXECUTE-ON-CALL: `Model.findAll()/create()/update()/destroy()` issue the query and
83
+ // return a promise — so its verbs are the I/O boundary.
84
+ [/^sequelize$/,
85
+ /^(find|create|update|destroy|upsert|count|max|min|sum|increment|decrement|reload|save|query|transaction)/,
84
86
  "Db"],
87
+ // Drizzle is a BUILDER: `db.select().from().where()` / `db.insert().values()` / `db.update().set()` /
88
+ // `db.delete().where()` issue NOTHING until a terminal `.execute()`/await/`.all()`/`.get()`/`.run()` (or
89
+ // the relational `db.query.x.findMany/findFirst`). Listing select/insert/update/delete as Db fabricated
90
+ // the effect onto a pure builder chain (the typeorm rule's `createQueryBuilder` discipline, violated).
91
+ // VERB-PRECISE: only the terminal execution verbs; the builder heads under-report (sound) until executed.
92
+ [/^drizzle-orm$/, /^(execute|transaction|findMany|findFirst|all|get|run)$/, "Db"],
85
93
  // Nest's HttpService wraps axios — the request verbs are Net.
86
94
  [/^@nestjs\/axios$/, /^(get|post|put|patch|delete|head|request)$/, "Net"],
87
95
  ];