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
pluginInput.client.session.messages =
(async () => ({ data: messages })) as unknown as PluginInput["client"]["session"]["messages"]
const messagesFunction = testCoerce<PluginInput["client"]["session"]["messages"]>(async () => ({ data: messages }))
pluginInput.client.session.messages = messagesFunction
return pluginInput
}
@@ -1,7 +1,7 @@
/// <reference types="bun-types" />
import { describe, expect, test } from "bun:test"
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("#given session with prior DONE and new messages", () => {
@@ -1,7 +1,7 @@
/// <reference types="bun-types" />
import { describe, expect, test } from "bun:test"
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("#given natural language completion text without explicit promise", () => {
@@ -44,7 +44,7 @@ describe("ralph-loop reset strategy race condition", () => {
const selectSessionDeferred = createDeferred()
const hook = createRalphLoopHook(
{
testCoerce<Parameters<typeof createRalphLoopHook>[0]>({
directory: process.cwd(),
client: {
session: {
@@ -86,7 +86,7 @@ describe("ralph-loop reset strategy race condition", () => {
},
},
},
} as unknown as Parameters<typeof createRalphLoopHook>[0],
}),
{ idleSettleMs: 0 },
)
@@ -15,7 +15,7 @@ describe("ulw-loop verification", () => {
let oracleTranscriptPath: string
function createMockPluginInput() {
return {
return testCoerce<Parameters<typeof createRalphLoopHook>[0]>({
client: {
session: {
promptAsync: async (opts: { path: { id: string }; body: { parts: Array<{ type: string; text: string }> } }) => {
@@ -39,7 +39,7 @@ describe("ulw-loop verification", () => {
},
},
directory: testDir,
} as unknown as Parameters<typeof createRalphLoopHook>[0]
})
}
beforeEach(() => {