Repository navigation
fix(spec)!: engine-side searchFields declarations refuse an empty list, as FullTextSearchSchema.fields does - #28154
Conversation
EngineQueryOptionsSchema.searchFields and its aggregate and count siblings take the shared search-field array arm, so the declaration never admits the value FullTextSearchSchema.fields (the structured search they share) and the Data API doors already refuse. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibybNsmrKsxbKJHwo36
…ds accept set Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibybNsmrKsxbKJHwo36
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
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 ec4fff953a3f513b80e830f1b92deb5206b36100 && git checkout ec4fff953a3f513b80e830f1b92deb5206b36100
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9f13ee81541ac1f6cbc2f5b5f2aca04e24ccc260 53d7eec3a696cc6f1ef435d1250b025c6031df0a && git checkout -B drift-repro 9f13ee81541ac1f6cbc2f5b5f2aca04e24ccc260 && git merge --no-ff 53d7eec3a696cc6f1ef435d1250b025c6031df0a
node scripts/docs-audit/affected-docs.mjs --json 9f13ee81541ac1f6cbc2f5b5f2aca04e24ccc260
|
|
domain:spec#1 · os-tesla · session_01L9qibwb6hBqszPTYJobitm Contract-review-claim: In-seat at |
|
domain:spec#1 · os-tesla · session_01L9qibwb6hBqszPTYJobitm Contract reviewServed-tier: Inputs: card #28059 body and its four comments (triage 6522171038, claim 6523197991, the domain:server note 6523729127, the os-dev-report 6525105567); PR #28154 body, five-file list, and the three-dot diff against Gate verdicts on the head: every one of the 50 check-runs is ① Derived judgmentsEach accept-set and public-surface change the diff implies, and whether it is right:
② Semver level
③ Boundary flags
④ Design judgmentpackages/spec/src/data/data-engine.zod.ts — judged against the ruling (card #28059 and triage 6522171038: "the engine-side
packages/spec/src/data/search-fields-names-a-field.ts — docblock only; the exported constants and factories are byte-identical. Judged against the tree: the new sentence "no published declaration of the override admits
Narrowing face as a whole (every non-prose path of the diff, the test file included): the narrowing takes no declared capability away at a consumer — both refusals it declares already exist on No must-fix. Should-fix: S1, S2 (changeset prose), S3 (one docblock parenthetical). Implemented-by: VERDICT: PASS |
… release; name both superseded entries Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibybNsmrKsxbKJHwo36
|
domain:spec#1 · os-tesla · session_01L9qibwb6hBqszPTYJobitm Regen-provenance: 6525975157 · 维护者速读
席位核对 · ACCEPT ·
|
domain:spec#1 · os-tesla · session_01L9qibwb6hBqszPTYJobitm
Requested by Tesla · project thread
Fixes #28059
Clause-②: no (narrowing)
Metadata-protocol: none
维护者速读
searchFields声明(EngineQueryOptionsSchema、EngineAggregateOptionsSchema、EngineCountOptionsSchema)改用共享的搜索字段数组规则,空数组[]被拒收,并带上与QuerySchema.searchFields相同的说明文字。search: { fields: [] }已被拒收,searchFields: []却被接受,而 Data API 入口和引擎(objectql: the engine followssearchFieldsinto its declared accept set (engine stage of #27683, the #27008 shape) #27732 进行中)都拒收它;按发布的类型或 JSON Schema 写代码的嵌入方和 AI 会被误导。string[] | undefined);引擎运行时不用这三个 schema 解析选项,所以直接调用引擎的行为本 PR 不变。回滚即 revert 本 PR。packages/spec/src/data/data-engine.zod.ts(三处声明)、packages/spec/src/data/search-fields-names-a-field.test.ts(原「仍接受空数组」的阶段边界测试翻转为拒收测试)、.changeset/28059-engine-search-fields-names-a-field.md(BREAKING 说明与 ADR-0087 处置)。pnpm --filter @objectstack/spec exec vitest run src/data/search-fields-names-a-field.test.ts,预期全部通过,其中包括 “EngineQueryOptionsSchema.searchFields refuses an empty list with the accept-set sentence”。What changes
EngineQueryOptionsSchema.searchFields,EngineAggregateOptionsSchema.searchFieldsandEngineCountOptionsSchema.searchFieldschange fromz.array(z.string()).optional()tosearchFieldsArray().optional(), the array armQuerySchema.searchFieldsandFullTextSearchSchema.fieldsalready use (./search-fields-names-a-field.ts, imported by this file already). An empty list is refused atsearchFieldswith the shared sentence. A list with a blank member is still admitted, as the shared arm admits it. One accept set, no fresh.min(1)..describe()ending in the sharedSEARCH_FIELDS_ACCEPT_SET, so the published JSON Schema and the reference docs state the rule.content/docs/references/data/data-engine.mdxis regenerated (3 lines).search-fields-names-a-field.tsdrops "the engine-side declarations do not take it yet".28059-engine-search-fields-names-a-field.md:@objectstack/specpatch (Metadata-protocol: none),fix(spec)!, both declaration lines, ADR-0087 dispositionnot-required (no-migration-prescription), and a "Supersedes" note for the unreleased spec/protocol: the publishedsearchFieldsdeclarations still admit an empty list that the data door now refuses; doessearchFieldsfollowselectinto a declared accept set, and does the engine follow? #27683 entry's bullet that said these declarations still admit[].Engine behaviour on
main. The in-process engine does not parse its options with these schemas, but since #28108 (6a648ac2, #27732, merged before this PR and shipping in the same release) it refusessearchFields: []andsearch.fields: []itself with400 VALIDATION_ERRORbefore any driver read. This branch's merge base predates that commit, so on this branch's own tree the engine still reads[]as absent; after the merge the declaration, the Data API doors and the engine refuse the same value. (Seat correction: the earlier sentence said the engine refusal was still in flight.)Tests
packages/spec/src/data/search-fields-names-a-field.test.ts:[]is still admitted) is replaced by "the engine-side searchFields declarations":%s.searchFields refuses an empty list with the accept-set sentence, for each of the three schemas:success: false, issuepathequal to['searchFields'], message equal toSEARCH_FIELDS_NAMES_NO_FIELD.%s.searchFields answers [] as its structured search.fields does: the bare and structured spellings on the same schema give the same message.keeps %s unchanged(one name, two names, a blank member) andstill admits no searchFields at all, for each schema.Ablation: removing the narrowing turns the new refusal cases red
On committed head
fca20448, all three declarations were reverted toz.array(z.string()).optional()(3 anchors replaced, 0 fixed spellings left, counted withgrep -c).vitest run src/data/search-fields-names-a-field.test.ts: 6 failed | 51 passed (57), exactly the 3 refusal and 3 same-answer cases. The file was restored withgit checkout HEAD --, andgit diff HEADwas empty. The describe-sentence cases stayed green because the mutation kept the.describe().Local runs
pnpm --filter @objectstack/spec typecheck: exit 0.pnpm --filter @objectstack/spec exec vitest runonc4560f09: Test Files 843 passed (843), Tests 23976 passed, 1 todo.pnpm --filter @objectstack/spec check:generated: 1 of 14 stale (content/docs/references/**) before--fix; after--fixup to date.check:api-surfacewas not stale: the types did not change.(narrowing)arm),pnpm --filter @objectstack/dogfood testunder the verify lock onc4560f09: lock VERDICT command-exit 0; Test Files 358 passed | 3 skipped (361), Tests 2883 passed | 20 skipped (2903).Acceptance notes
Clause-②: no. The order and triage6522171038writeno (narrowing), and this is a narrowing, so this body and the changeset carryno (narrowing).['']) is still admitted by all three declarations, as byQuerySchema.searchFields. The doors refuse a blank member as an unknown field. This PR leaves that alone, as spec/protocol: the publishedsearchFieldsdeclarations still admit an empty list that the data door now refuses; doessearchFieldsfollowselectinto a declared accept set, and does the engine follow? #27683 did.searchFields: []with these schemas (git grepofsearchFields: []outside the spec test: only door-level tests in rest and objectql, which go throughfindData, not these schemas).Verification
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 104 commands. All 104 ran with stdin from /dev/null, exit codes captured before any pipe: 104 exited 0. 7 first refused with exit 3 (PREREQUISITE NOT MET: no workspace build, and one self-test needing pinned commit621a4876); after the package build and fetching that commit, all 7 exited 0.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE: "104 derived famil(ies) accounted for — 104 run, 0 NOT-MEASURED".d38c42e6; the merge withorigin/main(c4560f09) brought in 9 commits, none touchingpackages/spec.Generated by Claude Code