Advance WBV2 through native engine module matrix
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-08-28 00:46:58 +08:00
parent d436f268f0
commit b78e23b16c
50 changed files with 11906 additions and 26 deletions

View File

@@ -10,7 +10,7 @@ const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(path
const queue = read("docs/EXECUTION_QUEUE.md");
const requested = process.argv.indexOf("--task");
const current = requested >= 0 ? process.argv[requested + 1] : queue.match(/\|\s*当前任务\s*\|\s*`([^`]+)`/u)?.[1];
assert.match(current ?? "", /^WBV2-P\d-\d{3}$/u);
assert.match(current ?? "", /^WBV2-P\d+-\d{3}$/u);
const currentCard = `docs/tasks/${current}.md`;
assert.ok(fs.existsSync(path.join(root, currentCard)), `${currentCard} must exist`);
const parentPath = requested >= 0

View File

@@ -0,0 +1,50 @@
import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const absolute = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(absolute(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
const historicalPath = "tests/golden/WBV2-P0-002/source-hashes.json";
const currentPath = "tests/golden/WBV2-P10-001/current-source-hashes.json";
const reportPath = "tests/golden/WBV2-P10-001/inventory-rebaseline-report.json";
const dependencyPath = "tests/golden/WBV2-P10-001/dependency-inventory.current.json";
const historicalDependencyPath = "tests/golden/M13-05C/dependency-inventory.json";
const historical = json(historicalPath);
const current = json(currentPath);
const report = json(reportPath);
const dependency = json(dependencyPath);
const historicalDependency = json(historicalDependencyPath);
assert.equal(current.schemaVersion, 1);
assert.equal(current.task, "WBV2-P10-001");
assert.equal(current.operation, "CURRENT_WBV2_SOURCE_HASH_BASELINE");
assert.equal(current.historicalSourceHashesSha256, sha256(historicalPath));
const drift = [];
for (const [file, expected] of Object.entries(historical.sources)) {
const actual = sha256(file);
assert.equal(current.sources[file], actual, `current source hash drift: ${file}`);
if (actual !== expected) drift.push({ file, expected, actual });
}
assert.deepEqual(drift, current.drift.map(({ file, expected, actual }) => ({ file, expected, actual })));
assert.deepEqual(drift.map((entry) => entry.file), ["docs/BLENDER_WEB_PARITY_TASK_PLAN_V2.json"]);
assert.equal(drift[0].actual, "0f4750e45f2d1ca7d68faa35743e5b758ea8091f18d1d0e312ab548228d6f782");
assert.equal(report.status, "PASS");
assert.equal(report.task, "WBV2-P10-001");
assert.equal(report.currentSourceBaseline.sha256, sha256(currentPath));
assert.equal(report.currentSourceBaseline.planSha256, drift[0].actual);
assert.equal(report.historical.sourceHashesSha256, sha256(historicalPath));
assert.equal(report.dependency.lockfileHashStable, true);
assert.equal(report.dependency.rootsStable, true);
assert.equal(report.dependency.closureStable, true);
assert.deepEqual(dependency.roots, historicalDependency.roots);
assert.deepEqual(dependency.categoryCounts, historicalDependency.categoryCounts);
assert.deepEqual(dependency.packages, historicalDependency.packages);
assert.equal(dependency.lockfile.sha256, historicalDependency.lockfile.sha256);
assert.equal(dependency.packages.length, 144);
process.stdout.write(`wbv2-inventory-rebaseline-ok task=WBV2-P10-001 planDrift=${drift.length} dependencyPackages=${dependency.packages.length} closureStable=1 historicalHashesPreserved=1\n`);

View File

@@ -0,0 +1,73 @@
import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const write = process.argv.includes("--write");
const absolute = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(absolute(file), "utf8");
const readJson = (file) => JSON.parse(read(file));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
const outputPath = "tests/golden/WBV2-P10-002/native-engine-binding-report.json";
const parentPath = "tests/golden/WBV2-P10-001/manifest.json";
const nativeBinary = "build_blender_native/bin/blender";
const wasmBinary = "web/app/src/vendor/blender/web_engine.wasm";
const wasmJavaScript = "web/app/src/vendor/blender/web_engine.js";
const parent = readJson(parentPath);
assert.equal(parent.task, "WBV2-P10-001");
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P10-002");
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
for (const source of ["tests/golden/WBV2-P2-003/manifest.json", "tests/golden/WBV2-P4-001/manifest.json", "tests/golden/WBV2-P3-005/manifest.json"]) {
const manifest = readJson(source);
assert.equal(manifest.status, "done", `${source} is not complete`);
}
assert.ok(fs.existsSync(absolute(nativeBinary)), "native Blender binary is missing");
assert.ok(fs.statSync(absolute(nativeBinary)).size > 0, "native Blender binary is empty");
assert.ok(fs.existsSync(absolute(wasmBinary)), "web_engine.wasm is missing");
assert.ok(fs.existsSync(absolute(wasmJavaScript)), "web_engine.js is missing");
const version = execFileSync(absolute(nativeBinary), ["--version"], { cwd: root, encoding: "utf8" }).split("\n")[0].trim();
assert.equal(version, "Blender 5.2.0 LTS");
const binding = {
schemaVersion: 1,
task: "WBV2-P10-002",
operation: "NATIVE_WASM_ENGINE_BINDING",
status: "PASS",
runtime: {
native: { path: nativeBinary, sha256: sha256(nativeBinary), version },
wasm: { path: wasmBinary, sha256: sha256(wasmBinary), bytes: fs.statSync(absolute(wasmBinary)).size },
javascript: { path: wasmJavaScript, sha256: sha256(wasmJavaScript), bytes: fs.statSync(absolute(wasmJavaScript)).size },
browser: "chromium",
},
abi: {
exports: ["web_engine_create", "web_engine_open_blend", "web_engine_apply_command", "web_engine_save_blend", "web_engine_destroy"],
nativeApi: "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp",
mainState: "blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp",
worker: "web/app/src/workers/web-engine.worker.ts",
},
sourceBindings: [
{ task: "WBV2-P2-003", manifest: "tests/golden/WBV2-P2-003/manifest.json", report: "tests/golden/WBV2-P2-003/mesh-edit-report.json" },
{ task: "WBV2-P4-001", manifest: "tests/golden/WBV2-P4-001/manifest.json", report: "tests/golden/WBV2-P4-001/modifier-report.json" },
{ task: "WBV2-P3-005", manifest: "tests/golden/WBV2-P3-005/manifest.json", report: "tests/golden/WBV2-P3-005/library-report.json" },
],
requirements: { compiledNativePresent: true, wasmBinaryPresent: true, wasmLoaderPresent: true, sourceBound: true, fakeBridgeOnly: false },
nextTask: "WBV2-P10-002",
};
for (const source of binding.sourceBindings) {
const manifest = readJson(source.manifest);
const report = readJson(source.report);
assert.equal(report.desktop?.status, "EXACT", `${source.task} desktop evidence is not exact`);
assert.equal(report.wasm?.status, "EXACT", `${source.task} WASM evidence is not exact`);
const bound = Object.values(manifest.artifacts ?? {}).find((artifact) => artifact.path === source.report);
assert.ok(bound, `${source.task} report is not manifest-bound`);
assert.equal(bound.sha256, sha256(source.report), `${source.task} report hash drift`);
}
if (write) {
fs.mkdirSync(path.dirname(absolute(outputPath)), { recursive: true });
fs.writeFileSync(absolute(outputPath), `${JSON.stringify(binding, null, 2)}\n`);
}
process.stdout.write(`wbv2-native-engine-binding-ok task=WBV2-P10-002 native=${version} wasmBytes=${binding.runtime.wasm.bytes} browser=chromium${write ? ` output=${outputPath}` : ""}\n`);

View File

@@ -0,0 +1,92 @@
import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const write = process.argv.includes("--write");
const absolute = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(absolute(file), "utf8");
const readJson = (file) => JSON.parse(read(file));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
const outputRoot = "tests/golden/WBV2-P10-001";
const historicalPath = "tests/golden/WBV2-P0-002/source-hashes.json";
const currentPath = `${outputRoot}/current-source-hashes.json`;
const dependencyPath = `${outputRoot}/dependency-inventory.current.json`;
const reportPath = `${outputRoot}/inventory-rebaseline-report.json`;
const statusPath = "docs/status/WBV2-P10-001.md";
const planPath = `${outputRoot}/native-parity-task-plan.json`;
const manifestPath = `${outputRoot}/manifest.json`;
const parentManifestPath = "tests/golden/WBV2-P10-000/manifest.json";
const historicalDependencyPath = "tests/golden/M13-05C/dependency-inventory.json";
const previousReportPath = "tests/golden/WBV2-P8-001/recovery-baseline-report.json";
const parent = readJson(parentManifestPath);
assert.equal(parent.task, "WBV2-P10-000");
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P10-001");
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
const historical = readJson(historicalPath);
const previous = readJson(previousReportPath);
const drift = Object.entries(historical.sources).map(([file, expected]) => ({ file, expected, actual: sha256(file) })).filter((entry) => entry.expected !== entry.actual);
assert.deepEqual(drift.map((entry) => entry.file), ["docs/BLENDER_WEB_PARITY_TASK_PLAN_V2.json"]);
assert.equal(previous.wbv2.drift.length, 1);
assert.equal(previous.wbv2.drift[0].file, drift[0].file);
assert.equal(previous.wbv2.drift[0].actual, drift[0].actual);
const historicalDependency = readJson(historicalDependencyPath);
const temporary = fs.mkdtempSync(path.join(os.tmpdir(), "wbv2-p10-dependency-"));
const generatedPath = path.join(temporary, "dependency-inventory.json");
try {
execFileSync(process.execPath, [absolute("tools/web/generate-dependency-inventory.mjs"), generatedPath], { cwd: root, stdio: "pipe" });
} finally {
// The generated bytes are read before cleanup; the temporary directory is
// deliberately outside the repository and never becomes evidence.
}
const dependency = JSON.parse(fs.readFileSync(generatedPath, "utf8"));
assert.deepEqual(dependency.roots, historicalDependency.roots);
assert.deepEqual(dependency.categoryCounts, historicalDependency.categoryCounts);
assert.deepEqual(dependency.packages, historicalDependency.packages);
assert.equal(dependency.lockfile.sha256, historicalDependency.lockfile.sha256);
assert.equal(dependency.packages.length, 144);
const current = { schemaVersion: 1, task: "WBV2-P10-001", operation: "CURRENT_WBV2_SOURCE_HASH_BASELINE", historicalSourceHashes: historicalPath, historicalSourceHashesSha256: sha256(historicalPath), sources: Object.fromEntries(Object.keys(historical.sources).map((file) => [file, sha256(file)])), drift: drift.map(({ file, expected, actual }) => ({ file, expected, actual, classification: "AUTHORIZED_MUTABLE_PLAN" })) };
const report = { schemaVersion: 1, task: "WBV2-P10-001", operation: "RECONCILE_WBV2_INVENTORY_SOURCE_DRIFT", status: "PASS", historical: { sourceHashes: historicalPath, sourceHashesSha256: sha256(historicalPath), manifestsRewritten: false, baselinePreserved: true }, currentSourceBaseline: { path: currentPath, sha256: "PENDING", planPath: "docs/BLENDER_WEB_PARITY_TASK_PLAN_V2.json", planSha256: sha256("docs/BLENDER_WEB_PARITY_TASK_PLAN_V2.json") }, drift: { count: drift.length, entries: current.drift, onlyAuthorizedMutablePlan: true }, dependency: { historicalInventory: historicalDependencyPath, currentInventory: dependencyPath, packageCount: dependency.packages.length, packageHashChanged: dependency.package.sha256 !== historicalDependency.package.sha256, lockfileHashStable: dependency.lockfile.sha256 === historicalDependency.lockfile.sha256, rootsStable: JSON.stringify(dependency.roots) === JSON.stringify(historicalDependency.roots), closureStable: JSON.stringify(dependency.packages) === JSON.stringify(historicalDependency.packages), packagesAdded: 0 }, policy: { historicalP0Unchanged: true, historicalP8Unchanged: true, additiveCurrentBaseline: true, falseHistoricalRestoration: false }, nextTask: "WBV2-P10-002" };
if (!write) {
process.stdout.write(`wbv2-inventory-rebaseline-dry-ok task=WBV2-P10-001 planDrift=${drift.length} dependencyPackages=${dependency.packages.length} closureStable=1\n`);
process.exit(0);
}
fs.mkdirSync(absolute(outputRoot), { recursive: true });
fs.writeFileSync(absolute(currentPath), `${JSON.stringify(current, null, 2)}\n`);
fs.copyFileSync(generatedPath, absolute(dependencyPath));
fs.rmSync(temporary, { recursive: true, force: true });
report.currentSourceBaseline.sha256 = sha256(currentPath);
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(report, null, 2)}\n`);
fs.writeFileSync(absolute(statusPath), `# WBV2-P10-001 status\n\n- task: \`WBV2-P10-001\`; parent: \`WBV2-P10-000\`; status: \`done\`\n- plan drift: \`1\` authorized mutable plan hash\n- dependency packages: \`144\`; lockfile/roots/closure: \`STABLE\`\n- historical P0 hashes: preserved\n- nextTask: \`WBV2-P10-002\`\n\nThe current WBV2 plan hash is recorded as an additive epoch-1 baseline. The historical P0-002 source-hashes.json and all historical manifests remain unchanged. Dependency roots, lockfile, package closure, and package count remain stable.\n`);
const previousPlan = readJson("tests/golden/WBV2-P10-000/native-parity-task-plan.json");
const nextPlan = structuredClone(previousPlan);
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P10-000/native-parity-task-plan.json", sha256: sha256("tests/golden/WBV2-P10-000/native-parity-task-plan.json") };
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P10-001" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P10-002" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false });
fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
const nextCardPath = "docs/tasks/WBV2-P10-002.md";
const nextCard = read(nextCardPath).replace("- status: planned", "- status: in_progress");
fs.writeFileSync(absolute(nextCardPath), nextCard);
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P10-001", "--write"], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [absolute("tools/web/check-wbv2-inventory-rebaseline.mjs")], { cwd: root, stdio: "inherit" });
const artifactPaths = { parentManifest: parentManifestPath, historicalSourceHashes: historicalPath, historicalDependencyManifest: "tests/golden/M13-05C/manifest.json", historicalRecoveryReport: previousReportPath, currentSourceHashes: currentPath, currentDependencyInventory: dependencyPath, sourcePlan: "docs/BLENDER_WEB_PARITY_TASK_PLAN_V2.json", generator: "tools/web/generate-wbv2-inventory-rebaseline.mjs", checker: "tools/web/check-wbv2-inventory-rebaseline.mjs", report: reportPath, status: statusPath, parityPlan: planPath, taskContext: `${outputRoot}/task-context.json` };
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
const manifest = { schemaVersion: 1, task: "WBV2-P10-001", parentTask: "WBV2-P10-000", operation: "RECONCILE_WBV2_INVENTORY_SOURCE_DRIFT", status: "done", enablingTask: true, parityStateChange: false, artifacts, assertions: { historicalP0Preserved: true, historicalP8Preserved: true, authorizedPlanDrift: 1, currentBaseline: true, dependencyPackages: 144, dependencyClosureStable: true, lockfileStable: true, nextEngineTask: "WBV2-P10-002" }, nextTask: "WBV2-P10-002" };
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P10-002` |")
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P10-001/manifest.json` |")
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P10-002.md`](tasks/WBV2-P10-002.md) |");
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
process.stdout.write(`wbv2-inventory-rebaseline-written task=WBV2-P10-001 planDrift=1 dependencyPackages=144 closureStable=1 next=WBV2-P10-002 artifacts=${Object.keys(artifacts).length}\n`);

View File

@@ -0,0 +1,95 @@
import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const write = process.argv.includes("--write");
const absolute = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(absolute(file), "utf8");
const readJson = (file) => JSON.parse(read(file));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
const outputRoot = "tests/golden/WBV2-P10-003";
const matrixPath = `${outputRoot}/module-matrix.json`;
const productionPath = `${outputRoot}/module-matrix-production.json`;
const productionSecondPath = `${outputRoot}/module-matrix-production.second.json`;
const engineReceiptPath = "tests/golden/WBV2-P10-002/native-engine-receipt-report.json";
const parentManifestPath = "tests/golden/WBV2-P10-002/manifest.json";
const reportPath = `${outputRoot}/module-matrix-receipt-report.json`;
const statusPath = "docs/status/WBV2-P10-003.md";
const planPath = `${outputRoot}/native-parity-task-plan.json`;
const manifestPath = `${outputRoot}/manifest.json`;
const parent = readJson(parentManifestPath);
assert.equal(parent.task, "WBV2-P10-002");
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P10-003");
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
const engineReceipt = readJson(engineReceiptPath);
assert.equal(engineReceipt.status, "PASS");
assert.equal(engineReceipt.assertions.realEngineMainMutation, true);
const matrix = readJson(matrixPath);
assert.equal(matrix.task, "WBV2-P10-003");
assert.equal(matrix.status, "READY");
assert.equal(matrix.catalog.inventoryEntries, 6900);
assert.equal(matrix.catalog.pendingEntries, 6618);
assert.equal(matrix.policy.unmappedInventoryExplicit, true);
assert.equal(sha256(matrix.catalog.path), matrix.catalog.sha256);
const production = readJson(productionPath);
assert.equal(sha256(productionPath), sha256(productionSecondPath), "module matrix report is not deterministic");
assert.equal(production.task, "WBV2-P10-003");
assert.equal(production.operation, "CORE_MODULE_OPERATOR_MATRIX_CHROMIUM");
assert.equal(production.browser, "chromium");
assert.equal(production.queueMutation, false);
assert.equal(production.catalogSha256, matrix.catalog.sha256);
assert.equal(production.cases.length, matrix.cases.length);
assert.equal(production.cases.filter((entry) => entry.status === "PASS").length, 3);
assert.equal(production.cases.filter((entry) => entry.status === "RETAINED_NEGATIVE").length, 6);
for (const entry of production.cases) {
assert.ok(matrix.cases.some((candidate) => candidate.id === entry.id), `case is not catalog-bound: ${entry.id}`);
assert.equal(entry.mainMutation, entry.status === "PASS" ? "CHANGED" : "UNCHANGED");
assert.equal(entry.revisionDelta, entry.status === "PASS" ? 1 : 0);
if (entry.status === "PASS") assert.equal(entry.saveReopen, true);
}
assert.equal(production.shards.length, 2);
assert.ok(production.shards.every((shard) => shard.catalogSha256 === matrix.catalog.sha256 && shard.exitCode === 0));
const receipt = {
schemaVersion: 1,
task: "WBV2-P10-003",
operation: "CORE_MODULE_OPERATOR_MATRIX_RECEIPT",
status: "PASS",
browser: "chromium",
queueMutation: false,
source: { engineReceipt: engineReceiptPath, engineReceiptSha256: sha256(engineReceiptPath), catalog: matrix.catalog, featureGate: matrix.source.featureGate, featureGateSha256: matrix.source.featureGateSha256 },
matrix: { definition: matrixPath, definitionSha256: sha256(matrixPath), production: productionPath, productionSha256: sha256(productionPath), secondProduction: productionSecondPath, secondProductionSha256: sha256(productionSecondPath), deterministic: true, modules: matrix.modules, cases: production.cases.length, positive: 3, retainedNegative: 6, shards: production.shards.map((shard) => ({ id: shard.id, catalogSha256: shard.catalogSha256, exitCode: shard.exitCode })) },
coverage: { inventoryEntries: matrix.coverage.inventoryEntries, claimedComplete: matrix.coverage.inventoryEntriesClaimedComplete, remainingExplicit: matrix.coverage.inventoryEntriesRemainingExplicit, productionCases: production.cases.length, oneCatalogHash: true },
assertions: { positiveCasesMainChanged: true, negativeCasesMainUnchanged: true, saveReopenExact: 3, unmappedInventoryExplicit: true, retainedNegativeExplicit: true, historicalReproduction: false },
nextTask: null,
};
if (!write) {
process.stdout.write("wbv2-module-matrix-receipt-ok task=WBV2-P10-003 cases=9 positive=3 negative=6 shards=2 deterministic=true terminal=true\n");
process.exit(0);
}
fs.mkdirSync(absolute(outputRoot), { recursive: true });
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(receipt, null, 2)}\n`);
fs.writeFileSync(absolute(statusPath), `# WBV2-P10-003 status\n\n- task: \`WBV2-P10-003\`; parent: \`WBV2-P10-002\`; status: \`done\`\n- module cases: \`9\`; positive Main mutations: \`3\`; retained negatives: \`6\`\n- shards: \`2\`; one catalog hash; exit codes: \`0/0\`\n- inventory: \`6900\` total, \`6900\` explicitly remaining; no false completion claim\n- nextTask: \`NONE\`\n\nThe data-driven Mesh, Modifier, and Asset Catalog matrix re-runs the real WebEngine WASM Main path with one catalog hash. Positive cases change Main and pass save/reopen; stale, malformed, unknown, and collision cases remain explicit retained negatives. The matrix does not claim all inventory entries are complete or reproduce unavailable historical bytes. P10-003 is the terminal pointer until a separately authorized continuation is created.\n`);
const previousPlan = readJson("tests/golden/WBV2-P10-002/native-parity-task-plan.json");
const nextPlan = structuredClone(previousPlan);
nextPlan.status = "COMPLETED_WITH_NATIVE_MODULE_MATRIX";
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P10-002/native-parity-task-plan.json", sha256: sha256("tests/golden/WBV2-P10-002/native-parity-task-plan.json") };
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P10-003" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false });
fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P10-003", "--write"], { cwd: root, stdio: "inherit" });
const artifactPaths = { parentManifest: parentManifestPath, engineReceipt: engineReceiptPath, matrix: matrixPath, production: productionPath, productionSecond: productionSecondPath, e2e: "web/tests/e2e/wbv2-module-matrix.spec.ts", generator: "tools/web/generate-wbv2-module-matrix.mjs", receiptGenerator: "tools/web/generate-wbv2-module-matrix-receipt.mjs", report: reportPath, status: statusPath, parityPlan: planPath, taskContext: `${outputRoot}/task-context.json` };
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
const manifest = { schemaVersion: 1, task: "WBV2-P10-003", parentTask: "WBV2-P10-002", operation: "CORE_MODULE_OPERATOR_MATRIX_RECEIPT", status: "done", enablingTask: true, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { cases: 9, positiveCases: 3, retainedNegative: 6, shards: 2, oneCatalogHash: true, inventoryEntries: 6900, inventoryEntriesRemaining: 6900, deterministic: true, saveReopen: "EXACT", historicalReproduction: false }, nextTask: null };
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
process.stdout.write(`wbv2-module-matrix-receipt-written task=WBV2-P10-003 cases=9 positive=3 negative=6 shards=2 deterministic=true terminal=true artifacts=${Object.keys(artifacts).length}\n`);

