Skip to content

Commit 39c864b

Browse files
ruel225claude
andcommitted
test(qa-lab): lock realized-driver invariant for nonmatching live factory
Add a regression covering a requested live driver with a channelId and supplied factories where none match: adapter selection throws instead of falling back to qa-channel while reporting driver live. This documents that realizedDriver 'live' is only returned when a matching factory actually creates the adapter. Co-Authored-By: Claude <[email protected]>
1 parent 7c8adac commit 39c864b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎extensions/qa-lab/src/suite.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,28 @@ describe("qa suite", () => {
197197
);
198198
});
199199

200+
it("rejects a requested live driver whose channel has no matching factory instead of recording live", async () => {
201+
// A requested live run with a channelId and supplied factories that none
202+
// match must throw at adapter selection rather than fall back to the shared
203+
// qa-channel transport while still reporting driver "live". This locks the
204+
// realization invariant ClawSweeper flagged on #116192: the realized driver
205+
// only becomes "live" when a matching factory actually creates the adapter.
206+
const create = vi.fn();
207+
208+
await expect(
209+
qaSuiteProgressTesting.createQaSuiteTransportAdapter({
210+
adapterFactories: [{ id: "telegram", matches: () => false, create }],
211+
channelDriver: "live",
212+
channelId: "whatsapp",
213+
outputDir: "/tmp/qa-output",
214+
state: {} as QaLabServerHandle["state"],
215+
transportId: "qa-channel",
216+
}),
217+
).rejects.toThrow("no QA transport factory for live:whatsapp");
218+
219+
expect(create).not.toHaveBeenCalled();
220+
});
221+
200222
it("preserves caller-supplied transport policy without scenario metadata", async () => {
201223
const adapter = { id: "telegram" } as QaTransportAdapter;
202224
const create = vi.fn(async () => adapter);

0 commit comments

Comments
 (0)