test(ralph-loop): remove unsafe fixture assertions

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-12 14:22:18 +09:00
parent 23211159c9
commit 0787867384
5 changed files with 8 additions and 8 deletions
@@ -16,8 +16,8 @@ export function createPluginInput(messages: SessionMessage[]): PluginInput {
$: {} as PluginInput["$"], $: {} as PluginInput["$"],
} as PluginInput } as PluginInput
pluginInput.client.session.messages = const messagesFunction = testCoerce<PluginInput["client"]["session"]["messages"]>(async () => ({ data: messages }))
(async () => ({ data: messages })) as unknown as PluginInput["client"]["session"]["messages"] pluginInput.client.session.messages = messagesFunction
return pluginInput return pluginInput
} }
@@ -1,7 +1,7 @@
/// <reference types="bun-types" /> /// <reference types="bun-types" />
import { describe, expect, test } from "bun:test" import { describe, expect, test } from "bun:test"
import { detectCompletionInSessionMessages } from "./completion-promise-detector" import { detectCompletionInSessionMessages } from "./completion-promise-detector"
import { createPluginInput } from "./completion-promise-detector-test-input" import { createPluginInput } from "./completion-promise-detector-test-input.test"
describe("detectCompletionInSessionMessages", () => { describe("detectCompletionInSessionMessages", () => {
describe("#given session with prior DONE and new messages", () => { describe("#given session with prior DONE and new messages", () => {
@@ -1,7 +1,7 @@
/// <reference types="bun-types" /> /// <reference types="bun-types" />
import { describe, expect, test } from "bun:test" import { describe, expect, test } from "bun:test"
import { detectCompletionInSessionMessages } from "./completion-promise-detector" import { detectCompletionInSessionMessages } from "./completion-promise-detector"
import { createPluginInput } from "./completion-promise-detector-test-input" import { createPluginInput } from "./completion-promise-detector-test-input.test"
describe("detectCompletionInSessionMessages negative cases", () => { describe("detectCompletionInSessionMessages negative cases", () => {
describe("#given natural language completion text without explicit promise", () => { describe("#given natural language completion text without explicit promise", () => {
@@ -44,7 +44,7 @@ describe("ralph-loop reset strategy race condition", () => {
const selectSessionDeferred = createDeferred() const selectSessionDeferred = createDeferred()
const hook = createRalphLoopHook( const hook = createRalphLoopHook(
{ testCoerce<Parameters<typeof createRalphLoopHook>[0]>({
directory: process.cwd(), directory: process.cwd(),
client: { client: {
session: { session: {
@@ -86,7 +86,7 @@ describe("ralph-loop reset strategy race condition", () => {
}, },
}, },
}, },
} as unknown as Parameters<typeof createRalphLoopHook>[0], }),
{ idleSettleMs: 0 }, { idleSettleMs: 0 },
) )
@@ -15,7 +15,7 @@ describe("ulw-loop verification", () => {
let oracleTranscriptPath: string let oracleTranscriptPath: string
function createMockPluginInput() { function createMockPluginInput() {
return { return testCoerce<Parameters<typeof createRalphLoopHook>[0]>({
client: { client: {
session: { session: {
promptAsync: async (opts: { path: { id: string }; body: { parts: Array<{ type: string; text: string }> } }) => { promptAsync: async (opts: { path: { id: string }; body: { parts: Array<{ type: string; text: string }> } }) => {
@@ -39,7 +39,7 @@ describe("ulw-loop verification", () => {
}, },
}, },
directory: testDir, directory: testDir,
} as unknown as Parameters<typeof createRalphLoopHook>[0] })
} }
beforeEach(() => { beforeEach(() => {