Implement configuration, runtime, frontend, and task governance closure
This commit is contained in:
23
web/app/test_frontend_m3.mjs
Normal file
23
web/app/test_frontend_m3.mjs
Normal file
@@ -0,0 +1,23 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { MemoryStorage } from "../workspace/journal.mjs";
|
||||
import { ReplayTimeline } from "../worker/replay.mjs";
|
||||
import { createCheckpoint } from "../workspace/recovery.mjs";
|
||||
import { ProjectWorkflow } from "./project-workflow.mjs";
|
||||
import { recoveryView } from "./recovery-panel.mjs";
|
||||
|
||||
const workflow = new ProjectWorkflow({ contextId: "linuxcnc-2.10.0-pre0-wasm-m1-py-c1", storage: new MemoryStorage(), projectId: "frontend-m3" });
|
||||
const imported = workflow.importFiles([{ path: "config/main.ini", data: "[EMC]\n" }, { path: "programs/main.ngc", data: "G0 X1\n" }]);
|
||||
assert.equal(imported.status, "verified");
|
||||
assert.deepEqual(workflow.exportFiles(), [{ path: "config/main.ini", data: "[EMC]\n" }, { path: "programs/main.ngc", data: "G0 X1\n" }]);
|
||||
const timeline = new ReplayTimeline();
|
||||
timeline.appendEvent(1, 0, "SESSION_READY", {});
|
||||
timeline.checkpoint(1, 0, { tick: 0 });
|
||||
const checkpoint = createCheckpoint({ contextId: workflow.contextId, timeline, state: { tick: 0 }, operations: [] });
|
||||
const pkg = workflow.package({ timeline, checkpoint, committedSeq: 1 });
|
||||
assert.equal(workflow.verify(pkg).package_hash, pkg.package_hash);
|
||||
const migrated = workflow.migrate(pkg, 2);
|
||||
assert.equal(workflow.verify(migrated, { expectedVersion: 2 }).format_version, 2);
|
||||
const offline = workflow.offline(migrated, [{ path: "ui/index.html", data: "<main>" }]);
|
||||
assert.equal(workflow.verifyOffline(offline, { workspacePackage: migrated, available: [{ path: "ui/index.html", data: "<main>" }] }).status, "ready");
|
||||
assert.equal(recoveryView({ status: "blocked", half_commits: [2] }).message, "half_commit_ignored");
|
||||
console.log(`frontend_m3=passed files=${workflow.exportFiles().length}`);
|
||||
Reference in New Issue
Block a user