Skip to content

Commit f810c34

Browse files
refactor(types)!: delete SubqueryNode and the filter builder configuration pair nothing reads (#31101)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoGkWmgZR7t1GLVZ3tjBQgX3)_ Part of #25921 (batch 12, claim 6703671714 with amendment 6703700084 naming the batch and its three rulings; the card's other open items stay on it) Clause-②: no (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:从 `@object-ui/types` 的 `data-protocol.ts` 删除 3 个没人读的类型:查询 AST 的 `SubqueryNode`,以及过滤器构建器配置一组的 `FilterBuilderConfig`、`FilterFieldConfig`。 - 为什么改:#25921 清理零消费者公开面;这 3 个名字在仓内与 hotcrm 都没有任何引用,没有任何查询构建器或过滤器 UI 构造或读取它们,留着会被当成 UI 协议包的公开承诺。 - 风险与回滚:纯类型删除,构建出的 JavaScript 不变;同模块的其它查询节点类型与 `DateRangeFilter` 原样保留。对外部 npm 使用者是破坏性变更,带一个 `!` patch changeset(BREAKING、FROM/TO、ADR-0087 `runtime-export-retired` 3 个)。另外按席位裁决修正了第 8 批待发 changeset 里一句「`FilterBuilderConfig` 保持导出」的话(DELIBERATE CORRECTION,见下)。回滚即 revert 本 PR。 - 先看:`ui/packages/types/src/data-protocol.ts`(删掉的声明与退役注释)、`.changeset/25921-types-subquery-filter-builder.md`(迁移说明)、`.changeset/25921-types-driver-datasource-block.md`(被修正的一句)。 - 两分钟验证:`git grep -lw -e SubqueryNode -e FilterBuilderConfig -e FilterFieldConfig -- ui packages` 预期只命中 `ui/packages/types` 里的退役注释与本 changeset;`pnpm --dir ui exec vitest run packages/types/` 预期全绿。 - 需要你做的:无,席位落地。 ## What changes `@object-ui/types` (its `.` entry) loses 3 types of `src/data-protocol.ts`. They are deleted from the module, not only from the entry: `SubqueryNode`, `FilterBuilderConfig`, `FilterFieldConfig`. - `src/data-protocol.ts`: the "Subquery node (Phase 3.3.3)" interface and the "Filter builder configuration (Phase 3.4.5)" pair go, each replaced by a two-line retirement comment. `FilterBuilderDateRangePreset`'s JSDoc said its eight future windows serve "the `FilterBuilderConfig` surface below"; it now names `DateRangeFilter`'s `preset`, the one remaining reader (ruling 3). - `src/index.ts`: the three names leave the `./data-protocol.js` type list; a comment at each spot names them. - `src/__tests__/phase35-validation-types-retired-10719.test.ts`: its second firing control used `FilterFieldConfig` as "the neighbouring filter type"; it now uses `DateRangeFilter`, same matcher, same module, kept (ruling 1, option A). The absence assertion and the `ObjectValidationRule` control are unchanged. - `.changeset/25921-types-subquery-filter-builder.md`: one `!` patch changeset, BREAKING, FROM/TO per name (no replacement in this package), and the ADR-0087 `runtime-export-retired` marker naming all 3. - `.changeset/25921-types-driver-datasource-block.md`: one sentence corrected, see below. `data-protocol.ts` is reached only through the `.` entry; no subpath entry of the package exports it. ### DELIBERATE CORRECTION of a pending release note `.changeset/25921-types-driver-datasource-block.md` (batch 8, still pending) listed `FilterBuilderConfig` among the `data-protocol.ts` names that stay exported. Both changesets compile into the same release, so that sentence would publish as false next to this batch's BREAKING note. Seat ruling 2 (amendment 6703700084, option A): delete only that name from that sentence and touch nothing else in the file. The corrected sentence now reads: > Every other name of `data-protocol.ts` stays exported unchanged, among them `DriverQueryConfig`, `SqlQueryAST`, the query-AST node types, `AdvancedFilterSchema` and `ObjectValidationRule` with its variants. `check-empty-changeset` stays red on this file by design (the DELIBERATE CORRECTION class); the dispatching seat's record confirms it. ## Tests - One in-package test changes: the firing control above. No other test reads the 3 names. - No ablation: a deletion of types with no tested behaviour behind it. The reverse probe below is the proof that the built `.d.ts` is the one read. ## Verification <details><summary>Census (read-only, before any edit; origin/main b631573, hotcrm 6961ab1)</summary> - Tool: the batch 8 census (TS AST of every published `ui/packages/*` main entry; identifier-token index over every tracked file of both repositories minus CHANGELOGs, changesets, the lockfile and release notes; prose and tests count as consumers; then not taught in README/demo/docs and not named by a kept export's declaration). `@object-ui/types`: 705 entry names, 144 zero-outside, 42 candidates. Note: this project's files `ui-seat-3/r2026-11-06/25921-b12-census.md`. - `git grep -lw` per name, whole repository: 0 hits outside `ui/packages/types/` except the pending batch 8 changeset (corrected above); hotcrm 0 for all 3. - No zod twin, not an arm of `AnySchema`, no subpath entry, not taught. - Positive controls, same module: `OffsetNode` and `AggregateNode` (core `query/query-ast.ts`), `DateRangeFilter` (core `utils/dashboard-filters.ts`). `AdvancedFilterOperator`, which typed `FilterFieldConfig.operators`, stays (`AdvancedFilterCondition` and a `ui/docs` audit read it). - No open PR touches `ui/packages/types/` (the claim's read at 07:00Z). </details> <details><summary>Local runs on head 736cafb (base b631573)</summary> - `env -u OS_SKIP_DTS pnpm --filter '@object-ui/types^...' build`, then `env -u OS_SKIP_DTS pnpm --filter @object-ui/types build` from a clean `dist` + `tsbuildinfo`, `pnpm --filter @object-ui/types run type-check` and `pnpm --dir ui exec vitest run packages/types/`: VERDICT command-exit 0; Test Files 388 passed (388), Tests 10470 passed (10470). Built `dist`: 0 files name `SubqueryNode`, `FilterBuilderConfig` or `FilterFieldConfig`; the control `DateRangeFilter` is in 4. - Reverse probe against the built `dist/index.d.ts`: a scratch file importing the 3 names plus the control `DateRangeFilter`, `tsc --noEmit --module nodenext`: 3 errors (TS2305 / TS2724, one per retired name), 0 on the control line. - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`: 36 derived, all run with stdin closed; 35 exit 0, `check-empty-changeset.mjs --base origin/main` exit 1 (the DELIBERATE CORRECTION above, by design). `--ran`: 36 run, 0 NOT-MEASURED, 0 UNRUN. `check-adr-0087-registration` verified all 3 operands at `data-protocol.ts`. `pnpm --dir ui exec vitest run scripts/`: 170 passed, 2 skipped (after building client and formula). - Extra: `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0; `pnpm check:new-line-citations` (ui) 0 new. - Full dogfood battery: `pnpm --filter @objectstack/dogfood test` under the verify lock (closure built first) on 736cafb: VERDICT command-exit 0; Test Files 434 passed, 3 skipped (437); Tests 3596 passed, 41 skipped (3637); no failure. </details> ## Acceptance notes - Still open on #25921 after this batch, in `@object-ui/types`: `field-types.ts`'s `VisibilityCondition` (an objectui#12242 orphan; its neighbour `FieldValidationFunction` stays because the one-authority gate's remedy text under `ui/scripts` teaches it, and `FieldConstraints` is module-local, not on the entry), `AuditFieldName`, `ContainerSchemaWithChildren`, and the two `designer.ts` blocks (Unified View with the objectui#12063 tombstone pin, Dashboard with a zod twin). `DataContext`, `EventHandlers` and `StyleProps` have no readers but sit on the `./data` and `./base` subpath entries, which the claim fences. The seven `Spec*` spec/ui aliases still wait on a predicate-2 ruling. `types/src/ai.ts` keeps its tombstones until the sunset rule of #25912; not touched here. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibvW4JtHmnJuaoYMkAY)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 465c2be commit f810c34

5 files changed

Lines changed: 31 additions & 68 deletions

File tree

‎.changeset/25921-types-driver-datasource-block.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Metadata-protocol: none
1111

1212
**BREAKING** for a host that imports any of these fifteen types from `@object-ui/types`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected.
1313

14-
They are **gone from the package, not only from the entry**: the "Phase 3.6" driver interfaces and the "Phase 3.7" datasource interfaces at the end of `data-protocol.ts` were read only by each other. Nothing implemented the driver interface and nothing constructed the datasource manager; the client talks to data through the `DataSource` interface instead. Every other name of `data-protocol.ts` stays exported unchanged, among them `DriverQueryConfig`, `SqlQueryAST`, the query-AST node types, `AdvancedFilterSchema`, `FilterBuilderConfig` and `ObjectValidationRule` with its variants.
14+
They are **gone from the package, not only from the entry**: the "Phase 3.6" driver interfaces and the "Phase 3.7" datasource interfaces at the end of `data-protocol.ts` were read only by each other. Nothing implemented the driver interface and nothing constructed the datasource manager; the client talks to data through the `DataSource` interface instead. Every other name of `data-protocol.ts` stays exported unchanged, among them `DriverQueryConfig`, `SqlQueryAST`, the query-AST node types, `AdvancedFilterSchema` and `ObjectValidationRule` with its variants.
1515

1616
What leaves, and what to write instead:
1717

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/types': patch
3+
---
4+
5+
refactor(types)!: delete `SubqueryNode` and the filter builder configuration pair nothing reads
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/types#SubqueryNode, @object-ui/types#FilterBuilderConfig, @object-ui/types#FilterFieldConfig) the retired operands are TypeScript-only interfaces declared in `data-protocol.ts`: a query-AST subquery node and a filter builder configuration pair that no query builder, renderer, adapter or host constructs or reads; nothing in the workspace or in hotcrm imports any of them from the package entry, they have no zod twin, they are not arms of `AnySchema`, and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** for a host that imports any of these three types from `@object-ui/types`. None had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected.
13+
14+
They are **gone from the package, not only from the entry**: `src/data-protocol.ts` no longer declares them. They were types only, so the built JavaScript is unchanged. The other query-AST node types (`SelectNode`, `OffsetNode`, `AggregateNode`, …), `DateRangeFilter` and `FilterBuilderDateRangePreset` stay exported unchanged.
15+
16+
What leaves, and what to write instead:
17+
18+
- FROM `SubqueryNode` TO no replacement in this package. Nothing built or read a subquery node; a host that kept one declares it locally on top of `QueryASTNode` and `SqlQueryAST`, which stay.
19+
- FROM `FilterBuilderConfig` TO no replacement. No filter builder read this configuration; a host that kept one declares it locally.
20+
- FROM `FilterFieldConfig` TO no replacement. It was only the `fields` item of `FilterBuilderConfig`; a host that kept one declares it locally (`AdvancedFilterOperator`, which typed its `operators`, stays).

‎ui/packages/types/src/__tests__/phase35-validation-types-retired-10719.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('@object-ui/types — the Phase 3.5 validation types stay retired (obje
158158
// Firing controls on the same matcher: a truncated read or a matcher that
159159
// can never match would otherwise pass the absence assertion below.
160160
expect(declares(source, 'ObjectValidationRule'), 'the object-level rule union is missing').toBe(true);
161-
expect(declares(source, 'FilterFieldConfig'), 'the neighbouring filter type is missing').toBe(true);
161+
expect(declares(source, 'DateRangeFilter'), 'the neighbouring date range filter type is missing').toBe(true);
162162

163163
expect(
164164
RETIRED.filter((name) => declares(source, name)),

‎ui/packages/types/src/data-protocol.ts‎

Lines changed: 6 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,8 @@ export interface OffsetNode extends QueryASTNode {
157157
value: number;
158158
}
159159

160-
/**
161-
* Subquery node (Phase 3.3.3)
162-
*/
163-
export interface SubqueryNode extends QueryASTNode {
164-
type: 'subquery';
165-
query: SqlQueryAST;
166-
alias?: string;
167-
}
160+
// `SubqueryNode` (Phase 3.3.3) is retired (objectstack#25921, batch 12): no
161+
// query builder, adapter or host constructed or read a subquery node.
168162

169163
/**
170164
* Aggregate function node (Phase 3.3.5)
@@ -571,7 +565,7 @@ export interface DateRangeFilter {
571565
* anything outside those thirteen by name;
572566
* - this one adds eight FUTURE windows (`tomorrow`, `next_week`,
573567
* `next_month`, `next_quarter`, `next_year`, `next_7_days`, `next_30_days`,
574-
* `next_90_days`) for the `FilterBuilderConfig` surface below, where a
568+
* `next_90_days`) for {@link DateRangeFilter}'s `preset` above, where a
575569
* forward-looking range ("due next week") is the point.
576570
*
577571
* So an author or agent who read the spec's thirteen off this name would have
@@ -608,60 +602,9 @@ export type FilterBuilderDateRangePreset =
608602
| 'next_30_days'
609603
| 'next_90_days';
610604

611-
/**
612-
* Filter builder configuration (Phase 3.4.5)
613-
*/
614-
export interface FilterBuilderConfig {
615-
/**
616-
* Available fields for filtering
617-
*/
618-
fields: FilterFieldConfig[];
619-
620-
/**
621-
* Default operator
622-
*/
623-
default_operator?: 'and' | 'or';
624-
625-
/**
626-
* Allow nested groups
627-
*/
628-
allow_groups?: boolean;
629-
630-
/**
631-
* Maximum nesting depth
632-
*/
633-
max_depth?: number;
634-
}
635-
636-
/**
637-
* Filter field configuration
638-
*/
639-
export interface FilterFieldConfig {
640-
/**
641-
* Field name
642-
*/
643-
name: string;
644-
645-
/**
646-
* Display label
647-
*/
648-
label: string;
649-
650-
/**
651-
* Field type
652-
*/
653-
type: string;
654-
655-
/**
656-
* Available operators for this field
657-
*/
658-
operators?: AdvancedFilterOperator[];
659-
660-
/**
661-
* Options for select fields
662-
*/
663-
options?: Array<{ label: string; value: any }>;
664-
}
605+
// The filter builder configuration pair (Phase 3.4.5: `FilterBuilderConfig`,
606+
// `FilterFieldConfig`) is retired (objectstack#25921, batch 12): no filter
607+
// builder, adapter or host read either shape.
665608

666609
// RETIRED (objectui#10719): the "Phase 3.5" field-validation family —
667610
// `AdvancedValidationSchema`, `AdvancedValidationRule`, `ValidationRuleType`,

‎ui/packages/types/src/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export type {
660660
OrderByNode,
661661
LimitNode,
662662
OffsetNode,
663-
SubqueryNode,
663+
// `SubqueryNode` was retired here (objectstack#25921, batch 12).
664664
AggregateNode,
665665
WindowNode,
666666
WindowFunction,
@@ -687,8 +687,8 @@ export type {
687687
// Renamed from `DateRangePreset` in objectui#4167 — the spec owns that name
688688
// for the narrower dashboard filter-bar vocabulary (objectstack#4115).
689689
FilterBuilderDateRangePreset,
690-
FilterBuilderConfig,
691-
FilterFieldConfig,
690+
// `FilterBuilderConfig` / `FilterFieldConfig` were retired here
691+
// (objectstack#25921, batch 12) — see the notes in `data-protocol.ts`.
692692
// Object-level validation rules. The five spec-named variants are derived from
693693
// `@objectstack/spec/data`; the other three are @deprecated objectui-local
694694
// variants the spec's union rejects. See data-protocol.ts.

0 commit comments

Comments
 (0)