Repository navigation
refactor(data-objectstack)!: retire the test-only clearSharedDiscoveryCache from the entry - #33666
Conversation
…yCache from the entry The per-origin discovery cache (the Map, getSharedDiscovery and the reset helper) moves verbatim from index.ts to the in-package module sharedDiscovery.ts. The entry keeps re-exporting getSharedDiscovery and reads it for ObjectStackAdapter.connect(); the test-only reset helper leaves the entry, like the other reset helpers already kept off the package barrels. The 28 in-package and 10 cross-package tests that call it import it from the module; no assertion changes. Co-Authored-By: Claude <noreply@anthropic.com>
…ads at collection check:test-source-alias judges a test file a change edits: the object picker under the dataset form loads both packages lazily, so the edited test imports them at module top instead of paying the first load inside a case's timeout. Co-Authored-By: Claude <noreply@anthropic.com>
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD Contract reviewServed-tier: ① Derived judgmentsRead on the net diff against the merge base
② Semver levelClause-②: no (narrowing) The changeset bumps ③ Boundary flags
④ Design judgmentThe narrowing takes away no declared capability. Attempts to break it, and what they found:
Findings:
No must-fix and no should-fix. The three nits are left as accepted deviations or a follow-up; none needs this head to move. Implemented-by: VERDICT: PASS |
|
你有fable为什么不自己复审? |
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD 席位核对Verdict: ACCEPT · head
|
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD Landing · head
State: ready + auto-merge. |
Requested by Leehom · project thread
Part of #25921
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none (the name appears under neither
skills/**norcontent/docs/**)维护者速读
@object-ui/data-objectstack的根入口不再导出只给测试用的clearSharedDiscoveryCache(清空适配器按来源缓存的 discovery 文档)。缓存这一小段代码原样搬进包内新模块sharedDiscovery.ts,getSharedDiscovery照旧从入口导出;38 个测试改为从该模块直接引入。这是 retire the zero-consumer surface: nine dead modules (2,211 LOC), plugin-ai, runner's publish flag, test-only reset helpers on public barrels, the providers trio, 122 dead i18n keys, root orphans #25921 第 18 批,补完卡上「reset* 测试助手移出公共入口」那一条的最后一项(前 8 个早已移出)。resetRuntimeConfigForTesting、__clearRecordEditableCache等助手一致。!patch,回滚即 revert 本 PR。ui/packages/data-objectstack/src/sharedDiscovery.ts、ui/packages/data-objectstack/src/index.ts(缓存段与新增 import)、.changeset/25921-data-objectstack-shared-discovery-cache-helper.md。node scripts/check-adr-0087-registration.mjs --base origin/main,预期该名字verified、退出 0。What changes
Batch 18 as named in the seat's amendment 6888438983 on claim 6888311800 (census
/mnt/project-files/pm-orders/ui/25921-b18-census.md, objectstackorigin/main6e287974, hotcrm2492ac6).ui/packages/data-objectstack/src/sharedDiscovery.ts: the per-origin discovery cache block (thediscoveryCacheMap,getSharedDiscovery,clearSharedDiscoveryCache), moved verbatim fromindex.tsunder a short module header.ui/packages/data-objectstack/src/index.ts: importsgetSharedDiscoveryfrom the module forObjectStackAdapter.connect()and re-exports it unchanged.clearSharedDiscoveryCacheleaves the entry; in its place sits the "test-only and stays off the barrel" comment its siblings carry in app-shell, types and plugin-detail.serverOriginOf, which sat between the moved lines, stays inindex.ts.data-objectstack/srcnow import the helper from./sharedDiscovery; 10 in console (4), app-shell (4) and react (2) import it by relative source path, the spelling those packages already use forresetRuntimeConfigForTesting,resetInflightGetsForTestingand__clearRecordEditableCache. ui vitest aliases@object-ui/data-objectstackto the packagesrc, so the adapter and the helper resolve to one module instance. No assertion changes.ui/packages/app-shell/src/views/metadata-admin/previews/canvasDataSource-27585.test.tsx, beyond its import line: two module-top side-effect imports,@objectstack/lintand@objectstack/formula, thatcheck:test-source-aliasasks of an edited test reaching those lazy loads (see Verification, round 1). The amendment named import-line edits only; this is the gate's prescribed fix for a file the batch had to touch..changeset/25921-data-objectstack-shared-discovery-cache-helper.md:!patch, BREAKING, FROM/TO, oneruntime-export-retiredmarker (FROM spans 1:1), both declaration lines.Why
The card's recommendation "Move the nine
reset*helpers into@object-ui/test-supportor tag them@internal" was done for eight helpers (objectui#13453 and #28544);clearSharedDiscoveryCachewas left as item B2 and carried as open in the landing notes through #31056. The census found zero non-test callers in either repo, and no README, docs page, skill, changeset or CHANGELOG naming it.Tests
rg -w -Fpass per repo): the helper's only hits outside the package are the 10 test files above; hotcrm 0. Positive control in the same block:getSharedDiscoveryhas non-test readers outside the package (ui/apps/console/src/languageSeed.ts,ui/packages/app-shell/src/chrome/ConditionalAuthWrapper.tsx) and stays exported.src/index.tsgoes 127 → 126, exactlyclearSharedDiscoveryCachegone, nothing added. The builtdist/index.js, imported at runtime, has noclearSharedDiscoveryCachekey and still hasgetSharedDiscoveryandObjectStackAdapter. A probe compiled against the builtdist/index.d.tsanswers TS2305 for the helper and nothing on the control line (getSharedDiscovery,ObjectStackAdapter).pnpm --workspace-concurrency=2 --filter '@object-ui/data-objectstack...' buildthen itstype-check(its tsconfig includes the in-package tests): VERDICT command-exit 0.--filter '@object-ui/console...' buildthentype-checkof@object-ui/react,@object-ui/app-shelland@object-ui/console(each runs itstsconfig.test.jsonor equivalent): VERDICT command-exit 0.pnpm --dir ui exec vitest run --maxWorkers=2 packages/data-objectstack/plus the 10 cross-package test files, under the lock: VERDICT command-exit 0, Test Files 131 passed (131), Tests 1475 passed (1475).Acceptance notes
runnermove underapps/orexamples/, and 57 newly CONFIRMED i18n keys that are not the card's 122.Verification
Derived gates on HEAD 85ef16b (38/38, all exit 0, --ran reconciled)
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran ran.list(each lineCMD :: exit N) → "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3)". Each command ran with stdin closed and its exit code captured before any pipe.node scripts/check-adr-0087-registration.mjs --base origin/mainexit 0:not-required (runtime-export-retired) -- verified: @object-ui/data-objectstack#clearSharedDiscoveryCache;--self-testexit 0node scripts/check-changeset-no-major.mjs --base origin/main,check-empty-changeset.mjs --base origin/main(+--self-test),check-closing-keyword-parity.mjs(+--self-test),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 0pnpm --dir ui exec vitest run scripts/under the lock → Test Files 171 passed | 2 skipped (173), Tests 5062 passed | 2 skipped (5064)pnpm check:type-check-debtunder the lock → exit 0 ("0 raw tsc error(s) total, none above its recorded number")pnpm check:cross-package-test-inputsexit 0 ("32 package(s) read outside themselves, all declared")pnpm check:test-source-aliasexit 0 (see round 1 below)pnpm --filter @objectstack/spec run check:duration-unit-keys,check:error-code-provenance;pnpm check:changeset-gate-self-tests,check:closed-ceremony-text,check:dispatcher-error-vocabulary,check:driver-memory-census,check:engine-double-contract,check:error-status-conformance,check:gitlink-declared,check:nul-bytes,check:published-files,check:query-options-erasure,check:refd-timer-probe,check:registry-log-declared,check:rest-log-spy-declared,check:skill-identifier-liveness,check:tier-file-adoption,check:type-check-coverage,check:undeclared-dep-imports,check:watch-hint-literal,check:where-matcher: exit 0Round 1 on 20126db (same 38): 37 exit 0,
pnpm check:test-source-aliasexit 1. It judges a test file a change edits, and the editedcanvasDataSource-27585.test.tsxreachesimport('@objectstack/lint')andimport('@objectstack/formula')inside function bodies (the object picker under the dataset form). Commit 85ef16b adds the two module-top side-effect imports the gate prescribes, the spelling threeAppContent.*tests in app-shell already use; that file then passes 5/5 under the lock, and the whole list was rerun on 85ef16b above.Outside the derivation:
node scripts/check-platform-checklist.mjs --changed-from origin/mainexit 0 (0 anchored files);pnpm --dir ui run check:new-line-citationsexit 0 (0 new citations).Full dogfood battery on HEAD 85ef16b
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 41m18s) · Test Files 467 passed | 3 skipped (470) · Tests 3953 passed | 42 skipped (3995) · no failure.Human Minimum
packages/specholds no runtime logic. (not touched)sharedDiscovery.ts, camelCase like its siblings)pnpm lintpasses. (lint is CI's run)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5oqJ6hpya34gYbwBaJ