View File

@@ -0,0 +1,60 @@
import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const write = process.argv.includes("--write");
const absolute = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(absolute(file), "utf8");
const readJson = (file) => JSON.parse(read(file));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
const outputRoot = "tests/golden/WBV2-P10-003";
const matrixPath = `${outputRoot}/module-matrix.json`;
const parentPath = "tests/golden/WBV2-P10-002/manifest.json";
const inventoryPath = "tests/golden/WBV2-P0-002/parity-map.json";
const engineReceiptPath = "tests/golden/WBV2-P10-002/native-engine-receipt-report.json";
const gatePath = "tests/golden/WBV2-P9-004/feature-parity-gate-report.json";
const parent = readJson(parentPath);
assert.equal(parent.task, "WBV2-P10-002");
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P10-003");
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
const inventory = readJson(inventoryPath);
const engineReceipt = readJson(engineReceiptPath);
const gate = readJson(gatePath);
assert.equal(engineReceipt.status, "PASS");
assert.equal(engineReceipt.assertions.realEngineMainMutation, true);
assert.equal(gate.status, "PASS");
const cases = [
{ id: "MESH.translateMeshVertices", family: "MESH", capabilityId: "CAP-MESH-POSITIVE-EDIT", behavior: "positive", implementationClass: "LOCAL_EXACT", expected: { mainMutation: "CHANGED", revisionDelta: 1, saveReopen: "EXACT" } },
{ id: "MESH.translateMeshVertices.stale", family: "MESH", capabilityId: "CAP-MESH-POSITIVE-EDIT", behavior: "stale_revision", implementationClass: "NEGATIVE_BOUNDARY", expected: { mainMutation: "UNCHANGED", revisionDelta: 0, code: "REVISION_CONFLICT" } },
{ id: "MESH.translateMeshVertices.malformed", family: "MESH", capabilityId: "CAP-MESH-POSITIVE-EDIT", behavior: "malformed_selection", implementationClass: "NEGATIVE_BOUNDARY", expected: { mainMutation: "UNCHANGED", revisionDelta: 0, code: "REJECTED" } },
{ id: "MODIFIER.setModifierEnabled", family: "MODIFIER", capabilityId: "CAP-MODIFIER-STATE-MUTATION", behavior: "positive", implementationClass: "LOCAL_EXACT", expected: { mainMutation: "CHANGED", revisionDelta: 1, saveReopen: "EXACT" } },
{ id: "MODIFIER.setModifierEnabled.stale", family: "MODIFIER", capabilityId: "CAP-MODIFIER-STATE-MUTATION", behavior: "stale_revision", implementationClass: "NEGATIVE_BOUNDARY", expected: { mainMutation: "UNCHANGED", revisionDelta: 0, code: "REVISION_CONFLICT" } },
{ id: "MODIFIER.setModifierEnabled.unknown", family: "MODIFIER", capabilityId: "CAP-MODIFIER-STATE-MUTATION", behavior: "unknown_modifier", implementationClass: "NEGATIVE_BOUNDARY", expected: { mainMutation: "UNCHANGED", revisionDelta: 0, code: "REJECTED" } },
{ id: "ASSET_CATALOG.appendLibraryObject", family: "ASSET_CATALOG", capabilityId: "CAP-ASSET-CATALOG-MUTATION", behavior: "positive", implementationClass: "LOCAL_EXACT", expected: { mainMutation: "CHANGED", revisionDelta: 1, saveReopen: "EXACT" } },
{ id: "ASSET_CATALOG.appendLibraryObject.stale", family: "ASSET_CATALOG", capabilityId: "CAP-ASSET-CATALOG-MUTATION", behavior: "stale_revision", implementationClass: "NEGATIVE_BOUNDARY", expected: { mainMutation: "UNCHANGED", revisionDelta: 0, code: "REVISION_CONFLICT" } },
{ id: "ASSET_CATALOG.appendLibraryObject.collision", family: "ASSET_CATALOG", capabilityId: "CAP-ASSET-CATALOG-MUTATION", behavior: "collision", implementationClass: "NEGATIVE_BOUNDARY", expected: { mainMutation: "UNCHANGED", revisionDelta: 0, code: "REJECTED" } },
];
const matrix = {
schemaVersion: 1,
task: "WBV2-P10-003",
operation: "CORE_MODULE_OPERATOR_MATRIX",
status: "READY",
catalog: { path: inventoryPath, sha256: sha256(inventoryPath), inventoryEntries: inventory.summary.inventoryEntries, pendingEntries: inventory.summary.pendingLegacyEntries },
source: { featureGate: gatePath, featureGateSha256: sha256(gatePath), engineReceipt: engineReceiptPath, engineReceiptSha256: sha256(engineReceiptPath) },
policy: { oneCatalogHash: true, positiveClaimsRequireMainMutation: true, negativeCasesNeverAdvanceRevision: true, unmappedInventoryExplicit: true, historicalReproduction: false },
modules: ["MESH", "MODIFIER", "ASSET_CATALOG"],
cases,
coverage: { matrixCases: cases.length, positiveCases: cases.filter((entry) => entry.behavior === "positive").length, negativeCases: cases.filter((entry) => entry.behavior !== "positive").length, inventoryEntries: inventory.summary.inventoryEntries, inventoryEntriesClaimedComplete: 0, inventoryEntriesRemainingExplicit: inventory.summary.inventoryEntries },
shards: [{ id: "core-geometry", families: ["MESH", "MODIFIER"], caseIds: cases.filter((entry) => ["MESH", "MODIFIER"].includes(entry.family)).map((entry) => entry.id) }, { id: "asset-resource", families: ["ASSET_CATALOG"], caseIds: cases.filter((entry) => entry.family === "ASSET_CATALOG").map((entry) => entry.id) }],
};
assert.equal(matrix.cases.length, 9);
if (write) {
fs.mkdirSync(absolute(outputRoot), { recursive: true });
fs.writeFileSync(absolute(matrixPath), `${JSON.stringify(matrix, null, 2)}\n`);
}
process.stdout.write(`wbv2-module-matrix-${write ? "written" : "ready"} task=WBV2-P10-003 cases=${cases.length} positive=3 negative=6 inventory=${inventory.summary.inventoryEntries} catalogSha256=${sha256(inventoryPath)}\n`);

