From 0d31aa8a58ab774e02b83cec4f1149da0814b260 Mon Sep 17 00:00:00 2001 From: yinlianghui-tw Date: Mon, 24 Aug 2026 09:24:07 +0000 Subject: [PATCH] chore(tsconfig): drop the two dead @objectstack paths entries and empty their ratchet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `compilerOptions.paths` mapped `@objectstack/plugin-msw` and `@objectstack/objectql` into `node_modules/**/src/index.ts` for two packages that are not dependencies of this workspace at all, so no install could ever produce those targets. Measured on this branch: zero declarations across every package.json, `node_modules/@objectstack/` holds only `spec`, nothing in `node_modules/.pnpm/` matches either name, and no compiled source carries a real import of either specifier (the same regex finds 12 real imports of `@objectstack/spec`, so the empty result is a reading rather than a broken grep). A dead mapping never fails a build — nothing resolves through it — it just reads as if the packages were wired up. Deleting the lines is behaviour-neutral: a `paths` key can only affect resolution of its own specifier, and both have zero importers. The two entries were the whole content of `KNOWN_MISSING_TARGETS`, the shrink-only ratchet #4804 carved out pending this decision, so that list is emptied in the same change and its pin now asserts the emptiness instead of passing vacuously. Every `paths` entry is guarded with no exemptions. The two specifiers keep appearing in prose (`skills/` guides, the ObjectOS integration page) as downstream-user examples; those need no `paths` map in this repo and are deliberately untouched. --- .../vitest-config-alias-targets-3944.test.ts | 44 ++++++++++++------- tsconfig.json | 2 - 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/scripts/__tests__/vitest-config-alias-targets-3944.test.ts b/scripts/__tests__/vitest-config-alias-targets-3944.test.ts index 77235a0e5c..372fb3215e 100644 --- a/scripts/__tests__/vitest-config-alias-targets-3944.test.ts +++ b/scripts/__tests__/vitest-config-alias-targets-3944.test.ts @@ -237,23 +237,22 @@ function resolveTarget(target: string): { abs: string; isPattern: boolean } { } /** - * objectui#4820 — two entries whose targets do not exist and which #4804 - * deliberately did NOT delete. They are dead for a different reason: they point - * into `node_modules` for packages that are not dependencies of this workspace - * at all (`node_modules/@objectstack/` holds only `spec`; neither name appears - * in any package.json), so no install can ever produce them. Whether the fix is - * to drop the lines or to add the dependencies AGENTS.md section 7 prescribes - * is a maintainer call, not a rider on #4804's six-line deletion. - * - * A shrink-only ratchet, not an exemption. The list may not grow — a NEW dead - * target is still red — and the pin below asserts each listed entry is still - * declared AND still missing, so resolving #4820 either way turns this file red - * until the list is emptied with it. + * objectui#4820 — RESOLVED, and this ratchet is empty as a result. + * + * It briefly carved out `@objectstack/plugin-msw` and `@objectstack/objectql`, + * two `paths` entries pointing into `node_modules` for packages that are not + * dependencies of this workspace at all, so no install could ever produce them. + * #4820 ruled direction A — drop the lines rather than add the dependencies — + * on the ground that adding a runtime dependency is a product decision that must + * not be back-derived from a dead config line. Both lines are gone from + * `tsconfig.json`, so the carve-out went with them. + * + * A shrink-only ratchet, not an exemption: it may not grow. Empty is its + * terminal state — every `paths` entry is now guarded with no exemptions, and + * the pin below keeps it that way. Re-adding either specifier needs the package + * to be a real dependency first, which the existence check enforces on its own. */ -const KNOWN_MISSING_TARGETS: readonly string[] = [ - '@objectstack/plugin-msw', - '@objectstack/objectql', -]; +const KNOWN_MISSING_TARGETS: readonly string[] = []; /** The six lines #4804 removed, in both spellings. */ const REMOVED_BY_4804 = [ @@ -341,7 +340,18 @@ describe('objectui#4804 — root tsconfig.json compilerOptions.paths table', () } }); - it('the objectui#4820 carve-out still describes exactly the entries it was written for', () => { + it('the objectui#4820 carve-out is empty, so no paths entry is exempt', () => { + // #4820 was resolved by deleting both carved-out lines, so this list is + // empty and every case above covers the whole table. Asserted rather than + // left implicit: with an empty list the two expectations below are vacuous, + // and a silently vacuous pin is the exact trap this file guards elsewhere. + expect( + KNOWN_MISSING_TARGETS, + 'KNOWN_MISSING_TARGETS is a shrink-only ratchet that reached empty when objectui#4820 ' + + 'landed. Re-populating it needs a card of its own — a new dead target is meant to go ' + + 'red here, not to be carved out.' + ).toEqual([]); + const declared = pathEntries.filter((e) => KNOWN_MISSING_TARGETS.includes(e.specifier)); expect( diff --git a/tsconfig.json b/tsconfig.json index a7c453ca56..5e639ab2e8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -31,8 +31,6 @@ "@object-ui/sdui-parser/*": ["packages/sdui-parser/src/*"], "@object-ui/protocol": ["packages/core/src"], "@object-ui/protocol/*": ["packages/core/src/*"], - "@objectstack/plugin-msw": ["node_modules/@objectstack/plugin-msw/src/index.ts"], - "@objectstack/objectql": ["node_modules/@objectstack/objectql/src/index.ts"], "@object-ui/console": ["apps/console/plugin.ts"] } },