接续L4-TOOL-DB浏览器Worker边界
结论:浏览器 Tool DB Worker 传输层已接入并明确阻塞缺失的 Python/WASM runtime,未冒充 DB_PROGRAM 执行就绪。
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
<script type="module">
|
||||
import {
|
||||
createLinuxCncToolDbProcessPort,
|
||||
createLinuxCncToolDbBrowserWorkerAdapter,
|
||||
createToolDbProcessDiagnostics,
|
||||
createToolDbStorePaths,
|
||||
loadToolDbFile,
|
||||
@@ -58,6 +59,32 @@
|
||||
assertEqual(planResult.status, "blocked_runtime_adapter_required", "contract-only plan status");
|
||||
assertEqual(planResult.tblFallbackSufficient, false, "tbl fallback guard");
|
||||
|
||||
const workerAdapter = createLinuxCncToolDbBrowserWorkerAdapter({
|
||||
workerUrl: new URL("../../runtime/workers/tool-db-python-worker.js", import.meta.url),
|
||||
});
|
||||
const workerPort = createLinuxCncToolDbProcessPort({
|
||||
dbProgramPath: "./db_nonran.py",
|
||||
sourceFiles: [
|
||||
"configs/sim/axis/db_demo/db_nonran.py",
|
||||
"configs/sim/axis/db_demo/db.py",
|
||||
"lib/python/tooldb.py",
|
||||
],
|
||||
runtimeMode: workerAdapter.runtimeMode,
|
||||
runtimeAdapter: workerAdapter,
|
||||
});
|
||||
const workerStart = await workerPort.start();
|
||||
assertEqual(workerStart.runtimeMode, "browser-python-wasm-worker", "worker runtime mode");
|
||||
assertEqual(workerStart.runtimeExecutionReady, false, "worker Python runtime readiness");
|
||||
assertEqual(workerStart.status, "blocked_browser_python_wasm_runtime_missing", "worker Python runtime status");
|
||||
const workerPlanResult = await workerPort.runTransactionPlan();
|
||||
assertEqual(
|
||||
workerPlanResult.status,
|
||||
"blocked_browser_python_wasm_runtime_missing",
|
||||
"worker plan blocked without Python/WASM runtime",
|
||||
);
|
||||
assertEqual(workerPlanResult.promotionAllowed, false, "worker promotion guard");
|
||||
await workerPort.close();
|
||||
|
||||
const transcript = [
|
||||
{ direction: "read", line: "v2.1" },
|
||||
{ direction: "write", line: "g" },
|
||||
|
||||
Reference in New Issue
Block a user