Repository navigation
feat(spec): export isListComparandOperator from @objectstack/spec/data; flow record nodes read it instead of a local copy - #29570
Conversation
…a; flow record nodes read it The list half of the field-operator split is published as a predicate, and service-automation's crud nodes import it instead of holding a local copy. The executor's reconciliation test retires; its assertion now lives beside the predicate in packages/spec. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZwoKyGHFx3aiQohjE
…arandOperator Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZwoKyGHFx3aiQohjE
…main Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbZwoKyGHFx3aiQohjE
📓 Docs Drift Check3 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 168 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 337ad071d4c8f7f2a82e283dac88d4e3ed8aaa32 && git checkout 337ad071d4c8f7f2a82e283dac88d4e3ed8aaa32
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 32907ae9ce0f020a966c5363eaca2a688240e47a e5b9d970c302cc3eae5608f7b548212f890bfa47 && git checkout -B drift-repro 32907ae9ce0f020a966c5363eaca2a688240e47a && git merge --no-ff e5b9d970c302cc3eae5608f7b548212f890bfa47
node scripts/docs-audit/affected-docs.mjs --json 32907ae9ce0f020a966c5363eaca2a688240e47a |
|
domain:spec#5 · os-warren · session_01JQwxbWR3K3h7i1ytwycVg1 Contract-review-claim: session_01JQwxbWR3K3h7i1ytwycVg1 · head e5b9d97 · 2026-11-02T19:18Z The published-schema face ( |
|
domain:spec#5 · os-warren · session_01JQwxbWR3K3h7i1ytwycVg1 Contract reviewServed-tier: Inputs: card #29419 body and its three comments (triage 6583885988, claim 6584093337, os-dev-report 6585662916); PR #29570 body, its eight-file list and the net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
domain:spec#5 · os-warren · session_01JQwxbWR3K3h7i1ytwycVg1 维护者速读
席位核对ACCEPT ·
|
Requested by Warren · project thread
Fixes #29419
Clause-②: yes
Metadata-protocol: none
维护者速读
@objectstack/spec/data新增导出谓词isListComparandOperator(op),对声明列表比较值的字段运算符($in/$nin/$between)答 true,其余答 false;流程记录节点(crud-nodes.ts)改为导入它,删掉本地那份LIST_COMPARAND_OPERATORS副本及其对账测试。packages/spec。packages/spec/src/data/filter-comparand-operators.ts(谓词与改写的模块说明),packages/spec/src/data/filter-comparand-operators.test.ts(对账断言的新家),packages/services/service-automation/src/builtin/crud-nodes.ts(导入替换)。pnpm --filter @objectstack/spec exec vitest run src/data/filter-comparand-operators.test.ts,预期 1 个测试文件、2 个用例全部通过。What changes
isListComparandOperator(op: string): boolean(packages/spec/src/data/filter-comparand-operators.ts), exported from@objectstack/spec/data(packages/spec/src/data/index.ts, a named re-export). It answers whether a$-spelled field operator declares a LIST comparand, reading the sameLIST_COMPARAND_OPERATORSset the comparand-type face reads. TSDoc is one sentence.ReadonlySetis still a liveSetat run time: a caller that cast and mutated it would change what every comparand face inpackages/specjudges. The predicate publishes the answer and keeps both sets module-private. The module docblock's section "Why it is NOT in thedatabarrel" is rewritten to say what the barrel now publishes from the file and why the sets stay out.packages/services/service-automation/src/builtin/crud-nodes.ts:operandValueRefusalasksisListComparandOperator(last); the localLIST_COMPARAND_OPERATORSand its docblock are removed, and the function docblock names the spec predicate. An import swap, nothing else.crud-filter-guard.test.ts"every declared operator whose comparand is a list takes an evaluated list, and no other does", plus its now-unusedFieldOperatorsSchemaimport. Its assertion, every operatorFieldOperatorsSchemadeclares is a list operator exactly when its enforced slot takes a list, now lives inpackages/spec/src/data/filter-comparand-operators.test.ts, against the predicate the executor calls. That is the same assertion at a layer closer to the code. The executor's own use of the predicate stays pinned by the file's remaining list-operator cases (see the ablation below).packages/spec/api-surface/data.jsonandpackages/spec/export-origins/data.jsongain the one row each..changeset/29419-list-comparand-operator-predicate.md,patchfor@objectstack/specand@objectstack/service-automation, carrying both declaration lines.Tests
packages/spec/src/data/filter-comparand-operators.test.ts(2 cases), importing through thedatabarrel: the predicate answerstrueexactly for each declared operator whoseFieldOperatorsSchemaslot accepts a two-item list (with a control that the grammar declares more than ten operators, and the derived list pinned to$between,$in,$nin), andfalsefor undeclared spellings (in,between,$and,$or,$not,$IN, the empty string,has).crud-filter-guard.test.tsloses the one retired case: 66 to 65.Acceptance notes
Metadata-protocolalone, andnonetakespatch, so both packages shippatch.packages/drivers/driver-sql/src/sql-driver.tsandpackages/plugins/plugin-security/src/rls-check-stored-form.tseach hold their ownLIST_COMPARAND_OPERATORS($in,$nin,$between). Both equal the spec set today, and neither is in this card's scope. Not filed: there is no defect, only a possible follow-up to read the new predicate.packages/spec/src/data/filter-comparand-shape.tskeeps its own module-privateLIST_COMPARAND_OPERATORSmap (operator to authoring spellings). It is a different shape, unchanged.protocol.tsfile is touched.Verification
Readings on head
e5b9d970c(6e184de6cmergesorigin/main390bd2aed, then the artifact regeneration), except where a line names4cc2f8814, the pre-merge head.Tests and typecheck
4cc2f8814:turbo run build --filter='@objectstack/service-automation^...'31/31 tasks;vitest runinpackages/services/service-automation: 262 files / 3394 tests passed;pnpm --filter @objectstack/service-automation typecheckexit 0 (VERDICT command-exit 0).e5b9d970c: specfilter-comparand-operators,filter-comparand-type,filter-comparand-shapetests: 3 files, 166 passed, 1 todo;crud-filter-guard.test.ts: 65 passed;pnpm --filter @objectstack/spec typecheckandpnpm --filter @objectstack/service-automation typecheckexit 0 (VERDICT command-exit 0).pnpm --filter @objectstack/spec check:generatedafter a spec build one5b9d970c: all 14 artifacts up to date.test:repois not run locally (no file of that project changed); it is CI'sTest Core.Ablations
Each through
scripts/ablation-replace.mjs(anchor hit once, blob changed, restored to the HEAD blob,git statusclean after), on4cc2f8814. Both tests import the code under test from source, so nodistleg applies.isListComparandOperatormade to answerfalsefor$between:filter-comparand-operators.test.ts1 failed / 1 passed of 2.crud-nodes.tsmade to treat$ninas a scalar operator:crud-filter-guard.test.ts4 failed / 61 passed of 65 (the three "an evaluated list at a list operator's comparand passes" cases and the empty-entry refusal).Derived gates
node scripts/pm/dispatch-gates.mjs --commandsderived 84 families one5b9d970c; all 84 ran there, each exit 0, with exit codes captured before any pipe.--ranreconciliation: "84 derived, 84 run, 0 NOT-MEASURED, 0 UNRUN", exit 0.4cc2f8814the same 84 ran.check:dual-build-cjs-loadsexited 3 there (PREREQUISITE NOT MET: nodist/for packages outside this diff's closure), andcheck-plugin-teardown-shape --self-testexited 3 until its pinned fixture commit was fetched into the shallow clone, then exited 0.pnpm lintfirst among them) are CI's.Dogfood battery: not run (no
!in the title and no(narrowing)arm).Human Minimum
packages/specholds no runtime logic. (The predicate is a constant lookup beside the constant it reads.)pnpm lintis CI's.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code