Skip to content

Commit b5fd350

Browse files
refactor(types)!: delete ActionExecutor and the Batch Operations pair nothing reads (#31056)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoLSQNGnW5WkMBDcmSiLyjgn)_ Part of #25921 (batch 11, claim 6696974190 with amendments 6697003965 naming the branch, 6697084388 naming the first batch and amendment 3 renaming it to this one; the card's other open items stay on it) Clause-②: no (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:从 `@object-ui/types` 的 `ui-action.ts` 删除 3 个没人读的类型:`ActionExecutor`,以及 "Batch Operations" 一组的 `BatchOperationConfig`、`BatchOperationSummary`。 - 为什么改:#25921 清理零消费者公开面;这 3 个名字在仓内与 hotcrm 都没有任何引用,动作实际由 `@object-ui/core` 的 `ActionRunner` 执行,留着会被当成 UI 协议包的公开承诺。 - 风险与回滚:纯类型删除,构建出的 JavaScript 不变;旁边的 "Transaction Support" 一组(core 的 `TransactionManager` 在用)原样保留。对外部 npm 使用者是破坏性变更,带一个 `!` patch changeset(BREAKING、FROM/TO、ADR-0087 `runtime-export-retired` 3 个)。回滚即 revert 本 PR。 - 先看:`ui/packages/types/src/ui-action.ts`(删掉的三个声明与新注释)、`.changeset/25921-types-action-executor-batch-ops.md`(迁移说明)、`ui/packages/types/src/index.ts`(入口列表与注释)。 - 两分钟验证:`git grep -lw -e ActionExecutor -e BatchOperationConfig -e BatchOperationSummary -- ui packages` 预期只命中 `ui/packages/types` 里的退役注释、本 changeset 与 CHANGELOG;`pnpm --dir ui exec vitest run packages/types/` 预期全绿。 - 需要你做的:无,席位落地。 ## What changes `@object-ui/types` (its `.` entry) loses 3 types of `src/ui-action.ts`. They are deleted from the module, not only from the entry: `ActionExecutor`, `BatchOperationConfig`, `BatchOperationSummary`. - `src/ui-action.ts`: the `ActionExecutor` function type and the "Batch Operations (Q2 2026 - Spec v2.0.1 Enhancement)" block go; a note at the end of the file, beside the existing undo/redo note, names them and points at `@object-ui/core`'s `ActionRunner` / `ActionRunnerHandler`. The "Transaction Support" block right after them stays: `TransactionConfig` and `TransactionResult` are imported by core's `TransactionManager.ts`. - `src/index.ts`: the three names leave the `./ui-action.js` type list; a two-line comment names them. - `.changeset/25921-types-action-executor-batch-ops.md`: one `!` patch changeset, BREAKING, FROM/TO per name (no replacement in this package; actions run through `ActionRunner`), and the ADR-0087 `runtime-export-retired` marker naming all 3. `ui-action.ts` is reached only through the `.` entry; no subpath entry of the package exports it. **Why this batch and not the first one named.** Amendment 6697084388 first named the seven `Spec`-prefixed `@objectstack/spec/ui` type aliases of the entry (`SpecFormView` and six more), also dead. That edit was made (fa03472) and reverted in this branch (ae6a942), because `check-adr-0087-registration` cannot verify predicate 2 for them: they are `export type { X as SpecX } from '@objectstack/spec/ui'`, a subpath of another workspace package, which the gate's export reader does not follow ("the declaration of `SpecFormView` cannot be located at the merge base"). The seat swapped the batch (amendment 3); the seven stay on the card, waiting on a predicate-2 ruling for that shape. The branch diff against `main` carries only this batch. ## Tests - No in-package test reads any of the 3 names, so no test changes. - 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 81deb54, 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`: 707 entry names, 147 zero-outside, 45 candidates; `ui-action.ts` 4 of them. Note: this project's files `ui-seat-3/r2026-11-06/25921-b11-census.md`. - `git grep -lw` per name, whole repository: 0 hits outside `ui/packages/types/`; hotcrm 0 for all 3. Inside the package: no reader besides the declaration and the entry line. - No zod twin, not an arm of `AnySchema`, no subpath entry, not taught. - Left in the module on purpose: `OBJECTUI_LOCAL_ACTION_TYPES` (the tool's fourth candidate; a runtime value pinned by `spec-derived-unions.test.ts`), and the Transaction trio (live in core). - Positive control, same module: `TransactionConfig` (core `TransactionManager.ts`). - No pending changeset names any of the 3; no open PR touches `ui/packages/types/` (the claim's read at 22:01Z, plus every PR opened since). </details> <details><summary>Local runs on head 697756b (base 81deb54)</summary> - `env -u OS_SKIP_DTS pnpm --filter '@object-ui/types...' build`, then after the edit `env -u OS_SKIP_DTS pnpm --filter @object-ui/types build` from a clean `dist` + `tsbuildinfo`: VERDICT command-exit 0. Built `dist`: 0 files name `ActionExecutor`, `BatchOperationConfig` or `BatchOperationSummary`; the control `TransactionConfig` is in 2. - `pnpm --filter @object-ui/types run type-check` and `pnpm --dir ui exec vitest run packages/types/`: VERDICT command-exit 0; Test Files 387 passed (387), Tests 10460 passed (10460). - Reverse probe against the built `dist/index.d.ts`: a scratch file importing the 3 names plus the control `TransactionConfig`, `tsc --noEmit --module nodenext`: 3 errors (TS2305 / TS2724, one per retired name), 0 on the control line. - `node scripts/pm/dispatch-gates.mjs --commands` on 697756b: 30 derived families, every line run with stdin closed, all exit 0 (`pnpm --dir ui exec vitest run scripts/`: Test Files 170 passed, 2 skipped (172), after building `@objectstack/client...` and `@objectstack/formula...` in this fresh worktree); `--ran` reconciliation: 30 derived, 30 run, 0 NOT-MEASURED, 0 UNRUN. - `check-adr-0087-registration --base origin/main`: "verified: @object-ui/types#ActionExecutor (export, ui/packages/types/src/ui-action.ts)", and the same for the other two. - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: exit 0 (0 anchored files in the change set). `pnpm --dir ui run check:new-line-citations`: 0 new citations. - Full dogfood (owed by the `(narrowing)` arm), head 697756b: runs on this head after the PR opens; its VERDICT line and counts go into the os-dev-report comment on #25921. - Records: this project's files `ui-seat-3/r2026-11-06/25921-b11/`. </details> ## Acceptance notes - The seven `Spec`-prefixed spec/ui aliases (`SpecDashboardHeader`, `SpecDashboardHeaderAction`, `SpecFormView`, `SpecListColumn`, `SpecPageComponent`, `SpecPageRegion`, `SpecPageVariable`) stay on #25921: zero readers, but their retirement needs a predicate-2 ruling for re-export aliases of a workspace subpath. No gate card is filed now (seat's call). - Still open on #25921 after this batch: `clearSharedDiscoveryCache` and the other barrel batches; in `@object-ui/types` the census lists `data-protocol.ts` (3 real names in two blocks), `designer.ts` (Unified View with the objectui#12063 tombstone pin, Dashboard with a zod twin) and scattered singles. `types/src/ai.ts` keeps its `never` tombstones until the sunset rule of #25912; not touched here. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibyZMb3aNnWtD2ukQXx)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent d959b0b commit b5fd350

3 files changed

Lines changed: 28 additions & 52 deletions

File tree

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 `ActionExecutor` and the Batch Operations pair nothing reads
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/types#ActionExecutor, @object-ui/types#BatchOperationConfig, @object-ui/types#BatchOperationSummary) the retired operands are TypeScript-only shapes declared in `ui-action.ts`: a function type for an action executor and a batch-operation config and summary pair that no renderer, adapter or host 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/ui-action.ts` no longer declares them. They were types only, so the built JavaScript is unchanged. The "Transaction Support" block beside them stays (`TransactionIsolationLevel`, `TransactionConfig`, `TransactionResult`; `@object-ui/core`'s `TransactionManager` reads them).
15+
16+
What leaves, and what to write instead:
17+
18+
- FROM `ActionExecutor` TO no replacement in this package. Actions run through `@object-ui/core`'s `ActionRunner`, which registers `ActionRunnerHandler` functions; a host that typed its own executor declares that signature locally.
19+
- FROM `BatchOperationConfig` TO no replacement. No renderer or runner read a batch-operation config; a host that kept one declares it locally.
20+
- FROM `BatchOperationSummary` TO no replacement. Nothing produced this summary; a host that kept one declares it locally.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,9 +1252,9 @@ export type {
12521252
// The `undo` payload of `ActionResult`, moved down from `@object-ui/core`'s
12531253
// `UndoManager` with it (objectui#6349, batch 4); core re-exports it.
12541254
UndoableOperation,
1255-
ActionExecutor,
1256-
BatchOperationConfig,
1257-
BatchOperationSummary,
1255+
// `ActionExecutor` / `BatchOperationConfig` / `BatchOperationSummary` were
1256+
// retired here (objectstack#25921, batch 11) — see the note at the end of
1257+
// `ui-action.ts`.
12581258
TransactionIsolationLevel,
12591259
TransactionConfig,
12601260
TransactionResult,

‎ui/packages/types/src/ui-action.ts‎

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,55 +1235,6 @@ export interface ActionResult {
12351235
undo?: UndoableOperation;
12361236
}
12371237

1238-
/**
1239-
* Action executor function type
1240-
*/
1241-
export type ActionExecutor = (
1242-
action: UIActionSchema,
1243-
context: ActionContext,
1244-
params?: Record<string, any>
1245-
) => Promise<ActionResult>;
1246-
1247-
// ============================================================================
1248-
// Batch Operations (Q2 2026 - Spec v2.0.1 Enhancement)
1249-
// ============================================================================
1250-
1251-
/** Batch operation configuration */
1252-
export interface BatchOperationConfig {
1253-
/** Operation name */
1254-
name: string;
1255-
/** Display label */
1256-
label: string;
1257-
/** Target action to execute on each record */
1258-
action: string;
1259-
/** Whether to run in parallel */
1260-
parallel?: boolean;
1261-
/** Maximum concurrent operations */
1262-
concurrency?: number;
1263-
/** Whether to continue on error */
1264-
continueOnError?: boolean;
1265-
/** Progress callback expression */
1266-
onProgress?: string;
1267-
/** Completion callback expression */
1268-
onComplete?: string;
1269-
}
1270-
1271-
/** Batch operation result */
1272-
export interface BatchOperationSummary {
1273-
/** Total items processed */
1274-
total: number;
1275-
/** Successfully processed count */
1276-
succeeded: number;
1277-
/** Failed count */
1278-
failed: number;
1279-
/** Individual results */
1280-
results: Array<{
1281-
recordId: string;
1282-
success: boolean;
1283-
error?: string;
1284-
}>;
1285-
}
1286-
12871238
// ============================================================================
12881239
// Transaction Support (Q2 2026 - Spec v2.0.1 Enhancement)
12891240
// ============================================================================
@@ -1323,6 +1274,11 @@ export interface TransactionResult {
13231274
rolledBack?: boolean;
13241275
}
13251276

1277+
// `ActionExecutor` and the "Batch Operations" pair (`BatchOperationConfig`,
1278+
// `BatchOperationSummary`) are retired (objectstack#25921, batch 11): nothing in
1279+
// this workspace or in hotcrm read them. `@object-ui/core`'s `ActionRunner` is
1280+
// the executor; it registers `ActionRunnerHandler` functions, not this type.
1281+
//
13261282
// The undo/redo trio this file used to declare (`UndoRedoEntry`,
13271283
// `UndoRedoConfig`, `UndoRedoState`) is retired (objectui#6349, batch 5): when
13281284
// it was removed nothing in the repository read or wrote any of the three, and

0 commit comments

Comments
 (0)