Files
fusion/package.json
gsxdsm f7e942e6f4 fix: resolve all full-suite failures + add structural mock-completeness gate check (round 10) (#2040)
## Summary

Fixes ALL failing shards from the latest full-suite run (29225946428)
AND adds a structural gate check to prevent the recurring mock-export
drift pattern that has caused every full-suite failure across rounds
1–9.

## What broke (run 29225946428, commit 504b0f8b0)

| Shard | Root cause | Tests fixed |
|---|---|---|
| **3 (CLI)** | `workflowValidateParams` (FN-7911) missing from
`@fusion/engine` mock | 8 files |
| **3 (CLI)** | `skill-sync.test.ts` — `fn_workflow_validate` missing
from engine-tools.md | 1 file |
| **4 (dashboard)** | 6 chat default settings keys missing from
description allowlist | 1 file |
| **1+2 (engine)** | `additionalSkillPaths` missing from
`buildSessionSkillContext` mocks (FN-1510/1511) | 10 tests |
| **1+2 (engine)** | heartbeat FN-7878 changed paused→error for generic
run failures | 1 test |
| **1+2 (engine)** | executor `updateTask` exact-match →
`objectContaining` (new fields) | 2 tests |
| **1+2 (engine)** | `connectMcpSessionTools` mock missing for pi.test
MCP forwarding | 1 test |

## Structural fix — `scripts/check-mock-completeness.mjs` (the "fix for
good")

**New gate check** added to `pnpm test:gate`. Statically validates every
hardcoded `vi.mock("@fusion/dashboard")` and `vi.mock("@fusion/engine")`
factory covers all named imports the source file uses. Runs in <0.2s, no
module evaluation.

**How it works:**
1. Extracts named exports from each barrel
(`packages/dashboard/src/index.ts`, `packages/engine/src/index.ts`)
2. For each test file with a hardcoded `vi.mock` factory (no
`importOriginal`/`importActual` spread):
- Resolves source files the test covers (static + dynamic imports,
convention mapping)
   - Extracts what those source files named-import from the barrel
- Resolves spread helpers (e.g. `...workflowAuthoringEngineMock`) by
reading the helper's exported keys
- Reports any barrel exports that are named-imported by source but
absent from the mock

**Why this fixes the recurring pattern:** Every round 1–9 failure was a
new barrel export imported by source but missing from a test mock. This
check catches it at gate time, before merge — not after the full-suite
fails on main.

Also completed all 15 latent mock gaps the guard found on first run (9
dashboard + 6 engine), including expanding the centralized
`workflowAuthoringEngineMock` helper with all `extension.ts` named
imports.

## Verification
- Gate (with new check): exit 0 ✅
- CLI: 355/355 passed ✅
- Engine (6 fixed files): 250/250 passed ✅
- i18n + settings: verified ✅
- Mock completeness guard: ✅ (0 issues)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Documented a new non-destructive workflow validation tool that
performs a dry-run and returns typed validation errors.

* **Tests**
* Updated and strengthened CLI, dashboard, extension, and engine tests
with more accurate mock exports and more resilient assertions.
* Adjusted expectations for session/heartbeat and retry-related
behaviors.

* **Chores**
* Added an automated mock-completeness gate and integrated it into the
test quality gate to keep mocks aligned with available platform exports.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-12 23:29:06 -07:00

118 lines
6.0 KiB
JSON

{
"name": "fusion-workspace",
"version": "0.58.0",
"private": true,
"license": "MIT",
"homepage": "https://github.com/Runfusion/Fusion#readme",
"repository": {
"type": "git",
"url": "https://github.com/Runfusion/Fusion"
},
"bugs": {
"url": "https://github.com/Runfusion/Fusion/issues"
},
"type": "module",
"packageManager": "pnpm@10.33.0",
"scripts": {
"pretest": "node scripts/check-no-nohup.mjs && node scripts/check-no-kill-4040.mjs && node scripts/check-no-test-timeout-appeasement.mjs && node scripts/check-changeset-format.mjs",
"pretest:full": "node scripts/check-no-nohup.mjs && node scripts/check-no-kill-4040.mjs && node scripts/check-no-test-timeout-appeasement.mjs && node scripts/check-changeset-format.mjs",
"check:line-count": "node scripts/check-file-line-count.mjs",
"check:changesets": "node scripts/check-changeset-format.mjs",
"check:quarantine-ledger": "node scripts/check-quarantine-ledger.mjs",
"check:mock-completeness": "node scripts/check-mock-completeness.mjs",
"test:gate": "node scripts/check-no-nohup.mjs && node scripts/check-no-kill-4040.mjs && node scripts/check-no-test-timeout-appeasement.mjs && node scripts/check-changeset-format.mjs && node scripts/check-mock-completeness.mjs && pnpm --filter @fusion/engine test:core && pnpm --filter @runfusion/fusion test:ci-shape",
"smoke:boot": "node scripts/boot-smoke.mjs",
"local": "node scripts/start-local.mjs",
"dev": "node scripts/dev-with-memory.mjs",
"start": "node scripts/dev-with-memory.mjs",
"dev:ui": "pnpm --filter @fusion/dashboard dev",
"dev:hmr": "node scripts/dev-hmr.mjs",
"lint": "eslint .",
"sync:fusion-skill": "node scripts/sync-fusion-skill-tools.mjs",
"sync:fusion-skill:check": "node scripts/sync-fusion-skill-tools.mjs --check",
"build": "node scripts/build-workspace.mjs",
"build:all": "pnpm -r build",
"verify:workspace": "pnpm lint && pnpm test:full && pnpm build",
"build:exe": "pnpm build && pnpm --filter @runfusion/fusion build:exe",
"build:exe:all": "pnpm build && pnpm --filter @runfusion/fusion build:exe:all",
"test": "node scripts/test-changed.mjs",
"verify:fast": "node scripts/verify-fast.mjs",
"test:scripts": "node scripts/run-script-tests.mjs",
"test:workflow-release-check": "node scripts/workflow-reliability-release-check.mjs",
"fn:cache-stats": "node scripts/cache-stats.mjs",
"test:full": "node scripts/test-changed.mjs --full --no-cache && pnpm --filter @fusion/engine test:slow",
"test:velocity": "node scripts/test-velocity-baseline.mjs",
"test:feedback-baseline": "node scripts/test-feedback-baseline.mjs",
"test:ci:shard": "node scripts/ci-test-shard.mjs",
"test:serial": "FUSION_TEST_CONCURRENCY=1 FUSION_TEST_WORKSPACE_CONCURRENCY=1 pnpm test:full",
"test:fast": "FUSION_TEST_CONCURRENCY=4 FUSION_TEST_WORKSPACE_CONCURRENCY=4 pnpm test:full",
"test:locked": "node scripts/test-with-lock.mjs",
"test:build": "pnpm --filter @fusion/dashboard test:build",
"test:isolated": "node scripts/check-test-isolation.mjs --before && pnpm test:full && node scripts/check-test-isolation.mjs",
"test:check-isolation": "node scripts/check-test-isolation.mjs",
"test:coverage": "pnpm -r --workspace-concurrency=1 exec vitest run --silent=passed-only --reporter=dot --coverage",
"test:coverage:core": "pnpm --filter @fusion/core exec vitest run --silent=passed-only --reporter=dot --coverage",
"test:coverage:engine": "pnpm --filter @fusion/engine exec vitest run --silent=passed-only --reporter=dot --coverage",
"test:coverage:cli": "pnpm --filter @runfusion/fusion exec vitest run --silent=passed-only --reporter=dot --coverage",
"test:coverage:dashboard": "pnpm --filter @fusion/dashboard exec vitest run --silent=passed-only --reporter=dot --coverage",
"test:slow-cli": "pnpm --filter @runfusion/fusion test:slow-cli",
"typecheck": "pnpm -r --filter=!@fusion/desktop --filter=!@fusion/mobile typecheck",
"i18n:extract": "i18next-cli extract",
"i18n:sync": "i18next-cli sync",
"i18n:types": "i18next-cli types",
"i18n:status": "tsx --no-warnings packages/i18n/scripts/check-i18n-parity.mjs",
"i18n:status:report": "i18next-cli status",
"i18n:lint": "i18next-cli lint",
"i18n:gen-cli": "pnpm --filter @fusion/i18n gen:cli-catalogs",
"changeset": "changeset",
"version": "changeset version",
"release": "node scripts/release.mjs",
"release:version": "changeset version && node scripts/sync-workspace-version.mjs && node scripts/run-ci-distill.mjs",
"mobile:build": "pnpm --filter @fusion/dashboard build && pnpm --filter @fusion/mobile cap sync",
"mobile:ios": "pnpm mobile:build && pnpm --filter @fusion/mobile cap open ios",
"mobile:android": "pnpm mobile:build && pnpm --filter @fusion/mobile cap open android",
"mobile:dev:ios": "pnpm --filter @fusion/mobile dev:ios",
"mobile:dev:android": "pnpm --filter @fusion/mobile dev:android",
"mobile:sync": "pnpm --filter @fusion/mobile cap sync",
"mobile:run:android": "bash scripts/mobile-run-android.sh",
"ios:acceptance": "node scripts/ios-acceptance.mjs",
"build:desktop": "pnpm --filter @fusion/desktop build",
"dist:desktop:win": "pnpm --filter @fusion/desktop build && pnpm --filter @fusion/desktop dist:win"
},
"pnpm": {
"ignoredBuiltDependencies": [
"@google/genai",
"better-sqlite3",
"cpu-features",
"electron-winstaller",
"keytar",
"sharp",
"ssh2"
],
"onlyBuiltDependencies": [
"@homebridge/node-pty-prebuilt-multiarch",
"electron",
"esbuild",
"koffi",
"protobufjs"
],
"overrides": {
"@types/node": "^25.5.2",
"protobufjs": "^7.5.8"
}
},
"devDependencies": {
"@changesets/cli": "^2.30.0",
"@eslint/js": "^9.0.0",
"eslint": "^9.0.0",
"esbuild": "^0.25.12",
"fast-glob": "^3.3.3",
"i18next-cli": "^1.59.1",
"react-devtools-core": "^7.0.1",
"tsx": "^4.19.0",
"typescript": "^5.7.0",
"typescript-eslint": "^8.0.0",
"yaml": "^2.8.3"
}
}