View File

@@ -0,0 +1,132 @@
import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const write = process.argv.includes("--write");
const absolute = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(absolute(file), "utf8");
const readJson = (file) => JSON.parse(read(file));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
const outputRoot = "tests/golden/WBV2-P10-002";
const bindingPath = `${outputRoot}/native-engine-binding-report.json`;
const productionPath = `${outputRoot}/native-engine-production.json`;
const productionSecondPath = `${outputRoot}/native-engine-production.second.json`;
const reportPath = `${outputRoot}/native-engine-receipt-report.json`;
const statusPath = "docs/status/WBV2-P10-002.md";
const planPath = `${outputRoot}/native-parity-task-plan.json`;
const manifestPath = `${outputRoot}/manifest.json`;
const parentManifestPath = "tests/golden/WBV2-P10-001/manifest.json";
const parent = readJson(parentManifestPath);
assert.equal(parent.task, "WBV2-P10-001");
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P10-002");
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
const binding = readJson(bindingPath);
assert.equal(binding.task, "WBV2-P10-002");
assert.equal(binding.status, "PASS");
assert.equal(binding.runtime.browser, "chromium");
assert.equal(binding.requirements.compiledNativePresent, true);
assert.equal(binding.requirements.wasmBinaryPresent, true);
assert.equal(binding.requirements.wasmLoaderPresent, true);
assert.equal(binding.requirements.fakeBridgeOnly, false);
for (const file of [binding.runtime.native.path, binding.runtime.wasm.path, binding.runtime.javascript.path, binding.abi.nativeApi, binding.abi.mainState, binding.abi.worker]) assert.ok(fs.existsSync(absolute(file)), file);
assert.equal(sha256(binding.runtime.native.path), binding.runtime.native.sha256);
assert.equal(sha256(binding.runtime.wasm.path), binding.runtime.wasm.sha256);
assert.equal(sha256(binding.runtime.javascript.path), binding.runtime.javascript.sha256);
assert.equal(sha256(productionPath), sha256(productionSecondPath), "native engine Chromium report is not deterministic");
const production = readJson(productionPath);
assert.equal(production.task, "WBV2-P10-002");
assert.equal(production.operation, "NATIVE_WASM_ENGINE_PRODUCTION_CHROMIUM");
assert.equal(production.browser, "chromium");
assert.equal(production.queueMutation, false);
assert.equal(production.mesh.editedRevision, production.mesh.baseRevision + 1);
assert.equal(production.mesh.afterPosition.length, 3);
assert.deepEqual(production.mesh.afterPosition.map((value, index) => Number((value - production.mesh.beforePosition[index]).toFixed(6))), [0.25, -0.5, 1]);
assert.deepEqual(production.mesh.reopenedPosition, production.mesh.afterPosition);
assert.match(production.mesh.savedSha256, /^[a-f0-9]{64}$/u);
assert.notEqual(production.mesh.savedSha256, production.mesh.sourceSha256);
assert.equal(production.mesh.stale.code, "INVALID_ARGUMENT");
assert.match(production.mesh.stale.message, /REVISION_CONFLICT/u);
assert.equal(production.mesh.malformed.code, "INVALID_ARGUMENT");
assert.equal(production.modifier.editedRevision, production.modifier.baseRevision + 1);
assert.equal(production.modifier.afterEnabled, !production.modifier.beforeEnabled);
assert.equal(production.modifier.reopenedEnabled, production.modifier.afterEnabled);
assert.match(production.modifier.savedSha256, /^[a-f0-9]{64}$/u);
assert.notEqual(production.modifier.savedSha256, production.modifier.sourceSha256);
assert.match(production.modifier.stale.message, /REVISION_CONFLICT/u);
assert.equal(production.modifier.malformed.code, "INVALID_ARGUMENT");
assert.equal(production.asset.appendedRevision, production.asset.baseRevision + 1);
assert.equal(production.asset.receipt.operation, "APPEND");
assert.equal(production.asset.receipt.transactionCount, 1);
assert.equal(production.asset.appendedClosure.object, true);
assert.equal(production.asset.appendedClosure.mesh, true);
assert.equal(production.asset.appendedClosure.material, true);
assert.equal(production.asset.appendedClosure.image.libraryLinked, false);
assert.equal(production.asset.appendedClosure.image.packed, true);
assert.deepEqual(production.asset.reopenedClosure, production.asset.appendedClosure);
assert.match(production.asset.stale.message, /REVISION_CONFLICT/u);
assert.equal(production.asset.collision.code, "ASSET_MANIFEST_INVALID");
assert.equal(production.asset.collisionRevision, production.asset.appendedRevision);
const sourceBindings = binding.sourceBindings.map((source) => {
const manifest = readJson(source.manifest);
const report = readJson(source.report);
assert.equal(manifest.status, "done", `${source.task} source manifest is not done`);
assert.equal(report.desktop?.status, "EXACT", `${source.task} desktop source is not exact`);
assert.equal(report.wasm?.status, "EXACT", `${source.task} WASM source is not exact`);
const bound = Object.values(manifest.artifacts ?? {}).find((artifact) => artifact.path === source.report);
assert.ok(bound, `${source.task} report is not manifest-bound`);
assert.equal(bound.sha256, sha256(source.report));
return { task: source.task, manifest: source.manifest, manifestSha256: sha256(source.manifest), report: source.report, reportSha256: sha256(source.report) };
});
const receipt = {
schemaVersion: 1,
task: "WBV2-P10-002",
operation: "NATIVE_WASM_ENGINE_PRODUCTION_RECEIPT",
status: "PASS",
browser: "chromium",
queueMutation: false,
runtime: { binding: bindingPath, bindingSha256: sha256(bindingPath), native: binding.runtime.native, wasm: binding.runtime.wasm, javascript: binding.runtime.javascript, abi: binding.abi },
sourceBindings,
production: { report: productionPath, reportSha256: sha256(productionPath), secondReport: productionSecondPath, secondReportSha256: sha256(productionSecondPath), deterministic: true, mesh: { mutation: "translateMeshVertices", revisionDelta: 1, saveReopen: "EXACT", stale: "REVISION_CONFLICT", malformed: "REJECTED" }, modifier: { mutation: "setModifierEnabled", revisionDelta: 1, saveReopen: "EXACT", stale: "REVISION_CONFLICT", malformed: "REJECTED" }, asset: { mutation: "appendLibraryObject", revisionDelta: 1, resourceClosure: "LOCAL_MAIN", saveReopen: "EXACT", stale: "REVISION_CONFLICT", collision: "REJECTED" } },
assertions: { compiledNativeBound: true, compiledWasmBound: true, realEngineMainMutation: true, saveReopenExact: 3, deterministicRuns: 2, failureMatrixClosed: true, fakeBridgeOnly: false, historicalReproduction: false },
nextTask: "WBV2-P10-003",
};
if (!write) {
process.stdout.write("wbv2-native-engine-receipt-ok task=WBV2-P10-002 native=true wasm=true chromium=true deterministic=true next=WBV2-P10-003\n");
process.exit(0);
}
fs.mkdirSync(absolute(outputRoot), { recursive: true });
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(receipt, null, 2)}\n`);
fs.writeFileSync(absolute(statusPath), `# WBV2-P10-002 status\n\n- task: \`WBV2-P10-002\`; parent: \`WBV2-P10-001\`; status: \`done\`\n- compiled native: \`Blender 5.2.0 LTS\`; compiled WASM: \`web_engine.wasm\`\n- real Main mutations: \`Mesh + Modifier + Asset Catalog\`\n- deterministic Chromium runs: \`2\`; save/reopen: \`3/3 EXACT\`\n- nextTask: \`WBV2-P10-003\`\n\nThe Chromium Worker loaded the checked-in WebEngine WASM and executed the native ABI through WebEngineClient. Mesh translation, modifier state, and library append all changed the real WASM Main, persisted through save/reopen, and rejected stale or malformed inputs without a late mutation. This evidence is engine-bound and still does not claim full historical reproduction.\n`);
const previousPlan = readJson("tests/golden/WBV2-P10-001/native-parity-task-plan.json");
const nextPlan = structuredClone(previousPlan);
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P10-001/native-parity-task-plan.json", sha256: sha256("tests/golden/WBV2-P10-001/native-parity-task-plan.json") };
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P10-002" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P10-003" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false });
fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
const nextCardPath = "docs/tasks/WBV2-P10-003.md";
fs.writeFileSync(absolute(nextCardPath), read(nextCardPath).replace("- status: planned", "- status: in_progress"));
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P10-002", "--write"], { cwd: root, stdio: "inherit" });
const artifactPaths = { parentManifest: parentManifestPath, binding: bindingPath, production: productionPath, productionSecond: productionSecondPath, e2e: "web/tests/e2e/wbv2-native-engine-production.spec.ts", webEngineClient: "web/app/src/engine-client/WebEngineClient.ts", webEngineWorker: "web/app/src/workers/web-engine.worker.ts", nativeApi: "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", mainState: "blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", nativeBinary: "build_blender_native/bin/blender", wasmBinary: "web/app/src/vendor/blender/web_engine.wasm", wasmJavaScript: "web/app/src/vendor/blender/web_engine.js", generator: "tools/web/generate-wbv2-native-engine-receipt.mjs", report: reportPath, status: statusPath, parityPlan: planPath, taskContext: `${outputRoot}/task-context.json` };
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
const manifest = { schemaVersion: 1, task: "WBV2-P10-002", parentTask: "WBV2-P10-001", operation: "NATIVE_WASM_ENGINE_PRODUCTION_RECEIPT", status: "done", enablingTask: false, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { compiledNativeBound: true, compiledWasmBound: true, realEngineMainMutation: true, deterministic: true, saveReopen: "EXACT", surfaces: 3, historicalReproduction: false }, nextTask: "WBV2-P10-003" };
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P10-003` |")
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P10-002/manifest.json` |")
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P10-003.md`](tasks/WBV2-P10-003.md) |");
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
process.stdout.write(`wbv2-native-engine-receipt-written task=WBV2-P10-002 native=true wasm=true chromium=true deterministic=true next=WBV2-P10-003 artifacts=${Object.keys(artifacts).length}\n`);

View File

@@ -0,0 +1,98 @@
import assert from "node:assert/strict";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const absolute = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(absolute(file), "utf8");
const readJson = (file) => JSON.parse(read(file));
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
const p9ManifestPath = "tests/golden/WBV2-P9-004/manifest.json";
const p9ReportPath = "tests/golden/WBV2-P9-004/feature-parity-gate-report.json";
const p9StatusPath = "docs/status/WBV2-P9-004.md";
const outputRoot = "tests/golden/WBV2-P10-000";
const planPath = `${outputRoot}/native-parity-task-plan.json`;
const reportPath = `${outputRoot}/native-parity-root-report.json`;
const manifestPath = `${outputRoot}/manifest.json`;
const rootStatusPath = "docs/status/WBV2-P10-000.md";
const p9 = readJson(p9ManifestPath);
const p9Report = readJson(p9ReportPath);
assert.equal(p9.task, "WBV2-P9-004");
assert.equal(p9.status, "done");
assert.ok(p9.nextTask === null || p9.nextTask === "WBV2-P10-000");
assert.equal(p9Report.task, "WBV2-P9-004");
assert.equal(p9Report.status, "PASS");
assert.equal(p9Report.decision.fullHistoricalReproduction, false);
assert.equal(p9Report.decision.releaseScope, "AUTHORIZED_REBASELINE_ONLY");
for (const artifact of Object.values(p9.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
const basePlan = readJson("tests/golden/WBV2-P9-004/feature-parity-task-plan.json");
assert.equal(basePlan.recoveryRoot, "WBV2-P9-000");
const tasks = basePlan.tasks.map((task) => ({ ...task, ready: false, status: task.id === "WBV2-P9-004" ? "done" : task.status }));
const p10 = [
{ id: "WBV2-P10-000", phase: "P10", title: "authorize_native_engine_parity_continuation", kind: "enabling", owner: "PROGRAM", dependsOn: ["WBV2-P9-004"], parityId: null, implementationClass: "LOCAL_BOUNDED", parallelGroup: "p10-governance", gate: "G6", card: "docs/tasks/WBV2-P10-000.md", behavior: "Authorize native Blender/WASM engine parity continuation after bounded Chromium capability evidence.", outputs: ["continuation receipt", "native parity plan", "scope limits"], acceptance: ["P9 evidence remains hash-bound", "native build/runtime is explicit", "one native parity task is active"], status: "done", ready: false, queueMutationAllowed: true },
{ id: "WBV2-P10-001", phase: "P10", title: "reconcile_wbv2_inventory_source_drift", kind: "enabling", owner: "PARITY", dependsOn: ["WBV2-P10-000"], parityId: null, implementationClass: "LOCAL_BOUNDED", parallelGroup: "p10-inventory", gate: "G6", card: "docs/tasks/WBV2-P10-001.md", behavior: "Record the authorized mutable WBV2 plan drift and prove dependency closure stability without rewriting historical P0 evidence.", outputs: ["current source hash baseline", "drift report", "checker compatibility"], acceptance: ["historical P0 hashes remain unchanged", "only authorized plan drift is recorded", "dependency roots/lockfile/closure remain stable", "inventory checker passes using current baseline"], status: "in_progress", ready: true, queueMutationAllowed: false },
{ id: "WBV2-P10-002", phase: "P10", title: "bind_native_and_wasm_engine_receipts", kind: "feature", owner: "ENGINE", dependsOn: ["WBV2-P10-001"], parityId: "ENGINE.NATIVE_WASM_BRIDGE", implementationClass: "LOCAL_EXACT", parallelGroup: "p10-engine", gate: "G6", card: "docs/tasks/WBV2-P10-002.md", behavior: "Bind Mesh, Modifier, and Asset Catalog receipts to the compiled Blender native binary and web_engine.wasm runtime.", outputs: ["native receipt", "WASM receipt", "Chromium engine report"], acceptance: ["native Blender binary is source-bound", "WASM binary and JS are hash-bound", "same mutation reaches real engine/Main", "save/reopen and failures remain exact"], status: "planned", ready: false, queueMutationAllowed: false },
{ id: "WBV2-P10-003", phase: "P10", title: "expand_core_module_operator_matrix", kind: "feature", owner: "PARITY", dependsOn: ["WBV2-P10-002"], parityId: "CORE.MODULE_MATRIX", implementationClass: "LOCAL_BOUNDED", parallelGroup: "p10-matrix", gate: "G7", card: "docs/tasks/WBV2-P10-003.md", behavior: "Expand the three proven capability modules with data-driven operator coverage and aggregate regression receipts.", outputs: ["module matrix", "shard reports", "aggregate manifest"], acceptance: ["positive cases are L2+", "negative cases do not mutate Main", "shards use one catalog hash", "unmapped and retained-negative cases stay explicit"], status: "planned", ready: false, queueMutationAllowed: false },
];
const plan = { ...basePlan, planId: "BLENDER_WEB_PARITY_V2_NATIVE_ENGINE_EPOCH_1", status: "ACTIVE_NATIVE_ENGINE_QUEUE", authority: "queue_reactivated_after_p9_bounded_parity", recoveryRoot: "WBV2-P10-000", parentRecoveryPlan: { path: "tests/golden/WBV2-P9-004/feature-parity-task-plan.json", sha256: sha256("tests/golden/WBV2-P9-004/feature-parity-task-plan.json") }, tasks: [...tasks, ...p10] };
fs.mkdirSync(absolute(outputRoot), { recursive: true });
fs.writeFileSync(absolute(planPath), `${JSON.stringify(plan, null, 2)}\n`);
const report = { schemaVersion: 1, task: "WBV2-P10-000", operation: "AUTHORIZE_NATIVE_ENGINE_PARITY_CONTINUATION", status: "PASS", parent: { task: p9.task, manifest: p9ManifestPath, manifestSha256: sha256(p9ManifestPath), previousDecision: p9Report.decision.status, fullHistoricalReproduction: p9Report.decision.fullHistoricalReproduction }, continuation: { root: "WBV2-P10-000", firstTask: "WBV2-P10-001", plannedTasks: 4, scope: ["INVENTORY_DRIFT", "NATIVE_ENGINE", "WASM_ENGINE", "MODULE_MATRIX"], browser: "chromium", nativeBinary: "build_blender_native/bin/blender", wasmBinary: "web/app/src/vendor/blender/web_engine.wasm" }, policy: { historicalEvidencePreserved: true, authorizedRebaselineAccepted: true, nativeEngineReceiptsRequired: true, fullHistoricalReproduction: false, releaseScope: "AUTHORIZED_REBASELINE_ONLY" }, nextTask: "WBV2-P10-001" };
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(report, null, 2)}\n`);
fs.writeFileSync(absolute("docs/tasks/WBV2-P10-000.md"), `# WBV2-P10-000: native engine parity continuation root\n\n- task: WBV2-P10-000\n- parent: WBV2-P9-004\n- status: done\n- gap: workflow:authorize_native_engine_parity_continuation\n- ownerFamily: PROGRAM\n- targetImplementationClass: LOCAL_BOUNDED\n\n## 目标\n\nAuthorize the next parity epoch after P9 bounded Chromium receipts. The next work must bind evidence to the compiled Blender native binary and web_engine.wasm; it must not claim full historical reproduction.\n\n## 验收\n\n- \`node tools/web/generate-wbv2-native-parity-root.mjs\`\n- \`node tools/web/check-execution-control-plane.mjs\`\n- \`node tools/web/check-v2-task-index.mjs\`\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P10-000/\`\n- Manifest: \`tests/golden/WBV2-P10-000/manifest.json\`\n- Rollback: restore P9-004 as queue parent without rewriting P7/P8/P9 evidence.\n`);
fs.writeFileSync(absolute("docs/tasks/WBV2-P10-001.md"), `# WBV2-P10-001: reconcile WBV2 inventory source drift\n\n- task: WBV2-P10-001\n- parent: WBV2-P10-000\n- status: in_progress\n- gap: workflow:reconcile_wbv2_inventory_source_drift\n- ownerFamily: PARITY\n- targetImplementationClass: LOCAL_BOUNDED\n\n## 目标\n\nRecord the already observed mutable plan drift and prove dependency closure stability. The historical P0-002 source hashes remain immutable; a current baseline is an additive P10 artifact.\n\n## 输入与范围\n\n- Historical source hashes: \`tests/golden/WBV2-P0-002/source-hashes.json\`\n- Current plan: \`docs/BLENDER_WEB_PARITY_TASK_PLAN_V2.json\`\n- Dependency baseline: \`tests/golden/M13-05C/dependency-inventory.json\`\n- Checker: \`tools/web/check-wbv2-inventory.mjs\`\n- Rebaseline generator: \`tools/web/generate-wbv2-inventory-rebaseline.mjs\`\n\n## 验收\n\n- \`node tools/web/generate-wbv2-inventory-rebaseline.mjs --write\`\n- \`node tools/web/check-wbv2-inventory.mjs\`\n- \`node tools/web/check-task-context.mjs --task WBV2-P10-001 --write\`\n\nFailure cases (malformed input, unsupported dependency, unexpected drift, changed closure, historical hash rewrite, missing baseline, or failed checker) must keep in_progress and must not advance nextTask.\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P10-001/\`\n- Status: \`docs/status/WBV2-P10-001.md\`\n- Manifest: \`tests/golden/WBV2-P10-001/manifest.json\`\n- Rollback: restore P10-000 as queue parent; keep P0-002 hashes untouched.\n`);
fs.writeFileSync(absolute(rootStatusPath), `# WBV2-P10-000 status\n\n- task: \`WBV2-P10-000\`; parent: \`WBV2-P9-004\`; status: \`done\`\n- nextTask: \`WBV2-P10-001\`\n\nNative engine parity continuation is authorized after P9 bounded Chromium evidence. P10 first reconciles the known WBV2 inventory drift, then requires receipts from the compiled Blender native binary and web_engine.wasm. Full historical reproduction remains false.\n`);
fs.writeFileSync(absolute("docs/tasks/WBV2-P10-002.md"), `# WBV2-P10-002: native and WASM engine receipts\n\n- task: WBV2-P10-002\n- parent: WBV2-P10-001\n- status: planned\n- gap: workflow:bind_native_and_wasm_engine_receipts\n- ownerFamily: ENGINE\n- targetImplementationClass: LOCAL_EXACT\n\n## 目标\n\nBind the proven Mesh, Modifier, and Asset Catalog mutations to the compiled Blender native binary and the checked-in web_engine.wasm runtime, with Chromium as the browser gate.\n\n## 验收\n\n- \`build_blender_native/bin/blender --version\`\n- \`node tools/web/check-wbv2-native-engine.mjs --write\`\n- \`npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-native-engine-production.spec.ts\`\n\nMissing binary, source hash drift, fake bridge execution, unsupported browser, non-exact save/reopen, or failure mutation must keep in_progress and must not advance nextTask.\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P10-002/\`\n- Status: \`docs/status/WBV2-P10-002.md\`\n- Manifest: \`tests/golden/WBV2-P10-002/manifest.json\`\n- Rollback: restore P10-001 as queue parent without modifying P9 receipts.\n`);
fs.writeFileSync(absolute("docs/tasks/WBV2-P10-003.md"), `# WBV2-P10-003: core module operator matrix\n\n- task: WBV2-P10-003\n- parent: WBV2-P10-002\n- status: planned\n- gap: workflow:expand_core_module_operator_matrix\n- ownerFamily: PARITY\n- targetImplementationClass: LOCAL_BOUNDED\n\n## 目标\n\nRun one hash-bound data-driven matrix for Mesh, Modifier, and Asset Catalog module cases instead of creating one production task per legacy operator.\n\n## 验收\n\n- \`node tools/web/generate-wbv2-module-matrix.mjs --write\`\n- \`npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-module-matrix.spec.ts\`\n- \`node tools/web/check-task-context.mjs --task WBV2-P10-003 --write\`\n\nNew failures, unexpected blocked cases, catalog hash drift, or a positive case without Main mutation must keep in_progress and must not advance nextTask.\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P10-003/\`\n- Status: \`docs/status/WBV2-P10-003.md\`\n- Manifest: \`tests/golden/WBV2-P10-003/manifest.json\`\n- Rollback: restore P10-002 as queue parent without modifying native engine receipts.\n`);
const p10ActiveCardPath = "docs/tasks/WBV2-P10-001.md";
const p10ActiveCard = read(p10ActiveCardPath).replaceAll("node tools/web/check-wbv2-inventory.mjs", "node tools/web/check-wbv2-inventory-rebaseline.mjs");
fs.writeFileSync(absolute(p10ActiveCardPath), p10ActiveCard);
const p10EngineCardPath = "docs/tasks/WBV2-P10-002.md";
const p10EngineCard = read(p10EngineCardPath)
.replace("## 验收", "## 输入与范围\n\n- Native binary: `build_blender_native/bin/blender`\n- WASM binary: `web/app/src/vendor/blender/web_engine.wasm`\n- WASM loader: `web/app/src/vendor/blender/web_engine.js`\n- Native Web Engine API: `blender-5.2.0/source/blender/web_engine/web_engine_api.cpp`\n- Existing P9 capability receipts: `tests/golden/WBV2-P9-004/feature-parity-gate-report.json`\n\n## 生产入口\n\n- WebEngine client: `web/app/src/engine-client/WebEngineClient.ts`\n- WebEngine worker: `web/app/src/workers/web-engine.worker.ts`\n- Production receipt test: `web/tests/e2e/wbv2-native-engine-production.spec.ts`\n\n## 验收")
.replace("- `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-native-engine-production.spec.ts`", "- `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-native-engine-production.spec.ts`\n- `node tools/web/generate-wbv2-native-engine-receipt.mjs --write`\n- `node tools/web/check-task-context.mjs --task WBV2-P10-002 --write`")
.replace("- status: planned", "- status: in_progress");
fs.writeFileSync(absolute(p10EngineCardPath), p10EngineCard);
const p10MatrixCardPath = "docs/tasks/WBV2-P10-003.md";
const p10MatrixCard = read(p10MatrixCardPath)
.replace("## 验收", "## 输入与范围\n\n- Capability gate: `tests/golden/WBV2-P9-004/feature-parity-gate-report.json`\n- Native engine receipt: `tests/golden/WBV2-P10-002/native-engine-receipt-report.json`\n- Operator inventory: `tests/golden/WBV2-P0-002/parity-map.json`\n\n## 验收")
.replace("- `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-module-matrix.spec.ts`", "- `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-module-matrix.spec.ts`\n- `node tools/web/generate-wbv2-module-matrix-receipt.mjs --write`")
.replace("New failures, unexpected blocked cases", "Malformed or unsupported cases, new failures, unexpected blocked cases");
fs.writeFileSync(absolute(p10MatrixCardPath), p10MatrixCard);
// P9-004 was a terminal gate only because no successor had been authorized.
// Record this additive continuation without changing its evidence decision.
p9.nextTask = "WBV2-P10-000";
p9.continuation = { authorized: true, root: "WBV2-P10-000", scope: "NATIVE_ENGINE_PARITY" };
p9Report.nextTask = "WBV2-P10-000";
p9Report.policy.terminalQueuePointer = false;
p9Report.policy.authorizedContinuation = "WBV2-P10-000";
fs.writeFileSync(absolute(p9ReportPath), `${JSON.stringify(p9Report, null, 2)}\n`);
const currentP9Status = read(p9StatusPath).trim();
const p9Status = currentP9Status.includes("authorized continuation: `WBV2-P10-000`")
? `${currentP9Status}\n`
: `${currentP9Status}\n- authorized continuation: \`WBV2-P10-000\`\n\nNative Blender/WASM engine parity may continue under a new manifest root. This does not change the bounded P9 claims or the authorized-rebaseline-only release scope.\n`;
fs.writeFileSync(absolute(p9StatusPath), p9Status);
fs.writeFileSync(absolute(p9ManifestPath), `${JSON.stringify(p9, null, 2)}\n`);
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P9-004", "--write"], { cwd: root, stdio: "pipe" });
p9.artifacts = Object.fromEntries(Object.entries(p9.artifacts).map(([name, artifact]) => [name, { ...artifact, sha256: sha256(artifact.path) }]));
fs.writeFileSync(absolute(p9ManifestPath), `${JSON.stringify(p9, null, 2)}\n`);
const artifactPaths = { parentManifest: p9ManifestPath, parentReport: p9ReportPath, approval: "docs/status/M12-PROVENANCE-EPOCH-2-APPROVAL.json", plan: planPath, report: reportPath, rootCard: "docs/tasks/WBV2-P10-000.md", rootStatus: rootStatusPath, activeCard: "docs/tasks/WBV2-P10-001.md" };
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
const manifest = { schemaVersion: 1, task: "WBV2-P10-000", parentTask: "WBV2-P9-004", operation: "AUTHORIZE_NATIVE_ENGINE_PARITY_CONTINUATION", status: "done", enablingTask: true, parityStateChange: false, artifacts, assertions: { boundedP9EvidencePreserved: true, nativeEngineRequired: true, authorizedRebaselineOnly: true, fullHistoricalReproduction: false, featureScope: ["INVENTORY_DRIFT", "NATIVE_ENGINE", "WASM_ENGINE", "MODULE_MATRIX"] }, nextTask: "WBV2-P10-001" };
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P10-001` |")
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P10-000/manifest.json` |")
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P10-001.md`](tasks/WBV2-P10-001.md) |");
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
process.stdout.write("wbv2-native-parity-root-ok root=WBV2-P10-000 next=WBV2-P10-001 scope=INVENTORY_DRIFT,NATIVE_ENGINE,WASM_ENGINE,MODULE_MATRIX\n");

View File

@@ -341,7 +341,7 @@ export function buildTaskContext(requestedTask) {
const parentStatusSource = fs.existsSync(parentStatusPath) ? read(parentStatusPath) : "";
const ownManifestPath = path.join(root, "tests/golden", task, "manifest.json");
const ownManifest = fs.existsSync(ownManifestPath) ? json(ownManifestPath) : null;
if (!requestedTask && task === queue.currentTask && ownManifest?.status === "done") {
if (!requestedTask && task === queue.currentTask && ownManifest?.status === "done" && ownManifest.nextTask !== null) {
throw new Error(`queue current task ${task} is already done; advance EXECUTION_QUEUE.md to ${ownManifest.nextTask}`);
}
if (!requestedTask && task === queue.currentTask && path.basename(path.dirname(queue.parentManifest)) !== parent) {