From bbcc46e7ae46bc6037d42c074fdd5c1f702bb44b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 25 Aug 2026 00:19:43 +0000 Subject: [PATCH] chore(runner): drop the unused "@app" vite alias and empty its ratchet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `packages/runner/vite.config.ts` declared `"@app"` pointing at `./src/app-data`. The alias had ZERO importers: a repo-wide sweep finds `@app` only in the declaration itself and in the ratchet prose below it. The documented App Data Symlink DX does not route through it. `LocalBundleLoader` (`packages/runner/src/lib/MetadataLoader.ts`) reads that directory through relative `import.meta.glob('../app-data/…')`, and README.md / runner.mdx teach `src/app-data/` as a path, never `@app`. So deleting the line changes no behaviour and breaks no documented workflow. Note what is NOT the ground here: `src/app-data/` is not a dead target. It is git-ignored (`packages/runner/.gitignore:1`) and user-supplied — absent from a fresh checkout BY DESIGN, created by any reader who follows the documented Development Workflow. The dead thing was the unused alias, not the directory it named. Same PR, as objectui#5168's shrink-only pin requires: the `KNOWN_MISSING_PACKAGE_ALIAS_TARGETS` carve-out entry goes with it. That entry was the list's only member, so the ratchet reaches empty — every package alias entry is now guarded with no exemptions. Emptying it makes both of the carve-out pin's existing expectations vacuous: each compares [] with [] and can no longer fail for any repo state. Rather than ship a pin that cannot fail, the pin now asserts emptiness itself first — which does go red if the list is re-populated — and says in-line that the two below it are knowingly vacuous at zero. Same shape objectui#4820 left on `KNOWN_MISSING_TARGETS` in this file. Part of #5380 --- packages/runner/vite.config.ts | 2 - .../vitest-config-alias-targets-3944.test.ts | 77 ++++++++++++------- 2 files changed, 51 insertions(+), 28 deletions(-) diff --git a/packages/runner/vite.config.ts b/packages/runner/vite.config.ts index fa2dacd439..c366bd0ffa 100644 --- a/packages/runner/vite.config.ts +++ b/packages/runner/vite.config.ts @@ -21,8 +21,6 @@ export default defineConfig({ "@/hooks": path.resolve(__dirname, "../../packages/components/src/hooks"), "@": path.resolve(__dirname, "./src"), - // ⚡️ DX: App Data Symlink - "@app": path.resolve(__dirname, "./src/app-data"), // ⚡️ DX: Map imports to source code for Hot Module Replacement // diff --git a/scripts/__tests__/vitest-config-alias-targets-3944.test.ts b/scripts/__tests__/vitest-config-alias-targets-3944.test.ts index 372fb3215e..3d331c5716 100644 --- a/scripts/__tests__/vitest-config-alias-targets-3944.test.ts +++ b/scripts/__tests__/vitest-config-alias-targets-3944.test.ts @@ -788,32 +788,39 @@ function packageAliasTargetExists(abs: string): boolean { } /** - * objectui#5380 — one entry whose target does not exist and which this PR - * deliberately does NOT delete, for the same reason objectui#4820 was carved - * out of the `paths` half rather than fixed in it. - * - * `packages/runner`'s `"@app"` points at `packages/runner/src/app-data`, which - * is absent in every form (no directory, no `app-data.`). Its comment reads - * `DX: App Data Symlink`, and nothing in the repo imports `@app` — the - * declaration is the only occurrence. So the fix is either "drop the line" or - * "restore the symlink this DX affordance was written for", and which one is a - * maintainer call, not a rider on a gate that is only supposed to start looking. - * Filed as objectui#5380; this file's job here is to stop it being invisible. - * - * Note it is NOT an `@object-ui/*` key. The finding that opened objectui#5168 - * counted 196 `@object-ui/*` entries, and a gate scoped to that prefix would - * have shipped green over this. That is the second time this exact config has - * outlived a target: its own comment records objectui#3593, where a - * `2>/dev/null` kept a dead `data-objectql` entry quiet. - * - * A shrink-only ratchet, not an exemption. The list may not grow — a NEW dead - * target is still red — and the pin below asserts the listed entry is still - * declared AND still missing, so resolving it either way turns this file red - * until the list is emptied with it. + * objectui#5380 — RESOLVED, and this ratchet is empty as a result. + * + * It briefly carved out `packages/runner`'s `"@app"`, which pointed at + * `packages/runner/src/app-data`. #5380 ruled direction A′: delete the alias + * line, on the measured ground that it had **zero importers** and that the + * documented App Data Symlink DX does not route through it — + * `packages/runner/src/lib/MetadataLoader.ts`'s `LocalBundleLoader` reads that + * directory through relative `import.meta.glob('../app-data/…')`, never through + * the alias. Deleting the line changed no behaviour. + * + * ⚠️ Read the ground carefully before carving out anything that looks like + * this again: `src/app-data/` is NOT a dead target. It is git-ignored + * (`packages/runner/.gitignore:1`) and **user-supplied** — the reader creates it + * by following `packages/runner/README.md` or `content/docs/utilities/runner.mdx`, + * and it is absent from a fresh checkout **by design**. What was dead was the + * unused alias, not the thing it named. An existence check reads a + * user-supplied directory as missing on CI and present on the machine of anyone + * who followed the docs; that checkout-state dependence is objectui#5968's + * subject, and this ratchet reaching empty is what removed its only instance + * here — not a fix for the class. + * + * Note the entry was NOT an `@object-ui/*` key. The finding that opened + * objectui#5168 counted 196 `@object-ui/*` entries, and a gate scoped to that + * prefix would have shipped green over it. That is why this half takes its + * scope from EVERY entry in every table, and why narrowing it to a prefix would + * silently shrink the surface. + * + * A shrink-only ratchet, not an exemption: it may not grow. Empty is its + * terminal state — every package alias entry is now guarded with no exemptions, + * and the pin below keeps it that way. A NEW dead target is meant to go red in + * the existence check above, not to be carved out. */ -const KNOWN_MISSING_PACKAGE_ALIAS_TARGETS: readonly { config: string; specifier: string }[] = [ - { config: 'packages/runner/vite.config.ts', specifier: '@app' }, -]; +const KNOWN_MISSING_PACKAGE_ALIAS_TARGETS: readonly { config: string; specifier: string }[] = []; const isCarvedOut = (entry: PackageAliasEntry): boolean => KNOWN_MISSING_PACKAGE_ALIAS_TARGETS.some( @@ -884,7 +891,25 @@ describe('objectui#5168 — package-level vite.config.ts alias tables', () => { } ); - it('the objectui#5168 carve-out still describes exactly the entries it was written for', () => { + it('the objectui#5168 carve-out is empty, so no package alias entry is exempt', () => { + // objectui#5380 was resolved by deleting the one carved-out line, so this + // list is empty and the existence check above now covers every entry. + // + // ⚠️ Asserted rather than left implicit. With an empty list BOTH + // expectations below are vacuous — each filters an empty list (or filters + // by `isCarvedOut`, which is false for everything) and compares [] with [], + // so neither can fail for ANY repo state. A silently vacuous pin is the + // exact trap the `toBeGreaterThanOrEqual` cases at the top of this block + // guard against, so the expectation that still bites at zero has to be + // written down: emptiness itself. This one goes red the moment the list is + // re-populated, which is the only way the two below become meaningful again. + expect( + KNOWN_MISSING_PACKAGE_ALIAS_TARGETS, + 'KNOWN_MISSING_PACKAGE_ALIAS_TARGETS is a shrink-only ratchet that reached empty when ' + + 'objectui#5380 landed. Re-populating it needs a card of its own — a new dead alias ' + + 'target is meant to go red in the existence check above, not to be carved out.' + ).toEqual([]); + const declared = KNOWN_MISSING_PACKAGE_ALIAS_TARGETS.filter((known) => packageAliasEntries.some((e) => e.config === known.config && e.specifier === known.specifier) );