Repository navigation
Commit 2cf269f
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
- .changeset
- ui/packages/types/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | | - | |
754 | | - | |
755 | 753 | | |
756 | 754 | | |
757 | 755 | | |
| |||
0 commit comments