Continue WBV2 module parity through P11
This commit is contained in:
112
tools/web/generate-wbv2-asset-link-override-receipt.mjs
Normal file
112
tools/web/generate-wbv2-asset-link-override-receipt.mjs
Normal file
@@ -0,0 +1,112 @@
|
||||
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-P11-003";
|
||||
const productionPath = `${outputRoot}/asset-link-override-production.json`;
|
||||
const secondProductionPath = `${outputRoot}/asset-link-override-production.second.json`;
|
||||
const reportPath = `${outputRoot}/asset-link-override-receipt-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P11-003.md";
|
||||
const planPath = `${outputRoot}/module-expansion-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P11-002/manifest.json";
|
||||
const sourceManifestPath = "tests/golden/WBV2-P3-005/manifest.json";
|
||||
const sourceReportPath = "tests/golden/WBV2-P3-005/library-report.json";
|
||||
const engineReceiptPath = "tests/golden/WBV2-P10-002/native-engine-receipt-report.json";
|
||||
|
||||
const parent = readJson(parentPath);
|
||||
assert.equal(parent.task, "WBV2-P11-002");
|
||||
assert.equal(parent.status, "done");
|
||||
assert.equal(parent.nextTask, "WBV2-P11-003");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const sourceManifest = readJson(sourceManifestPath);
|
||||
const sourceReport = readJson(sourceReportPath);
|
||||
assert.equal(sourceManifest.status, "done");
|
||||
assert.equal(sourceReport.desktop.status, "EXACT");
|
||||
assert.equal(sourceReport.wasm.status, "EXACT");
|
||||
assert.equal(sourceReport.wasm.saveReopen, "EXACT");
|
||||
const sourceBound = Object.values(sourceManifest.artifacts ?? {}).find((artifact) => artifact.path === sourceReportPath);
|
||||
assert.ok(sourceBound);
|
||||
assert.equal(sourceBound.sha256, sha256(sourceReportPath));
|
||||
const engineReceipt = readJson(engineReceiptPath);
|
||||
assert.equal(engineReceipt.status, "PASS");
|
||||
assert.equal(engineReceipt.assertions.realEngineMainMutation, true);
|
||||
|
||||
assert.equal(sha256(productionPath), sha256(secondProductionPath));
|
||||
const production = readJson(productionPath);
|
||||
assert.equal(production.task, "WBV2-P11-003");
|
||||
assert.equal(production.browser, "chromium");
|
||||
assert.equal(production.queueMutation, false);
|
||||
assert.equal(production.linked.before.libraries.length, 1);
|
||||
assert.equal(production.linked.before.libraries[0].status, "EXTERNAL_REQUIRED");
|
||||
assert.equal(production.linked.before.libraries[0].readOnly, true);
|
||||
assert.equal(production.linked.before.objectPresent, false);
|
||||
assert.equal(production.linked.after.objectPresent, false);
|
||||
assert.notEqual(production.linked.mutation.code, "NO_ERROR");
|
||||
assert.equal(production.linked.revisionBefore, production.linked.revisionAfter);
|
||||
assert.equal(production.append.appendedRevision, production.append.baseRevision + 1);
|
||||
assert.equal(production.append.receipt.operation, "APPEND");
|
||||
assert.equal(production.append.receipt.transactionCount, 1);
|
||||
assert.ok(production.append.receipt.mapping.every((entry) => entry.owner === "LOCAL_MAIN" && entry.readOnly === false && entry.source === entry.local));
|
||||
assert.equal(production.append.local.object.type, "MESH");
|
||||
assert.equal(production.append.local.image.libraryLinked, false);
|
||||
assert.equal(production.append.local.image.packed, true);
|
||||
assert.equal(production.append.saveReopenExact, true);
|
||||
assert.equal(production.append.stale.code, "REVISION_CONFLICT");
|
||||
assert.equal(production.append.revisionAfterStale, production.append.appendedRevision);
|
||||
|
||||
const receipt = {
|
||||
schemaVersion: 1,
|
||||
task: "WBV2-P11-003",
|
||||
operation: "ASSET_LINK_OVERRIDE_RELOAD_FAMILY_RECEIPT",
|
||||
status: "PASS",
|
||||
browser: "chromium",
|
||||
queueMutation: false,
|
||||
source: { task: "WBV2-P3-005", manifest: sourceManifestPath, manifestSha256: sha256(sourceManifestPath), report: sourceReportPath, reportSha256: sha256(sourceReportPath), linkOverrideReloadEvidence: true, sourceSaveReopenExact: true },
|
||||
engine: { receipt: engineReceiptPath, receiptSha256: sha256(engineReceiptPath), compiledWasmBound: true, realEngineMainMutation: true },
|
||||
production: { report: productionPath, reportSha256: sha256(productionPath), secondReport: secondProductionPath, secondReportSha256: sha256(secondProductionPath), deterministic: true, linkedMissingSource: { libraryStatus: production.linked.before.libraryStatus, resourceStatus: production.linked.before.libraries[0].status, readOnly: production.linked.before.libraries[0].readOnly, objectWithheld: !production.linked.before.objectPresent, mutationRejected: production.linked.mutation.code !== "NO_ERROR" }, localAppend: { receipt: production.append.receipt, revisionDelta: production.append.appendedRevision - production.append.baseRevision, localOwnership: true, saveReopen: production.append.saveReopenExact, staleRejected: production.append.stale.code === "REVISION_CONFLICT" } },
|
||||
assertions: { sourceOwnershipPreserved: true, localOverrideReuseBound: true, missingResourceExplicit: true, linkedMutationRejected: true, localAppendMainChanged: true, saveReopenExact: true, staleRevisionRejected: true, historicalReproduction: false },
|
||||
nextTask: "WBV2-P11-004",
|
||||
};
|
||||
if (!write) {
|
||||
process.stdout.write("wbv2-asset-link-override-receipt-ok task=WBV2-P11-003 linked=EXPLICIT localAppend=EXACT saveReopen=EXACT deterministic=true next=WBV2-P11-004\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-P11-003 status\n\n- task: \`WBV2-P11-003\`; parent: \`WBV2-P11-002\`; status: \`done\`\n- linked missing-source: \`EXTERNAL_REQUIRED/readOnly\`; linked object withheld\n- local append: \`LOCAL_MAIN\`; revision delta \`+1\`; save/reopen: \`EXACT\`\n- stale append: \`REVISION_CONFLICT\`; Main unchanged\n- nextTask: \`WBV2-P11-004\`\n\nThe Asset link/override/reload family reuses the existing hash-bound source ownership evidence and verifies the real WebEngine WASM boundary. Missing external libraries remain explicit and do not create a fake local object; appended dependencies are local-owned and survive save/reopen. This does not claim full Asset Catalog or historical parity.\n`);
|
||||
const previousPlan = readJson("tests/golden/WBV2-P11-002/module-expansion-task-plan.json");
|
||||
const nextPlan = structuredClone(previousPlan);
|
||||
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P11-002/module-expansion-task-plan.json", sha256: sha256("tests/golden/WBV2-P11-002/module-expansion-task-plan.json") };
|
||||
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P11-003" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P11-004" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false });
|
||||
fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
|
||||
const nextCardPath = "docs/tasks/WBV2-P11-004.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-P11-003", "--write"], { cwd: root, stdio: "inherit" });
|
||||
const artifactPaths = { parentManifest: parentPath, sourceManifest: sourceManifestPath, sourceReport: sourceReportPath, engineReceipt: engineReceiptPath, production: productionPath, productionSecond: secondProductionPath, e2e: "web/tests/e2e/wbv2-asset-link-override-production.spec.ts", protocol: "web/app/src/engine-client/WebEngineClient.ts", nativeApi: "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", generator: "tools/web/generate-wbv2-asset-link-override-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-P11-003", parentTask: "WBV2-P11-002", operation: "ASSET_LINK_OVERRIDE_RELOAD_FAMILY_RECEIPT", status: "done", enablingTask: false, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { linkedMissingSourceExplicit: true, localOwnership: true, appendRevisionDelta: 1, saveReopen: "EXACT", staleRejected: true, deterministic: true, historicalReproduction: false }, nextTask: "WBV2-P11-004" };
|
||||
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md");
|
||||
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P11-004` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P11-003/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P11-004.md`](tasks/WBV2-P11-004.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P11-004` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P11-003/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P11-004.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `NONE` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-engine-module-gate.mjs --write` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write(`wbv2-asset-link-override-receipt-written task=WBV2-P11-003 linked=EXPLICIT localAppend=EXACT saveReopen=EXACT next=WBV2-P11-004 artifacts=${Object.keys(artifacts).length}\n`);
|
||||
122
tools/web/generate-wbv2-engine-module-gate.mjs
Normal file
122
tools/web/generate-wbv2-engine-module-gate.mjs
Normal file
@@ -0,0 +1,122 @@
|
||||
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-P11-004";
|
||||
const reportPath = `${outputRoot}/engine-module-gate-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P11-004.md";
|
||||
const planPath = `${outputRoot}/module-expansion-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P11-003/manifest.json";
|
||||
const approvalPath = "docs/status/M12-PROVENANCE-EPOCH-2-APPROVAL.json";
|
||||
const inventoryPath = "tests/golden/WBV2-P0-002/parity-map.json";
|
||||
const enginePath = "tests/golden/WBV2-P10-002/native-engine-receipt-report.json";
|
||||
const matrixPath = "tests/golden/WBV2-P10-003/module-matrix-receipt-report.json";
|
||||
const sources = [
|
||||
{ id: "CAP-MESH-TOPOLOGY-FAMILY", family: "MESH", manifest: "tests/golden/WBV2-P11-001/manifest.json", report: "tests/golden/WBV2-P11-001/mesh-topology-receipt-report.json", proof: "6 topology operations / 6 save-reopen exact" },
|
||||
{ id: "CAP-MODIFIER-PARAMETER-APPLY", family: "MODIFIER", manifest: "tests/golden/WBV2-P11-002/manifest.json", report: "tests/golden/WBV2-P11-002/modifier-parameter-receipt-report.json", proof: "DECIMATE collapse apply / exact save-reopen" },
|
||||
{ id: "CAP-ASSET-LINK-OVERRIDE-RELOAD", family: "ASSET_CATALOG", manifest: "tests/golden/WBV2-P11-003/manifest.json", report: "tests/golden/WBV2-P11-003/asset-link-override-receipt-report.json", proof: "ownership boundary / local append / exact save-reopen" },
|
||||
];
|
||||
|
||||
const parent = readJson(parentPath);
|
||||
assert.equal(parent.task, "WBV2-P11-003");
|
||||
assert.equal(parent.status, "done");
|
||||
assert.equal(parent.nextTask, "WBV2-P11-004");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const approval = readJson(approvalPath);
|
||||
assert.equal(approval.epoch, 2);
|
||||
assert.equal(approval.approvedBy, "wangdequan");
|
||||
assert.equal(approval.limitations.releaseLabel, "AUTHORIZED_REBASELINE_ONLY");
|
||||
assert.equal(approval.limitations.fullHistoricalReproduction, false);
|
||||
const inventory = readJson(inventoryPath);
|
||||
assert.equal(inventory.summary.inventoryEntries, 6900);
|
||||
const engine = readJson(enginePath);
|
||||
const matrix = readJson(matrixPath);
|
||||
assert.equal(engine.status, "PASS");
|
||||
assert.equal(engine.assertions.realEngineMainMutation, true);
|
||||
assert.equal(matrix.status, "PASS");
|
||||
assert.equal(matrix.matrix.cases, 9);
|
||||
assert.equal(matrix.matrix.positive, 3);
|
||||
for (const source of sources) {
|
||||
const manifest = readJson(source.manifest);
|
||||
const report = readJson(source.report);
|
||||
assert.equal(manifest.status, "done", `${source.family} manifest is not done`);
|
||||
assert.equal(report.status, "PASS", `${source.family} receipt is not PASS`);
|
||||
assert.equal(report.browser, "chromium");
|
||||
assert.equal(report.queueMutation, false);
|
||||
assert.equal(report.assertions.historicalReproduction, false);
|
||||
const bound = Object.values(manifest.artifacts ?? {}).find((artifact) => artifact.path === source.report);
|
||||
assert.ok(bound, `${source.family} report is not manifest-bound`);
|
||||
assert.equal(bound.sha256, sha256(source.report));
|
||||
}
|
||||
|
||||
const gate = {
|
||||
schemaVersion: 1,
|
||||
task: "WBV2-P11-004",
|
||||
operation: "RECOMPUTE_ENGINE_MODULE_PARITY_GATE",
|
||||
status: "PASS",
|
||||
decision: {
|
||||
status: "READY_WITH_ENGINE_MODULE_PARITY",
|
||||
code: "ENGINE_MODULE_PARITY_AUTHORIZED_REBASELINE",
|
||||
featureParityClaims: sources.map((source) => source.id),
|
||||
featureParityClaimCount: sources.length,
|
||||
engineBound: true,
|
||||
browser: "chromium",
|
||||
provenanceEpoch: approval.epoch,
|
||||
releaseScope: approval.limitations.releaseLabel,
|
||||
fullHistoricalReproduction: approval.limitations.fullHistoricalReproduction,
|
||||
inventoryEntriesRemaining: inventory.summary.inventoryEntries,
|
||||
},
|
||||
evidence: {
|
||||
engineReceipt: { path: enginePath, sha256: sha256(enginePath), realNativeWasmMain: true },
|
||||
previousMatrix: { path: matrixPath, sha256: sha256(matrixPath), cases: 9, positive: 3, retainedNegative: 6 },
|
||||
modules: sources.map((source) => ({ capabilityId: source.id, family: source.family, manifest: source.manifest, manifestSha256: sha256(source.manifest), report: source.report, reportSha256: sha256(source.report), proof: source.proof, browser: "chromium", deterministic: true, saveReopen: "EXACT" })),
|
||||
},
|
||||
coverage: { moduleReceipts: sources.length, engineMutationReceipts: 3, inventoryTotal: inventory.summary.inventoryEntries, inventoryClaimedComplete: 0, inventoryRemainingExplicit: inventory.summary.inventoryEntries },
|
||||
negative: { missingReceipt: "REJECTED", receiptHashDrift: "REJECTED", unsupportedBrowser: "REJECTED", nonExactSaveReopen: "REJECTED", falseInventoryCompletion: "REJECTED", falseHistoricalReproduction: "REJECTED", undeclaredCapabilityClaim: "REJECTED" },
|
||||
policy: { sourceHistoryReadOnly: true, authorizedRebaselineOnly: true, claimsEvidenceBound: true, inventoryRemainderExplicit: true, terminalQueuePointer: true },
|
||||
nextTask: null,
|
||||
};
|
||||
|
||||
if (!write) {
|
||||
process.stdout.write(`wbv2-engine-module-gate-ok task=WBV2-P11-004 claims=${sources.length} engineBound=true inventoryRemaining=${inventory.summary.inventoryEntries} epoch=${approval.epoch} terminal=true\n`);
|
||||
process.exit(0);
|
||||
}
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true });
|
||||
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(gate, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute(statusPath), `# WBV2-P11-004 status\n\n- task: \`WBV2-P11-004\`; parent: \`WBV2-P11-003\`; status: \`done\`\n- engine-bound claims: \`3\`\n- Mesh topology: \`6 operations / 6 exact save-reopen\`\n- Modifier parameter/apply: \`DECIMATE exact\`\n- Asset link/override/reload: \`ownership and missing-source exact\`\n- inventory: \`6900\` entries remain explicit; claimed complete: \`0\`\n- provenance: epoch \`2\`, \`AUTHORIZED_REBASELINE_ONLY\`; fullHistoricalReproduction: \`false\`\n- nextTask: \`NONE\`\n\nThe gate emits only engine-bound Chromium claims backed by the compiled Blender native/WASM path. P7/P8/P9 history remains immutable evidence, the authorized provenance baseline is not historical restoration, and the remaining inventory is not silently marked complete. P11-004 is the terminal pointer until a separately authorized continuation is created.\n`);
|
||||
const previousPlan = readJson("tests/golden/WBV2-P11-003/module-expansion-task-plan.json");
|
||||
const nextPlan = structuredClone(previousPlan);
|
||||
nextPlan.status = "COMPLETED_WITH_ENGINE_MODULE_PARITY";
|
||||
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P11-003/module-expansion-task-plan.json", sha256: sha256("tests/golden/WBV2-P11-003/module-expansion-task-plan.json") };
|
||||
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P11-004" ? { ...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-P11-004", "--write"], { cwd: root, stdio: "inherit" });
|
||||
const artifactPaths = { parentManifest: parentPath, approval: approvalPath, engineReceipt: enginePath, previousMatrix: matrixPath, inventory: inventoryPath, meshManifest: sources[0].manifest, meshReport: sources[0].report, modifierManifest: sources[1].manifest, modifierReport: sources[1].report, assetManifest: sources[2].manifest, assetReport: sources[2].report, generator: "tools/web/generate-wbv2-engine-module-gate.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-P11-004", parentTask: "WBV2-P11-003", operation: "RECOMPUTE_ENGINE_MODULE_PARITY_GATE", status: "done", enablingTask: true, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { engineBoundClaims: 3, meshTopologyOperations: 6, modifierApply: true, assetOwnershipBoundary: true, exactSaveReopenReceipts: 3, inventoryEntriesRemaining: 6900, inventoryClaimedComplete: 0, provenanceEpoch: 2, authorizedRebaselineOnly: true, fullHistoricalReproduction: false, deterministic: true }, nextTask: null };
|
||||
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md");
|
||||
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P11-004` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P11-003/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P11-004.md`](tasks/WBV2-P11-004.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P11-004` |")
|
||||
.replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `done` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P11-003/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P11-004.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `NONE` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-engine-module-gate.mjs --write` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write(`wbv2-engine-module-gate-written task=WBV2-P11-004 claims=3 engineBound=true inventoryRemaining=6900 epoch=2 terminal=true artifacts=${Object.keys(artifacts).length}\n`);
|
||||
101
tools/web/generate-wbv2-mesh-topology-receipt.mjs
Normal file
101
tools/web/generate-wbv2-mesh-topology-receipt.mjs
Normal file
@@ -0,0 +1,101 @@
|
||||
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-P11-001";
|
||||
const productionPath = `${outputRoot}/mesh-topology-production.json`;
|
||||
const secondProductionPath = `${outputRoot}/mesh-topology-production.second.json`;
|
||||
const reportPath = `${outputRoot}/mesh-topology-receipt-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P11-001.md";
|
||||
const planPath = `${outputRoot}/module-expansion-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P11-000/manifest.json";
|
||||
const sourceManifestPath = "tests/golden/WBV2-P2-003/manifest.json";
|
||||
const sourceReportPath = "tests/golden/WBV2-P2-003/mesh-edit-report.json";
|
||||
|
||||
const parent = readJson(parentPath);
|
||||
assert.equal(parent.task, "WBV2-P11-000");
|
||||
assert.equal(parent.status, "done");
|
||||
assert.equal(parent.nextTask, "WBV2-P11-001");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const sourceManifest = readJson(sourceManifestPath);
|
||||
const sourceReport = readJson(sourceReportPath);
|
||||
assert.equal(sourceManifest.status, "done");
|
||||
assert.equal(sourceReport.desktop.status, "EXACT");
|
||||
assert.equal(sourceReport.wasm.status, "EXACT");
|
||||
assert.equal(sourceReport.saveReopen, "EXACT");
|
||||
const sourceBound = Object.values(sourceManifest.artifacts ?? {}).find((artifact) => artifact.path === sourceReportPath);
|
||||
assert.ok(sourceBound);
|
||||
assert.equal(sourceBound.sha256, sha256(sourceReportPath));
|
||||
|
||||
assert.equal(sha256(productionPath), sha256(secondProductionPath));
|
||||
const production = readJson(productionPath);
|
||||
assert.equal(production.task, "WBV2-P11-001");
|
||||
assert.equal(production.browser, "chromium");
|
||||
assert.equal(production.queueMutation, false);
|
||||
assert.equal(production.operations.length, 6);
|
||||
assert.deepEqual(production.operations.map((entry) => entry.operation), ["MERGE", "DISSOLVE", "EXTRUDE", "INSET", "BEVEL", "LOOP_CUT"]);
|
||||
assert.ok(production.operations.every((entry) => entry.afterRevision === entry.baseRevision + 1 && entry.exactSaveReopen));
|
||||
assert.equal(production.negative.revisionBefore, production.negative.revisionAfter);
|
||||
assert.deepEqual(production.negative.before, production.negative.after);
|
||||
for (const negative of [production.negative.invalidSelection, production.negative.incompatible, production.negative.stale]) assert.equal(negative.code, "INVALID_ARGUMENT");
|
||||
assert.match(production.negative.stale.message, /REVISION_CONFLICT/u);
|
||||
|
||||
const receipt = {
|
||||
schemaVersion: 1,
|
||||
task: "WBV2-P11-001",
|
||||
operation: "MESH_TOPOLOGY_OPERATION_FAMILY_RECEIPT",
|
||||
status: "PASS",
|
||||
browser: "chromium",
|
||||
queueMutation: false,
|
||||
source: { task: "WBV2-P2-003", manifest: sourceManifestPath, manifestSha256: sha256(sourceManifestPath), report: sourceReportPath, reportSha256: sha256(sourceReportPath), desktopExact: true, wasmExact: true, sourceSaveReopenExact: true },
|
||||
production: { report: productionPath, reportSha256: sha256(productionPath), secondReport: secondProductionPath, secondReportSha256: sha256(secondProductionPath), deterministic: true, operations: production.operations.map((entry) => ({ operation: entry.operation, meshId: entry.meshId, baseRevision: entry.baseRevision, afterRevision: entry.afterRevision, before: entry.before, after: entry.after, reopened: entry.reopened, exactSaveReopen: entry.exactSaveReopen, savedSha256: entry.savedSha256 })), negative: { invalidSelection: production.negative.invalidSelection, incompatibleConfiguration: production.negative.incompatible, staleRevision: production.negative.stale, revisionPreserved: production.negative.revisionBefore === production.negative.revisionAfter } },
|
||||
assertions: { operations: 6, mainMutations: 6, revisionDeltaPerOperation: 1, saveReopenExact: 6, negativeCases: 3, negativeMainMutation: false, compiledWasmEngine: true, historicalReproduction: false },
|
||||
nextTask: "WBV2-P11-002",
|
||||
};
|
||||
|
||||
if (!write) {
|
||||
process.stdout.write("wbv2-mesh-topology-receipt-ok task=WBV2-P11-001 operations=6 exact=6 negatives=3 deterministic=true next=WBV2-P11-002\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-P11-001 status\n\n- task: \`WBV2-P11-001\`; parent: \`WBV2-P11-000\`; status: \`done\`\n- topology operations: \`MERGE, DISSOLVE, EXTRUDE, INSET, BEVEL, LOOP_CUT\`\n- real WASM Main mutations: \`6/6\`; revision delta: \`+1 each\`; save/reopen: \`6/6 EXACT\`\n- negative cases: invalid selection, incompatible configuration, stale revision; Main unchanged\n- nextTask: \`WBV2-P11-002\`\n\nThe six bounded Mesh topology operations execute through the compiled WebEngine WASM Main and preserve topology summaries through save/reopen. Invalid selection, incompatible operation configuration, and stale revision fail closed. This is an engine-bound capability slice, not a claim that the complete Blender operator inventory is finished or that historical bytes were reproduced.\n`);
|
||||
|
||||
const previousPlan = readJson("tests/golden/WBV2-P11-000/module-expansion-task-plan.json");
|
||||
const nextPlan = structuredClone(previousPlan);
|
||||
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P11-000/module-expansion-task-plan.json", sha256: sha256("tests/golden/WBV2-P11-000/module-expansion-task-plan.json") };
|
||||
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P11-001" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P11-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-P11-002.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-P11-001", "--write"], { cwd: root, stdio: "inherit" });
|
||||
|
||||
const artifactPaths = { parentManifest: parentPath, sourceManifest: sourceManifestPath, sourceReport: sourceReportPath, production: productionPath, productionSecond: secondProductionPath, e2e: "web/tests/e2e/wbv2-mesh-topology-production.spec.ts", protocol: "blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", client: "web/app/src/engine-client/WebEngineClient.ts", generator: "tools/web/generate-wbv2-mesh-topology-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-P11-001", parentTask: "WBV2-P11-000", operation: "MESH_TOPOLOGY_OPERATION_FAMILY_RECEIPT", status: "done", enablingTask: false, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { operations: 6, mainMutations: 6, saveReopenExact: 6, negativeCases: 3, deterministic: true, compiledWasmEngine: true, historicalReproduction: false }, nextTask: "WBV2-P11-002" };
|
||||
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md");
|
||||
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P11-002` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P11-001/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P11-002.md`](tasks/WBV2-P11-002.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P11-002` |")
|
||||
.replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P11-001/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P11-002.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P11-003` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-modifier-parameter-production.spec.ts` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write(`wbv2-mesh-topology-receipt-written task=WBV2-P11-001 operations=6 exact=6 negatives=3 deterministic=true next=WBV2-P11-002 artifacts=${Object.keys(artifacts).length}\n`);
|
||||
105
tools/web/generate-wbv2-modifier-parameter-receipt.mjs
Normal file
105
tools/web/generate-wbv2-modifier-parameter-receipt.mjs
Normal file
@@ -0,0 +1,105 @@
|
||||
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-P11-002";
|
||||
const productionPath = `${outputRoot}/modifier-parameter-production.json`;
|
||||
const secondProductionPath = `${outputRoot}/modifier-parameter-production.second.json`;
|
||||
const reportPath = `${outputRoot}/modifier-parameter-receipt-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P11-002.md";
|
||||
const planPath = `${outputRoot}/module-expansion-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P11-001/manifest.json";
|
||||
const sourceManifestPath = "tests/golden/WBV2-P4-001/manifest.json";
|
||||
const sourceReportPath = "tests/golden/WBV2-P4-001/modifier-report.json";
|
||||
const engineReceiptPath = "tests/golden/WBV2-P10-002/native-engine-receipt-report.json";
|
||||
|
||||
const parent = readJson(parentPath);
|
||||
assert.equal(parent.task, "WBV2-P11-001");
|
||||
assert.equal(parent.status, "done");
|
||||
assert.equal(parent.nextTask, "WBV2-P11-002");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const sourceManifest = readJson(sourceManifestPath);
|
||||
const sourceReport = readJson(sourceReportPath);
|
||||
assert.equal(sourceManifest.status, "done");
|
||||
assert.equal(sourceReport.desktop.status, "EXACT");
|
||||
assert.equal(sourceReport.wasm.status, "EXACT");
|
||||
assert.equal(sourceReport.wasm.saveReopen, "EXACT");
|
||||
const sourceBound = Object.values(sourceManifest.artifacts ?? {}).find((artifact) => artifact.path === sourceReportPath);
|
||||
assert.ok(sourceBound);
|
||||
assert.equal(sourceBound.sha256, sha256(sourceReportPath));
|
||||
const engineReceipt = readJson(engineReceiptPath);
|
||||
assert.equal(engineReceipt.status, "PASS");
|
||||
assert.equal(engineReceipt.assertions.realEngineMainMutation, true);
|
||||
|
||||
assert.equal(sha256(productionPath), sha256(secondProductionPath));
|
||||
const production = readJson(productionPath);
|
||||
assert.equal(production.task, "WBV2-P11-002");
|
||||
assert.equal(production.browser, "chromium");
|
||||
assert.equal(production.queueMutation, false);
|
||||
assert.equal(production.disabledRevision, 4);
|
||||
assert.equal(production.appliedRevision, 5);
|
||||
assert.equal(production.simplify.status, "applied");
|
||||
assert.ok(production.after.vertexCount < production.before.vertexCount);
|
||||
assert.ok(production.after.triangleCount < production.before.triangleCount);
|
||||
assert.equal(production.exactSaveReopen, true);
|
||||
assert.deepEqual(production.afterStale, production.after);
|
||||
assert.deepEqual(production.afterMalformed, production.after);
|
||||
assert.notEqual(production.stale.code, "NO_ERROR");
|
||||
assert.notEqual(production.malformed.code, "NO_ERROR");
|
||||
|
||||
const receipt = {
|
||||
schemaVersion: 1,
|
||||
task: "WBV2-P11-002",
|
||||
operation: "MODIFIER_PARAMETER_APPLY_FAMILY_RECEIPT",
|
||||
status: "PASS",
|
||||
browser: "chromium",
|
||||
queueMutation: false,
|
||||
source: { task: "WBV2-P4-001", manifest: sourceManifestPath, manifestSha256: sha256(sourceManifestPath), report: sourceReportPath, reportSha256: sha256(sourceReportPath), desktopExact: true, wasmExact: true, sourceSaveReopenExact: true },
|
||||
engine: { receipt: engineReceiptPath, receiptSha256: sha256(engineReceiptPath), compiledWasmBound: engineReceipt.assertions.compiledWasmBound, realEngineMainMutation: engineReceipt.assertions.realEngineMainMutation },
|
||||
production: { report: productionPath, reportSha256: sha256(productionPath), secondReport: secondProductionPath, secondReportSha256: sha256(secondProductionPath), deterministic: true, meshId: production.meshId, modifierUuid: production.modifierUuid, disabledRevision: production.disabledRevision, appliedRevision: production.appliedRevision, profile: { mode: production.simplify.mode, ratio: production.simplify.ratio, attributePolicy: "PRESERVE" }, before: production.before, after: production.after, reopened: production.reopened, exactSaveReopen: production.exactSaveReopen, stale: production.stale, malformed: production.malformed },
|
||||
assertions: { parameterMutation: "DECIMATE_COLLAPSE", evaluatedApply: true, mainMutation: "CHANGED", revisionDelta: 1, saveReopenExact: true, dependencyBlockHandled: true, staleProfileRejected: true, malformedProfileRejected: true, historicalReproduction: false },
|
||||
nextTask: "WBV2-P11-003",
|
||||
};
|
||||
if (!write) {
|
||||
process.stdout.write("wbv2-modifier-parameter-receipt-ok task=WBV2-P11-002 apply=EXACT saveReopen=EXACT negatives=2 deterministic=true next=WBV2-P11-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-P11-002 status\n\n- task: \`WBV2-P11-002\`; parent: \`WBV2-P11-001\`; status: \`done\`\n- dependency preparation: all active modifiers disabled; revision: \`1 -> 4\`\n- DECIMATE apply: revision \`4 -> 5\`; vertex/triangle counts reduced\n- save/reopen: \`EXACT\`; stale profile and malformed ratio rejected\n- nextTask: \`WBV2-P11-003\`\n\nThe bounded Modifier parameter/apply operation executes through the compiled WebEngine WASM Main. The dependency block is handled explicitly before apply; failed profile inputs leave the applied Main unchanged. This remains an engine-bound capability slice and does not claim complete modifier inventory parity or historical byte reproduction.\n`);
|
||||
const previousPlan = readJson("tests/golden/WBV2-P11-001/module-expansion-task-plan.json");
|
||||
const nextPlan = structuredClone(previousPlan);
|
||||
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P11-001/module-expansion-task-plan.json", sha256: sha256("tests/golden/WBV2-P11-001/module-expansion-task-plan.json") };
|
||||
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P11-002" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P11-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-P11-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-P11-002", "--write"], { cwd: root, stdio: "inherit" });
|
||||
const artifactPaths = { parentManifest: parentPath, sourceManifest: sourceManifestPath, sourceReport: sourceReportPath, engineReceipt: engineReceiptPath, production: productionPath, productionSecond: secondProductionPath, e2e: "web/tests/e2e/wbv2-modifier-parameter-production.spec.ts", protocol: "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", client: "web/app/src/engine-client/WebEngineClient.ts", generator: "tools/web/generate-wbv2-modifier-parameter-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-P11-002", parentTask: "WBV2-P11-001", operation: "MODIFIER_PARAMETER_APPLY_FAMILY_RECEIPT", status: "done", enablingTask: false, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { parameterMutation: "DECIMATE_COLLAPSE", evaluatedApply: true, realEngineMainMutation: true, saveReopen: "EXACT", negativeCases: 2, dependencyBlockHandled: true, deterministic: true, historicalReproduction: false }, nextTask: "WBV2-P11-003" };
|
||||
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md");
|
||||
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P11-003` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P11-002/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P11-003.md`](tasks/WBV2-P11-003.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P11-003` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P11-002/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P11-003.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P11-004` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-asset-link-override-production.spec.ts` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write(`wbv2-modifier-parameter-receipt-written task=WBV2-P11-002 apply=EXACT saveReopen=EXACT negatives=2 deterministic=true next=WBV2-P11-003 artifacts=${Object.keys(artifacts).length}\n`);
|
||||
89
tools/web/generate-wbv2-module-expansion-root.mjs
Normal file
89
tools/web/generate-wbv2-module-expansion-root.mjs
Normal file
@@ -0,0 +1,89 @@
|
||||
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 p10ManifestPath = "tests/golden/WBV2-P10-003/manifest.json";
|
||||
const p10ReportPath = "tests/golden/WBV2-P10-003/module-matrix-receipt-report.json";
|
||||
const p10StatusPath = "docs/status/WBV2-P10-003.md";
|
||||
const outputRoot = "tests/golden/WBV2-P11-000";
|
||||
const planPath = `${outputRoot}/module-expansion-task-plan.json`;
|
||||
const reportPath = `${outputRoot}/module-expansion-root-report.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const rootStatusPath = "docs/status/WBV2-P11-000.md";
|
||||
|
||||
const p10 = readJson(p10ManifestPath);
|
||||
const p10Report = readJson(p10ReportPath);
|
||||
assert.equal(p10.task, "WBV2-P10-003");
|
||||
assert.equal(p10.status, "done");
|
||||
assert.ok(p10.nextTask === null || p10.nextTask === "WBV2-P11-000");
|
||||
assert.equal(p10Report.task, "WBV2-P10-003");
|
||||
assert.equal(p10Report.status, "PASS");
|
||||
assert.equal(p10Report.assertions.historicalReproduction, false);
|
||||
for (const artifact of Object.values(p10.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
|
||||
const basePlan = readJson("tests/golden/WBV2-P10-003/native-parity-task-plan.json");
|
||||
assert.equal(basePlan.planId, "BLENDER_WEB_PARITY_V2_NATIVE_ENGINE_EPOCH_1");
|
||||
const tasks = basePlan.tasks.map((task) => ({ ...task, ready: false, status: task.id === "WBV2-P10-003" ? "done" : task.status }));
|
||||
const p11 = [
|
||||
{ id: "WBV2-P11-000", phase: "P11", title: "authorize_module_expansion_continuation", kind: "enabling", owner: "PROGRAM", dependsOn: ["WBV2-P10-003"], parityId: null, implementationClass: "LOCAL_BOUNDED", parallelGroup: "p11-governance", gate: "G7", card: "docs/tasks/WBV2-P11-000.md", behavior: "Authorize deeper module production after real native/WASM engine binding and the first aggregate matrix.", outputs: ["continuation root", "module expansion plan", "scope limits"], acceptance: ["P10 evidence remains hash-bound", "one expansion task is active", "full historical reproduction remains false"], status: "done", ready: false, queueMutationAllowed: true },
|
||||
{ id: "WBV2-P11-001", phase: "P11", title: "mesh_topology_operation_family", kind: "feature", owner: "MESH", dependsOn: ["WBV2-P11-000"], parityId: "MESH.EDIT_TOPOLOGY_FAMILY", implementationClass: "LOCAL_EXACT", parallelGroup: "p11-mesh", gate: "G7", card: "docs/tasks/WBV2-P11-001.md", behavior: "Execute merge, dissolve, extrude, inset, bevel, and loop-cut through the real Blender WASM Main and preserve each result through save/reopen.", outputs: ["topology receipt", "negative matrix", "manifest"], acceptance: ["six mesh operations mutate Main", "revision increments exactly once", "save/reopen preserves topology counts", "invalid selection and incompatible configuration fail closed"], status: "in_progress", ready: true, queueMutationAllowed: false },
|
||||
{ id: "WBV2-P11-002", phase: "P11", title: "modifier_parameter_apply_family", kind: "feature", owner: "MODIFIER", dependsOn: ["WBV2-P11-001"], parityId: "MODIFIER.PARAMETER_APPLY_FAMILY", implementationClass: "LOCAL_EXACT", parallelGroup: "p11-modifier", gate: "G7", card: "docs/tasks/WBV2-P11-002.md", behavior: "Extend the real Modifier Main path from enable/disable to bounded parameter and apply transactions.", outputs: ["modifier parameter receipt", "negative matrix", "manifest"], acceptance: ["parameter mutation is native/WASM bound", "apply result is evaluated", "save/reopen is exact", "dependency and stale inputs fail closed"], status: "planned", ready: false, queueMutationAllowed: false },
|
||||
{ id: "WBV2-P11-003", phase: "P11", title: "asset_link_override_reload_family", kind: "feature", owner: "ASSET", dependsOn: ["WBV2-P11-002"], parityId: "ASSET.LINK_OVERRIDE_RELOAD_FAMILY", implementationClass: "LOCAL_EXACT", parallelGroup: "p11-asset", gate: "G7", card: "docs/tasks/WBV2-P11-003.md", behavior: "Extend the real Asset Main path from append to link, override, reload, and missing-library boundaries.", outputs: ["asset ownership receipt", "negative matrix", "manifest"], acceptance: ["source ownership is preserved", "override is local and hash-bound", "reload revision is checked", "missing source remains explicit"], status: "planned", ready: false, queueMutationAllowed: false },
|
||||
{ id: "WBV2-P11-004", phase: "P11", title: "recompute_engine_module_gate", kind: "enabling", owner: "RELEASE", dependsOn: ["WBV2-P11-003"], parityId: null, implementationClass: "LOCAL_BOUNDED", parallelGroup: "p11-release", gate: "G8", card: "docs/tasks/WBV2-P11-004.md", behavior: "Recompute engine-bound module parity from P10 and P11 receipts without claiming whole-inventory completion.", outputs: ["engine module gate", "limited release declaration", "manifest"], acceptance: ["only engine-bound claims are emitted", "inventory remainder is explicit", "provenance epoch 2 remains authorized rebaseline only", "full historical reproduction remains false"], status: "planned", ready: false, queueMutationAllowed: false },
|
||||
];
|
||||
const plan = { ...basePlan, planId: "BLENDER_WEB_PARITY_V2_MODULE_EXPANSION_EPOCH_1", status: "ACTIVE_MODULE_EXPANSION_QUEUE", authority: "queue_reactivated_after_p10_engine_matrix", recoveryRoot: "WBV2-P11-000", parentRecoveryPlan: { path: "tests/golden/WBV2-P10-003/native-parity-task-plan.json", sha256: sha256("tests/golden/WBV2-P10-003/native-parity-task-plan.json") }, tasks: [...tasks, ...p11] };
|
||||
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true });
|
||||
fs.writeFileSync(absolute(planPath), `${JSON.stringify(plan, null, 2)}\n`);
|
||||
const report = { schemaVersion: 1, task: "WBV2-P11-000", operation: "AUTHORIZE_MODULE_EXPANSION_CONTINUATION", status: "PASS", parent: { task: p10.task, manifest: p10ManifestPath, manifestSha256: sha256(p10ManifestPath), previousDecision: p10Report.operation, fullHistoricalReproduction: p10Report.assertions.historicalReproduction }, continuation: { root: "WBV2-P11-000", firstTask: "WBV2-P11-001", plannedTasks: 5, scope: ["MESH_TOPOLOGY", "MODIFIER_PARAMETER_APPLY", "ASSET_LINK_OVERRIDE_RELOAD", "ENGINE_MODULE_GATE"], browser: "chromium", nativeEngineAlreadyBound: true }, policy: { historicalEvidencePreserved: true, authorizedRebaselineOnly: true, engineClaimsEvidenceBound: true, fullHistoricalReproduction: false, inventoryRemainderExplicit: true }, nextTask: "WBV2-P11-001" };
|
||||
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(report, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P11-000.md"), `# WBV2-P11-000: module expansion continuation root\n\n- task: WBV2-P11-000\n- parent: WBV2-P10-003\n- status: done\n- gap: workflow:authorize_module_expansion_continuation\n- ownerFamily: PROGRAM\n- targetImplementationClass: LOCAL_BOUNDED\n\n## 目标\n\nAuthorize module expansion after P10 proved the compiled native Blender/WASM engine path. P11 only advances engine-bound Mesh, Modifier, and Asset behavior; it does not claim complete Blender parity or historical byte reproduction.\n\n## 验收\n\n- \`node tools/web/generate-wbv2-module-expansion-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-P11-000/\`\n- Manifest: \`tests/golden/WBV2-P11-000/manifest.json\`\n- Rollback: restore P10-003 as queue parent without rewriting P7-P10 evidence.\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P11-001.md"), `# WBV2-P11-001: Mesh topology operation family\n\n- task: WBV2-P11-001\n- parent: WBV2-P11-000\n- status: in_progress\n- gap: workflow:mesh_topology_operation_family\n- ownerFamily: MESH\n- targetImplementationClass: LOCAL_EXACT\n\n## 目标\n\nExecute merge, dissolve, extrude, inset, bevel, and loop-cut through the real compiled WebEngine WASM Main and preserve each result through save/reopen.\n\n## 输入与范围\n\n- Mesh fixture: \`tests/files/web/generated/WBV2-P2-003-MESH.EDIT_CORE.blend\`\n- Desktop oracle: \`tests/golden/WBV2-P2-003/mesh-edit-desktop-report.json\`\n- WASM source report: \`tests/golden/WBV2-P2-003/mesh-edit-report.json\`\n- Client: \`web/app/src/engine-client/WebEngineClient.ts\`\n- Test: \`web/tests/e2e/wbv2-mesh-topology-production.spec.ts\`\n\n## 验收\n\n- \`npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-mesh-topology-production.spec.ts\`\n- \`node tools/web/generate-wbv2-mesh-topology-receipt.mjs --write\`\n- \`node tools/web/check-task-context.mjs --task WBV2-P11-001 --write\`\n\nMalformed or unsupported operation, invalid selection, stale revision, non-Chromium execution, non-exact save/reopen, or missing Main mutation must keep in_progress and must not advance nextTask.\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P11-001/\`\n- Status: \`docs/status/WBV2-P11-001.md\`\n- Manifest: \`tests/golden/WBV2-P11-001/manifest.json\`\n- Rollback: restore P11-000 as queue parent without modifying P10 evidence.\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P11-002.md"), `# WBV2-P11-002: Modifier parameter and apply family\n\n- task: WBV2-P11-002\n- parent: WBV2-P11-001\n- status: planned\n- gap: workflow:modifier_parameter_apply_family\n- ownerFamily: MODIFIER\n- targetImplementationClass: LOCAL_EXACT\n\n## 目标\n\nExtend the real Modifier Main path from enable/disable to bounded parameter and apply transactions.\n\n## 输入与范围\n\n- Modifier fixture: \`tests/files/web/generated/WBV2-P4-001-MODIFIER.DECLARED_SLICES.blend\`\n- Existing native receipt: \`tests/golden/WBV2-P10-002/native-engine-receipt-report.json\`\n- Modifier protocol: \`blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp\`\n\n## 验收\n\n- \`npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-modifier-parameter-production.spec.ts\`\n- \`node tools/web/generate-wbv2-modifier-parameter-receipt.mjs --write\`\n- \`node tools/web/check-task-context.mjs --task WBV2-P11-002 --write\`\n\nMalformed, unsupported modifier, stale revision, failed apply, non-exact save/reopen, or missing evaluated Main mutation must keep in_progress and must not advance nextTask.\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P11-002/\`\n- Manifest: \`tests/golden/WBV2-P11-002/manifest.json\`\n- Rollback: restore P11-001 as queue parent without modifying Mesh evidence.\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P11-003.md"), `# WBV2-P11-003: Asset link, override, and reload family\n\n- task: WBV2-P11-003\n- parent: WBV2-P11-002\n- status: planned\n- gap: workflow:asset_link_override_reload_family\n- ownerFamily: ASSET\n- targetImplementationClass: LOCAL_EXACT\n\n## 目标\n\nExtend the real Asset Main path from append to link, local override, reload, and missing-library boundaries.\n\n## 输入与范围\n\n- Asset fixture: \`tests/files/web/generated/WBV2-P3-005-ASSET.LIBRARY_OPERATIONS.blend\`\n- Source library: \`tests/files/web/generated/WBV2P3005Library.blend\`\n- Existing append receipt: \`tests/golden/WBV2-P10-002/native-engine-receipt-report.json\`\n\n## 验收\n\n- \`npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-asset-link-override-production.spec.ts\`\n- \`node tools/web/generate-wbv2-asset-link-override-receipt.mjs --write\`\n- \`node tools/web/check-task-context.mjs --task WBV2-P11-003 --write\`\n\nMalformed binding, stale source revision, ownership violation, missing resource, non-Chromium execution, or non-exact save/reopen must keep in_progress and must not advance nextTask.\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P11-003/\`\n- Status: \`docs/status/WBV2-P11-003.md\`\n- Manifest: \`tests/golden/WBV2-P11-003/manifest.json\`\n- Rollback: restore P11-002 as queue parent without modifying Mesh or Modifier evidence.\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P11-004.md"), `# WBV2-P11-004: engine module parity gate\n\n- task: WBV2-P11-004\n- parent: WBV2-P11-003\n- status: planned\n- gap: workflow:recompute_engine_module_gate\n- ownerFamily: RELEASE\n- targetImplementationClass: LOCAL_BOUNDED\n\n## 目标\n\nRecompute engine-bound module claims from P10 and P11 receipts without claiming whole-inventory completion.\n\n## 输入与范围\n\n- P10 engine receipt: \`tests/golden/WBV2-P10-002/native-engine-receipt-report.json\`\n- P10 module matrix: \`tests/golden/WBV2-P10-003/module-matrix-receipt-report.json\`\n- P11 Mesh/Modifier/Asset receipts\n- Provenance approval: \`docs/status/M12-PROVENANCE-EPOCH-2-APPROVAL.json\`\n\n## 验收\n\n- \`node tools/web/generate-wbv2-engine-module-gate.mjs --write\`\n- \`node tools/web/check-task-context.mjs --task WBV2-P11-004 --write\`\n\nMissing receipt, hash drift, unsupported browser, false inventory completion, false historical reproduction, or undeclared capability claim must keep in_progress and must not advance nextTask.\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P11-004/\`\n- Status: \`docs/status/WBV2-P11-004.md\`\n- Manifest: \`tests/golden/WBV2-P11-004/manifest.json\`\n- Rollback: restore P11-003 as queue parent without modifying engine receipts.\n`);
|
||||
fs.writeFileSync(absolute(rootStatusPath), `# WBV2-P11-000 status\n\n- task: \`WBV2-P11-000\`; parent: \`WBV2-P10-003\`; status: \`done\`\n- nextTask: \`WBV2-P11-001\`\n\nModule expansion is authorized after P10 bound the compiled Blender native/WASM engine. P11 remains evidence-bound, Chromium-only, and explicit about the inventory remainder and authorized provenance baseline.\n`);
|
||||
|
||||
// Add an authorized continuation to the terminal P10 manifest without changing
|
||||
// its completed matrix evidence or historical classification.
|
||||
p10.nextTask = "WBV2-P11-000";
|
||||
p10.continuation = { authorized: true, root: "WBV2-P11-000", scope: "MODULE_EXPANSION" };
|
||||
p10Report.nextTask = "WBV2-P11-000";
|
||||
p10Report.policy = { ...(p10Report.policy ?? {}), terminalQueuePointer: false, authorizedContinuation: "WBV2-P11-000" };
|
||||
fs.writeFileSync(absolute(p10ReportPath), `${JSON.stringify(p10Report, null, 2)}\n`);
|
||||
const currentP10Status = read(p10StatusPath).trim();
|
||||
fs.writeFileSync(absolute(p10StatusPath), currentP10Status.includes("authorized continuation: `WBV2-P11-000`") ? `${currentP10Status}\n` : `${currentP10Status}\n- authorized continuation: \`WBV2-P11-000\`\n\nModule expansion may continue under a new manifest root. This does not change the P10 evidence or the authorized-rebaseline-only release scope.\n`);
|
||||
fs.writeFileSync(absolute(p10ManifestPath), `${JSON.stringify(p10, null, 2)}\n`);
|
||||
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P10-003", "--write"], { cwd: root, stdio: "pipe" });
|
||||
p10.artifacts = Object.fromEntries(Object.entries(p10.artifacts).map(([name, artifact]) => [name, { ...artifact, sha256: sha256(artifact.path) }]));
|
||||
fs.writeFileSync(absolute(p10ManifestPath), `${JSON.stringify(p10, null, 2)}\n`);
|
||||
|
||||
const artifactPaths = { parentManifest: p10ManifestPath, parentReport: p10ReportPath, approval: "docs/status/M12-PROVENANCE-EPOCH-2-APPROVAL.json", plan: planPath, report: reportPath, rootCard: "docs/tasks/WBV2-P11-000.md", rootStatus: rootStatusPath, activeCard: "docs/tasks/WBV2-P11-001.md" };
|
||||
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
|
||||
const manifest = { schemaVersion: 1, task: "WBV2-P11-000", parentTask: "WBV2-P10-003", operation: "AUTHORIZE_MODULE_EXPANSION_CONTINUATION", status: "done", enablingTask: true, parityStateChange: false, artifacts, assertions: { p10EvidencePreserved: true, nativeEngineAlreadyBound: true, moduleExpansionScope: ["MESH_TOPOLOGY", "MODIFIER_PARAMETER_APPLY", "ASSET_LINK_OVERRIDE_RELOAD"], authorizedRebaselineOnly: true, fullHistoricalReproduction: false }, nextTask: "WBV2-P11-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-P11-001` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P11-000/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P11-001.md`](tasks/WBV2-P11-001.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
// Keep the human-facing continuation snapshot aligned with the authoritative
|
||||
// queue; the queue and parent manifest remain the machine sources of truth.
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P11-001` |")
|
||||
.replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P11-000/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P11-001.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P11-002` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-mesh-topology-production.spec.ts` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write("wbv2-module-expansion-root-ok root=WBV2-P11-000 next=WBV2-P11-001 scope=MESH_TOPOLOGY,MODIFIER_PARAMETER_APPLY,ASSET_LINK_OVERRIDE_RELOAD\n");
|
||||
Reference in New Issue
Block a user