Repository navigation
refactor(objectql): the engine sort door judges computed types by the spec's predicate - #37835
Conversation
…irtualSearchField assertOrderByIsMaterializable now reads the spec predicate the Data API sort door and the sortability projection read, instead of a 'formula' literal of its own. No verdict changes today: SEARCH_VIRTUAL_TYPES holds formula alone. A pin test holds the engine door to the Data API door for every FieldType member. Comments that still named the retired UNMATERIALIZED_SORT_TYPES now point at the live predicate, and the ledger of the other sites that spell this fact lives beside the engine door. Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check1 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 25 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 8de91a6569317c5903207ddc5ce5d8e6c867a611 && git checkout 8de91a6569317c5903207ddc5ce5d8e6c867a611
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1028438748dfbb6a76a981a25310fe39c481fb2c 4edfb2fd9955470e9ef4e9ebca21584bf9fd4630 && git checkout -B drift-repro 1028438748dfbb6a76a981a25310fe39c481fb2c && git merge --no-ff 4edfb2fd9955470e9ef4e9ebca21584bf9fd4630
node scripts/docs-audit/affected-docs.mjs --json 1028438748dfbb6a76a981a25310fe39c481fb2c |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie Final head for review: |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT at head 席位核对Shape and gates. The flag is not a gap. Fixes is right, under the corrected acceptance. Record 7209730357's N3 and N4 asked for two things.
Changeset, sentence by sentence. Contract review. None owed: no Landing: not governed, ≤3000 lines, no narrowing. The area lands it. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie Landing by area o1-B · 2026-11-27T06:47Z · head
State: ready + auto-merge now; #37810 closes on merge via |
Requested by Elon · project thread
Fixes #37810
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
assertOrderByIsMaterializable(packages/objectql/src/engine-top-level.ts) judged "computed on read" with its owntype === 'formula'. It now asksisVirtualSearchFieldfrom@objectstack/spec/data, the predicate the Data API door (assertSortFieldsExist, third verdict) and the sortability projection already read.SEARCH_VIRTUAL_TYPESis pinned to exactlyformula, andisVirtualSearchFieldis true exactly for a stringtypein that set, so no verdict moves for any field, schema-valid or not. Code, status,field,fieldsand message are unchanged.packages/objectql/src/engine-sort-door-agreement.test.ts: for every member ofFieldType.optionsit asks the engine door and the Data API door about the same sort over the same definition, and fails if they part. It copies no verdict table. A companion field declaringsortable: falsetells the Data API door's third verdict (computed type, names the field alone) from its fourth (names the companion), the same device as the metadata-protocol agreement test. The engine door does not judgesortable: false, so the companion never moves its answer. A control asserts the table has both refused and accepted types.fieldHasColumnandSqlDriver.createColumn(driver-sql),remote-transport.ts(driver-turso),planFormulaProjectionandsearch-companion.ts(objectql),VIRTUAL_FIELD_TYPES(plugin-audit). None of those sites changes.packages/lint/src/validate-sortable-fields.ts(two places; the first pointed at a note that no longer exists and now points at the two doors' "ONE SOURCE" notes),packages/drivers/driver-sql/src/sql-driver-external-unprovisioned-sort-anchor.test.ts(two places), and the twoui/packages/plugin-listtests. Comment-only.@objectstack/objectqlpatch.Read first
packages/objectql/src/engine-top-level.ts, theassertOrderByIsMaterializablehunk: the one-line predicate swap is the only behaviour edit in the PR.packages/objectql/src/engine-sort-door-agreement.test.ts: how the Data API door's third verdict is told from its fourth.packages/lint/src/validate-sortable-fields.ts: the rewritten pointer near the top of the docblock.Two-minute check
pnpm --filter @objectstack/objectql exec vitest run src/engine-sort-door-agreement.test.tsprintsTests 50 passed (50)(one control plus 49 field types).Tests
All runs at head
4edfb2fd99, throughscripts/pm/os-verify-lock.sh, after building the@objectstack/objectqldependency closure.Package suites and typecheck (all green)
Ablation: the pin goes red the day the spec's set grows without the engine door
The future case, staged on disk:
SEARCH_VIRTUAL_TYPESinpackages/spec/src/data/search-fields.tswidened toformulaandsummarywithscripts/ablation-replace.mjs(anchor 1 to 0, blob changed), spec rebuilt, andscripts/ablation-dist-preflight.mjsfound the widened set in 2 built files ofpackages/spec/dist. (Its tree reading answered exit 3 only because the source spells the set with single quotes and the build with double quotes; the dist reading, the one the suite consumes, passed.)So Leg B is the drift the card describes: the Data API door refuses
summaryand the engine door lets it through. Leg A shows the change ends it, and Leg C shows the two are identical today. After restoring, both source files matched their HEAD blobs,git status --porcelainwas empty andgit diff HEADwas empty.Acceptance notes
UNMATERIALIZED_SORT_TYPES.packages/metadata-protocol/src/protocol-query-validation.tsaround line 613, in the Data API door's own "ONE SOURCE" note: "This door used to carry a set of its own for the same fact (UNMATERIALIZED_SORT_TYPES,formulaalone, retired here)". It is a history pointer, kept on purpose so a search for the old name lands on its replacement (contract record 7209730357, N4). The card's acceptance line reads "no comment outside CHANGELOG files", and the card's own list names the six comments edited here. The file is not in the claim, so it is left as it is and raised in the report. The shipped changeset.changeset/37386-sort-door-reads-projection-predicate.mddoes not name the set.query-expression-conformance.test.tspins the wording across doors. The daySEARCH_VIRTUAL_TYPESgrows, that sentence needs the type name too. Noted, not filed.not.toBe('formula').driver-sqldepends on@objectstack/spec, so it could askisVirtualSearchFieldinstead. The claim makes that file comment-only, so it is left alone. Noted, not filed.ObjectQL.find. That keeps it free of an engine boot for 49 types.query-expression-conformance.test.tsalready pins the wiring fromengine.find/engine.findOneto this door.ui/comment edits run no local test. Comment-only.Test UIcovers them in CI.Verification
node scripts/pm/dispatch-gates.mjs --commands(76 families for this diff) run at4edfb2fd99: 73 exit 0.--ranreconciliation: 76 of 76 accounted for.node scripts/check-plugin-teardown-shape.mjs --self-test(exit 3, its pinned fixture commit is out of reach of a shallow clone);pnpm check:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: 80 packages have nodist/);pnpm --dir ui exec vitest run scripts/(one red case,unit-registry-absence-collision.test.ts, because@objectstack/clienthas nodist/here, so the files that import it could not be measured; this diff touches noui/module).node scripts/check-platform-checklist.mjs --changed-from origin/main: OK, 1 anchor judged, 0 lost.node scripts/pm/overlap-check.mjs: clean againstorigin/main9b50fedbfaand the two open PRs that shareengine-top-level.ts(feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676, refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366).!and there is no(narrowing)arm.Generated by Claude Code