Skip to content

Commit d0512c2

Browse files
refactor(core)!: retire RegisteredAction and deepFreeze from the @object-ui/core entry (#31348)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XH4WSrD2AHNZsG3WQ5eREZa)_ Part of #25921 Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none (neither name appears under `skills/**` or `content/docs/**`) ## 维护者速读 - 改了什么:`@object-ui/core` 的根入口不再导出 `RegisteredAction` 和 `deepFreeze` 两个名字;这是 #25921 的第 15 批。两者仍留在各自模块里,包内代码照常使用。 - 为什么改:两个仓库里没有任何代码从包入口引用它们;包外仅有的同名文字都是别处自己声明的同名接口或函数(一个 dogfood 测试的接口、四个测试里的本地 `deepFreeze` 函数和沙箱源码文本)。 - 风险与回滚:只把两行 `export *` 改成具名列表,无声明删除、无模块移动;外部 npm 宿主若从入口 import 这两个名字会编译失败(未实测,changeset 写了 BREAKING 与替代写法)。`!` patch,回滚即 revert 本 PR。 - 先看:`ui/packages/core/src/index.ts`(freeze-schema 具名列表)、`ui/packages/core/src/actions/index.ts`(ActionEngine 具名列表)、`.changeset/25921-core-homonym-only-exports.md`。 - 两分钟验证:`node scripts/check-adr-0087-registration.mjs --base origin/main`,预期两个名字都 `verified … (export, ui/packages/core/src/…)`、退出 0。 - 需要你做的:无,席位落地。 ## What changes Batch 15 as named in the seat's amendment 6716057610 on claim 6716004841 (census `/mnt/project-files/pm-orders/ui/25921-b15-census.md`, `origin/main` `604a2b3b`, hotcrm `6961ab1`). After this batch the `@object-ui/core` entry holds no other name retirable under the card's rules. - **`ui/packages/core/src/actions/index.ts`** (unpublished sub-barrel that `src/index.ts` star-exports): `export * from './ActionEngine.js'` becomes a named list (`ActionEngine`, `ACTION_LOCATIONS`, `ActionLocation`, `ShortcutBinding`) without `RegisteredAction`, which stays in the module as the type of `ActionEngine`'s private registry. - **`ui/packages/core/src/index.ts`**: `export * from './utils/freeze-schema.js'` becomes a named list of the module's other seven exports (`SYSTEM_VIEW_MARKER`, `defineSystemView`, `isSystemView`, `cloneAsOverride`, `DeepReadonly`, `DeepMutable`, `SystemView`) without `deepFreeze`, which stays in the module for `defineSystemView`. - **Changeset** `.changeset/25921-core-homonym-only-exports.md`: `!` patch, BREAKING, FROM/TO for each name, `runtime-export-retired` ×2 (FROM spans 1:1), both declaration lines. No declaration is deleted and no module moves. ## Tests - Census (`rg -o -w -F` over both trees, then each outside hit read by hand): `RegisteredAction`'s only outside hit is `packages/qa/dogfood/test/organization-rename-door.dogfood.test.ts`, which declares its own `interface RegisteredAction`. `deepFreeze`'s outside hits are four local `function deepFreeze` declarations (in `packages/spec`, `plugin-security` and two `service-analytics` tests) and `var deepFreeze` inside the sandbox source text of `packages/runtime/src/sandbox/quickjs-runner.ts`. None imports `@object-ui/core`. hotcrm: 0 for both. Positive controls, `git grep -l -w -F NAME origin/main -- . ':!ui/packages/core'` (files): `ActionEngine` 65, `defineSystemView` 5. - Rule 3: the emitted-declaration walk from every kept export reaches neither name (a private member's type does not reach the `.d.ts`). Neither is in the core README, which teaches `defineSystemView`, `cloneAsOverride` and `isSystemView` (all kept). Core's only JS export is `.`. - Reverse probe of the entry (TypeScript checker export list of `src/index.ts`): 476 names before, 474 after; exactly `RegisteredAction` and `deepFreeze` gone, none added. Built `dist/index.js` imported at runtime: `deepFreeze` is not a key; `defineSystemView`, `isSystemView`, `cloneAsOverride`, `SYSTEM_VIEW_MARKER`, `ActionEngine` and `ACTION_LOCATIONS` are. - `pnpm --filter '@object-ui/core...' build && pnpm --filter @object-ui/core run type-check` under the lock: `VERDICT command-exit 0`. - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/core/` → Test Files 233 passed (233), Tests 4376 passed | 27 skipped (4403). - No test was added or removed, and there is no ablation: this only stops re-exporting two names and changes no tested behaviour. ## Acceptance notes - Three more names the batch 14 census counted as homonym-only stay on the card, because each outside hit is prose about core's own function, and prose counts as a consumer: `hasConflictingColumnIdentity` (a JSDoc in a `plugin-detail` test), `evaluatePlainCondition` (the v18 18.3 release note) and `meetsContrastLevel` (a 2026-06 audit under a `core/theme/ThemeEngine.ts` heading). - After this batch the seat records `@object-ui/core` as exhausted under the card's current rules (amendment 6716057610). ## Verification <details><summary>Derived gates on HEAD dddbca3 (30/30, all exit 0, --ran reconciled)</summary> `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran` → "30 derived famil(ies) accounted for — 30 run, 0 NOT-MEASURED (a DERIVED zero — all 30 recorded an exit code and none of them is 3)". - `node scripts/check-adr-0087-registration.mjs --base origin/main` exit 0: `verified: @object-ui/core#RegisteredAction (export, ui/packages/core/src/actions/ActionEngine.ts), @object-ui/core#deepFreeze (export, ui/packages/core/src/utils/freeze-schema.ts)`; `--self-test` exit 0 - `node scripts/check-changeset-no-major.mjs --base origin/main` exit 0 - `node scripts/check-empty-changeset.mjs --base origin/main` exit 0; `--self-test` exit 0 - `node scripts/check-closing-keyword-parity.mjs` exit 0; `--self-test` exit 0 - `node scripts/check-comment-mask-corpus.mjs`, `check-sdui-manifest.mjs` (+ `--self-test`), `ci/snapshot-next.mjs --self-test`, `pm/release-rehearsal-clone.mjs --self-test`, `release-pending-publish.mjs --self-test`: exit 0 - `pnpm --dir ui exec vitest run scripts/` → Test Files 170 passed | 2 skipped (172), Tests 4996 passed | 2 skipped (4998). A first run without `@objectstack/client` built locally answered exit 1 in `unit-registry-absence-collision.test.ts` ("Failed to resolve entry for package @objectstack/client" for 37 app-shell modules); after building that package's closure the same command answered exit 0. - `pnpm --filter @objectstack/spec run check:duration-unit-keys`, `pnpm check:changeset-gate-self-tests`, `check:closed-ceremony-text`, `check:dispatcher-error-vocabulary`, `check:driver-memory-census`, `check:gitlink-declared`, `check:nul-bytes`, `check:published-files`, `check:refd-timer-probe`, `check:registry-log-declared`, `check:rest-log-spy-declared`, `check:skill-identifier-liveness`, `check:test-source-alias`, `check:tier-file-adoption`, `check:undeclared-dep-imports`, `check:watch-hint-literal`: exit 0 Outside the derivation: `pnpm check:changeset-fixed` exit 0; `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0 (no anchored file); `pnpm --dir ui check:new-line-citations` exit 0 (0 new citations); `pnpm check:published-readme-exports` not run locally (needs every published package built; CI runs it). </details> <details><summary>Full dogfood battery on HEAD dddbca3</summary> `bash scripts/pm/os-verify-lock.sh -c "pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test"` → `os-verify-lock: VERDICT command-exit 0` (held 38m15s) · Test Files 435 passed | 3 skipped (438) · Tests 3610 passed | 41 skipped (3651) · no failure. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5nqfeFSXxNcgTAEjp3)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5nqfeFSXxNcgTAEjp3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9a63ecb commit d0512c2

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@object-ui/core': patch
3+
---
4+
5+
refactor(core)!: retire two zero-consumer exports from the package entry (`RegisteredAction`, `deepFreeze`)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (runtime-export-retired @object-ui/core#RegisteredAction, @object-ui/core#deepFreeze) the retired operands are a TypeScript interface and a helper function of the core package; nothing in the workspace or in hotcrm imports either from the package entry (the only other spellings are local declarations of the same names in unrelated test files and in sandbox source text, none of which imports the package), 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 `RegisteredAction` or `deepFreeze` from `@object-ui/core`. Neither had an importer anywhere in the workspace or in hotcrm, so the Console and every `@object-ui/*` package are unaffected.
13+
14+
Both stay in their modules, which this package's own code still reads; only the entry stops publishing them:
15+
16+
- `RegisteredAction` types `ActionEngine`'s private action registry and is not part of any public `ActionEngine` method.
17+
- `deepFreeze` is the freezing step inside `defineSystemView`.
18+
19+
Every other name the entry exported stays exported unchanged, among them `ActionEngine`, `ShortcutBinding`, `ActionLocation`, `ACTION_LOCATIONS`, `defineSystemView`, `isSystemView`, `cloneAsOverride`, `SYSTEM_VIEW_MARKER`, `SystemView`, `DeepReadonly` and `DeepMutable`.
20+
21+
What leaves, and what to write instead:
22+
23+
- FROM `RegisteredAction` TO the host's own type: register actions through `ActionEngine.registerAction()` and read them back through its public methods, which never expose the registry entry shape.
24+
- FROM `deepFreeze` TO `defineSystemView()` for a System View, or `Object.freeze()` applied recursively in the host for any other object graph.

‎ui/packages/core/src/actions/index.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
*/
88

99
export * from './ActionRunner.js';
10-
export * from './ActionEngine.js';
10+
// Named, not `export *`: `RegisteredAction` stays in the module as the type of
11+
// `ActionEngine`'s private registry and off the public entry
12+
// (objectstack#25921: zero consumers).
13+
export {
14+
ActionEngine,
15+
ACTION_LOCATIONS,
16+
type ActionLocation,
17+
type ShortcutBinding,
18+
} from './ActionEngine.js';
1119
export {
1220
ACTION_DEF_KEYS,
1321
SPEC_ACTION_KEYS,

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,18 @@ export {
185185
type DebugFlags,
186186
} from './utils/debug.js';
187187
export * from './utils/debug-collector.js';
188-
export * from './utils/freeze-schema.js';
188+
// Named, not `export *`: `deepFreeze` stays in the module for
189+
// `defineSystemView` and off the public entry (objectstack#25921: zero
190+
// consumers).
191+
export {
192+
SYSTEM_VIEW_MARKER,
193+
defineSystemView,
194+
isSystemView,
195+
cloneAsOverride,
196+
type DeepReadonly,
197+
type DeepMutable,
198+
type SystemView,
199+
} from './utils/freeze-schema.js';
189200
// The shared key/value-bag check (objectui#13458); locals switch to it when touched.
190201
export * from './utils/is-plain-object.js';
191202
// `protocols/` retired whole in objectui#13453. Its three remaining bridges —

0 commit comments

Comments
 (0)