Skip to content

fix: backup automation mock + Claude probes dashboard alias#2293

Merged
gsxdsm merged 1 commit into
mainfrom
fix/main-tests-v11
Jul 18, 2026
Merged

fix: backup automation mock + Claude probes dashboard alias#2293
gsxdsm merged 1 commit into
mainfrom
fix/main-tests-v11

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Full Suite after #2292: shards 1–3 green; shard 4 failed FN-7537 backup automation tests with store.getGlobalSettingsDir is not a function.

Test plan

  • Local manual backup run parity (4 tests)
  • PR gate
  • Post-merge Full Suite

Summary by CodeRabbit

  • Bug Fixes
    • Improved automation backup test coverage for global backup directory handling.
    • Preserved reliable manual backup behavior and event ordering across supported automation steps.
    • Fixed dashboard API test configuration for Claude runtime probe resolution.

FN-7537 manual backup parity needs store.getGlobalSettingsDir after
resolveGlobalBackupRoot product drift. Alias dashboard Vitest Claude
runtime to probes-entry so API-quality tests do not load ACP index.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Dashboard automation backup test stores now mock the global settings directory, and Vitest resolves the Claude runtime alias to its probe entry point while retaining the dedicated probe alias.

Changes

Backup test fixtures

Layer / File(s) Summary
Mock global settings directory
packages/dashboard/src/__tests__/routes-automation.test.ts
Shared and manual-backup TaskStore fixtures now provide getGlobalSettingsDir() alongside getFusionDir().

Claude runtime alias

Layer / File(s) Summary
Probe entry alias
packages/dashboard/vitest.config.ts
The Claude runtime alias now targets src/probes-entry.ts, with the probe subpath targeting src/probe.ts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: backup automation mock fixes and the Claude probes dashboard alias update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/main-tests-v11

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 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR repairs dashboard backup tests and narrows Claude runtime resolution during Vitest runs. The main changes are:

  • Adds getGlobalSettingsDir to the automation route mock store.
  • Keeps backup fixtures under their temporary Fusion directories.
  • Resolves Claude probe imports without loading the full ACP runtime.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The backup fixtures retain temporary-directory isolation.
  • The lightweight Claude entry exports every symbol used by the current dashboard importer.

Important Files Changed

Filename Overview
packages/dashboard/src/tests/routes-automation.test.ts Adds the missing global-settings-directory mock and scopes backup tests to their temporary fixture directory.
packages/dashboard/vitest.config.ts Maps Claude runtime probe imports to lightweight entries that provide the symbols used by dashboard tests.

Reviews (1): Last reviewed commit: "fix: backup automation mock getGlobalSet..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/dashboard/vitest.config.ts`:
- Around line 592-598: Reorder the aliases in the Vitest configuration so
"`@fusion-plugin-examples/claude-runtime/probe`" is declared before the broader
"`@fusion-plugin-examples/claude-runtime`" alias, ensuring probe imports resolve
to src/probe.ts rather than through probes-entry.ts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a2c8f00d-c6d9-4243-8b0c-694cc8673efe

📥 Commits

Reviewing files that changed from the base of the PR and between 91eb1b0 and 3c25a30.

📒 Files selected for processing (2)
  • packages/dashboard/src/__tests__/routes-automation.test.ts
  • packages/dashboard/vitest.config.ts

