Skip to content

跟进:引擎排序闸门改读计算字段的唯一出处,并清理残留的旧集合名注释 #37810

Description

@objectstack-fleet

repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie

Filing gate: ② follow-up out of #37386. The source is the contract record 7209730357 on PR #37785 (nits N3 and N4) and L1-a's ACCEPT 7209761400 on the same head, which accepts both as deviations and sends them to one follow-up card that the area files. The owning area files it under the source card.
Grading: area:ai · Task · p3 · reach: the engine's own orderBy door in @objectstack/objectql and six comments across lint, driver-sql and ui tests · evidence: read.

维护者速读

  • 做什么:37203 跟进:ADR-0160 D1 补「排序字段不可排序」这条作者错误,并把计算字段类型收成一个出处 #37386 把 HTTP 数据接口的排序闸门和可排序投影改成读同一个「哪些字段类型没有列可排序」的来源;引擎自己的排序闸门还在自己写死 formula,这张卡把它也改成读那个来源,并把六处还提旧集合名的注释改对。
  • 谁受益:以后新增一种计算字段类型时,引擎内部调用(钩子、流程)和 HTTP 调用的排序判断会同时跟上,不会一个拒绝一个静默丢掉排序。
  • 不做会怎样:今天两边结果一样;等计算类型扩充的那天,进程内调用 ObjectQL.find 的排序会被悄悄丢掉。
  • 需要你做的:无。

What

  1. N3, the engine door spells its own formula. assertOrderByIsMaterializable in packages/objectql/src/engine-top-level.ts tests type === 'formula'. Make it read isVirtualSearchField from @objectstack/spec (the package already imports it in aggregate-query-shape-door.ts and filter-comparand-shape.ts), and pin it beside the engine's own tests so the engine door, the Data API door and the projection agree for every member of FieldType.options.
  2. N4, the retired name lives on in comments. UNMATERIALIZED_SORT_TYPES was removed with its docblock in PR docs(adr): ADR-0160 amended a fifth and a sixth time; the Data API sort door reads the sortability projection's computed-type predicate #37785. Update the comments that still name it: packages/lint/src/validate-sortable-fields.ts (around lines 105 and 217; line 105 points at a note that is gone), packages/drivers/driver-sql/src/sql-driver-external-unprovisioned-sort-anchor.test.ts (around lines 47 and 258), and ui/packages/plugin-list/src/__tests__/ListView.sortFieldFallback.test.tsx and ListView.relationalSort.test.tsx. CHANGELOG entries stay as written.
  3. The removed docblock also listed the other places that spell this fact (fieldHasColumn, createColumn, remote-transport, planFormulaProjection, search-companion, plugin-audit). Record where that list now lives (a comment beside isVirtualSearchField or the engine door), without changing those sites.

Acceptance

  • The engine door judges computed types through isVirtualSearchField; a pin test reds if it and the Data API door part on any FieldType member.
  • No comment outside CHANGELOG files names UNMATERIALIZED_SORT_TYPES; the lint docblock no longer points at a removed note.
  • No verdict changes for any schema-valid field today. Clause-②: no, Metadata-protocol: none.

Blocked-by: #37386 (PR #37785)
Parent: #37386
Size: S
Dedupe (objectstack, is:issue is:open): "assertOrderByIsMaterializable" → only #37386 (source) · "UNMATERIALIZED_SORT_TYPES" → only #37386 (source). No duplicate.

