test(experiment): ground RTO apparatus in real fixture

This commit is contained in:
2026-08-18 12:39:19 +01:00
parent 25a88c5fc3
commit 4a34dcc361
2 changed files with 218 additions and 1 deletions
+42 -1
View File
@@ -1,10 +1,41 @@
/**
* Expanded mock scenario library for the Confidence Engine workspace.
* Each scenario produces a complete investigation journey through turns.
*
*
* UI-only development work — no reasoning engine changes.
*/
/* ── RTO.A4 real captured fixture (RTO.A1 superseded) ──────────── */
import fixtureData from "../../tests/fixtures/live-product-launch-update-response.json";
/**
* Thin projection of a real captured Engine update response into the
* shape already expected by the workspace/mock client.
*
* The real captured fixture remains the source of truth — no reasoning
* content is recreated or synthesized here.
*/
function projectRealUpdateFixture(fixture) {
return {
success: fixture.success,
stage: fixture.stage,
situationGraph: fixture.updatedSituationGraph,
updatedSituationGraph: fixture.updatedSituationGraph,
selectedQuestion: fixture.selectedQuestion,
newlySurfacedNodeIds: (fixture.proposal?.addedNodes || [])
.filter(node => node.kind === "unknown")
.map(node => node.id),
diagnostics: fixture.diagnostics,
noQuestionReason: null,
// Mark as experimental so buildScenarioFixture routes through the scenario branch
_experimental: { apparatusMode: "rto-real-fixture" },
_sourceFixturePath: "../../tests/fixtures/live-product-launch-update-response.json",
};
}
const __rtoRealScenario = projectRealUpdateFixture(fixtureData);
/* ── Node / Edge factories ─────────────────────────────── */
export function mkN(id, label, opts) {
@@ -389,6 +420,11 @@ export var MULTI_THREAD_ITEMS = multiThreadItems;
/* ── Registry ─────────────────────────────────────── */
var SCENARIOS = {
"rto-real-product-launch": {
scenario: __rtoRealScenario,
label: "[RTO.A4] Real captured product-launch update",
centralStatement: __rtoRealScenario?.updatedSituationGraph?.centralStatement || "",
},
"default": { turns: comparisonTurns, label: "Comparison (product ratings)", centralStatement: comparisonTurns[0].centralStatement },
"comparison": { turns: comparisonTurns, label: "Comparison (product ratings)", centralStatement: comparisonTurns[0].centralStatement },
"contradictory": { turns: contradictoryTurns, label: "Contradictory evidence", centralStatement: contradictoryTurns[0].centralStatement },
@@ -409,6 +445,11 @@ export function buildScenarioFixture(scenarioName, turnIdx) {
var s = SCENARIOS[scenarioName];
if (!s) return null;
/* RTO.A4 real fixture — returned as-is (already projected) */
if (s.scenario && s.scenario._sourceFixturePath) {
return s.scenario;
}
/* Experimental multi-thread — does not follow the turns model */
if (s.scenario && s.scenario._experimental) {
var mt = s.scenario;