Reorganize Blender Web execution around capabilities
This commit is contained in:
20
web/tests/unit/execution-control-plane.test.mjs
Normal file
20
web/tests/unit/execution-control-plane.test.mjs
Normal file
@@ -0,0 +1,20 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import test from "node:test";
|
||||
import path from "node:path";
|
||||
|
||||
const root = path.resolve(import.meta.dirname, "../../..");
|
||||
|
||||
test("execution control plane reports one queue pointer and capability throughput", () => {
|
||||
const output = execFileSync(process.execPath, [
|
||||
path.join(root, "tools/web/check-execution-control-plane.mjs"),
|
||||
"--allow-unrunnable",
|
||||
], { cwd: root, encoding: "utf8" });
|
||||
const report = JSON.parse(output);
|
||||
assert.equal(report.status, "PASS");
|
||||
assert.equal(report.queue.currentTask, "WBV2-P0-002");
|
||||
assert.equal(report.queue.parentNextTask, report.queue.currentTask);
|
||||
assert.equal(report.efficiency.capabilityClusters, 3);
|
||||
assert.ok(report.efficiency.averageGapsPerCapability >= 1);
|
||||
assert.equal(report.issues.length, 0);
|
||||
});
|
||||
@@ -4,7 +4,7 @@ import { collectGeneratedGapPreflight } from "../../../tools/web/generated-gap-p
|
||||
import { readIndexedTask, root, verifyTaskIndex } from "../../../tools/web/task-context-lib.mjs";
|
||||
|
||||
test("generated gap preflight accepts a runnable task with existing inputs", () => {
|
||||
verifyTaskIndex();
|
||||
verifyTaskIndex("M16-GAP-00281");
|
||||
const entry = readIndexedTask("M16-GAP-00281");
|
||||
assert.deepEqual(collectGeneratedGapPreflight({ root, task: "M16-GAP-00281", entry }), []);
|
||||
});
|
||||
|
||||
@@ -5,12 +5,12 @@ import { buildTaskContext, compactTaskContext, contextSizeReport, CONTEXT_LIMITS
|
||||
test("current task context is bounded and follows the parent pointer", () => {
|
||||
const bundle = buildTaskContext();
|
||||
const report = contextSizeReport(bundle);
|
||||
assert.match(bundle.context.task, /^M\d+-GAP-\d{5}$/);
|
||||
assert.match(bundle.context.parentTask, /^M\d+-GAP-\d{5}$/);
|
||||
assert.match(bundle.context.task, /^(?:M\d+-GAP-\d{5}|WBV2-P\d-\d{3})$/);
|
||||
assert.match(bundle.context.parentTask, /^(?:M\d+-GAP-\d{5}|WBV2-(?:BASELINE|P\d-\d{3}))$/);
|
||||
assert.equal(bundle.context.parent.manifest.nextTask, bundle.context.task);
|
||||
assert.ok(bundle.context.commands.length >= 1);
|
||||
assert.equal(bundle.context.sourceDocuments.taskCard, `docs/tasks/${bundle.context.task}.md`);
|
||||
assert.equal(bundle.context.sourceDocuments.taskIndex, "tests/golden/M15-03A/task-index.json");
|
||||
assert.equal(bundle.context.sourceDocuments.taskIndex, "tests/golden/WBV2/task-index.json");
|
||||
assert.ok(!JSON.stringify(bundle.context).includes("next-task-plan.json"));
|
||||
assert.equal(bundle.context.scope.ownerFamily, readIndexedTask(bundle.context.task).ownerFamily);
|
||||
assert.equal(report.withinBudget, true);
|
||||
|
||||
Reference in New Issue
Block a user