fix: CLI shouldSuperviseDashboard mock + getCliPackageVersion/isUnresolvedCliPackageVersion + executeRequeueLoopCount + i18n buttonShort (round 9) (#2034)

## Summary

Fixes shard 3 (CLI) + shard 4 (i18n) failures from full-suite run
29223788088.

## Fixes

### CLI (shard 3) — 5 files, ~140 tests
- **`bin.test.ts`** — `bin.ts:851` now imports
`shouldSuperviseDashboard` and `bin.ts:865` imports
`runDashboardSupervised` from `./commands/dashboard.js`. Test mock only
exported `runDashboard`. Missing `shouldSuperviseDashboard` → TypeError
→ caught → `process.exit:1`. Added `shouldSuperviseDashboard: vi.fn(()
=> false)` + `runDashboardSupervised` to mock + `commandMocks`.
- **`daemon/serve/dashboard.test.ts`** — `@fusion/dashboard` barrel
(index.ts:115) re-exports `getCliPackageVersion`,
`isUnresolvedCliPackageVersion`, `resolveCliPackageVersionInfo`. Added
all 3 to each file's `@fusion/dashboard` mock.
- **`task.test.ts`** — `executeRequeueLoopCount: 0` added to
TaskResetField set by recent commit; retry test assertions needed the
new field in both `mockUpdateTask` expectations.

### i18n (shard 4) — 4 locale files
- **`settings.reset.buttonShort`** missing from zh-TW, fr, es, ko (zh-CN
already had it).

### Engine (shards 1+2) — already fixed in PR #2025 (merged on main)
- Run 29223788088 was at commit `b85a6b866` (pre-PR-2025-merge), so
engine + i18n `storageMigrationNotice` failures visible in that run are
already resolved on main.

## Verification
- daemon: 21/21 ✅ | serve: 58/58 ✅ | dashboard: 91/91 ✅ | task retry:
5/5 ✅
- i18n parity + gate-coverage: 7/7 ✅
- Gate (`pnpm test:gate`): exit 0 ✅
- `bin.test.ts`: cannot verify locally (`@agentclientprotocol/sdk` not
installed locally; CI resolves from lockfile). Mock exports verified
against `dashboard.ts` source.

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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved task retry recovery by correctly resetting execution
counters.

* **Localization**
* Added support for shorter reset-button labels in Spanish, French,
Korean, and Traditional Chinese.

* **Tests**
* Updated command and startup checks to reflect current dashboard and
version-handling behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
gsxdsm
2026-07-12 21:58:12 -07:00
committed by GitHub
parent a628a13888
commit 4ea5dd6739
9 changed files with 28 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import { join } from "node:path";
const commandMocks = vi.hoisted(() => ({
runDashboard: vi.fn(),
runDashboardSupervised: vi.fn(),
runServe: vi.fn(),
runDaemon: vi.fn(),
runDesktop: vi.fn(),
@@ -151,7 +152,12 @@ vi.mock("../commands/dashboard-tui/index.js", () => ({
vi.mock("../commands/onboard.js", () => ({ runOnboard: commandMocks.runOnboard }));
vi.mock("../commands/dashboard.js", () => ({ runDashboard: commandMocks.runDashboard }));
vi.mock("../commands/dashboard.js", () => ({
runDashboard: commandMocks.runDashboard,
// FNXC:CliTests 2026-07-13-08:20: bin.ts now imports shouldSuperviseDashboard (supervision is the default) and runDashboardSupervised from dashboard.js; mock must surface both so the no-args dashboard launch test reaches runDashboard instead of failing on an undefined import.
shouldSuperviseDashboard: vi.fn(() => false),
runDashboardSupervised: commandMocks.runDashboardSupervised,
}));
vi.mock("../commands/serve.js", () => ({ runServe: commandMocks.runServe }));
vi.mock("../commands/daemon.js", () => ({ runDaemon: commandMocks.runDaemon }));
vi.mock("../commands/desktop.js", () => ({ runDesktop: commandMocks.runDesktop }));

View File

@@ -563,6 +563,11 @@ vi.mock("@fusion/core", async (importOriginal) => {
});
vi.mock("@fusion/dashboard", () => ({
// FNXC:CliTests 2026-07-13-08:10: @fusion/dashboard barrel re-exports cli-package-version helpers; mock must surface them for startup model sync.
isUnresolvedCliPackageVersion: vi.fn(() => false),
resolveCliPackageVersionInfo: vi.fn(() => ({ version: "0.0.0-test", isUnresolved: false })),
getCliPackageVersion: vi.fn(() => "0.0.0"),
// FNXC:CliTests 2026-07-13-08:00: getCliPackageVersion added to @fusion/dashboard barrel export; mock must surface it for daemon/serve startup model sync.
createServer: mocks.createServerMock,
GitHubClient: vi.fn().mockImplementation(function () {
return {};

View File

@@ -396,6 +396,9 @@ const mockListen = vi.fn((port: number) => {
});
vi.mock("@fusion/dashboard", () => ({
// FNXC:CliTests 2026-07-13-08:10: @fusion/dashboard barrel re-exports cli-package-version helpers; mock must surface them for startup model sync.
isUnresolvedCliPackageVersion: vi.fn(() => false),
resolveCliPackageVersionInfo: vi.fn(() => ({ version: "0.0.0-test", isUnresolved: false })),
createServer: vi.fn((_store: unknown, opts: Record<string, any> = {}) => {
if (!opts.onMerge) {
if (opts.engine) {

View File

@@ -623,6 +623,11 @@ vi.mock("@fusion/core", async (importOriginal) => {
});
vi.mock("@fusion/dashboard", () => ({
// FNXC:CliTests 2026-07-13-08:10: @fusion/dashboard barrel re-exports cli-package-version helpers; mock must surface them for startup model sync.
isUnresolvedCliPackageVersion: vi.fn(() => false),
resolveCliPackageVersionInfo: vi.fn(() => ({ version: "0.0.0-test", isUnresolved: false })),
getCliPackageVersion: vi.fn(() => "0.0.0"),
// FNXC:CliTests 2026-07-13-08:00: getCliPackageVersion added to @fusion/dashboard barrel export; mock must surface it for daemon/serve startup model sync.
createServer: mocks.createServerMock,
GitHubClient: vi.fn().mockImplementation(function () {
return {};

View File

@@ -2594,6 +2594,8 @@ describe("runTaskRetry", () => {
reviewerContextRetryCount: 0,
reviewerFallbackRetryCount: 0,
completionHandoffLimboRecoveryCount: 0,
// FNXC:TaskRetry 2026-07-13-08:15: executeRequeueLoopCount added to TaskResetField set; retry must zero it alongside other recovery counters.
executeRequeueLoopCount: 0,
graphResumeRetryCount: 0,
mergeAuditBounceCount: 0,
mergeRetries: 0,
@@ -2669,6 +2671,8 @@ describe("runTaskRetry", () => {
reviewerContextRetryCount: 0,
reviewerFallbackRetryCount: 0,
completionHandoffLimboRecoveryCount: 0,
// FNXC:TaskRetry 2026-07-13-08:15: executeRequeueLoopCount added to TaskResetField set; retry must zero it alongside other recovery counters.
executeRequeueLoopCount: 0,
graphResumeRetryCount: 0,
mergeAuditBounceCount: 0,
mergeRetries: 0,

View File

@@ -6725,6 +6725,7 @@
},
"reset": {
"button": "",
"buttonShort": "",
"buttonTitle": "",
"dialogAriaLabel": "",
"dialogTitle": "",

View File

@@ -6725,6 +6725,7 @@
},
"reset": {
"button": "",
"buttonShort": "",
"buttonTitle": "",
"dialogAriaLabel": "",
"dialogTitle": "",

View File

@@ -6725,6 +6725,7 @@
},
"reset": {
"button": "",
"buttonShort": "",
"buttonTitle": "",
"dialogAriaLabel": "",
"dialogTitle": "",

View File

@@ -6725,6 +6725,7 @@
},
"reset": {
"button": "",
"buttonShort": "",
"buttonTitle": "",
"dialogAriaLabel": "",
"dialogTitle": "",