Skip to content

Commit 2cf269f

Browse files
refactor(types)!: delete the fifteen driver and datasource interfaces nothing reads (#30852)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao8GXZo5KhgyhXQG5nyiW3ra)_ Part of #25921 (batch 8, claim 6677520603 with amendments 6677541846 and 6677640939; the card's other open items stay on it) Clause-②: no (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:从 `@object-ui/types` 删除 `data-protocol.ts` 末尾的 15 个服务端驱动与数据源接口(`SqlDriverInterface`、`DatasourceManager`、`ConnectionPool` 等),连同入口上的两组导出。 - 为什么改:#25921 清理零消费者公开面;这些接口描述的是服务端 SQL 驱动和数据源管理器,没有任何渲染器、适配器或宿主实现它们,仓内与 hotcrm 都没有引用,留着只会被当成 UI 协议包的公开承诺。 - 风险与回滚:只删 TypeScript 类型,运行时零变化;对外部 npm 使用者是破坏性变更,带一个 `!` patch changeset(BREAKING、FROM/TO、ADR-0087 `runtime-export-retired` 15 个)。回滚即 revert 本 PR。 - 先看:`ui/packages/types/src/index.ts`(删掉的两组导出)、`.changeset/25921-types-driver-datasource-block.md`(迁移说明)、`ui/packages/types/src/__tests__/report-chart-query-spec-parity.test.ts`(按席位裁决删两行)。 - 两分钟验证:`git grep -w -e SqlDriverInterface -e DatasourceManager -- ui/packages/types/src` 预期 0 命中;`pnpm --dir ui exec vitest run packages/types/` 预期全绿。 - 需要你做的:无,席位落地。 ## What changes `@object-ui/types` (its `.` entry) loses the "Phase 3.6" driver interfaces and the "Phase 3.7" datasource interfaces at the end of `src/data-protocol.ts`. All 15 are deleted from the package, not only from the entry, because their only readers were each other: `SqlDriverInterface`, `ConnectionConfig`, `DriverQueryResult`, `BatchOperation`, `BatchResult`, `TransactionContext`, `CacheManager`, `ConnectionPool`, `DatasourceRegistration`, `DatasourceType`, `DatasourceMetric`, `DatasourceAlert`, `DatasourceManager`, `HealthCheckResult`, `DatasourceMetrics`. - `src/index.ts`: the two comment-headed groups go from the `./data-protocol.js` named list. Every other name of that list stays. - `src/data-protocol.ts`: the block is deleted; the module header stops naming the two interfaces. - `src/data.ts`: the `BatchTransactionOperation` docblock stops contrasting itself with the deleted driver-level `BatchOperation`. - `src/__tests__/report-chart-query-spec-parity.test.ts`: see Tests. - `.changeset/25921-types-driver-datasource-block.md`: one `!` patch changeset, BREAKING, FROM/TO per group (no replacement in this package; the platform's contracts are `DriverInterface` and `DatasourceSchema` in `@objectstack/spec/data`), and the ADR-0087 `runtime-export-retired` marker naming all 15. No module other than `data-protocol.ts` changes shape. `data-protocol.ts` is reached only through the `.` entry; no subpath entry of the package re-exports it. ## Tests - **Two `it.each` rows dropped, by the seat's ruling (amendment 6677640939, answer A):** `report-chart-query-spec-parity.test.ts` pinned "the spec does not own `SqlDriverInterface`" and "… `DatasourceRegistration`". With both names gone there is no ui name left for the spec to collide with. The file's "Renamed" docblock bullet drops the two names with them. Every other row of the file stays, including the spec-owned positive list (`DriverInterface`, `DatasourceSchema` among it). - No test is added: the deletion is TypeScript-only, and the absence is held by `check-adr-0087-registration` reading the 15 operands against the built entry. ## Verification <details><summary>Census (read-only, before any edit; origin/main 9b24f3c, hotcrm 6961ab1)</summary> - Method: 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 the package README / demo / docs, and not named by a kept export's declaration. - 10 of the 15 have 0 hits outside `ui/packages/types/` in either repository. - 5 have homonym hits only, each resolved to another declaration: `ConnectionConfig` (mysql2's class, in `service-datasource` comments and a test), `BatchResult` (a test-local interface in `plugin-security`), `HealthCheckResult` (the cli doctor's own interface), `CacheManager` (prose in hotcrm's archived legacy specs about another class). None imports `@object-ui/types`. - Positive controls in the same module: `DriverQueryConfig`, `ObjectValidationRule` (kept; still exported, still in the built `dist`). - No pending changeset names any of the 15; none of the 37 open PRs touches `ui/packages/types/`. </details> <details><summary>Local runs on head 7577983 (base c17719d)</summary> - `env -u OS_SKIP_DTS pnpm --filter '@object-ui/types...' build`: VERDICT command-exit 0. The built `dist` has 0 files naming `SqlDriverInterface`, `DatasourceManager`, `HealthCheckResult` or `ConnectionPool`; `DriverQueryConfig` is in 2. - `pnpm --filter @object-ui/types run type-check` (src, examples, tests): exit 0. - `pnpm --dir ui exec vitest run packages/types/`: Test Files 387 passed (387), Tests 10462 passed (10462). - `node scripts/pm/dispatch-gates.mjs --commands`: 35 derived families, every line run with stdin closed; `--ran` reconciliation: 35 run, 0 NOT-MEASURED, 0 UNRUN, all exit 0. - `pnpm --dir ui exec vitest run scripts/`: the first run went red in two files (`unit-registry-absence-collision.test.ts`: "Failed to resolve entry for package @objectstack/formula"; `date-only-zone-pins-10183.test.ts`: the forked runs "ran no case at all"), because `@objectstack/formula` had no `dist` in this fresh worktree. After `pnpm --filter '@objectstack/formula...' build` both files pass (2 files, 44 tests), and the full rerun is Test Files 170 passed, 2 skipped (172), Tests 4970 passed, 2 skipped. - `node scripts/check-sdui-manifest.mjs`: exit 0. - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: exit 0 (no anchored file in the change set). - `pnpm --dir ui run check:new-line-citations`: 0 new citations. - Full dogfood (owed by the `(narrowing)` arm): head 7577983, `bash scripts/pm/os-verify-lock.sh -c "pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test"`: VERDICT command-exit 0; Test Files 423 passed, 3 skipped (426); Tests 3533 passed, 41 skipped (3574); no failure. </details> ## Acceptance notes - Still open on #25921 after this batch: `clearSharedDiscoveryCache` (36 files name it; tests in other packages import it, so it needs a test-support home first) and the other barrel batches. `@object-ui/types` keeps about 56 more zero-outside candidates (`spec-report.ts`, `designer.ts`, `api-types.ts`, `product-blocks.ts`, `ui-action.ts` and others), several of them tombstones or parity-pinned, for later batches. Census and tools: this project's files `ui-seat-3/r2026-11-06/25921-b8-census.md`. - `types/src/ai.ts` keeps its `never` tombstones until the sunset rule of #25912; not touched here. - Noted only, not filed: the `markdown-it` override in `pnpm-workspace.yaml` matches no resolved package (the lockfile carries only the override line). --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibwHV3BxRgPuX4fK7sj)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5d4f2aa commit 2cf269f

5 files changed

Lines changed: 24 additions & 701 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/types': patch
3+
---
4+
5+
refactor(types)!: delete the fifteen driver and datasource interfaces nothing reads
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/types#SqlDriverInterface, @object-ui/types#ConnectionConfig, @object-ui/types#DriverQueryResult, @object-ui/types#BatchOperation, @object-ui/types#BatchResult, @object-ui/types#TransactionContext, @object-ui/types#CacheManager, @object-ui/types#ConnectionPool, @object-ui/types#DatasourceRegistration, @object-ui/types#DatasourceType, @object-ui/types#DatasourceMetric, @object-ui/types#DatasourceAlert, @object-ui/types#DatasourceManager, @object-ui/types#HealthCheckResult, @object-ui/types#DatasourceMetrics) the retired operands are TypeScript-only interfaces and unions for a server-side SQL driver and a datasource manager that no renderer, adapter or host implements; nothing in the workspace or in hotcrm imports any of them from the package entry, they have no zod twin, 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 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.
13+
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.
15+
16+
What leaves, and what to write instead:
17+
18+
- FROM `SqlDriverInterface`, `ConnectionConfig`, `DriverQueryResult`, `BatchOperation`, `BatchResult`, `TransactionContext`, `CacheManager`, `ConnectionPool` TO no replacement in this package. A client reads and writes data through `DataSource` (`BatchTransactionOperation` with `DataSource.batchTransaction` for a transactional batch); the platform's runtime driver contract is `DriverInterface` from `@objectstack/spec/data`.
19+
- FROM `DatasourceRegistration`, `DatasourceType`, `DatasourceMetric`, `DatasourceAlert`, `DatasourceManager`, `HealthCheckResult`, `DatasourceMetrics` TO no replacement in this package. An authored datasource is `DatasourceSchema` from `@objectstack/spec/data`; a host that kept its own registry declares these shapes locally.

‎ui/packages/types/src/__tests__/report-chart-query-spec-parity.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* spec owns, or a divergence outliving the reason it was granted. Four-way
2020
* parity, in the shape `select-option-spec-parity.test.ts` established.
2121
* - **Renamed** (`ChartDataSeries`, `ChartDataSeriesSchema`, `SqlQueryAST`,
22-
* `DriverQueryConfig`, `SqlDriverInterface`, `DatasourceRegistration`): the
22+
* `DriverQueryConfig`): the
2323
* concepts genuinely differ from the spec exports whose names they were
2424
* wearing. The risk is picking a new name the spec ALREADY owns — the
2525
* `PageComponentSchema` mistake from objectui#3074 — so each new name is
@@ -750,8 +750,6 @@ describe('renamed local dialects do not collide with a spec export (objectui#307
750750
['ChartDataSeriesSchema', 'zod twin of ChartDataSeries'],
751751
['SqlQueryAST', 'compiled SQL syntax tree, not the spec ObjectQL request'],
752752
['DriverQueryConfig', 'high-level query config the SQL AST builder consumes'],
753-
['SqlDriverInterface', "objectui's SQL-oriented client driver abstraction"],
754-
['DatasourceRegistration', 'in-memory datasource registration record'],
755753
// objectui#3162 batch 8. `JoinNode` was ledgered as "erased to `any` upstream,
756754
// re-export once objectstack#4171 lands". #4171 landed — and the symbol it was
757755
// waiting on no longer exists: spec 17.0.0 retired `query.joins` and the whole

0 commit comments

Comments
 (0)