Activity

  1. added
    pm:blocked
    area:ai
    domain:server
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:server · Task · priority:p3 · pm:blocked · size XS; rationale: the engine's sort gate reads the computed-field single source, and old collection-name comments are cleaned up. Hygiene: p3. Blocked by #37386.

  3. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie

    Claim: PM loop round 2 · area o1-B (review follow-up of PR #37785, filed by this area) · 2026-11-27T05:21Z
    Session: session_016WV4cxBECSPtHxQMZDHSie
    Account: os-elon-musk
    Branch: claude/area-o1B-37810
    Worktree: objectstack-issue-37810
    Domain: domain:server
    Area: o1-B
    Seat: repo:objectstack#1
    File surface: packages/objectql/src/engine-top-level.ts (assertOrderByIsMaterializable only) and a pin test beside the engine's own tests; comment-only edits in packages/lint/src/validate-sortable-fields.ts, packages/drivers/driver-sql/src/sql-driver-external-unprovisioned-sort-anchor.test.ts, ui/packages/plugin-list/src/__tests__/ListView.sortFieldFallback.test.tsx, ui/packages/plugin-list/src/__tests__/ListView.relationalSort.test.tsx; one place that records the list of other sites spelling this fact (a comment beside isVirtualSearchField in packages/spec/src/data/search-fields.ts or beside the engine door); a changeset for @objectstack/objectql (patch). No CHANGELOG edits (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card (Task)
    Thread-read: none
    Premise: holds — on main after PR #37785 the engine door tests type === 'formula' and SEARCH_VIRTUAL_TYPES is pinned to exactly ['formula'], so no verdict moves; UNMATERIALIZED_SORT_TYPES survives only in comments (contract record 7209730357, N3 and N4).
    Serial constraints cleared: Blocked-by #37386 closed (PR #37785 merged); open PRs naming engine-top-level.ts are read by overlap-check before each push
    Pre-claim lane: packages/objectql ⇒ domain:server, not governed; L1 in L1-a, landed by area o1-B.
    Prior rulings read: none on this surface; source records 7209730357 (PASS) and 7209761400 (ACCEPT) on PR #37785.

  4. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 27, 2026
  5. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie
    os-dev-report

    {
      "issue": 37810,
      "status": "done",
      "branch": "claude/area-o1B-37810",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37835",
      "session": "session_016WV4cxBECSPtHxQMZDHSie",
      "premise_still_valid": true,
      "summary": "assertOrderByIsMaterializable (packages/objectql/src/engine-top-level.ts) now judges computed types with isVirtualSearchField from @objectstack/spec/data instead of its own 'formula' literal. That is the predicate the Data API door (assertSortFieldsExist, third verdict) and the sortability projection read. The verdict is identical for every value today because SEARCH_VIRTUAL_TYPES is exactly {formula} and the predicate is true exactly for a string type in the set. New pin engine-sort-door-agreement.test.ts holds the engine door to the Data API door for all 49 FieldType.options members, with a control row. The docblock carries a ONE SOURCE note and the ledger of the six other sites that spell this fact (fieldHasColumn, SqlDriver.createColumn, driver-turso remote-transport, planFormulaProjection, search-companion, plugin-audit VIRTUAL_FIELD_TYPES); none of those sites changed. The six comments that named UNMATERIALIZED_SORT_TYPES (lint x2, with the dead pointer now aimed at the two doors' ONE SOURCE notes; driver-sql anchor test x2; two plugin-list ui tests) now name the live predicate. Changeset: @objectstack/objectql patch with bare Clause-②: no / Metadata-protocol: none. The PR body carries a Chinese maintainer-summary section, as the os-dev definition of done requires, although the dispatch asked for English GitHub text; under os-dev the definition file wins.",
      "tests": "Head 4edfb2fd99, all runs under os-verify-lock after building the objectql dependency closure (VERDICT command-exit 0). pnpm --filter @objectstack/objectql test: Test Files 639 passed (639), Tests 14485 passed (14485). objectql typecheck: tsc + check:test-typecheck OK (debt unchanged). lint typecheck OK. driver-sql sql-driver-external-unprovisioned-sort-anchor.test.ts: 12/12. New pin: 50/50. Ablation (scripts/ablation-replace.mjs + ablation-dist-preflight.mjs, trap restore): Leg A, spec SEARCH_VIRTUAL_TYPES widened to {formula, summary}, spec rebuilt, preflight dist marker present in 2 built files, new door: 50 passed. Leg B, same spec plus the engine door reverted to the formula literal: 1 failed | 49 passed, FAIL on the 'summary' row (engineCallsComputed expected true, got false). Leg C, spec restored and rebuilt (preflight: marker absent from all 614 built files), literal door: 50 passed (no verdict moves today). Leg D, committed head: 50 passed. The preflight tree reading answered exit 3 in both spec legs only because src spells the set with single quotes and dist with double quotes; the dist reading passed both times. After restore, src blobs matched HEAD, git status --porcelain empty, git diff HEAD empty.",
      "gates": "Local: dispatch-gates --commands (76 families, derived at 4edfb2fd99) run at 4edfb2fd99: 73 exit 0. NOT MEASURED (prerequisite): node scripts/check-plugin-teardown-shape.mjs --self-test exit 3, because its pinned fixture commit is unreachable in a shallow clone; pnpm check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET because 80 packages have no dist; pnpm --dir ui exec vitest run scripts/ exit 1, one case (unit-registry-absence-collision.test.ts) red only because @objectstack/client has no dist here, and the diff touches no ui module. dispatch-gates --ran: 76/76 accounted for, exit 0. check-platform-checklist --changed-from origin/main: OK, exit 0. overlap-check: VERDICT clean exit 0 against origin/main 9b50fedbfa and PRs #37676 and #37366. CI on PR #37835 head 4edfb2fd99 when reported: 1 success, 5 skipped, 17 in_progress, 0 failure.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 relay writes: fleet-write pr_create (POST /repos/objectstack-ai/objectstack/pulls plus POST .../issues/37835/assignees), and post-stamped os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/37810/comments). Not counted: 2 git pushes, one empty probe branch and two commits.",
      "open_questions": [
        {
          "question": "The card's acceptance line says no comment outside CHANGELOG files names UNMATERIALIZED_SORT_TYPES. One still does: the Data API door's own ONE SOURCE note in packages/metadata-protocol/src/protocol-query-validation.ts around line 613 ('...(`UNMATERIALIZED_SORT_TYPES`, `formula` alone, retired here)'). The file is outside the claimed surface, and contract record 7209730357 N4 treats the mention as a deliberate search pointer. Should it stay?",
          "options": [
            "A: keep it as a history pointer, so a search for the old name lands on its replacement, and read the acceptance line as the card's enumerated six comments",
            "B: remove the name in a follow-up one-line comment edit on metadata-protocol (a new claim surface)"
          ],
          "recommendation": "A, because the mention says the set was retired and names its replacement, which is what a reader grepping the old name needs. Removing it costs that pointer and buys nothing."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — the engine and Data API refusal text still says 'A formula field is virtual' / 'a formula value is computed on read' regardless of type; correct today, and it will need the type name the day SEARCH_VIRTUAL_TYPES grows (wording pinned by query-expression-conformance.test.ts)",
        "carrier: none · noted, not filed — packages/drivers/driver-sql/src/sql-driver-external-unprovisioned-sort-anchor.test.ts asserts anchors are not 'formula' with a literal; driver-sql depends on @objectstack/spec, so it could ask isVirtualSearchField instead (left alone because the claim made that file comment-only)"
      ]
    }
  6. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie

    Premise correction by the card's filer (area o1-B) · 2026-11-27T06:18Z
    The acceptance line "No comment outside CHANGELOG files names UNMATERIALIZED_SORT_TYPES" overstated what the source record asked. Contract record 7209730357 N4 lists six stale comments and says of the Data API door's own note in packages/metadata-protocol/src/protocol-query-validation.ts (~:613): "The door's new comment keeps the name as a search pointer, so a search still lands." That note says the set was retired and names its replacement, so it stays. The acceptance line reads: the six comments N4 enumerates no longer name UNMATERIALIZED_SORT_TYPES, and the lint docblock no longer points at a removed note; the retirement pointer in the Data API door's note is kept. This answers the dev report's open question (7211384620) with its option A; no scope change, no new claim surface.

  7. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie

    Close-out (area o1-B) · 2026-11-27T07:43Z
    Delivered: PR #37835 merged: ObjectQL's own orderBy door (assertOrderByIsMaterializable) judges computed types with isVirtualSearchField, the predicate the Data API door and the sortability projection read; a pin holds the engine door to the Data API door for every FieldType member (ablation: the summary row goes red when the spec's set widens and the engine door keeps its literal). The six comments N4 enumerated name the live predicate, and the ledger of other sites that spell the fact now lives in the engine door's docblock. No verdict moved. L1 ACCEPT 7211820365; no contract review owed.
    State: pm:dispatched removed with the close. Remaining: none on this card.

  8. removed
    pm:dispatched
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions