fix(confidence-engine): correct experiment helper project root

This commit is contained in:
2026-09-05 06:15:05 +01:00
parent f2a761d26f
commit a59d60262e
+5 -3
View File
@@ -16,10 +16,12 @@
// Use the standard environment loader already available to this Next repository.
// loadEnvConfig mutates process.env in-place (same semantics as previous bespoke parser).
const path = require("path");
const PROJECT_ROOT = path.resolve(__dirname, "..");
(function loadEnvironment() {
try {
const { loadEnvConfig } = require("@next/env");
loadEnvConfig(__dirname, undefined, { logOutput: "none" }, false);
loadEnvConfig(PROJECT_ROOT, undefined, { logOutput: "none" }, false);
} catch {
// loader unavailable — proceed with whatever is already set.
}
@@ -90,7 +92,7 @@ async function runStartCaseExperiment(scenarioInput, experimentInstruction) {
);
}
const { startCase: _sc } = await import("../../lib/graph/orchestrator.js");
const { startCase: _sc } = await import(PROJECT_ROOT + "/lib/graph/orchestrator.js");
startCase = _sc;
}
@@ -135,7 +137,7 @@ async function runStartCaseExperiment(scenarioInput, experimentInstruction) {
// Used only for deterministic apparatus verification of the import path.
if (process.env.START_CASE_EXPERIMENT_HELPER_IMPORT_ONLY === "1") {
try {
const mod = await import("../../lib/graph/orchestrator.js");
const mod = await import(PROJECT_ROOT + "/lib/graph/orchestrator.js");
const startCaseResolved = typeof mod.startCase === "function";
const output = JSON.stringify({
success: true,