Comment on lines 592 to +598
"@fusion-plugin-examples/claude-runtime": resolve(
__dirname,
"../../plugins/fusion-plugin-claude-runtime/src/index.ts",
"../../plugins/fusion-plugin-claude-runtime/src/probes-entry.ts",
),
"@fusion-plugin-examples/claude-runtime/probe": resolve(
__dirname,
"../../plugins/fusion-plugin-claude-runtime/src/probe.ts",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python - <<'PY'
from pathlib import Path

text = Path("packages/dashboard/vitest.config.ts").read_text()
specific = text.index('"`@fusion-plugin-examples/claude-runtime/probe`"')
base = text.index('"`@fusion-plugin-examples/claude-runtime`"')
assert specific < base, "The specific /probe alias must precede the base alias"
PY

Repository: Runfusion/Fusion

Length of output: 297


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Show the relevant section with line numbers.
sed -n '570,620p' packages/dashboard/vitest.config.ts | cat -n

# Search for similar alias ordering patterns in the repo.
rg -n '"`@fusion-plugin-examples/`.*/probe"|resolve\(' packages/dashboard -g 'vitest.config.ts' -g 'vite.config.ts' -g '*.ts' | sed -n '1,120p'

Repository: Runfusion/Fusion

Length of output: 16186


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

sed -n '570,620p' packages/dashboard/vitest.config.ts | cat -n
rg -n '"`@fusion-plugin-examples/`.*/probe"|resolve\(' packages/dashboard -g 'vitest.config.ts' -g 'vite.config.ts' -g '*.ts' | sed -n '1,120p'

Repository: Runfusion/Fusion

Length of output: 14944


🌐 Web query:

Vite resolve.alias array order first match prefix exact string alias subpath documentation

💡 Result:

In Vite, the resolve.alias configuration supports either an object or an array of objects [1][2]. When using the array format (Array<{ find: string | RegExp, replacement: string }>), the order of the entries is significant because Vite processes them sequentially and applies the first matching rule it encounters [1][3]. Key points regarding order, prefix matching, and string aliases: 1. Order Matters: Vite evaluates aliases in the order they are defined in the array [1][4]. The first rule that matches the import path will be applied, and subsequent rules for that path will be ignored [3]. 2. Prefix Collisions: If you have aliases that share a common prefix (e.g., @app and @app/components), the more specific alias (the longer path) must be defined before the more general alias [3]. If the general alias is listed first, it will intercept and handle the import, preventing the more specific rule from ever being evaluated [3]. 3. Array vs. Object: While the object format (Record<string, string>) is convenient for simple, exact-prefix mapping, it does not guarantee evaluation order in the same explicit way as an array [2][3]. The array format is required when you need to use Regular Expressions for complex patterns or when you must strictly control the precedence of competing aliases [1][3]. To ensure correct resolution, always order your alias array from the most specific paths to the most general ones [3]. Example of correct ordering: resolve: { alias: [ { find: '@app/components', replacement: '/absolute/path/to/components' }, // More specific first { find: '@app', replacement: '/absolute/path/to/app' } // Less specific second ] }

Citations:


🌐 Web query:

Vite object alias string prefix matching order specific alias before base object syntax

💡 Result:

In Vite, the resolve.alias configuration—whether defined as an object or an array—is processed in the order specified, with the first matching rule taking precedence [1][2][3]. Because Vite evaluates these entries sequentially and stops at the first successful match, the order of your aliases is critical, especially when dealing with overlapping or nested path prefixes [3]. When multiple aliases share a common prefix (e.g., @core and @core/auth), defining the more specific alias before the less specific one ensures that the correct path is resolved [3]. If the less specific alias (e.g., @core) is defined first, it will intercept imports intended for the more specific one (e.g., @core/auth) [3]. Key points regarding configuration: - Array Format: The array format (Array<{ find, replacement }>) is recommended for most configurations because it explicitly preserves the order of entries and allows for more complex patterns like Regular Expressions [1][2][3]. - Object Format: While the object format (Record<string, string>) is convenient for simple aliases, it relies on the iteration order of object keys, which is generally reliable in modern JavaScript but can be less transparent than an explicit array [1][2]. - Implementation Details: Internally, Vite processes these aliases in a top-down manner [4]. If you use the array format, your configuration should explicitly list your most specific aliases (e.g., those with longer or more distinct path segments) at the top of the array [3]. If you find that an alias is being incorrectly overridden, reordering your resolve.alias configuration to prioritize the most specific path match will resolve the issue [5][3].

Citations:


Place the /probe alias before the base alias.

The broader @fusion-plugin-examples/claude-runtime alias will also match @fusion-plugin-examples/claude-runtime/probe, so that import can resolve to probes-entry.ts/probe instead of src/probe.ts.

Suggested fix
-      "`@fusion-plugin-examples/claude-runtime`": resolve(
-        __dirname,
-        "../../plugins/fusion-plugin-claude-runtime/src/probes-entry.ts",
-      ),
       "`@fusion-plugin-examples/claude-runtime/probe`": resolve(
         __dirname,
         "../../plugins/fusion-plugin-claude-runtime/src/probe.ts",
       ),
+      "`@fusion-plugin-examples/claude-runtime`": resolve(
+        __dirname,
+        "../../plugins/fusion-plugin-claude-runtime/src/probes-entry.ts",
+      ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@fusion-plugin-examples/claude-runtime": resolve(
__dirname,
"../../plugins/fusion-plugin-claude-runtime/src/index.ts",
"../../plugins/fusion-plugin-claude-runtime/src/probes-entry.ts",
),
"@fusion-plugin-examples/claude-runtime/probe": resolve(
__dirname,
"../../plugins/fusion-plugin-claude-runtime/src/probe.ts",
"`@fusion-plugin-examples/claude-runtime/probe`": resolve(
__dirname,
"../../plugins/fusion-plugin-claude-runtime/src/probe.ts",
),
"`@fusion-plugin-examples/claude-runtime`": resolve(
__dirname,
"../../plugins/fusion-plugin-claude-runtime/src/probes-entry.ts",
),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dashboard/vitest.config.ts` around lines 592 - 598, Reorder the
aliases in the Vitest configuration so
"`@fusion-plugin-examples/claude-runtime/probe`" is declared before the broader
"`@fusion-plugin-examples/claude-runtime`" alias, ensuring probe imports resolve
to src/probe.ts rather than through probes-entry.ts.

@gsxdsm
gsxdsm merged commit c21bfdb into main Jul 18, 2026
7 checks passed
@gsxdsm
gsxdsm deleted the fix/main-tests-v11 branch July 18, 2026 09:56
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