Repository navigation
refactor(driver-sql, plugin-security): read the list-comparand split from @objectstack/spec/data - #29660
Conversation
…from the spec Both modules kept a hand copy of the list operators ($in, $nin, $between). They now call isListComparandOperator from @objectstack/spec/data, the one source the comparand faces read. The copies equalled the spec set, so behaviour is unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbYnNFzqeb7KM8Lpd7j
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbYnNFzqeb7KM8Lpd7j
📓 Docs Drift Check3 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 26 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 73047f30e4a197ba2fe7de3f2482e6722ab0ff57 && git checkout 73047f30e4a197ba2fe7de3f2482e6722ab0ff57
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e0187d0fe1c89f1c70d0d2a65024cb6a2e5d4af7 19e661f7227e82485711e4be6c28f0fbd022877e && git checkout -B drift-repro e0187d0fe1c89f1c70d0d2a65024cb6a2e5d4af7 && git merge --no-ff 19e661f7227e82485711e4be6c28f0fbd022877e
node scripts/docs-audit/affected-docs.mjs --json e0187d0fe1c89f1c70d0d2a65024cb6a2e5d4af7 |
|
domain:server#4 · os-warren · session_01JQwxbacSXJQqAztgt4UMrS 席位核对ACCEPT ·
|
Output of `node scripts/codemod-split-sql-driver.mjs --write` on sql-driver.ts at origin/main 2ea6042 (input sha256 9abf7867fd98; #29660 touched it), unedited: 54 method bodies move to 18 section modules and 96 of the 129 top-level declarations ahead of the class to sql-driver-top-level.ts; sql-driver.ts 18330 -> 14050 lines. Output tree sha256 ab8990700a0d, the same on two runs. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
Requested by Warren · project thread
Fixes #29611
Clause-②: no
Metadata-protocol: none
维护者速读
driver-sql的sql-driver.ts与plugin-security的rls-check-stored-form.ts删掉各自手抄的LIST_COMPARAND_OPERATORS($in/$nin/$between),改为调用@objectstack/spec/data导出的isListComparandOperator。packages/plugins/plugin-security/src/rls-check-stored-form.ts(storedOperand一行替换),packages/drivers/driver-sql/src/sql-driver.ts(assertCompilableComparand成员循环一行替换,加导入)。git grep -n LIST_COMPARAND_OPERATORS -- packages/drivers/driver-sql packages/plugins/plugin-security,预期零命中(退出码 1)。What changes
packages/drivers/driver-sql/src/sql-driver.ts:assertCompilableComparandbind-tests each member of a list operator's array only whenisListComparandOperator(op)answers true. The module-privateLIST_COMPARAND_OPERATORSand its docblock are removed. The docblock's reason (a scalar operator handed an array keeps its own "requires a single comparable value" message) moves into the call-site comment. A new import line from@objectstack/spec/datacarries a comment in the file's existing style, and the{@link}in the scalar set's docblock now names the predicate.packages/plugins/plugin-security/src/rls-check-stored-form.ts:storedOperandasksisListComparandOperator(op), added to the existing@objectstack/spec/dataimport. The module-private copy is removed. TheVALUE_COMPARISON_OPERATORSdocblock now says the list half is the spec's answer. That set is unchanged: it is a different question (which operators compare with the stored value), and the card does not move it..changeset/29611-driver-sql-list-comparand-predicate.md(@objectstack/driver-sqlpatch) and.changeset/29611-plugin-security-list-comparand-predicate.md(@objectstack/plugin-securitypatch), each with both declaration lines.packages/specedit. Noprotocol.tsfile is touched.Tests
sql-driver-compile-refusal-seam.test.tsfor the list-member bind refusal) and stay green.Acceptance notes
4d8095ba, a scratch script read each local set from source and compared it with the built spec predicate over 43 spellings: the 19 operatorsFieldOperatorsSchemadeclares, plus 24 others (the infix spellings=,==,!=,<>,>,>=,<,<=,like,ilike;in,nin,not in,between;$and,$or,$not,$field,$IN; the empty string; andconstructor,__proto__,toString,hasOwnProperty). Both sets answered exactly asisListComparandOperatoron every spelling, and each holds$in,$nin,$between. The spec export covers every case the local copies handled. The script was not committed.@objectstack/spec(workspace:*) and import from@objectstack/spec/data, so no manifest changes.driver-sqlkeeps its other local operator sets (SCALAR_COMPARAND_OPERATORSwith infix spellings,TEXT_PATTERN_OPERATORS,LIKE_PATTERN_OPERATORS). They are driver-specific and outside this card.Verification
Readings on head
19e661f7, which mergesorigin/main3482f3d8into the change commita7214859(base4d8095ba). Each reading was also taken ona7214859before the merge, with the same results except where noted.Tests and typecheck
19e661f7:pnpm install --frozen-lockfile, thenpnpm exec turbo run build --filter=!@objectstack/docs --concurrency=2, 117/117 tasks,VERDICT command-exit 0.pnpm --filter @objectstack/driver-sql --filter @objectstack/plugin-security typecheck:VERDICT command-exit 0.pnpm --filter @objectstack/plugin-security test: 241 files passed, 5203 tests passed, 45 skipped,VERDICT command-exit 0. (5202 ona7214859; the merge brought a reworkedit.eachtable indefault-row-scope-declarations.test.ts, from feat(platform-objects): sys_personal_view, a reader's own named list views, with the owner's delete door (server step) #29575.)pnpm --filter @objectstack/driver-sql test: 236 files passed, 12 skipped; 3847 tests passed, 214 skipped,VERDICT command-exit 0.test:repois not run locally (no file of that project changed); it is CI'sTest Core.Derived gates and lint
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon19e661f7derived 60 families. All 60 ran, each exit 0, exit codes captured before any pipe.--ranreconciliation: "60 derived, 60 run, 0 NOT-MEASURED, 0 UNRUN", exit 0, no stale-tree warning.a7214859the same derivation gave 61 families (the extra one,check:pm-changeset-deadline-census, was retired onmainby chore(pm): delete changeset-deadline-census, a report-only tool nothing calls #29577). There,check:dual-build-cjs-loadsandcheck:i18nfirst exited 3 (PREREQUISITE NOT MET: nodist/outside this diff's closure). After a full build both exited 0, and the reconciliation read 61 of 61 run. That run also warned the tree was 10 commits behindorigin/main, which is why the branch mergedmainand every reading was taken again.pnpm lint(repo-wide eslint) exit 0 on both heads.Dogfood battery: not run (no
!in the title and no(narrowing)arm).Human Minimum
packages/specholds no runtime logic. (No spec change.)pnpm lintpasses (local run, exit 0).main, one pull request.packages/spectouched: not touched, nothing to regenerate.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code