experiment(confidence-engine): isolate reconstruction observation
This commit is contained in:
@@ -374,6 +374,34 @@ describe("lib/graph/orchestrator startCase", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("returns initial reconstruction evidence before downstream question generation", async () => {
|
||||
const analysis = makeAnalysisResult();
|
||||
mockAnalyseScenario.mockResolvedValue(analysis);
|
||||
const downstreamProvider = {
|
||||
generateReconstruction: vi.fn(() => {
|
||||
throw new Error("downstream question generation must not run");
|
||||
}),
|
||||
};
|
||||
const { startCase } = await import("@/lib/graph/orchestrator.js");
|
||||
|
||||
const result = await startCase(
|
||||
{ scenario: "Scenario text" },
|
||||
{ reconstructionOnly: true, provider: downstreamProvider },
|
||||
);
|
||||
|
||||
expect(result).toMatchObject({
|
||||
success: true,
|
||||
reconstruction: analysis.reconstruction,
|
||||
selectedQuestion: null,
|
||||
});
|
||||
expect(result.situationGraph.nodes.length).toBeGreaterThan(0);
|
||||
expect(result.diagnostics.graphReferenceValidation).toEqual({
|
||||
valid: true,
|
||||
errors: [],
|
||||
});
|
||||
expect(downstreamProvider.generateReconstruction).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("rejects invalid request input without throwing", async () => {
|
||||
const { startCase } = await import("@/lib/graph/orchestrator.js");
|
||||
|
||||
|
||||
@@ -174,6 +174,7 @@ describe("start-case-experiment-helper.cjs apparatus", () => {
|
||||
startCase: async (_input, dependencies) => {
|
||||
expect(typeof dependencies.reconstructionProvider?.generateReconstruction).toBe("function");
|
||||
expect(dependencies.reconstructionModelName).toBe("gpt-5.6-terra");
|
||||
expect(dependencies.reconstructionOnly).toBe(true);
|
||||
return {
|
||||
success: true,
|
||||
situationGraph: { nodes: [], edges: [] },
|
||||
|
||||
Reference in New Issue
Block a user