Skip to content

fix(test): a Vite prefix-match alias silently unresolved a core subpath (greens full-suite shard 1) - #2686

Merged
gsxdsm merged 1 commit into
mainfrom
fix/core-subpath-alias-plugin-configs
Jul 30, 2026
Merged

fix(test): a Vite prefix-match alias silently unresolved a core subpath (greens full-suite shard 1)#2686
gsxdsm merged 1 commit into
mainfrom
fix/core-subpath-alias-plugin-configs

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

What

full-suite.yml shard 1 on main fails with zero test failures — it dies on a resolution error:

Failed to resolve import "@fusion/core/task-delete-attribution" from "packages/dashboard/app/api/client.ts"

Root cause. Vite string aliases match by PREFIX. So find: "@fusion/core"core/src/index.ts rewrites @fusion/core/task-delete-attribution into core/src/index.ts/task-delete-attribution, which cannot resolve. The narrower subpath alias has to come first.

The module exists and is correctly declared in packages/core/package.json exports — this is purely a test-config trap, and packages/dashboard/vitest.config.ts already documents it in a comment. Six configs alias @fusion/dashboard (whose app/api/client.ts imports that browser-safe leaf) while lacking the narrower alias, so they inherited the trap. This carries the same one-line pattern to all six.

Measured

dependency-graph — the project actually red on main:

Test files Tests collected
before 3 failed | 17 passed 147
after 20 passed 180

33 tests were never collected — neither passing nor reported as failing. That is the part worth flagging: an unresolved import removes tests from the run silently, and the shard's own summary printed no Tests N failed line at all, which is why this red looked like infrastructure noise rather than a real defect.

No regressions: reports 110, cli-printing-press 41, compound-engineering 317, gate 726 — all green. pnpm lint clean.

@fusion/desktop is 1 failed | 264 passed both before and after; verified pre-existing on clean origin/main by reverting just that one config and re-running. Cause is @fusion-plugin-examples/roadmap entry resolution, unrelated — flagged, not fixed.

Deliberately not changed

Engine's second @fusion/core alias (the .gate-bundle/core.mjs entry) is untouched: that lane bundles core on purpose, and pointing it at source would defeat the isolation the gate bundle exists to provide.

Full-suite triage this came out of (for whoever owns the rest)

Reading the four red shards of the last completed run on main (30523568756):

Shard Real cause Owner
1/4 this PR — resolution error, 0 test failures
2/4 23 failed: store-wedge-resolution.pg, central-archive-secrets, task-delete-caller-attribution, task-delete-nonblocking-cleanup #2669 / #2675 cover the first two
3/4 watchdog SIGKILL mid-@fusion/engine [1/2] — no test failures, no summary unowned
4/4 17 failed, all in @runfusion/fusion CLI (project.test.ts 8, task.test.ts 5, extension.test.ts 2, +2) unowned

Two of the four shard reds contain no failing test at all, so "main's full-suite failure count" cannot be read off the shard conclusions — it has to be read off Tests N failed summary lines, and shards 1 and 3 emit none.

…th (full-suite shard 1)

Vite string aliases match by PREFIX, so `find: "@fusion/core"` -> `core/src/index.ts`
rewrites `@fusion/core/task-delete-attribution` into
`core/src/index.ts/task-delete-attribution`, which cannot resolve. Six configs alias
`@fusion/dashboard` (whose `app/api/client.ts` imports that browser-safe leaf) while
lacking the narrower subpath alias that must precede the broad one.

The dashboard config already documents this exact hazard in a comment; the fix carries
the same one-line pattern to the six configs that inherited the trap.

MEASURED — dependency-graph, the project that was actually red on main:
  before: 3 failed files | 17 passed, 147 tests collected
  after:  20 passed files,               180 tests collected
33 tests were never collected, so they were neither passing nor reported as failing.

No regressions: reports 110, cli-printing-press 41, compound-engineering 317, gate 726
all green. desktop is 1 failed | 264 passed BOTH before and after (pre-existing on clean
main: @fusion-plugin-examples/roadmap entry resolution, unrelated to this change).

Engine's second `@fusion/core` alias (the `.gate-bundle/core.mjs` entry) is deliberately
untouched — that lane bundles core on purpose and must not resolve from source.

Fusion-Task-Id: U9
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@gsxdsm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 03e459e4-a816-4945-8d41-560fc23b2dc8

📥 Commits

Reviewing files that changed from the base of the PR and between 30e287a and 1256a77.

📒 Files selected for processing (6)
  • packages/desktop/vitest.config.ts
  • packages/engine/vitest.config.ts
  • plugins/fusion-plugin-cli-printing-press/vitest.config.ts
  • plugins/fusion-plugin-compound-engineering/vitest.config.ts
  • plugins/fusion-plugin-dependency-graph/vitest.config.ts
  • plugins/fusion-plugin-reports/vitest.config.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds ordered Vitest aliases for the browser-safe @fusion/core/task-delete-attribution subpath before the broader @fusion/core alias.

  • Applies the resolution fix to desktop and engine test configurations.
  • Applies the same fix to the CLI Printing Press, Compound Engineering, Dependency Graph, and Reports plugin test configurations.

Confidence Score: 5/5

The PR appears safe to merge, with the alias ordering consistently corrected across the affected Vitest configurations.

The new aliases resolve the existing core leaf module before Vite can apply the broader prefix alias, and no concrete changed-code failure remains.

Important Files Changed

Filename Overview
packages/desktop/vitest.config.ts Adds the exact core subpath alias ahead of the prefix-matching core alias.
packages/engine/vitest.config.ts Adds the source-leaf alias at the root while preserving the engine-core project's intentional gate-bundle override.
plugins/fusion-plugin-cli-printing-press/vitest.config.ts Adds the correctly ordered subpath alias using the plugin configuration's existing URL-resolution convention.
plugins/fusion-plugin-compound-engineering/vitest.config.ts Adds the exact subpath entry before the broad core entry in the ordered alias array.
plugins/fusion-plugin-dependency-graph/vitest.config.ts Adds the exact subpath entry before the broad core entry in the ordered alias array.
plugins/fusion-plugin-reports/vitest.config.ts Adds the exact core subpath alias while retaining the existing dashboard subpath ordering.

Reviews (1): Last reviewed commit: "fix(test): a Vite prefix-match alias sil..." | Re-trigger Greptile

@gsxdsm
gsxdsm merged commit 3e80dcb into main Jul 30, 2026
7 checks passed
@gsxdsm
gsxdsm deleted the fix/core-subpath-alias-plugin-configs branch July 30, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant