test(FN-4892): fix type-safe intake preflight coverage

Fusion-Task-Id: FN-4892
Fusion-Task-Lineage: 6f56b468-a827-416d-ba1f-444e1326d613
This commit is contained in:
Fusion (runfusion.ai)
2026-05-18 00:38:24 -07:00
committed by gsxdsm
parent 02f571d0cf
commit aa60dd3c1a
3 changed files with 15 additions and 15 deletions

View File

@@ -32,12 +32,12 @@ describe("reliability interactions: same-agent duplicate intake", () => {
const a = await fx.store.createTask({
title: "fix: secrets sync typecheck",
description: "typecheck error in secrets-sync",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
const b = await fx.store.createTask({
title: "fix: secrets sync typecheck regression",
description: "typecheck error in secrets-sync",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
expect((await fx.store.getTask(a.id)).column).toBe("triage");
@@ -55,12 +55,12 @@ describe("reliability interactions: same-agent duplicate intake", () => {
const a = await fx.store.createTask({
title: "fix: secrets sync typecheck",
description: "typecheck error in secrets-sync",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
const b = await fx.store.createTask({
title: "fix: secrets sync typecheck regression",
description: "typecheck error in secrets-sync",
source: { sourceType: "agent", sourceAgentId: "agent-y" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-y" },
});
expect((await fx.store.getTask(a.id)).column).toBe("triage");
@@ -74,12 +74,12 @@ describe("reliability interactions: same-agent duplicate intake", () => {
const a = await fx.store.createTask({
title: "fix: api timeout",
description: "network timeout issue",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
const b = await fx.store.createTask({
title: "feat: add mission detail panel",
description: "new dashboard ui",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
expect((await fx.store.getTask(a.id)).column).toBe("triage");
@@ -96,13 +96,13 @@ describe("reliability interactions: same-agent duplicate intake", () => {
const a = await fx.store.createTask({
title: "fix: secrets sync typecheck",
description: "typecheck error in secrets-sync",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
vi.setSystemTime(new Date(start.getTime() + 25 * 60 * 60 * 1000));
const b = await fx.store.createTask({
title: "fix: secrets sync typecheck regression",
description: "typecheck error in secrets-sync",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
expect((await fx.store.getTask(a.id)).column).toBe("triage");
@@ -116,7 +116,7 @@ describe("reliability interactions: same-agent duplicate intake", () => {
await fx.store.createTask({
title: "fix: baseline",
description: "desc",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
vi.spyOn(fx.store, "listTasks").mockRejectedValueOnce(new Error("boom"));
@@ -124,7 +124,7 @@ describe("reliability interactions: same-agent duplicate intake", () => {
const b = await fx.store.createTask({
title: "fix: baseline clone",
description: "desc",
source: { sourceType: "agent", sourceAgentId: "agent-x" },
source: { sourceType: "agent_heartbeat", sourceAgentId: "agent-x" },
});
expect((await fx.store.getTask(b.id)).column).toBe("triage");

View File

@@ -49,7 +49,7 @@ describe("reliability interactions: ghost-bug preflight", () => {
it("auto-archives when cited construct is missing", async () => {
const fx = await createFixture();
fixtures.push(fx);
const task = await fx.store.createTask({ title: "fix: missing construct", description: "typecheck error", prompt: "draft" });
const task = await fx.store.createTask({ title: "fix: missing construct", description: "typecheck error" });
await (fx.triage as any).finalizeApprovedTask(
task,
@@ -69,7 +69,7 @@ describe("reliability interactions: ghost-bug preflight", () => {
it("passes to todo when construct exists", async () => {
const fx = await createFixture();
fixtures.push(fx);
const task = await fx.store.createTask({ title: "fix: existing construct", description: "typecheck error", prompt: "draft" });
const task = await fx.store.createTask({ title: "fix: existing construct", description: "typecheck error" });
await (fx.triage as any).finalizeApprovedTask(
task,
@@ -85,7 +85,7 @@ describe("reliability interactions: ghost-bug preflight", () => {
it("keeps task when title is non-bug-shape and no constructs are cited", async () => {
const fx = await createFixture();
fixtures.push(fx);
const task = await fx.store.createTask({ title: "chore: dependency refresh", description: "typecheck error still reported", prompt: "draft" });
const task = await fx.store.createTask({ title: "chore: dependency refresh", description: "typecheck error still reported" });
await (fx.triage as any).finalizeApprovedTask(
task,
@@ -101,7 +101,7 @@ describe("reliability interactions: ghost-bug preflight", () => {
it("fails open when probe throws", async () => {
const fx = await createFixture();
fixtures.push(fx);
const task = await fx.store.createTask({ title: "fix: throwing probe", description: "typecheck error", prompt: "draft" });
const task = await fx.store.createTask({ title: "fix: throwing probe", description: "typecheck error" });
vi.spyOn(triagePreflight, "runGhostBugPreflight").mockRejectedValueOnce(new Error("boom"));
await (fx.triage as any).finalizeApprovedTask(

View File

@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from "vitest";
import { extractCitedConstructs, isBugFixShape, runGhostBugPreflight } from "../triage-preflight";
import { extractCitedConstructs, isBugFixShape, runGhostBugPreflight } from "../triage-preflight.js";
describe("triage-preflight", () => {
it("isBugFixShape matrix", () => {