528 lines
42 KiB
JavaScript
528 lines
42 KiB
JavaScript
/**
|
|
* 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) {
|
|
var kind = (opts && opts.kind) || "unknown";
|
|
var status = (opts && opts.status) || (kind === "unknown" ? "unknown" : "known");
|
|
var confidence = (opts && opts.confidence) || "low";
|
|
return {
|
|
id:id, label:label, description:label, kind:kind, status:status, confidence:confidence,
|
|
confidenceAssessment:{ evidenceConfidence:confidence, completenessStatus:"partial", conclusionConfidence:confidence },
|
|
value:(opts && opts.value !== undefined) ? opts.value : null,
|
|
unit:(opts && opts.unit) || null, evidenceIds:[], dependsOn:[], affects:[], childIds:[]
|
|
};
|
|
}
|
|
|
|
export function mkE(id, a, b, rel) {
|
|
var r = rel || "supports";
|
|
return { id:id, fromNodeId:a, toNodeId:b, relationship:r, confidence:"medium", description:a+" -> "+b };
|
|
}
|
|
|
|
/* ── Scenario: Comparison (product ratings) ───────────── */
|
|
|
|
var comparisonTurns = [
|
|
{
|
|
centralStatement: "Product A has a 4.2 star average rating while Product B averages 4.6 stars across 10,000+ reviews each.",
|
|
nodes: [
|
|
mkN("obs-1","Product A average rating: 4.2 stars",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","Product B average rating: 4.6 stars",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-3","Both products have 10,000+ reviews",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("state-1","Comparing two products before purchase decision",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the rating systems are comparable"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","obs-3","u-1")],
|
|
resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"Are both products rated on the same validated scale?", reason:"Different rating systems could make direct comparison meaningless.", reasoningPattern:"comparability_check" },
|
|
noQReason:null, summary:"Two products have been rated highly, but we do not yet know whether their ratings are measured the same way."
|
|
},
|
|
{
|
|
centralStatement: "Product A has a 4.2 star average rating while Product B averages 4.6 stars across 10,000+ reviews each.",
|
|
nodes: [
|
|
mkN("obs-1","Product A average rating: 4.2 stars",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","Product B average rating: 4.6 stars",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-3","Both products have 10,000+ reviews",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-4","Both use the standard 5-star customer review scale",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("state-1","Comparing two products before purchase decision",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the rating systems are comparable",{status:"resolved",confidence:"high"}),
|
|
mkN("u-2","Whether verified purchase reviews differ significantly between the two products"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","obs-3","u-1"),mkE("e-4","obs-4","u-1"),mkE("e-5","obs-3","u-2")],
|
|
resolved:["u-1"], active:"u-2",
|
|
question:{ nodeId:"u-2", question:"Do verified purchase reviews show a similar gap between the two products?", reason:"Fake or unverified reviews could inflate ratings.", reasoningPattern:"evidence_quality" },
|
|
noQReason:null, summary:"The rating scales are comparable. The next uncertainty is review authenticity."
|
|
},
|
|
{
|
|
centralStatement: "Product A has a 4.2 star average rating while Product B averages 4.6 stars across 10,000+ reviews each.",
|
|
nodes: [
|
|
mkN("obs-1","Product A average rating: 4.2 stars",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","Product B average rating: 4.6 stars",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-3","Both products have 10,000+ reviews",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-4","Both use the standard 5-star customer review scale",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-5","Verified purchase gap remains approximately 0.3 stars in both products' subsets",{kind:"observation",status:"known",confidence:"medium"}),
|
|
mkN("state-1","Comparing two products before purchase decision",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the rating systems are comparable",{status:"resolved",confidence:"high"}),
|
|
mkN("u-2","Whether verified purchase reviews differ significantly",{status:"resolved",confidence:"medium"}),
|
|
mkN("u-3","Whether the remaining gap reflects genuine quality difference or a niche preference"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","obs-3","u-1"),mkE("e-4","obs-4","u-1"),mkE("e-5","obs-3","u-2"),mkE("e-6","obs-5","u-2"),mkE("e-7","obs-3","u-3")],
|
|
resolved:["u-1","u-2"], active:"u-3",
|
|
question:{ nodeId:"u-3", question:"Could the remaining rating difference be explained by product niche rather than quality?", reason:"Different customer segments may have different expectations.", reasoningPattern:"alternative_explanation" },
|
|
noQReason:null, summary:"Verified reviews confirm the gap is genuine. The remaining question is whether it reflects quality or preference."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Contradictory Evidence ─────────────────── */
|
|
|
|
var contradictoryTurns = [
|
|
{
|
|
centralStatement: "Two consultants provided opposite recommendations about whether to outsource IT operations.",
|
|
nodes: [
|
|
mkN("obs-1","Consultant A recommends outsourcing based on cost savings data",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","Consultant B recommends against outsourcing citing quality risks",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("state-1","Making an IT operations decision",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the consultants are evaluating the same criteria"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1")],
|
|
resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"Are the two consultants using comparable evaluation criteria?", reason:"Contradictory conclusions often stem from different starting assumptions.", reasoningPattern:"comparability_check" },
|
|
noQReason:null, summary:"Two opposing recommendations exist. Before deciding, we need to know if they are looking at the same thing."
|
|
},
|
|
{
|
|
centralStatement: "Two consultants provided opposite recommendations about whether to outsource IT operations.",
|
|
nodes: [
|
|
mkN("obs-1","Consultant A recommends outsourcing based on cost savings data",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","Consultant B recommends against outsourcing citing quality risks",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-3","Consultant A focused on short-term cost reduction over 2 years",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-4","Consultant B focused on long-term capability retention over 5+ years",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("state-1","Making an IT operations decision",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the consultants are evaluating the same criteria",{status:"resolved",confidence:"high"}),
|
|
mkN("u-2","Which time horizon is appropriate for this organisation"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","obs-3","u-1"),mkE("e-4","obs-4","u-1"),mkE("e-5","obs-3","u-2"),mkE("e-6","obs-4","u-2")],
|
|
resolved:["u-1"], active:"u-2",
|
|
question:{ nodeId:"u-2", question:"What time horizon should guide this particular organisation's decision?", reason:"Different horizons produce different valid conclusions.", reasoningPattern:"criteria_alignment" },
|
|
noQReason:null, summary:"The consultants disagree because they use different timeframes. The real question is which horizon fits."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Missing Evidence ──────────────────────── */
|
|
|
|
var missingEvidenceTurns = [
|
|
{
|
|
centralStatement: "A hospital wants to determine whether a new patient monitoring system would reduce adverse events.",
|
|
nodes: [
|
|
mkN("obs-1","Adverse events have been stable at 2.3% for the past year",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("state-1","Evaluating a new patient monitoring system",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the current baseline measurement is reliable"),
|
|
mkN("u-2","Whether similar systems have demonstrated effectiveness elsewhere"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1")],
|
|
resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"How reliably are adverse events currently being measured and reported?", reason:"An unreliable baseline makes any comparison impossible.", reasoningPattern:"measurement_validity" },
|
|
noQReason:null, summary:"We have a single data point. Before evaluating any new system, we need to trust the starting measurement."
|
|
},
|
|
{
|
|
centralStatement: "A hospital wants to determine whether a new patient monitoring system would reduce adverse events.",
|
|
nodes: [
|
|
mkN("obs-1","Adverse events have been stable at 2.3% for the past year",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","Adverse event reporting is incident-based and potentially incomplete",{kind:"observation",status:"known",confidence:"medium"}),
|
|
mkN("state-1","Evaluating a new patient monitoring system",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the current baseline measurement is reliable",{status:"resolved",confidence:"medium"}),
|
|
mkN("u-2","Whether similar systems have demonstrated effectiveness elsewhere"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","u-1")],
|
|
resolved:["u-1"], active:"u-2",
|
|
question:{ nodeId:"u-2", question:"Has comparable monitoring technology been deployed in similar hospitals with measured outcomes?", reason:"Without external evidence, this remains a unique test.", reasoningPattern:"precedent_search" },
|
|
noQReason:null, summary:"The baseline is uncertain. External evidence would strengthen the case either way."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Evidence Limit (stuck early) ─────────── */
|
|
|
|
var evidenceLimitTurns = [
|
|
{
|
|
centralStatement: "Should a mid-sized manufacturing company invest in automated quality inspection?",
|
|
nodes: [
|
|
mkN("obs-1","Current defect rate is 3.2%",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","Re call costs total approximately $400K annually",{kind:"observation",status:"known",confidence:"medium"}),
|
|
mkN("state-1","Evaluating automated quality inspection investment",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the total cost of an automation solution is understood"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1")],
|
|
resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"What would a complete automation solution cost including installation and training?", reason:"Without knowing the investment required, feasibility cannot be assessed.", reasoningPattern:"cost_feasibility" },
|
|
noQReason:null, summary:"Known costs of inaction exist but the cost of action is completely unknown."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Circular Reasoning ───────────────────── */
|
|
|
|
var circularTurns = [
|
|
{
|
|
centralStatement: "A team argues that Project X should continue because it is strategic, and it is strategic because the team believes in it.",
|
|
nodes: [
|
|
mkN("obs-1","The team believes Project X is important to strategy",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("u-1","Whether Project X has independent strategic value beyond team conviction"),
|
|
],
|
|
edges: [],
|
|
resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"What external evidence supports the strategic value of Project X?", reason:"Belief alone cannot establish strategic justification.", reasoningPattern:"circularity_detection" },
|
|
noQReason:null, summary:"The argument appears circular. We need evidence independent of team conviction."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Decision Investigation ──────────────── */
|
|
|
|
var decisionTurns = [
|
|
{
|
|
centralStatement: "Should I relocate my engineering team from London to Manchester?",
|
|
nodes: [
|
|
mkN("obs-1","Manchester office rental costs are approximately 60% lower than London",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","The team has expressed mixed feelings about relocation",{kind:"observation",status:"known",confidence:"medium"}),
|
|
mkN("state-1","Deciding on engineering team relocation",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the cost savings offset potential talent retention risks"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1")],
|
|
resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"What would the likely impact on talent retention and recruitment be?", reason:"Cost savings are real but only relevant if the team can still be staffed.", reasoningPattern:"decision" },
|
|
noQReason:null, summary:"Financial motivation is clear. The remaining question is whether the workforce will remain."
|
|
},
|
|
{
|
|
centralStatement: "Should I relocate my engineering team from London to Manchester?",
|
|
nodes: [
|
|
mkN("obs-1","Manchester office rental costs are approximately 60% lower than London",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("obs-2","The team has expressed mixed feelings about relocation",{kind:"observation",status:"known",confidence:"medium"}),
|
|
mkN("obs-3","Manchester has a growing tech ecosystem with 500+ engineering roles posted monthly",{kind:"observation",status:"known",confidence:"medium"}),
|
|
mkN("state-1","Deciding on engineering team relocation",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the cost savings offset potential talent retention risks",{status:"resolved",confidence:"medium"}),
|
|
mkN("u-2","Whether the cultural transition is manageable for a team of this size"),
|
|
],
|
|
edges: [mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","obs-3","u-1"),mkE("e-4","obs-2","u-2")],
|
|
resolved:["u-1"], active:"u-2",
|
|
question:{ nodeId:"u-2", question:"What support mechanisms would help the team through a geographical transition?", reason:"Mixed feelings are normal but the right support can make it viable.", reasoningPattern:"implementation" },
|
|
noQReason:null, summary:"Market conditions in Manchester are promising. The remaining question is cultural."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Planning Investigation ─────────────── */
|
|
|
|
var planningTurns = [
|
|
{
|
|
centralStatement: "We want to launch a new product line within 6 months but have no clear roadmap.",
|
|
nodes: [
|
|
mkN("obs-1","Target launch window is Q3",{kind:"observation",status:"known",confidence:"high"}),
|
|
mkN("state-1","Planning a new product launch",{kind:"state",status:"provisional",confidence:"medium"}),
|
|
mkN("u-1","Whether the core product design is complete enough to begin production planning"),
|
|
],
|
|
edges: [],
|
|
resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"What stage is the product design currently at?", reason:"Production planning cannot begin until design is stable.", reasoningPattern:"planning" },
|
|
noQReason:null, summary:"A deadline exists but the product itself has not yet been defined."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Long Investigation (market entry - 10 turns) ─── */
|
|
|
|
var longTurns = [
|
|
{
|
|
centralStatement: "Should we enter the European market with our SaaS analytics platform?",
|
|
nodes: [mkN("obs-1","Current revenue is $2M ARR in the US market only",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Evaluating European market entry",{kind:"state",status:"provisional",confidence:"medium"}),mkN("u-1","Whether there is genuine demand for our category in Europe")],
|
|
edges:[mkE("e-1","obs-1","state-1")], resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"How large and mature is the analytics SaaS market in Europe?", reason:"Entering a non-existent or negligible market is not justified.", reasoningPattern:"market_validity" }, noQReason:null, summary:"We are US-based. The first question before any expansion is whether demand exists."
|
|
},
|
|
{
|
|
centralStatement: "Should we enter the European market with our SaaS analytics platform?",
|
|
nodes: [mkN("obs-1","Current revenue is $2M ARR in the US market only",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","European analytics SaaS market valued at approximately €8B and growing 15% annually",{kind:"observation",status:"known",confidence:"medium"}),mkN("state-1","Evaluating European market entry",{kind:"state",status:"provisional",confidence:"medium"}),mkN("u-1","Whether there is genuine demand for our category in Europe",{status:"resolved",confidence:"medium"}),mkN("u-2","Whether our product is suitable for European compliance requirements")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","u-1")], resolved:["u-1"], active:"u-2",
|
|
question:{ nodeId:"u-2", question:"Does our platform comply with GDPR and other European data regulations?", reason:"Non-compliance makes market entry legally impossible.", reasoningPattern:"compliance" }, noQReason:null, summary:"Demand exists. The next constraint is regulatory."
|
|
},
|
|
{
|
|
centralStatement: "Should we enter the European market with our SaaS analytics platform?",
|
|
nodes: [mkN("obs-1","Current revenue is $2M ARR in the US market only",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","European analytics SaaS market valued at approximately €8B and growing 15% annually",{kind:"observation",status:"known",confidence:"medium"}),mkN("obs-3","Our platform does not currently support EU data residency requirements",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Evaluating European market entry",{kind:"state",status:"provisional",confidence:"medium"}),mkN("u-1","Whether there is genuine demand for our category in Europe",{status:"resolved",confidence:"medium"}),mkN("u-2","Whether our product is suitable for European compliance requirements",{status:"resolved",confidence:"high"}),mkN("u-3","Whether the cost of achieving compliance is justified by the market size")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","u-1"),mkE("e-3","obs-3","u-2")], resolved:["u-1","u-2"], active:"u-3",
|
|
question:{ nodeId:"u-3", question:"What investment would it take to achieve full EU data residency compliance?", reason:"We know the market exists and we are non-compliant. The remaining question is cost.", reasoningPattern:"cost_benefit" }, noQReason:null, summary:"Compliance is feasible. The remaining question is cost."
|
|
},
|
|
{
|
|
centralStatement: "Should we enter the European market with our SaaS analytics platform?",
|
|
nodes: [mkN("obs-1","Current revenue is $2M ARR in the US market only",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","European analytics SaaS market valued at approximately €8B and growing 15% annually",{kind:"observation",status:"known",confidence:"medium"}),mkN("obs-3","Our platform does not currently support EU data residency requirements",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-4","Achieving compliance would require approximately 6 months and $500K engineering investment",{kind:"observation",status:"known",confidence:"medium"}),mkN("state-1","Evaluating European market entry",{kind:"state",status:"provisional",confidence:"medium"}),mkN("u-1","Whether there is genuine demand for our category in Europe",{status:"resolved",confidence:"medium"}),mkN("u-2","Whether our product is suitable for European compliance requirements",{status:"resolved",confidence:"high"}),mkN("u-3","Whether the cost of achieving compliance is justified by the market size",{status:"resolved",confidence:"medium"}),mkN("u-4","Whether we have competitive differentiation against existing European players")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","u-1"),mkE("e-3","obs-3","u-2"),mkE("e-4","obs-4","u-3")], resolved:["u-1","u-2","u-3"], active:"u-4",
|
|
question:{ nodeId:"u-4", question:"What differentiates our platform against established European competitors?", reason:"Market entry requires more than compliance — we need a reason for customers to switch.", reasoningPattern:"competitive_analysis" }, noQReason:null, summary:"Compliance is feasible. The remaining question is competitive edge."
|
|
},
|
|
{
|
|
centralStatement: "Should we enter the European market with our SaaS analytics platform?",
|
|
nodes: [mkN("obs-1","Current revenue is $2M ARR in the US market only",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","European analytics SaaS market valued at approximately €8B and growing 15% annually",{kind:"observation",status:"known",confidence:"medium"}),mkN("obs-3","Our platform does not currently support EU data residency requirements",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-4","Achieving compliance would require approximately 6 months and $500K engineering investment",{kind:"observation",status:"known",confidence:"medium"}),mkN("obs-5","Our real-time collaboration feature has no direct European equivalent and aligns with EU procurement trends",{kind:"observation",status:"provisional",confidence:"medium"}),mkN("state-1","Evaluating European market entry",{kind:"state",status:"provisional",confidence:"medium"}),mkN("u-1","Whether there is genuine demand for our category in Europe",{status:"resolved",confidence:"medium"}),mkN("u-2","Whether our product is suitable for European compliance requirements",{status:"resolved",confidence:"high"}),mkN("u-3","Whether the cost of achieving compliance is justified by the market size",{status:"resolved",confidence:"medium"}),mkN("u-4","Whether we have competitive differentiation against existing European players",{status:"resolved",confidence:"medium"})],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","u-1"),mkE("e-3","obs-3","u-2"),mkE("e-4","obs-4","u-3"),mkE("e-5","obs-5","u-4")], resolved:["u-1","u-2","u-3","u-4"], active:null,
|
|
question:null, noQReason:"All investigation areas resolved. A conditional recommendation can be formed.", summary:"European market entry is justified if: compliance is achieved (6 months, $500K), and the real-time collaboration feature is positioned as the differentiator against established competitors."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Complete Investigation (full resolution) ─ */
|
|
|
|
var completeTurns = [
|
|
{
|
|
centralStatement: "A manufacturing company reports complaints increased by 35% while production increased by 40%.",
|
|
nodes: [mkN("obs-1","Complaints increased by 35%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","Production increased by 40%",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Current situation",{kind:"state",status:"provisional",confidence:"medium"}),mkN("u-1","Whether the two figures cover the same period")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1")], resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"Were the complaint and production figures measured over the same period?", reason:"If the figures cover different periods, comparing their movement could be misleading.", reasoningPattern:"comparability_check" }, noQReason:null, summary:"Two changes have been reported, but we do not yet know whether the figures are directly comparable."
|
|
},
|
|
{
|
|
centralStatement: "A manufacturing company reports complaints increased by 35% while production increased by 40%.",
|
|
nodes: [mkN("obs-1","Complaints increased by 35%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","Production increased by 40%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-3","Both figures cover the same three-month period",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Current situation",{kind:"state",status:"provisional",confidence:"medium"}),mkN("rel-1","Complaint and production trends are related",{kind:"relationship",status:"known",confidence:"medium"}),mkN("u-1","Whether the two figures cover the same period",{status:"resolved",confidence:"high"}),mkN("u-2","Whether the percentage changes use comparable baselines")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","rel-1","u-1")], resolved:["u-1"], active:"u-2",
|
|
question:{ nodeId:"u-2", question:"Were both percentages calculated from comparable baseline counts?", reason:"Establishing the reference point for both figures is essential before evaluating their relationship.", reasoningPattern:"baseline_comparability" }, noQReason:null, summary:"The timing basis is now clear."
|
|
},
|
|
{
|
|
centralStatement: "A manufacturing company reports complaints increased by 35% while production increased by 40%.",
|
|
nodes: [mkN("obs-1","Complaints increased by 35%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","Production increased by 40%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-3","Both figures cover the same three-month period",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-4","Complaints rose from 100 to 135; production rose from 1,000 to 1,400 units",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Current situation",{kind:"state",status:"provisional",confidence:"medium"}),mkN("rel-1","Complaint and production trends are related",{kind:"relationship",status:"known",confidence:"medium"}),mkN("u-1","Whether the two figures cover the same period",{status:"resolved",confidence:"high"}),mkN("u-2","Whether the percentage changes use comparable baselines",{status:"resolved",confidence:"medium"}),mkN("u-3","Whether complaints increased faster than production on a per-unit basis")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","rel-1","u-1"),mkE("e-4","obs-3","u-1"),mkE("e-5","rel-1","u-2")], resolved:["u-1","u-2"], active:"u-3",
|
|
question:{ nodeId:"u-3", question:"Did the complaint rate per unit produced improve or worsen?", reason:"Absolute changes in complaints and production are known; the relative rate determines whether the situation improved.", reasoningPattern:"rate_comparison" }, noQReason:null, summary:"The absolute baselines are now known."
|
|
},
|
|
{
|
|
centralStatement: "A manufacturing company reports complaints increased by 35% while production increased by 40%.",
|
|
nodes: [mkN("obs-1","Complaints increased by 35%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","Production increased by 40%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-3","Both figures cover the same three-month period",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-4","Complaints rose from 100 to 135; production rose from 1,000 to 1,400 units",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-5","The complaint rate fell from 10 per 1,000 to about 9.6 per 1,000",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Current situation",{kind:"state",status:"provisional",confidence:"medium"}),mkN("rel-1","Complaint and production trends are related",{kind:"relationship",status:"known",confidence:"medium"}),mkN("u-1","Whether the two figures cover the same period",{status:"resolved",confidence:"high"}),mkN("u-2","Whether the percentage changes use comparable baselines",{status:"resolved",confidence:"medium"}),mkN("u-3","Whether complaints increased faster than production on a per-unit basis",{status:"resolved",confidence:"high"}),mkN("u-4","Whether reporting practices changed")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","rel-1","u-1"),mkE("e-4","obs-3","u-1"),mkE("e-5","rel-1","u-2"),mkE("e-6","obs-4","u-2"),mkE("e-7","obs-4","u-3")], resolved:["u-1","u-2","u-3"], active:"u-4",
|
|
question:{ nodeId:"u-4", question:"Was there any change in how complaints were recorded during the period?", reason:"The per-unit rate changed; we need to rule out recording artifacts before concluding a genuine shift.", reasoningPattern:"artifact_exclusion" }, noQReason:null, summary:"The per-unit complaint rate improved slightly."
|
|
},
|
|
{
|
|
centralStatement: "A manufacturing company reports complaints increased by 35% while production increased by 40%.",
|
|
nodes: [mkN("obs-1","Complaints increased by 35%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","Production increased by 40%",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-3","Both figures cover the same three-month period",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-4","Complaints rose from 100 to 135; production rose from 1,000 to 1,400 units",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-5","The complaint rate fell from 10 per 1,000 to about 9.6 per 1,000",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-6","Same complaint categories and reporting rules were used throughout",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Current situation",{kind:"state",status:"provisional",confidence:"medium"}),mkN("rel-1","Complaint and production trends are related",{kind:"relationship",status:"known",confidence:"medium"}),mkN("u-1","Whether the two figures cover the same period",{status:"resolved",confidence:"high"}),mkN("u-2","Whether the percentage changes use comparable baselines",{status:"resolved",confidence:"medium"}),mkN("u-3","Whether complaints increased faster than production on a per-unit basis",{status:"resolved",confidence:"high"}),mkN("u-4","Whether reporting practices changed",{status:"resolved",confidence:"high"})],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1"),mkE("e-3","rel-1","u-1"),mkE("e-4","obs-3","u-1"),mkE("e-5","rel-1","u-2"),mkE("e-6","obs-4","u-2"),mkE("e-7","obs-4","u-3"),mkE("e-8","obs-5","u-3"),mkE("e-9","rel-1","u-4"),mkE("e-10","obs-6","u-4")], resolved:["u-1","u-2","u-3","u-4"], active:null,
|
|
question:null, noQReason:"All required investigation areas are resolved.", summary:"The figures cover the same period, use comparable baselines, show an improved complaint rate, and were recorded consistently."
|
|
}
|
|
];
|
|
|
|
/* ── Scenario: Diagnosis (churn) ───────────────────── */
|
|
|
|
var diagnosisTurns = [
|
|
{
|
|
centralStatement: "Customer churn increased from 2% to 5% monthly over the last quarter.",
|
|
nodes: [mkN("obs-1","Churn was 2% per month in Q1",{kind:"observation",status:"known",confidence:"high"}),mkN("obs-2","Churn rose to 5% per month in Q3",{kind:"observation",status:"known",confidence:"high"}),mkN("state-1","Diagnosing the cause of increased churn",{kind:"state",status:"provisional",confidence:"medium"}),mkN("u-1","Whether the churn increase is concentrated in a specific customer segment")],
|
|
edges:[mkE("e-1","obs-1","state-1"),mkE("e-2","obs-2","state-1")], resolved:[], active:"u-1",
|
|
question:{ nodeId:"u-1", question:"Which customer segments account for the majority of the increased churn?", reason:"A blanket analysis hides which segment is driving the problem.", reasoningPattern:"diagnosis" }, noQReason:null, summary:"Churn has tripled. The first diagnostic step is to identify where it concentrates."
|
|
}
|
|
];
|
|
|
|
/* ── Experimental multi-thread apparatus (RTO.A1) ──── */
|
|
/**
|
|
* FIXTURE-ONLY — not production reasoning.
|
|
* Represents a curated set of open investigation threads for a
|
|
* product-launch timing decision, allowing user-directed selection
|
|
* of which thread becomes visually primary.
|
|
*
|
|
* The central situation statement is drawn from the existing
|
|
* pre-anchored-product-launch-options.json scenario data.
|
|
*/
|
|
|
|
var multiThreadCase = {
|
|
centralStatement: "We are evaluating two product-launch timing options: launching the new software product this year or waiting twelve months.",
|
|
caseSummary: "An organisation holds a nearly-ready software product and must choose between launching within the current year (with ~£300k immediate cost) or delaying launch by twelve months (forgoing first-year revenue while avoiding near-term costs). One large enterprise customer's potential contract could significantly influence the timing decision. The situation is unresolved with multiple legitimate investigation pathways.",
|
|
};
|
|
|
|
var multiThreadItems = [
|
|
{
|
|
id: "mt-ent-customer-signing",
|
|
label: "Enterprise customer signing probability",
|
|
description: "The likelihood, negotiation stage, and targeted signing date for the large enterprise client whose potential contract represents a significant portion of expected revenue.",
|
|
recommendationOrder: 1,
|
|
questionFrame: "What outcome would demonstrate enough value to justify launching a software product now?",
|
|
},
|
|
{
|
|
id: "mt-competitor-timing",
|
|
label: "Competitor timing / first-mover consequences",
|
|
description: "Whether competitors are actively developing similar products and how soon they might release them, and what the market share impact would be if we lose the first-mover window.",
|
|
recommendationOrder: 2,
|
|
questionFrame: "What evidence would clarify whether competitors are actively developing similar products and how soon they might release them?",
|
|
},
|
|
{
|
|
id: "mt-financial-comparison",
|
|
label: "Financial viability of launching now versus waiting",
|
|
description: "The exact monetary value of the potential enterprise contract relative to the £300k launch cost, projected cash-flow impact, and net present value comparison across the two timing options.",
|
|
recommendationOrder: 3,
|
|
questionFrame: "What evidence would clarify the exact percentage of total projected revenue attributable to the enterprise customer?",
|
|
},
|
|
];
|
|
|
|
var multiThreadTurn = {
|
|
centralStatement: multiThreadCase.centralStatement,
|
|
situationGraph: {
|
|
nodes: [
|
|
mkN("mt-state-1", multiThreadCase.caseSummary, { kind: "state", status: "provisional", confidence: "medium" }),
|
|
mkN("mt-opt-1", "Launch this year: capture ~£1.2M revenue now, incur ~£300k cost",{ kind: "observation", status: "known", confidence: "high" }),
|
|
mkN("mt-opt-2", "Wait twelve months: avoid £300k cost, forgo first-year revenue",{ kind: "observation", status: "known", confidence: "medium" }),
|
|
],
|
|
edges: [mkE("mt-e-1","mt-opt-1","mt-state-1"), mkE("mt-e-2","mt-opt-2","mt-state-1")],
|
|
activeUnknownNodeId: null,
|
|
resolvedNodeIds: [],
|
|
},
|
|
active: null,
|
|
question: null,
|
|
noQReason: "Multi-thread apparatus — no single active unknown. Choose an investigation thread.",
|
|
summary: multiThreadCase.caseSummary + " | 3 open investigation items available. Engine recommendation marked.",
|
|
|
|
/* Experimental presentation state — NOT production graph fields */
|
|
_experimental: {
|
|
scenario: "multi-thread",
|
|
caseContext: multiThreadCase,
|
|
availableThreads: multiThreadItems,
|
|
recommendedThreadId: "mt-ent-customer-signing",
|
|
selectedThreadId: null,
|
|
apparatusMode: "selection",
|
|
},
|
|
};
|
|
|
|
/* Re-export situationGraph on the fixture itself for backwards compat */
|
|
Object.defineProperty(multiThreadTurn, "nodes", { get() { return this.situationGraph.nodes; } });
|
|
Object.defineProperty(multiThreadTurn, "edges", { get() { return this.situationGraph.edges; } });
|
|
Object.defineProperty(multiThreadTurn, "resolved", { get() { return this.situationGraph.resolvedNodeIds; } });
|
|
|
|
/* Export the experimental scenario data */
|
|
export var MULTI_THREAD_FIXTURE = multiThreadTurn;
|
|
export var MULTI_THREAD_CASE = multiThreadCase;
|
|
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 },
|
|
"missing-evidence": { turns: missingEvidenceTurns, label: "Missing evidence", centralStatement: missingEvidenceTurns[0].centralStatement },
|
|
"evidence-limit":{ turns: evidenceLimitTurns, label: "Evidence limit (stuck early)", centralStatement: evidenceLimitTurns[0].centralStatement },
|
|
"circular": { turns: circularTurns, label: "Circular reasoning", centralStatement: circularTurns[0].centralStatement },
|
|
"decision": { turns: decisionTurns, label: "Decision (team relocation)", centralStatement: decisionTurns[0].centralStatement },
|
|
"planning": { turns: planningTurns, label: "Planning (product launch)", centralStatement: planningTurns[0].centralStatement },
|
|
"long": { turns: longTurns, label: "Long investigation (market entry)", centralStatement: longTurns[0].centralStatement },
|
|
"complete": { turns: completeTurns, label: "Complete investigation", centralStatement: completeTurns[0].centralStatement },
|
|
"diagnosis": { turns: diagnosisTurns, label: "Diagnosis (churn)", centralStatement: diagnosisTurns[0].centralStatement },
|
|
"multi-thread": { scenario: multiThreadTurn, label: "[E] Multi-thread apparatus (RTO.A1)", centralStatement: multiThreadCase.centralStatement },
|
|
};
|
|
|
|
/* ── Build a fixture for a named scenario at a given turn index ─ */
|
|
|
|
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;
|
|
return {
|
|
success: true,
|
|
situationGraph: {
|
|
centralStatement: mt.centralStatement,
|
|
currentSummary: mt.summary,
|
|
nodes: mt.nodes,
|
|
edges: mt.edges,
|
|
activeUnknownNodeId: mt.active,
|
|
resolvedNodeIds: mt.resolved
|
|
},
|
|
selectedQuestion: mt.question || null,
|
|
noQuestionReason: mt.noQReason,
|
|
newlySurfacedNodeIds: [],
|
|
diagnostics: {
|
|
promptVersion: "v0.4",
|
|
modelName: "mock-ollama",
|
|
responseDurationMs: 0,
|
|
validationStatus: "valid",
|
|
nodeCount: mt.nodes.length,
|
|
edgeCount: mt.edges.length,
|
|
investigationStrategy: { key: "multi_thread_experiment" },
|
|
unknownSelectionExplanation: null
|
|
},
|
|
_experimentalState: mt._experimental
|
|
};
|
|
}
|
|
|
|
if (!s.turns) return null;
|
|
var t = s.turns[Math.min(turnIdx, s.turns.length - 1)];
|
|
return {
|
|
success: true,
|
|
summary: t.summary || null,
|
|
situationGraph: {
|
|
centralStatement: t.centralStatement,
|
|
currentSummary: t.summary,
|
|
nodes: t.nodes,
|
|
edges: t.edges,
|
|
activeUnknownNodeId: t.active,
|
|
resolvedNodeIds: t.resolved
|
|
},
|
|
selectedQuestion: t.question || null,
|
|
noQuestionReason: t.noQReason,
|
|
newlySurfacedNodeIds: [],
|
|
diagnostics: {
|
|
promptVersion: "v0.4",
|
|
modelName: "mock-ollama",
|
|
responseDurationMs: 0,
|
|
validationStatus: "valid",
|
|
nodeCount: t.nodes.length,
|
|
edgeCount: t.edges.length,
|
|
investigationStrategy: { key: (t.question && t.question.reasoningPattern) || "default" },
|
|
unknownSelectionExplanation: t.active ? { status: "single_candidate" } : null
|
|
}
|
|
};
|
|
}
|
|
|
|
/* ── List of available scenarios for the scene selector ─ */
|
|
|
|
export var AVAILABLE_SCENARIOS = [];
|
|
for (var key in SCENARIOS) {
|
|
if (SCENARIOS.hasOwnProperty(key)) {
|
|
var entry = SCENARIOS[key];
|
|
AVAILABLE_SCENARIOS.push({
|
|
key: key,
|
|
label: entry.label,
|
|
centralStatement: entry.centralStatement,
|
|
turnCount: entry.turns ? entry.turns.length : 1 // experimental scenarios show as single-turn
|
|
});
|
|
}
|
|
}
|
|
|
|
export default SCENARIOS;
|