From 6a1b64fa0e907b9975228b532b96966537f2f77d Mon Sep 17 00:00:00 2001 From: Fusion Agent Date: Tue, 29 Sep 2026 11:13:13 -0300 Subject: [PATCH] test(cli): unbreak the Full Suite lanes on push-to-main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full Suite (non-blocking) run 36404155928 on d3573cca7 fails every shard plus the pipeline smoke tier, all from packages/cli. Each failure is test drift, not product defect — none of these assertions are protecting behaviour that regressed. 1. docs-screenshot-links: "expected [ ...(18) ] to deeply equal [ ...(16) ]". FN-9295 dropped artifacts-doc-edit.png and artifacts-gallery.png from the expected list because no markdown referenced them yet. docs/dashboard-guide.md has since referenced both again, so the references are real and the list must carry them. 2. cli-quiet-prompt-surfaces: died with ENOENT on src/commands/research.ts. That command was deleted in FN-9331 (74ffa19ef, "remove the fn research CLI") while this test kept auditing it. Drop the removed path from the audited list. 3. extension-experiment-finalize: all 5 cases failed at module setup with 'No "MAX_TASK_MESSAGE_LENGTH" export is defined on the @fusion/core mock'. extension.ts reads that constant while registering the refine tool's zod schema, and this file uses a FULL-REPLACEMENT mock, so the missing export aborts the file before a single assertion runs. The mock now carries the real constant (100_000). A fourth red test, task-retry.test.ts, is not touched here: it fails only when the workspace has not been built, because @fusion-plugin-examples/antigravity-runtime resolves through exports.import -> ./dist/index.js. `pnpm build` produces that dist and the test passes, which is what Full Suite already does before the shards. Fixing it would mean changing the build cache contract, not a test. Verified on this branch: the whole packages/cli suite is green — 150 files passed, 1859 tests passed, 0 failures. eslint 0 errors, check-mock-completeness green. --- .../cli/src/__tests__/cli-quiet-prompt-surfaces.test.ts | 4 +++- packages/cli/src/__tests__/docs-screenshot-links.test.ts | 9 +++++++-- .../src/__tests__/extension-experiment-finalize.test.ts | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/__tests__/cli-quiet-prompt-surfaces.test.ts b/packages/cli/src/__tests__/cli-quiet-prompt-surfaces.test.ts index 64cdab85e3..ed52d0cc02 100644 --- a/packages/cli/src/__tests__/cli-quiet-prompt-surfaces.test.ts +++ b/packages/cli/src/__tests__/cli-quiet-prompt-surfaces.test.ts @@ -35,7 +35,9 @@ describe("CLI quiet prompt and result source contracts", () => { }); it("keeps all audited result writers attached to the output seam", () => { - for (const file of ["task.ts", "org-import.ts", "workflow.ts", "research.ts", "experiment-finalize.ts", "update.ts"]) { + // FN-9331 (74ffa19ef) removed the `fn research` CLI, so research.ts no longer exists and must + // not be audited here. Listing it made this test die with ENOENT on a removed source file. + for (const file of ["task.ts", "org-import.ts", "workflow.ts", "experiment-finalize.ts", "update.ts"]) { const source = readFileSync(join(cliRoot, "commands", file), "utf8"); expect(source, file).toMatch(/import\s*\{[^}]*\bresult\b[^}]*\}\s*from\s*["']\.\.\/output\.js["']/); expect(source, file).toMatch(/(?:result|outputResult)\(/); diff --git a/packages/cli/src/__tests__/docs-screenshot-links.test.ts b/packages/cli/src/__tests__/docs-screenshot-links.test.ts index 5ce6610b6b..1aeba13a30 100644 --- a/packages/cli/src/__tests__/docs-screenshot-links.test.ts +++ b/packages/cli/src/__tests__/docs-screenshot-links.test.ts @@ -63,10 +63,15 @@ describe("docs screenshot links", () => { } } - // FN-9295: artifacts-doc-edit.png and artifacts-gallery.png are not referenced by any - // markdown files; removed from expected list to match actual docs. + // FN-9295 removed artifacts-doc-edit.png and artifacts-gallery.png from this list because no + // markdown referenced them at the time. docs/dashboard-guide.md has since referenced both + // again (Artifacts gallery, Artifact document viewer with edit mode), so the references are + // real and the expected list must carry them again — otherwise this assertion fails on + // origin/main with "expected [ ...(18) ] to deeply equal [ ...(16) ]". expect(screenshotReferences.map(({ repoPath }) => repoPath).sort()).toEqual([ "docs/screenshots/agents-view.png", + "docs/screenshots/artifacts-doc-edit.png", + "docs/screenshots/artifacts-gallery.png", "docs/screenshots/chat-view.png", "docs/screenshots/dashboard-overview.png", "docs/screenshots/dashboard-overview.png", diff --git a/packages/cli/src/__tests__/extension-experiment-finalize.test.ts b/packages/cli/src/__tests__/extension-experiment-finalize.test.ts index 5e843e3c06..d97a9de925 100644 --- a/packages/cli/src/__tests__/extension-experiment-finalize.test.ts +++ b/packages/cli/src/__tests__/extension-experiment-finalize.test.ts @@ -64,6 +64,11 @@ vi.mock("@fusion/core", () => ({ formatRoleMismatchReason: vi.fn(() => ""), resolveAgentProvisioningPolicy: vi.fn(() => ({ approvalMode: "auto" })), TASK_PRIORITIES: ["low", "normal", "high", "urgent"], + // extension.ts reads MAX_TASK_MESSAGE_LENGTH while registering the refine tool's zod schema. + // A full-replacement mock that omits it fails at registration, before any assertion runs, so the + // mock has to carry the real constant or this whole file errors with + // 'No "MAX_TASK_MESSAGE_LENGTH" export is defined on the @fusion/core mock'. + MAX_TASK_MESSAGE_LENGTH: 100_000, getProjectRootFromWorktree: vi.fn(() => null), // FNXC:ToolPermissionGates 2026-07-26-14:55: fn_experiment_finalize is now withheld from agent // principals; the guard resolves the caller principal via the session-identity registry.