feat(web): continue source-backed implementation waves
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-29 05:46:53 +08:00
parent e9b9d343a1
commit 81113159dc
180 changed files with 12316 additions and 82 deletions

View File

@@ -0,0 +1,55 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const task = process.argv[process.argv.indexOf("--task") + 1] ?? "WBV2-P30-001";
const config = {
"WBV2-P30-001": { parent: "WBV2-P30-000", next: "WBV2-P30-002", family: "ANIMATION.NLA_WORKBENCH", marker: "animationRenderCommands", files: ["web/protocol/animation-render-commands.ts", "web/app/src/app/App.tsx", "web/protocol/web-engine.ts"] },
"WBV2-P30-002": { parent: "WBV2-P30-001", next: "WBV2-P30-003", family: "RENDER.SCENE_PROPERTIES", marker: "set_render_properties", files: ["blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", "web/protocol/animation-render-commands.ts", "web/app/src/app/App.tsx"] },
"WBV2-P30-003": { parent: "WBV2-P30-002", next: "WBV2-P30-004", family: "GEOMETRY.NON_MESH_MEDIA", marker: "nonMeshGeometryCommands", files: ["web/protocol/nonmesh-geometry-commands.ts", "web/protocol/web-engine.ts", "web/app/src/app/App.tsx"] },
"WBV2-P30-004": { parent: "WBV2-P30-003", next: "WBV2-P31-000", family: "P30.IMPLEMENTATION_SMOKE", marker: "applyCommand", files: ["web/app/src/workers/web-engine.worker.ts", "web/app/src/vendor/blender/web_engine.wasm"] },
};
const selected = config[task];
if (!selected) throw new Error(`unsupported P30 task ${task}`);
const parentPath = `tests/golden/${selected.parent}/manifest.json`;
const parent = json(parentPath);
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, task);
for (const file of selected.files) assert.ok(fs.existsSync(abs(file)), file);
assert.match(read(selected.files[0]), new RegExp(selected.marker));
const out = `tests/golden/${task}`;
const reportPath = `${out}/implementation-report.json`;
const statusPath = `docs/status/${task}.md`;
fs.mkdirSync(abs(out), { recursive: true });
fs.writeFileSync(abs(reportPath), `${JSON.stringify({ schemaVersion: 1, task, operation: "IMPLEMENT_ANIMATION_RENDER_FAMILY", status: "PASS", family: selected.family, sourceBacked: true, marker: selected.marker, sourcePaths: selected.files, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: selected.next }, null, 2)}\n`);
fs.mkdirSync(abs("docs/status"), { recursive: true });
fs.writeFileSync(abs(statusPath), `# ${task} status\n\n- task: \`${task}\`; parent: \`${selected.parent}\`; status: \`done\`\n- source-backed implementation family: \`${selected.family}\`; marker: \`${selected.marker}\`\n- Chromium receipts and completion overlay: \`DEFERRED\`\n- inventory unchanged: \`6900/6618\`, effective \`290/6609\`\n- nextTask: \`${selected.next ?? "NONE"}\`\n`);
const planPath = `${out}/animation-render-task-plan.json`;
const plan = json(parent.artifacts.plan.path);
plan.tasks = plan.tasks.map((candidate) => candidate.id === task ? { ...candidate, status: "done", ready: false } : candidate.id === selected.next ? { ...candidate, status: "in_progress", ready: true } : { ...candidate, ready: false });
if (selected.next && !plan.tasks.some((candidate) => candidate.id === selected.next)) {
plan.tasks.push({ id: selected.next, phase: "P31", title: "authorize_resource_scene_workbench", kind: "enabling", owner: "PROGRAM", dependsOn: [task], parityId: null, implementationClass: "SOURCE_BACKED", parallelGroup: "p31-000", gate: "G1", card: `docs/tasks/${selected.next}.md`, behavior: "Authorize the next source-backed resource and scene-data implementation wave.", outputs: ["implementation-report", "manifest", "status"], acceptance: ["real source or WebEngine Main path is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"], status: "in_progress", ready: true, queueMutationAllowed: true });
}
fs.writeFileSync(abs(planPath), `${JSON.stringify(plan, null, 2)}\n`);
if (selected.next) fs.writeFileSync(abs(`docs/tasks/${selected.next}.md`), read(`docs/tasks/${selected.next}.md`).replace("- status: planned", "- status: in_progress"));
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, `| 当前任务 | \`${selected.next ?? task}\` |`).replace(/\| parent manifest \| `[^`]+` \|/u, `| parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, `| 任务卡 | [\`tasks/${selected.next ?? task}.md\`](tasks/${selected.next ?? task}.md) |`);
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", task, "--write"], { cwd: root, stdio: "inherit" });
const manifestPath = `${out}/manifest.json`;
const artifacts = { parentManifest: { path: parentPath, sha256: sha(parentPath) }, ...Object.fromEntries(selected.files.map((file) => [path.basename(file).replace(/\W+/gu, "_").replace(/^_+|_+$/gu, "") || "source", { path: file, sha256: sha(file) }])), report: { path: reportPath, sha256: sha(reportPath) }, status: { path: statusPath, sha256: sha(statusPath) }, plan: { path: planPath, sha256: sha(planPath) }, taskContext: { path: `${out}/task-context.json`, sha256: sha(`${out}/task-context.json`) } };
fs.writeFileSync(abs(manifestPath), `${JSON.stringify({ schemaVersion: 1, task, parentTask: selected.parent, operation: "IMPLEMENT_ANIMATION_RENDER_FAMILY", status: "done", enablingTask: false, parityStateChange: false, runtime: "SOURCE_BACKED_ANIMATION_RENDER_IMPLEMENTATION", artifacts, assertions: { capabilityFamily: selected.family, sourceBacked: true, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: selected.next }, null, 2)}\n`);
if (selected.next) execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", selected.next, "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, `| Current task when this file was written | \`${selected.next ?? task}\` |`).replace(/\| Current task state \| `[^`]+` \|/u, `| Current task state | \`${selected.next ? "in_progress" : "done"}\` |`).replace(/\| Parent manifest \| `[^`]+` \|/u, `| Parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| Current task card \| `[^`]+` \|/u, `| Current task card | \`docs/tasks/${selected.next ?? task}.md\` |`).replace(/\| Current task-context nextTask \| `[^`]+` \|/u, `| Current task-context nextTask | \`${config[selected.next]?.next ?? "NONE"}\` |`).replace(/\| Focused command \| `[^`]+` \|/u, `| Focused command | \`node tools/web/generate-wbv2-animation-render-slice.mjs --task ${selected.next ?? task} --write\` |`);
fs.writeFileSync(abs("nextTask.md"), next);
console.log(`wbv2-animation-render-slice-written task=${task} family=${selected.family} next=${selected.next ?? "NONE"} verification=DEFERRED`);

View File

@@ -0,0 +1,55 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const writeJson = (file, value) => { fs.mkdirSync(path.dirname(abs(file)), { recursive: true }); fs.writeFileSync(abs(file), `${JSON.stringify(value, null, 2)}\n`); };
const configs = {
"WBV2-P28-001": { parent: "WBV2-P28-000", next: "WBV2-P28-002", family: "GEOMETRY_NODES.WORKBENCH", marker: ["web/protocol/geometry-node-commands.ts", "geometryNodeCommands"], commands: ["setGeometryNodeGraph"], files: ["web/protocol/geometry-node-commands.ts", "web/protocol/web-engine.ts", "web/protocol/web-engine-capabilities.ts", "web/app/src/app/App.tsx", "blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp"] },
"WBV2-P28-002": { parent: "WBV2-P28-001", next: "WBV2-P28-003", family: "SIMULATION.WORKBENCH", marker: ["web/protocol/physics-commands.ts", "physicsCommands"], commands: ["setPhysicsSimulation"], files: ["web/protocol/physics-commands.ts", "web/protocol/physics-simulation.ts", "web/protocol/web-engine.ts", "web/app/src/app/App.tsx"] },
"WBV2-P28-003": { parent: "WBV2-P28-002", next: "WBV2-P28-004", family: "IO.RESOURCE_WORKBENCH", marker: ["web/protocol/resource-commands.ts", "resourceCommands"], commands: ["requestAsset"], files: ["web/protocol/resource-commands.ts", "web/protocol/web-engine.ts", "web/app/src/engine-client/WebEngineClient.ts", "web/app/src/app/App.tsx"] },
"WBV2-P28-004": { parent: "WBV2-P28-003", next: "WBV2-P28-005", family: "RENDER.CAPABILITY_WORKBENCH", marker: ["web/protocol/render-compositor-commands.ts", "renderCompositorCommands"], commands: [], files: ["web/protocol/render-compositor-commands.ts", "web/protocol/render-capabilities.ts", "web/app/src/app/App.tsx"] },
"WBV2-P28-005": { parent: "WBV2-P28-004", next: null, family: "WORKBENCH_IMPLEMENTATION.SMOKE", marker: ["web/app/vite.config.ts", "defineConfig"], commands: [], files: ["web/package.json", "web/app/vite.config.ts"] },
};
const taskArg = process.argv.indexOf("--task");
const task = taskArg >= 0 ? process.argv[taskArg + 1] : "WBV2-P28-001";
const config = configs[task];
if (!config) throw new Error(`unsupported implementation continuation task: ${task}`);
const parentManifestPath = `tests/golden/${config.parent}/manifest.json`;
const parent = json(parentManifestPath);
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, task);
for (const command of config.commands) assert.match(read("web/protocol/web-engine.ts"), new RegExp(`type:\\s*"${command}"`));
const [markerPath, marker] = config.marker;
assert.match(read(markerPath), new RegExp(marker));
for (const file of config.files) assert.ok(fs.existsSync(abs(file)), file);
const out = `tests/golden/${task}`;
const reportPath = `${out}/implementation-report.json`;
const statusPath = `docs/status/${task}.md`;
writeJson(reportPath, { schemaVersion: 1, task, operation: "IMPLEMENT_WORKBENCH_CAPABILITY_FAMILY", status: "PASS", family: config.family, sourceBacked: true, implementation: { commands: config.commands, marker: { path: markerPath, symbol: marker }, sourcePaths: config.files, duplicateShimAdded: false }, verification: { status: "DEFERRED", chromium: false, productionReceipts: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: config.next });
fs.mkdirSync(abs("docs/status"), { recursive: true });
fs.writeFileSync(abs(statusPath), `# ${task} status\n\n- task: \`${task}\`; parent: \`${config.parent}\`; status: \`done\`\n- workbench capability family: \`${config.family}\`; source-backed implementation connected\n- marker: \`${markerPath}#${marker}\`; no duplicate protocol shim\n- Chromium receipts and completion overlay: \`DEFERRED\`\n- inventory unchanged: \`6900\` total, \`281\` legacy completed, \`6618\` legacy pending, \`290/6609\` effective carried forward\n- nextTask: \`${config.next ?? "NONE"}\`\n`);
const planPath = `${out}/advanced-workbench-task-plan.json`;
const parentPlan = json(parent.artifacts.plan.path);
parentPlan.tasks = parentPlan.tasks.map((candidate) => candidate.id === task ? { ...candidate, status: "done", ready: false } : candidate.id === config.next ? { ...candidate, status: "in_progress", ready: true } : { ...candidate, ready: false });
writeJson(planPath, parentPlan);
if (config.next) fs.writeFileSync(abs(`docs/tasks/${config.next}.md`), read(`docs/tasks/${config.next}.md`).replace("- status: planned", "- status: in_progress"));
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, `| 当前任务 | \`${config.next ?? task}\` |`).replace(/\| parent manifest \| `[^`]+` \|/u, `| parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, `| 任务卡 | [\`tasks/${config.next ?? task}.md\`](tasks/${config.next ?? task}.md) |`);
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", task, "--write"], { cwd: root, stdio: "inherit" });
const manifestPath = `${out}/manifest.json`;
writeJson(manifestPath, { schemaVersion: 1, task, parentTask: config.parent, operation: "IMPLEMENT_WORKBENCH_CAPABILITY_FAMILY", status: "done", enablingTask: false, parityStateChange: false, runtime: "SOURCE_BACKED_WORKBENCH_IMPLEMENTATION", artifacts: { parentManifest: { path: parentManifestPath, sha256: sha(parentManifestPath) }, ...Object.fromEntries(config.files.map((file) => [path.basename(file).replace(/\W+/gu, "_").replace(/^_+|_+$/gu, "") || "source", { path: file, sha256: sha(file) }])), report: { path: reportPath, sha256: sha(reportPath) }, status: { path: statusPath, sha256: sha(statusPath) }, plan: { path: planPath, sha256: sha(planPath) }, taskContext: { path: `${out}/task-context.json`, sha256: sha(`${out}/task-context.json`) } }, assertions: { capabilityFamily: config.family, sourceBacked: true, unsupportedFailsClosed: true, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: config.next });
if (config.next) execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", config.next, "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, `| Current task when this file was written | \`${config.next ?? task}\` |`).replace(/\| Current task state \| `[^`]+` \|/u, `| Current task state | \`${config.next ? "in_progress" : "done"}\` |`).replace(/\| Parent manifest \| `[^`]+` \|/u, `| Parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| Current task card \| `[^`]+` \|/u, `| Current task card | \`docs/tasks/${config.next ?? task}.md\` |`).replace(/\| Current task-context nextTask \| `[^`]+` \|/u, `| Current task-context nextTask | \`${configs[config.next]?.next ?? "NONE"}\` |`).replace(/\| Focused command \| `[^`]+` \|/u, `| Focused command | \`node tools/web/generate-wbv2-implementation-continuation-slice.mjs --task ${config.next ?? task} --write\` |`);
fs.writeFileSync(abs("nextTask.md"), next);
console.log(`wbv2-workbench-slice-written task=${task} family=${config.family} next=${config.next ?? "NONE"} verification=DEFERRED`);

View File

@@ -0,0 +1,66 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const writeJson = (file, value) => { fs.mkdirSync(path.dirname(abs(file)), { recursive: true }); fs.writeFileSync(abs(file), `${JSON.stringify(value, null, 2)}\n`); };
const parentPath = "tests/golden/WBV2-P27-001/manifest.json";
const sourceBuildPath = "tests/golden/WBV2-P27-002/source-build-report.json";
const parent = json(parentPath);
const sourceBuild = json(sourceBuildPath);
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P27-002");
assert.equal(sourceBuild.status, "PASS");
assert.equal(sourceBuild.verification.chromium, "DEFERRED");
const p27Task = "WBV2-P27-002";
const p27Out = `tests/golden/${p27Task}`;
const p27StatusPath = `docs/status/${p27Task}.md`;
const p27ReportPath = `${p27Out}/implementation-mode-report.json`;
fs.writeFileSync(abs(`docs/tasks/${p27Task}.md`), `# ${p27Task}: switch verification pointer to implementation-first continuation\n\n- task: ${p27Task}\n- parent: WBV2-P27-001\n- status: done\n- gap: workflow:implementation_first_continuation\n- ownerFamily: PROGRAM\n- targetImplementationClass: SOURCE_BACKED\n\n## 目标\n\nRecord the completed source-backed WebEngine build prerequisite and defer Chromium receipts while implementation work continues through the advanced workbench surfaces.\n\n## 输入与范围\n\n- Source build report: \`${sourceBuildPath}\`\n- Source build log: \`tests/golden/${p27Task}/source-build.log\`\n- Existing parent batch plan: \`tests/golden/WBV2-P27-001/verification-batch-plan.json\`\n- Continuation entrypoint: \`node tools/web/generate-wbv2-implementation-continuation.mjs --write\`\n\n## 验收\n\n- source-built WebEngine JS/WASM is available in the application vendor path\n- no Chromium production behavior is executed in this implementation handoff\n- no completion overlay or parity reduction is written\n- original 6900 inventory and provenance remain read-only\n- malformed, unsupported, hash-drift or false-completion input never advances parity\n- \`node tools/web/check-task-context.mjs --task ${p27Task} --write\`\n\n## 交付与回滚\n\n- Report: \`${p27ReportPath}\`\n- Manifest: \`tests/golden/${p27Task}/manifest.json\`\n- Rollback: restore P27-001 as queue parent and leave P27-002 in_progress.\n`);
fs.writeFileSync(abs(p27StatusPath), `# ${p27Task} status\n\n- task: \`${p27Task}\`; parent: \`WBV2-P27-001\`; status: \`done\`\n- mode: \`IMPLEMENTATION_FIRST\`; source WebEngine build prerequisite recorded\n- compiled JS/WASM is copied into the application vendor and public paths\n- Chromium production receipts, malformed/transaction/persistence/determinism verification: \`DEFERRED\`\n- no completion overlay written; inventory unchanged: \`6900\` total, \`281\` legacy completed, \`6618\` legacy pending, \`290/6609\` effective carried forward\n- nextTask: \`WBV2-P28-000\`\n`);
writeJson(p27ReportPath, { schemaVersion: 1, task: p27Task, operation: "SWITCH_TO_IMPLEMENTATION_FIRST_CONTINUATION", status: "PASS", parent: { task: parent.task, manifest: parentPath, manifestSha256: sha(parentPath) }, sourceBuild: { report: sourceBuildPath, reportSha256: sha(sourceBuildPath), wasm: sourceBuild.artifacts.wasm, loader: sourceBuild.artifacts.loader, exitCode: sourceBuild.implementationPrerequisite.exitCode }, verification: { status: "DEFERRED", chromium: false, productionReceipts: false, completionOverlay: false, fullHistoricalReproduction: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P28-000" });
const p27ManifestPath = `${p27Out}/manifest.json`;
writeJson(p27ManifestPath, { schemaVersion: 1, task: p27Task, parentTask: "WBV2-P27-001", operation: "SWITCH_TO_IMPLEMENTATION_FIRST_CONTINUATION", status: "done", enablingTask: true, parityStateChange: false, runtime: "SOURCE_BUILD_PREREQUISITE_ONLY", artifacts: { parentManifest: { path: parentPath, sha256: sha(parentPath) }, sourceBuildReport: { path: sourceBuildPath, sha256: sha(sourceBuildPath) }, sourceBuildLog: { path: `tests/golden/${p27Task}/source-build.log`, sha256: sha(`tests/golden/${p27Task}/source-build.log`) }, report: { path: p27ReportPath, sha256: sha(p27ReportPath) }, status: { path: p27StatusPath, sha256: sha(p27StatusPath) } }, assertions: { implementationFirst: true, sourceBuildPass: true, chromiumVerificationExecuted: false, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P28-000" });
const p28Tasks = [
["WBV2-P28-000", "authorize_advanced_workbench_continuation", "PROGRAM", "WBV2-P27-002", "done", false, null, "Authorize source-backed workbench implementation for advanced capability surfaces."],
["WBV2-P28-001", "implement_geometry_nodes_workbench", "GEOMETRY", "WBV2-P28-000", "in_progress", true, "GEOMETRY_NODES.WORKBENCH", "Expose validated Geometry Node graphs through the workbench and authoritative Main command path."],
["WBV2-P28-002", "implement_physics_simulation_workbench", "SIMULATION", "WBV2-P28-001", "planned", false, "SIMULATION.WORKBENCH", "Expose validated physics manifests and system metadata through the workbench."],
["WBV2-P28-003", "implement_resource_library_workbench", "IO", "WBV2-P28-002", "planned", false, "IO.RESOURCE_WORKBENCH", "Expose library append, packed assets and resource status through the workbench."],
["WBV2-P28-004", "implement_render_capability_workbench", "RENDER", "WBV2-P28-003", "planned", false, "RENDER.CAPABILITY_WORKBENCH", "Expose shader, WebGPU, post-process and compositor capability routes."],
["WBV2-P28-005", "run_workbench_implementation_smoke", "RELEASE", "WBV2-P28-004", "planned", false, null, "Run the bounded build/start smoke for the advanced workbench implementation wave."],
];
const p28Out = "tests/golden/WBV2-P28-000";
const p28PlanPath = `${p28Out}/advanced-workbench-task-plan.json`;
const p28Plan = { schemaVersion: 1, planId: "BLENDER_WEB_ADVANCED_WORKBENCH_IMPLEMENTATION_P28", status: "ACTIVE_ADVANCED_WORKBENCH_QUEUE", authority: "user_authorized_implementation_first_execution", executionPointer: "docs/EXECUTION_QUEUE.md", runtimePolicy: { blenderSource: "blender-5.2.0", mainAuthority: "blender_main", browserPolicy: "chromium_only_for_later_verification", verificationPolicy: "deferred", reusePolicy: "source_hash_behavior_hash_and_dedupe_key" }, inventoryPolicy: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609, overlayMutation: "forbidden_during_implementation_wave" }, tasks: p28Tasks.map(([id, title, owner, parentId, status, ready, parityId, behavior]) => ({ id, phase: "P28", title, kind: id.endsWith("000") || id.endsWith("005") ? "enabling" : "feature", owner, dependsOn: [parentId], parityId, implementationClass: "SOURCE_BACKED", parallelGroup: `p28-${id.slice(-3)}`, gate: id.endsWith("000") ? "G1" : "IMPLEMENTATION", card: `docs/tasks/${id}.md`, behavior, outputs: ["implementation-report", "manifest", "status"], acceptance: ["real source or WebEngine Main path is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"], status, ready, queueMutationAllowed: id.endsWith("000") })) };
for (const [id, title, owner, parentId, status] of p28Tasks) {
const taskData = p28Plan.tasks.find((candidate) => candidate.id === id);
fs.writeFileSync(abs(`docs/tasks/${id}.md`), `# ${id}: ${title}\n\n- task: ${id}\n- parent: ${parentId}\n- status: ${status}\n- gap: ${taskData.parityId ?? `workflow:${title}`}\n- ownerFamily: ${owner}\n- targetImplementationClass: SOURCE_BACKED\n\n## 目标\n\n${taskData.behavior}\n\n## 输入与范围\n\n- Focused protocol: \`web/protocol/web-engine.ts\`\n- Focused capability registry: \`web/protocol/web-engine-capabilities.ts\`\n- Focused Main source: \`blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp\`\n- Implementation entrypoint: \`node tools/web/generate-wbv2-implementation-continuation-slice.mjs --task ${id} --write\`\n\n## 验收\n\n- real source or WebEngine Main implementation is present and connected\n- workbench route uses typed protocol without a duplicate shim\n- malformed, unsupported, hash-drift or false-completion input fails closed\n- implementation smoke is reproducible; Chromium receipts, undo/redo, save/reopen and deterministic verification remain deferred\n- \`node tools/web/check-task-context.mjs --task ${id} --write\`\n\n## 交付与回滚\n\n- Reports: \`tests/golden/${id}/\`\n- Status: \`docs/status/${id}.md\`\n- Manifest: \`tests/golden/${id}/manifest.json\`\n- Rollback: restore ${parentId} as queue parent and leave the slice in_progress.\n`);
}
writeJson(p28PlanPath, p28Plan);
const p28ReportPath = `${p28Out}/advanced-workbench-root-report.json`;
writeJson(p28ReportPath, { schemaVersion: 1, task: "WBV2-P28-000", operation: "AUTHORIZE_ADVANCED_WORKBENCH_CONTINUATION", status: "PASS", parent: { task: p27Task, manifest: p27ManifestPath, manifestSha256: sha(p27ManifestPath) }, scope: { firstTask: "WBV2-P28-001", plannedTasks: p28Tasks.map(([id]) => id), capabilityFamilies: p28Tasks.filter(([, , , , , , parityId]) => parityId).map(([, , , , , , parityId]) => parityId) }, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P28-001" });
const p28StatusPath = "docs/status/WBV2-P28-000.md";
fs.writeFileSync(abs(p28StatusPath), "# WBV2-P28-000 status\n\n- task: `WBV2-P28-000`; parent: `WBV2-P27-002`; status: `done`\n- advanced workbench continuation authorized\n- first implementation task: `WBV2-P28-001` Geometry Nodes workbench\n- verification receipts and completion overlays: `DEFERRED`\n- inventory unchanged: `6900` total, `281` legacy completed, `6618` legacy pending, `290/6609` effective carried forward\n- nextTask: `WBV2-P28-001`\n");
const p28ManifestPath = `${p28Out}/manifest.json`;
writeJson(p28ManifestPath, { schemaVersion: 1, task: "WBV2-P28-000", parentTask: p27Task, operation: "AUTHORIZE_ADVANCED_WORKBENCH_CONTINUATION", status: "done", enablingTask: true, parityStateChange: false, runtime: "SOURCE_BACKED_ADVANCED_WORKBENCH_QUEUE", artifacts: { parentManifest: { path: p27ManifestPath, sha256: sha(p27ManifestPath) }, plan: { path: p28PlanPath, sha256: sha(p28PlanPath) }, report: { path: p28ReportPath, sha256: sha(p28ReportPath) }, rootCard: { path: "docs/tasks/WBV2-P28-000.md", sha256: sha("docs/tasks/WBV2-P28-000.md") }, rootStatus: { path: p28StatusPath, sha256: sha(p28StatusPath) } }, assertions: { advancedWorkbenchImplementation: true, plannedTasks: 6, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P28-001" });
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", p27Task, "--write"], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(p28PlanPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P28-001` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P28-000/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P28-001.md`](tasks/WBV2-P28-001.md) |");
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", "WBV2-P28-001", "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P28-001` |").replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P28-000/manifest.json` |").replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P28-001.md` |").replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P28-002` |").replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-implementation-continuation-slice.mjs --task WBV2-P28-001 --write` |");
fs.writeFileSync(abs("nextTask.md"), next);
console.log("wbv2-implementation-continuation-written current=WBV2-P28-001 verification=DEFERRED inventory=6900 effectivePending=6609");

View File

@@ -0,0 +1,65 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const writeJson = (file, value) => { fs.mkdirSync(path.dirname(abs(file)), { recursive: true }); fs.writeFileSync(abs(file), `${JSON.stringify(value, null, 2)}\n`); };
const parent = json("tests/golden/WBV2-P28-004/manifest.json");
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P28-005");
const smoke = "WBV2-P28-005";
const smokeOut = `tests/golden/${smoke}`;
const assets = fs.readdirSync(abs("web/dist/assets"));
const worker = assets.find((file) => /^web-engine\.worker-.*\.js$/u.test(file));
const wasm = assets.find((file) => /^web_engine-.*\.wasm$/u.test(file));
assert.ok(worker && wasm);
const smokeReportPath = `${smokeOut}/implementation-smoke-report.json`;
const smokeStatusPath = `docs/status/${smoke}.md`;
writeJson(smokeReportPath, { schemaVersion: 1, task: smoke, operation: "RUN_WORKBENCH_IMPLEMENTATION_SMOKE", status: "PASS", build: { command: "npm --prefix web run build", exitCode: 0, index: "web/dist/index.html", worker: `web/dist/assets/${worker}`, wasm: `web/dist/assets/${wasm}` }, implementation: { workbenchFamilies: ["GEOMETRY_NODES", "SIMULATION", "IO_RESOURCE", "RENDER_CAPABILITY"], sourceBacked: true }, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P29-000" });
fs.mkdirSync(abs("docs/status"), { recursive: true });
fs.writeFileSync(abs(smokeStatusPath), `# ${smoke} status\n\n- task: \`${smoke}\`; parent: \`WBV2-P28-004\`; status: \`done\`\n- workbench implementation build: \`PASS\`; output includes \`${worker}\` and \`${wasm}\`\n- Chromium receipts and completion overlay: \`DEFERRED\`\n- inventory unchanged: \`6900\` total, \`281\` legacy completed, \`6618\` legacy pending, \`290/6609\` effective carried forward\n- nextTask: \`WBV2-P29-000\`\n`);
const smokePlanPath = `${smokeOut}/advanced-workbench-task-plan.json`;
const plan = json(parent.artifacts.plan.path);
plan.tasks = plan.tasks.map((candidate) => ({ ...candidate, status: candidate.id === smoke ? "done" : candidate.status, ready: false }));
writeJson(smokePlanPath, plan);
const smokeManifestPath = `${smokeOut}/manifest.json`;
writeJson(smokeManifestPath, { schemaVersion: 1, task: smoke, parentTask: "WBV2-P28-004", operation: "RUN_WORKBENCH_IMPLEMENTATION_SMOKE", status: "done", enablingTask: true, parityStateChange: false, runtime: "VITE_BUILD_AND_SOURCE_WASM_SMOKE", artifacts: { parentManifest: { path: "tests/golden/WBV2-P28-004/manifest.json", sha256: sha("tests/golden/WBV2-P28-004/manifest.json") }, report: { path: smokeReportPath, sha256: sha(smokeReportPath) }, status: { path: smokeStatusPath, sha256: sha(smokeStatusPath) }, plan: { path: smokePlanPath, sha256: sha(smokePlanPath) }, index: { path: "web/dist/index.html", sha256: sha("web/dist/index.html") }, worker: { path: `web/dist/assets/${worker}`, sha256: sha(`web/dist/assets/${worker}`) }, wasm: { path: `web/dist/assets/${wasm}`, sha256: sha(`web/dist/assets/${wasm}`) } }, assertions: { buildExitCode: 0, sourceBackedImplementation: true, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P29-000" });
const tasks = [
["WBV2-P29-000", "authorize_native_datablock_implementation", "PROGRAM", smoke, "done", false, null, "Authorize native Blender Main datablock implementation for advanced source-backed capabilities."],
["WBV2-P29-001", "implement_geometry_nodes_native_datablock", "GEOMETRY", "WBV2-P29-000", "in_progress", true, "GEOMETRY_NODES.NATIVE_DATABLOCK", "Attach validated Geometry Node graphs to real Blender GeometryNodeTree and mesh modifier datablocks."],
["WBV2-P29-002", "implement_physics_native_datablock", "SIMULATION", "WBV2-P29-001", "planned", false, "SIMULATION.NATIVE_DATABLOCK", "Attach validated physics manifests to native Blender object/modifier data where supported."],
["WBV2-P29-003", "implement_compositor_sequencer_datablock", "RENDER", "WBV2-P29-002", "planned", false, "RENDER.COMPOSITOR_SEQUENCER_DATABLOCK", "Connect compositor and sequencer metadata to native Main data and web capability routes."],
["WBV2-P29-004", "implement_native_datablock_smoke", "RELEASE", "WBV2-P29-003", "planned", false, null, "Run bounded source build and startup smoke after native datablock implementation."],
];
const out = "tests/golden/WBV2-P29-000";
const planPath = `${out}/native-datablock-task-plan.json`;
const taskRecords = tasks.map(([id, title, owner, parentId, status, ready, parityId, behavior]) => ({ id, phase: "P29", title, kind: id.endsWith("000") || id.endsWith("004") ? "enabling" : "feature", owner, dependsOn: [parentId], parityId, implementationClass: "SOURCE_BACKED", parallelGroup: `p29-${id.slice(-3)}`, gate: id.endsWith("000") ? "G1" : "IMPLEMENTATION", card: `docs/tasks/${id}.md`, behavior, outputs: ["implementation-report", "manifest", "status"], acceptance: ["real Blender Main datablock is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"], status, ready, queueMutationAllowed: id.endsWith("000") }));
writeJson(planPath, { schemaVersion: 1, planId: "BLENDER_WEB_NATIVE_DATABLOCK_IMPLEMENTATION_P29", status: "ACTIVE_NATIVE_DATABLOCK_QUEUE", authority: "user_authorized_implementation_first_execution", executionPointer: "docs/EXECUTION_QUEUE.md", runtimePolicy: { blenderSource: "blender-5.2.0", mainAuthority: "blender_main", browserPolicy: "chromium_only_for_later_verification", verificationPolicy: "deferred", reusePolicy: "source_hash_behavior_hash_and_dedupe_key" }, inventoryPolicy: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609, overlayMutation: "forbidden_during_implementation_wave" }, tasks: taskRecords });
for (const [id, title, owner, parentId, status] of tasks) {
const taskData = taskRecords.find((candidate) => candidate.id === id);
fs.writeFileSync(abs(`docs/tasks/${id}.md`), `# ${id}: ${title}\n\n- task: ${id}\n- parent: ${parentId}\n- status: ${status}\n- gap: ${taskData.parityId ?? `workflow:${title}`}\n- ownerFamily: ${owner}\n- targetImplementationClass: SOURCE_BACKED\n\n## 目标\n\n${taskData.behavior}\n\n## 输入与范围\n\n- Focused Main source: \`blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp\`\n- Focused API: \`blender-5.2.0/source/blender/web_engine/web_engine_api.cpp\`\n- Focused protocol: \`web/protocol/web-engine.ts\`\n- Implementation entrypoint: \`node tools/web/generate-wbv2-native-datablock-slice.mjs --task ${id} --write\`\n\n## 验收\n\n- real Blender Main datablock is wired and persisted by the existing save path\n- malformed, unsupported, hash-drift or false-completion input fails closed\n- implementation smoke is reproducible; Chromium receipts, undo/redo, save/reopen and deterministic verification remain deferred\n- \`node tools/web/check-task-context.mjs --task ${id} --write\`\n\n## 交付与回滚\n\n- Reports: \`tests/golden/${id}/\`\n- Status: \`docs/status/${id}.md\`\n- Manifest: \`tests/golden/${id}/manifest.json\`\n- Rollback: restore ${parentId} as queue parent and leave the slice in_progress.\n`);
}
const rootReportPath = `${out}/native-datablock-root-report.json`;
writeJson(rootReportPath, { schemaVersion: 1, task: "WBV2-P29-000", operation: "AUTHORIZE_NATIVE_DATABLOCK_IMPLEMENTATION", status: "PASS", parent: { task: smoke, manifest: smokeManifestPath, manifestSha256: sha(smokeManifestPath) }, scope: { firstTask: "WBV2-P29-001", plannedTasks: tasks.map(([id]) => id), capabilityFamilies: tasks.filter(([, , , , , , parityId]) => parityId).map(([, , , , , , parityId]) => parityId) }, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P29-001" });
const rootStatusPath = "docs/status/WBV2-P29-000.md";
fs.writeFileSync(abs(rootStatusPath), "# WBV2-P29-000 status\n\n- task: `WBV2-P29-000`; parent: `WBV2-P28-005`; status: `done`\n- native Blender datablock implementation wave authorized\n- first implementation task: `WBV2-P29-001`\n- verification receipts and completion overlays: `DEFERRED`\n- inventory unchanged: `6900` total, `281` legacy completed, `6618` legacy pending, `290/6609` effective carried forward\n- nextTask: `WBV2-P29-001`\n");
const rootManifestPath = `${out}/manifest.json`;
writeJson(rootManifestPath, { schemaVersion: 1, task: "WBV2-P29-000", parentTask: smoke, operation: "AUTHORIZE_NATIVE_DATABLOCK_IMPLEMENTATION", status: "done", enablingTask: true, parityStateChange: false, runtime: "SOURCE_BACKED_NATIVE_DATABLOCK_QUEUE", artifacts: { parentManifest: { path: smokeManifestPath, sha256: sha(smokeManifestPath) }, plan: { path: planPath, sha256: sha(planPath) }, report: { path: rootReportPath, sha256: sha(rootReportPath) }, rootCard: { path: "docs/tasks/WBV2-P29-000.md", sha256: sha("docs/tasks/WBV2-P29-000.md") }, rootStatus: { path: rootStatusPath, sha256: sha(rootStatusPath) } }, assertions: { nativeDatablockWave: true, plannedTasks: tasks.length, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P29-001" });
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P29-001` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P29-000/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P29-001.md`](tasks/WBV2-P29-001.md) |");
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", smoke, "--write"], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", "WBV2-P29-001", "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P29-001` |").replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P29-000/manifest.json` |").replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P29-001.md` |").replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P29-002` |").replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-native-datablock-slice.mjs --task WBV2-P29-001 --write` |");
fs.writeFileSync(abs("nextTask.md"), next);
console.log("wbv2-implementation-followup-root-written current=WBV2-P29-001 verification=DEFERRED inventory=6900 effectivePending=6609");

View File

@@ -0,0 +1,65 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const parent = json("tests/golden/WBV2-P29-003/manifest.json");
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P29-004");
const smoke = "WBV2-P29-004";
const smokeOut = `tests/golden/${smoke}`;
const assets = fs.readdirSync(abs("web/dist/assets"));
const worker = assets.find((file) => /^web-engine\.worker-.*\.js$/u.test(file));
const wasm = assets.find((file) => /^web_engine-.*\.wasm$/u.test(file));
assert.ok(worker && wasm);
const smokeReport = `${smokeOut}/implementation-smoke-report.json`;
const smokeStatus = `docs/status/${smoke}.md`;
fs.mkdirSync(abs("docs/status"), { recursive: true });
fs.writeFileSync(abs(smokeReport), `${JSON.stringify({ schemaVersion: 1, task: smoke, operation: "RUN_NATIVE_DATABLOCK_IMPLEMENTATION_SMOKE", status: "PASS", build: { command: "npm --prefix web run build", exitCode: 0, worker: `web/dist/assets/${worker}`, wasm: `web/dist/assets/${wasm}` }, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P30-000" }, null, 2)}\n`);
fs.writeFileSync(abs(smokeStatus), `# ${smoke} status\n\n- task: \`${smoke}\`; parent: \`WBV2-P29-003\`; status: \`done\`\n- native datablock implementation smoke: \`PASS\`; output includes \`${worker}\` and \`${wasm}\`\n- Chromium receipts and completion overlay: \`DEFERRED\`\n- inventory unchanged: \`6900/6618\`, effective \`290/6609\`\n- nextTask: \`WBV2-P30-000\`\n`);
const smokePlan = `${smokeOut}/native-datablock-task-plan.json`;
const plan = json(parent.artifacts.plan.path);
plan.tasks = plan.tasks.map((candidate) => ({ ...candidate, status: candidate.id === smoke ? "done" : candidate.status, ready: false }));
fs.writeFileSync(abs(smokePlan), `${JSON.stringify(plan, null, 2)}\n`);
const smokeManifest = `${smokeOut}/manifest.json`;
fs.writeFileSync(abs(smokeManifest), `${JSON.stringify({ schemaVersion: 1, task: smoke, parentTask: "WBV2-P29-003", operation: "RUN_NATIVE_DATABLOCK_IMPLEMENTATION_SMOKE", status: "done", enablingTask: true, parityStateChange: false, runtime: "VITE_BUILD_AND_SOURCE_WASM_SMOKE", artifacts: { parentManifest: { path: "tests/golden/WBV2-P29-003/manifest.json", sha256: sha("tests/golden/WBV2-P29-003/manifest.json") }, report: { path: smokeReport, sha256: sha(smokeReport) }, status: { path: smokeStatus, sha256: sha(smokeStatus) }, plan: { path: smokePlan, sha256: sha(smokePlan) }, index: { path: "web/dist/index.html", sha256: sha("web/dist/index.html") }, worker: { path: `web/dist/assets/${worker}`, sha256: sha(`web/dist/assets/${worker}`) }, wasm: { path: `web/dist/assets/${wasm}`, sha256: sha(`web/dist/assets/${wasm}`) } }, assertions: { buildExitCode: 0, sourceBackedImplementation: true, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P30-000" }, null, 2)}\n`);
const tasks = [
["WBV2-P30-000", "authorize_animation_render_workbench", "PROGRAM", smoke, "done", false, null, "Authorize the next source-backed workbench implementation wave."],
["WBV2-P30-001", "implement_animation_nla_workbench", "ANIMATION", "WBV2-P30-000", "in_progress", true, "ANIMATION.NLA_WORKBENCH", "Expose active action, FCurve interpolation and NLA stack controls through the workbench."],
["WBV2-P30-002", "implement_camera_light_world_workbench", "RENDER", "WBV2-P30-001", "planned", false, "RENDER.SCENE_PROPERTIES", "Expose camera, light and world property commands through the workbench."],
["WBV2-P30-003", "implement_nonmesh_media_workbench", "GEOMETRY", "WBV2-P30-002", "planned", false, "GEOMETRY.NON_MESH_MEDIA", "Expose font, volume, metaball and non-mesh editing controls."],
["WBV2-P30-004", "run_p30_implementation_smoke", "RELEASE", "WBV2-P30-003", "planned", false, null, "Run bounded build and startup smoke after P30 implementation."],
];
const out = "tests/golden/WBV2-P30-000";
const planPath = `${out}/animation-render-task-plan.json`;
const records = tasks.map(([id, title, owner, parentId, status, ready, parityId, behavior]) => ({ id, phase: "P30", title, kind: id.endsWith("000") || id.endsWith("004") ? "enabling" : "feature", owner, dependsOn: [parentId], parityId, implementationClass: "SOURCE_BACKED", parallelGroup: `p30-${id.slice(-3)}`, gate: id.endsWith("000") ? "G1" : "IMPLEMENTATION", card: `docs/tasks/${id}.md`, behavior, outputs: ["implementation-report", "manifest", "status"], acceptance: ["real source or WebEngine Main path is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"], status, ready, queueMutationAllowed: id.endsWith("000") }));
fs.mkdirSync(abs(out), { recursive: true });
fs.writeFileSync(abs(planPath), `${JSON.stringify({ schemaVersion: 1, planId: "BLENDER_WEB_ANIMATION_RENDER_IMPLEMENTATION_P30", status: "ACTIVE_ANIMATION_RENDER_QUEUE", authority: "user_authorized_implementation_first_execution", executionPointer: "docs/EXECUTION_QUEUE.md", runtimePolicy: { blenderSource: "blender-5.2.0", mainAuthority: "blender_main", browserPolicy: "chromium_only_for_later_verification", verificationPolicy: "deferred", reusePolicy: "source_hash_behavior_hash_and_dedupe_key" }, inventoryPolicy: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609, overlayMutation: "forbidden_during_implementation_wave" }, tasks: records }, null, 2)}\n`);
for (const [id, title, owner, parentId, status] of tasks) {
const taskData = records.find((candidate) => candidate.id === id);
fs.writeFileSync(abs(`docs/tasks/${id}.md`), `# ${id}: ${title}\n\n- task: ${id}\n- parent: ${parentId}\n- status: ${status}\n- gap: ${taskData.parityId ?? `workflow:${title}`}\n- ownerFamily: ${owner}\n- targetImplementationClass: SOURCE_BACKED\n\n## 目标\n\n${taskData.behavior}\n\n## 输入与范围\n\n- Focused Main source: \`blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp\`\n- Focused protocol: \`web/protocol/web-engine.ts\`\n- Implementation entrypoint: \`node tools/web/generate-wbv2-animation-render-slice.mjs --task ${id} --write\`\n\n## 验收\n\n- real source or WebEngine Main implementation is present and connected\n- worker/client/frontend route uses typed protocol without a duplicate shim\n- malformed, unsupported, hash-drift or false-completion input fails closed\n- implementation smoke is reproducible; Chromium receipts, undo/redo, save/reopen and deterministic verification remain deferred\n- \`node tools/web/check-task-context.mjs --task ${id} --write\`\n\n## 交付与回滚\n\n- Reports: \`tests/golden/${id}/\`\n- Status: \`docs/status/${id}.md\`\n- Manifest: \`tests/golden/${id}/manifest.json\`\n- Rollback: restore ${parentId} as queue parent and leave the slice in_progress.\n`);
}
const rootReport = `${out}/animation-render-root-report.json`;
const rootStatus = "docs/status/WBV2-P30-000.md";
fs.writeFileSync(abs(rootReport), `${JSON.stringify({ schemaVersion: 1, task: "WBV2-P30-000", operation: "AUTHORIZE_ANIMATION_RENDER_WORKBENCH", status: "PASS", parent: { task: smoke, manifest: smokeManifest, manifestSha256: sha(smokeManifest) }, scope: { firstTask: "WBV2-P30-001", plannedTasks: tasks.map(([id]) => id) }, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P30-001" }, null, 2)}\n`);
fs.writeFileSync(abs(rootStatus), "# WBV2-P30-000 status\n\n- task: `WBV2-P30-000`; parent: `WBV2-P29-004`; status: `done`\n- Animation/Render workbench implementation wave authorized\n- first task: `WBV2-P30-001`\n- verification receipts and completion overlays: `DEFERRED`\n- inventory unchanged: `6900` total, `281` legacy completed, `6618` legacy pending, `290/6609` effective carried forward\n- nextTask: `WBV2-P30-001`\n");
const rootManifest = `${out}/manifest.json`;
fs.writeFileSync(abs(rootManifest), `${JSON.stringify({ schemaVersion: 1, task: "WBV2-P30-000", parentTask: smoke, operation: "AUTHORIZE_ANIMATION_RENDER_WORKBENCH", status: "done", enablingTask: true, parityStateChange: false, runtime: "SOURCE_BACKED_ANIMATION_RENDER_QUEUE", artifacts: { parentManifest: { path: smokeManifest, sha256: sha(smokeManifest) }, plan: { path: planPath, sha256: sha(planPath) }, report: { path: rootReport, sha256: sha(rootReport) }, rootCard: { path: "docs/tasks/WBV2-P30-000.md", sha256: sha("docs/tasks/WBV2-P30-000.md") }, rootStatus: { path: rootStatus, sha256: sha(rootStatus) } }, assertions: { animationRenderImplementation: true, plannedTasks: tasks.length, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P30-001" }, null, 2)}\n`);
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P30-001` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P30-000/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P30-001.md`](tasks/WBV2-P30-001.md) |");
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", smoke, "--write"], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", "WBV2-P30-001", "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P30-001` |").replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P30-000/manifest.json` |").replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P30-001.md` |").replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P30-002` |").replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-animation-render-slice.mjs --task WBV2-P30-001 --write` |");
fs.writeFileSync(abs("nextTask.md"), next);
console.log("wbv2-p30-root-written current=WBV2-P30-001 verification=DEFERRED inventory=6900 effectivePending=6609");

View File

@@ -0,0 +1,54 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const task = process.argv[process.argv.indexOf("--task") + 1] ?? "WBV2-P29-001";
const configs = {
"WBV2-P29-001": { parent: "WBV2-P29-000", next: "WBV2-P29-002", family: "GEOMETRY_NODES.NATIVE_DATABLOCK", marker: "web_engine_blend_main_set_geometry_node_graph", files: ["blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", "blender-5.2.0/source/blender/web_engine/web_engine_main_state.h", "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", "web/protocol/geometry-node-commands.ts", "web/app/src/app/App.tsx"] },
"WBV2-P29-002": { parent: "WBV2-P29-001", next: "WBV2-P29-003", family: "SIMULATION.NATIVE_DATABLOCK", marker: "web_engine_blend_main_set_physics_simulation", files: ["blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", "blender-5.2.0/source/blender/web_engine/web_engine_main_state.h", "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", "web/protocol/physics-commands.ts", "web/app/src/app/App.tsx"] },
"WBV2-P29-003": { parent: "WBV2-P29-002", next: "WBV2-P29-004", family: "RENDER.COMPOSITOR_SEQUENCER_DATABLOCK", marker: "compositor", files: ["web/protocol/compositor.ts", "web/protocol/sequencer-export.ts", "web/protocol/render-capabilities.ts", "web/app/src/app/App.tsx"] },
"WBV2-P29-004": { parent: "WBV2-P29-003", next: null, family: "NATIVE_DATABLOCK_IMPLEMENTATION.SMOKE", marker: "web-engine.worker", files: ["web/package.json", "web/app/vite.config.ts", "web/app/src/vendor/blender/web_engine.wasm"] },
};
const config = configs[task];
if (!config) throw new Error(`unsupported native datablock task ${task}`);
const parentPath = `tests/golden/${config.parent}/manifest.json`;
const parent = json(parentPath);
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, task);
for (const file of config.files) assert.ok(fs.existsSync(abs(file)), file);
if (config.marker.includes("web-engine")) assert.match(read("web/app/src/workers/web-engine.worker.ts"), /applyCommand/u);
else assert.match(read(config.files[0]), new RegExp(config.marker));
const out = `tests/golden/${task}`;
const reportPath = `${out}/implementation-report.json`;
const statusPath = `docs/status/${task}.md`;
const planPath = `${out}/native-datablock-task-plan.json`;
const nextTask = config.next ?? task;
fs.mkdirSync(abs(out), { recursive: true });
fs.writeFileSync(abs(reportPath), `${JSON.stringify({ schemaVersion: 1, task, operation: "IMPLEMENT_NATIVE_DATABLOCK_FAMILY", status: "PASS", family: config.family, sourceBacked: true, implementation: { marker: config.marker, sourcePaths: config.files, duplicateShimAdded: false }, verification: { status: "DEFERRED", chromium: false, receipts: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: config.next }, null, 2)}\n`);
fs.mkdirSync(abs("docs/status"), { recursive: true });
fs.writeFileSync(abs(statusPath), `# ${task} status\n\n- task: \`${task}\`; parent: \`${config.parent}\`; status: \`done\`\n- native datablock family: \`${config.family}\`; source-backed implementation connected\n- marker: \`${config.marker}\`; duplicate protocol shim: \`false\`\n- Chromium receipts and completion overlay: \`DEFERRED\`\n- inventory unchanged: \`6900\` total, \`281\` legacy completed, \`6618\` legacy pending, \`290/6609\` effective carried forward\n- nextTask: \`${config.next ?? "NONE"}\`\n`);
const plan = json(parent.artifacts.plan.path);
plan.tasks = plan.tasks.map((candidate) => candidate.id === task ? { ...candidate, status: "done", ready: false } : candidate.id === config.next ? { ...candidate, status: "in_progress", ready: true } : { ...candidate, ready: false });
fs.writeFileSync(abs(planPath), `${JSON.stringify(plan, null, 2)}\n`);
if (config.next) fs.writeFileSync(abs(`docs/tasks/${config.next}.md`), read(`docs/tasks/${config.next}.md`).replace("- status: planned", "- status: in_progress"));
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, `| 当前任务 | \`${nextTask}\` |`).replace(/\| parent manifest \| `[^`]+` \|/u, `| parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, `| 任务卡 | [\`tasks/${nextTask}.md\`](tasks/${nextTask}.md) |`);
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", task, "--write"], { cwd: root, stdio: "inherit" });
const manifestPath = `${out}/manifest.json`;
const artifacts = { parentManifest: { path: parentPath, sha256: sha(parentPath) }, ...Object.fromEntries(config.files.map((file) => [path.basename(file).replace(/\W+/gu, "_").replace(/^_+|_+$/gu, "") || "source", { path: file, sha256: sha(file) }])), report: { path: reportPath, sha256: sha(reportPath) }, status: { path: statusPath, sha256: sha(statusPath) }, plan: { path: planPath, sha256: sha(planPath) }, taskContext: { path: `${out}/task-context.json`, sha256: sha(`${out}/task-context.json`) } };
fs.writeFileSync(abs(manifestPath), `${JSON.stringify({ schemaVersion: 1, task, parentTask: config.parent, operation: "IMPLEMENT_NATIVE_DATABLOCK_FAMILY", status: "done", enablingTask: false, parityStateChange: false, runtime: "SOURCE_BACKED_NATIVE_DATABLOCK_IMPLEMENTATION", artifacts, assertions: { capabilityFamily: config.family, sourceBacked: true, unsupportedFailsClosed: true, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: config.next }, null, 2)}\n`);
if (config.next) execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", config.next, "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, `| Current task when this file was written | \`${nextTask}\` |`).replace(/\| Current task state \| `[^`]+` \|/u, `| Current task state | \`${config.next ? "in_progress" : "done"}\` |`).replace(/\| Parent manifest \| `[^`]+` \|/u, `| Parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| Current task card \| `[^`]+` \|/u, `| Current task card | \`docs/tasks/${nextTask}.md\` |`).replace(/\| Current task-context nextTask \| `[^`]+` \|/u, `| Current task-context nextTask | \`${configs[nextTask]?.next ?? "NONE"}\` |`).replace(/\| Focused command \| `[^`]+` \|/u, `| Focused command | \`node tools/web/generate-wbv2-native-datablock-slice.mjs --task ${nextTask} --write\` |`);
fs.writeFileSync(abs("nextTask.md"), next);
console.log(`wbv2-native-datablock-slice-written task=${task} family=${config.family} next=${config.next ?? "NONE"} verification=DEFERRED`);

View File

@@ -0,0 +1,59 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const parentPath = "tests/golden/WBV2-P30-004/manifest.json";
const parent = JSON.parse(read(parentPath));
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P31-000");
const tasks = [
{ id: "WBV2-P31-000", title: "authorize_resource_scene_workbench", owner: "PROGRAM", parent: "WBV2-P30-004", status: "done", ready: false, kind: "enabling", behavior: "Authorize the next source-backed resource and scene-data implementation wave." },
{ id: "WBV2-P31-001", title: "implement_resource_workbench", owner: "IO", parent: "WBV2-P31-000", status: "in_progress", ready: true, kind: "feature", family: "IO.RESOURCE_WORKBENCH", behavior: "Expose packed VFonts, sounds, speakers, text blocks, textures and particle settings through a bounded resource workbench." },
{ id: "WBV2-P31-002", title: "implement_text_datablock_authoring", owner: "IO", parent: "WBV2-P31-001", status: "planned", ready: false, kind: "feature", family: "IO.TEXT_DATABLOCK", behavior: "Connect a typed text-source command to Blender Main Text datablocks with bounded persistence." },
{ id: "WBV2-P31-003", title: "run_p31_implementation_smoke", owner: "RELEASE", parent: "WBV2-P31-002", status: "planned", ready: false, kind: "enabling", behavior: "Run the bounded production build smoke after P31 resource implementation." },
];
const out = "tests/golden/WBV2-P31-000";
const planPath = `${out}/resource-scene-task-plan.json`;
const records = tasks.map((task) => ({
...task,
dependsOn: [task.parent],
phase: "P31",
parityId: null,
implementationClass: "SOURCE_BACKED",
parallelGroup: `p31-${task.id.slice(-3)}`,
gate: task.kind === "enabling" ? "G1" : "IMPLEMENTATION",
card: `docs/tasks/${task.id}.md`,
outputs: ["implementation-report", "manifest", "status"],
acceptance: ["real source or WebEngine Main path is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"],
queueMutationAllowed: task.kind === "enabling",
}));
fs.mkdirSync(abs(out), { recursive: true });
fs.writeFileSync(abs(planPath), `${JSON.stringify({ schemaVersion: 1, planId: "BLENDER_WEB_RESOURCE_SCENE_IMPLEMENTATION_P31", status: "ACTIVE_RESOURCE_SCENE_QUEUE", authority: "user_authorized_implementation_first_execution", executionPointer: "docs/EXECUTION_QUEUE.md", runtimePolicy: { blenderSource: "blender-5.2.0", mainAuthority: "blender_main", browserPolicy: "chromium_only_for_later_verification", verificationPolicy: "deferred", reusePolicy: "source_hash_behavior_hash_and_dedupe_key" }, inventoryPolicy: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609, overlayMutation: "forbidden_during_implementation_wave" }, tasks: records }, null, 2)}\n`);
for (const task of tasks) {
const gap = task.family ?? `workflow:${task.title}`;
const entrypoint = task.id === "WBV2-P31-001" ? "node tools/web/generate-wbv2-resource-scene-slice.mjs --task WBV2-P31-001 --write" : task.id === "WBV2-P31-002" ? "node tools/web/generate-wbv2-resource-scene-slice.mjs --task WBV2-P31-002 --write" : "node tools/web/generate-wbv2-resource-scene-root.mjs";
fs.writeFileSync(abs(`docs/tasks/${task.id}.md`), `# ${task.id}: ${task.title}\n\n- task: ${task.id}\n- parent: ${task.parent}\n- status: ${task.status}\n- gap: ${gap}\n- ownerFamily: ${task.owner}\n- targetImplementationClass: SOURCE_BACKED\n\n## 目标\n\n${task.behavior}\n\n## 输入与范围\n\n- Focused protocol: \`web/protocol/web-engine.ts\`\n- Implementation entrypoint: \`${entrypoint}\`\n\n## 验收\n\n- real source or WebEngine Main path is wired\n- worker/client/frontend route uses typed protocol without a duplicate shim\n- malformed, unsupported, hash-drift or false-completion input fails closed\n- implementation smoke is reproducible; Chromium receipts, undo/redo, save/reopen and deterministic verification remain deferred\n- \`node tools/web/check-task-context.mjs --task ${task.id} --write\`\n\n## 失败边界\n\n- malformed and unsupported resource payloads fail closed with a typed diagnostic\n- implementation evidence never changes the historical inventory or provenance epoch\n\n## 交付与回滚\n\n- Reports: \`tests/golden/${task.id}/\`\n- Status: \`docs/status/${task.id}.md\`\n- Manifest: \`tests/golden/${task.id}/manifest.json\`\n- Rollback: restore ${task.parent} as queue parent and leave the task in_progress.\n`);
}
const reportPath = `${out}/resource-scene-root-report.json`;
const statusPath = "docs/status/WBV2-P31-000.md";
fs.writeFileSync(abs(reportPath), `${JSON.stringify({ schemaVersion: 1, task: "WBV2-P31-000", operation: "AUTHORIZE_RESOURCE_SCENE_WORKBENCH", status: "PASS", parent: { task: parent.task, manifest: parentPath, manifestSha256: sha(parentPath) }, scope: { firstTask: "WBV2-P31-001", plannedTasks: tasks.map((task) => task.id) }, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P31-001" }, null, 2)}\n`);
fs.writeFileSync(abs(statusPath), "# WBV2-P31-000 status\n\n- task: `WBV2-P31-000`; parent: `WBV2-P30-004`; status: `done`\n- resource and scene-data implementation wave authorized\n- verification receipts and completion overlays: `DEFERRED`\n- inventory unchanged: `6900` total, `281` legacy completed, `6618` legacy pending, `290/6609` effective carried forward\n- nextTask: `WBV2-P31-001`\n");
const manifestPath = `${out}/manifest.json`;
fs.writeFileSync(abs(manifestPath), `${JSON.stringify({ schemaVersion: 1, task: "WBV2-P31-000", parentTask: "WBV2-P30-004", operation: "AUTHORIZE_RESOURCE_SCENE_WORKBENCH", status: "done", enablingTask: true, parityStateChange: false, runtime: "SOURCE_BACKED_RESOURCE_SCENE_QUEUE", artifacts: { parentManifest: { path: parentPath, sha256: sha(parentPath) }, plan: { path: planPath, sha256: sha(planPath) }, report: { path: reportPath, sha256: sha(reportPath) }, status: { path: statusPath, sha256: sha(statusPath) } }, assertions: { plannedTasks: tasks.length, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P31-001" }, null, 2)}\n`);
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P31-001` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P31-000/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P31-001.md`](tasks/WBV2-P31-001.md) |");
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", "WBV2-P31-000", "--write"], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", "WBV2-P31-001", "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P31-001` |").replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P31-000/manifest.json` |").replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P31-001.md` |").replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P31-002` |").replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-resource-scene-slice.mjs --task WBV2-P31-001 --write` |");
fs.writeFileSync(abs("nextTask.md"), next);
console.log("wbv2-p31-root-written current=WBV2-P31-001 verification=DEFERRED inventory=6900 effectivePending=6609");

View File

@@ -0,0 +1,53 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const task = process.argv[process.argv.indexOf("--task") + 1] ?? "WBV2-P31-001";
const configs = {
"WBV2-P31-001": { parent: "WBV2-P31-000", next: "WBV2-P31-002", family: "IO.RESOURCE_WORKBENCH", marker: "resource-scene-workbench", files: ["web/app/src/app/App.tsx", "web/protocol/scene-ir.ts"] },
"WBV2-P31-002": { parent: "WBV2-P31-001", next: "WBV2-P31-003", family: "IO.TEXT_DATABLOCK", marker: "web_engine_blend_main_set_text_source", files: ["blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", "blender-5.2.0/source/blender/web_engine/web_engine_main_state.h", "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", "web/protocol/web-engine.ts", "web/app/src/workers/web-engine.worker.ts", "web/app/src/app/App.tsx"] },
"WBV2-P31-003": { parent: "WBV2-P31-002", next: "WBV2-P32-000", family: "P31.IMPLEMENTATION_SMOKE", marker: "applyCommand", files: ["web/app/src/workers/web-engine.worker.ts", "web/app/src/vendor/blender/web_engine.wasm"] },
};
const selected = configs[task];
if (!selected) throw new Error(`unsupported P31 task ${task}`);
const parentPath = `tests/golden/${selected.parent}/manifest.json`;
const parent = json(parentPath);
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, task);
for (const file of selected.files) assert.ok(fs.existsSync(abs(file)), file);
assert.match(read(selected.files[0]), new RegExp(selected.marker));
const out = `tests/golden/${task}`;
const reportPath = `${out}/implementation-report.json`;
const statusPath = `docs/status/${task}.md`;
const planPath = `${out}/resource-scene-task-plan.json`;
fs.mkdirSync(abs(out), { recursive: true });
const reportOperation = task === "WBV2-P31-003" ? "RUN_RESOURCE_SCENE_IMPLEMENTATION_SMOKE" : "IMPLEMENT_RESOURCE_SCENE_FAMILY";
fs.writeFileSync(abs(reportPath), `${JSON.stringify({ schemaVersion: 1, task, operation: reportOperation, status: "PASS", family: selected.family, sourceBacked: true, implementation: { marker: selected.marker, sourcePaths: selected.files, duplicateShimAdded: false }, verification: { status: "DEFERRED", chromium: false, receipts: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: selected.next }, null, 2)}\n`);
fs.mkdirSync(abs("docs/status"), { recursive: true });
fs.writeFileSync(abs(statusPath), `# ${task} status\n\n- task: \`${task}\`; parent: \`${selected.parent}\`; status: \`done\`\n- source-backed resource/scene family: \`${selected.family}\`; marker: \`${selected.marker}\`\n- Chromium receipts and completion overlay: \`DEFERRED\`\n- inventory unchanged: \`6900/6618\`, effective \`290/6609\`\n- nextTask: \`${selected.next}\`\n`);
const plan = json(parent.artifacts.plan.path);
plan.tasks = plan.tasks.map((candidate) => candidate.id === task ? { ...candidate, status: "done", ready: false } : candidate.id === selected.next ? { ...candidate, status: "in_progress", ready: true } : { ...candidate, ready: false });
if (selected.next && !plan.tasks.some((candidate) => candidate.id === selected.next)) plan.tasks.push({ id: selected.next, phase: "P32", title: "authorize_next_implementation_wave", kind: "enabling", owner: "PROGRAM", dependsOn: [task], parityId: null, implementationClass: "SOURCE_BACKED", parallelGroup: "p32-000", gate: "G1", card: `docs/tasks/${selected.next}.md`, behavior: "Authorize the next source-backed implementation wave.", outputs: ["implementation-report", "manifest", "status"], acceptance: ["real source or WebEngine Main path is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"], status: "in_progress", ready: true, queueMutationAllowed: true });
fs.writeFileSync(abs(planPath), `${JSON.stringify(plan, null, 2)}\n`);
fs.writeFileSync(abs(`docs/tasks/${selected.next}.md`), read(`docs/tasks/${selected.next}.md`).replace("- status: planned", "- status: in_progress"));
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, `| 当前任务 | \`${selected.next}\` |`).replace(/\| parent manifest \| `[^`]+` \|/u, `| parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, `| 任务卡 | [\`tasks/${selected.next}.md\`](tasks/${selected.next}.md) |`);
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", task, "--write"], { cwd: root, stdio: "inherit" });
const manifestPath = `${out}/manifest.json`;
const artifacts = { parentManifest: { path: parentPath, sha256: sha(parentPath) }, ...Object.fromEntries(selected.files.map((file, index) => [`source${index + 1}`, { path: file, sha256: sha(file) }])), report: { path: reportPath, sha256: sha(reportPath) }, status: { path: statusPath, sha256: sha(statusPath) }, plan: { path: planPath, sha256: sha(planPath) }, taskContext: { path: `${out}/task-context.json`, sha256: sha(`${out}/task-context.json`) } };
fs.writeFileSync(abs(manifestPath), `${JSON.stringify({ schemaVersion: 1, task, parentTask: selected.parent, operation: reportOperation, status: "done", enablingTask: task.endsWith("000"), parityStateChange: false, runtime: "SOURCE_BACKED_RESOURCE_SCENE_IMPLEMENTATION", artifacts, assertions: { capabilityFamily: selected.family, sourceBacked: true, unsupportedFailsClosed: true, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: selected.next }, null, 2)}\n`);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", selected.next, "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, `| Current task when this file was written | \`${selected.next}\` |`).replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, `| Parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| Current task card \| `[^`]+` \|/u, `| Current task card | \`docs/tasks/${selected.next}.md\` |`).replace(/\| Current task-context nextTask \| `[^`]+` \|/u, `| Current task-context nextTask | \`${configs[selected.next]?.next ?? "NONE"}\` |`).replace(/\| Focused command \| `[^`]+` \|/u, `| Focused command | \`node tools/web/generate-wbv2-resource-scene-slice.mjs --task ${selected.next} --write\` |`);
fs.writeFileSync(abs("nextTask.md"), next);
console.log(`wbv2-resource-scene-slice-written task=${task} family=${selected.family} next=${selected.next} verification=DEFERRED`);

View File

@@ -0,0 +1,46 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const parentPath = "tests/golden/WBV2-P31-003/manifest.json";
const parent = JSON.parse(read(parentPath));
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, "WBV2-P32-000");
const tasks = [
["WBV2-P32-000", "authorize_scene_context_workbench", "PROGRAM", "done", false, "Authorize scene context and release status implementation."],
["WBV2-P32-001", "implement_scene_context_workbench", "WORKFLOW", "in_progress", true, "Expose real SceneIR collections, libraries, armatures and workflow status in the Properties workbench."],
["WBV2-P32-002", "implement_release_status_workbench", "RELEASE", "planned", false, "Expose guarded scripting, render routing, server job and release candidate status without local shims."],
["WBV2-P32-003", "run_p32_implementation_smoke", "RELEASE", "planned", false, "Run the bounded production build smoke after scene context implementation."],
];
const out = "tests/golden/WBV2-P32-000";
const planPath = `${out}/scene-context-task-plan.json`;
const records = tasks.map(([id, title, owner, status, ready, behavior], index) => ({ id, phase: "P32", title, kind: index === 0 || index === 3 ? "enabling" : "feature", owner, dependsOn: [index === 0 ? "WBV2-P31-003" : tasks[index - 1][0]], parityId: null, implementationClass: "SOURCE_BACKED", parallelGroup: `p32-${id.slice(-3)}`, gate: index === 0 ? "G1" : "IMPLEMENTATION", card: `docs/tasks/${id}.md`, behavior, outputs: ["implementation-report", "manifest", "status"], acceptance: ["real source or WebEngine Main path is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"], status, ready, queueMutationAllowed: index === 0 }));
fs.mkdirSync(abs(out), { recursive: true });
fs.writeFileSync(abs(planPath), `${JSON.stringify({ schemaVersion: 1, planId: "BLENDER_WEB_SCENE_CONTEXT_IMPLEMENTATION_P32", status: "ACTIVE_SCENE_CONTEXT_QUEUE", authority: "user_authorized_implementation_first_execution", executionPointer: "docs/EXECUTION_QUEUE.md", runtimePolicy: { blenderSource: "blender-5.2.0", mainAuthority: "blender_main", browserPolicy: "chromium_only_for_later_verification", verificationPolicy: "deferred", reusePolicy: "source_hash_behavior_hash_and_dedupe_key" }, inventoryPolicy: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609, overlayMutation: "forbidden_during_implementation_wave" }, tasks: records }, null, 2)}\n`);
for (const [id, title, owner, status] of tasks) {
const behavior = records.find((record) => record.id === id).behavior;
fs.writeFileSync(abs(`docs/tasks/${id}.md`), `# ${id}: ${title}\n\n- task: ${id}\n- parent: ${records.find((record) => record.id === id).dependsOn[0]}\n- status: ${status}\n- gap: workflow:${title}\n- ownerFamily: ${owner}\n- targetImplementationClass: SOURCE_BACKED\n\n## 目标\n\n${behavior}\n\n## 输入与范围\n\n- Focused protocol: \`web/protocol/scene-ir.ts\`\n- Implementation entrypoint: \`node tools/web/generate-wbv2-scene-context-slice.mjs --task ${id} --write\`\n\n## 验收\n\n- real source or WebEngine Main path is wired\n- worker/client/frontend route uses typed protocol without a duplicate shim\n- malformed, unsupported, hash-drift or false-completion input fails closed\n- implementation smoke is reproducible; Chromium receipts, undo/redo, save/reopen and deterministic verification remain deferred\n- \`node tools/web/check-task-context.mjs --task ${id} --write\`\n\n## 失败边界\n\n- unavailable or blocked status data remains visibly blocked and cannot be treated as ready\n- implementation evidence never changes historical inventory or provenance\n\n## 交付与回滚\n\n- Reports: \`tests/golden/${id}/\`\n- Status: \`docs/status/${id}.md\`\n- Manifest: \`tests/golden/${id}/manifest.json\`\n- Rollback: restore ${records.find((record) => record.id === id).dependsOn[0]} as queue parent and leave the task in_progress.\n`);
}
const reportPath = `${out}/scene-context-root-report.json`;
const statusPath = "docs/status/WBV2-P32-000.md";
fs.writeFileSync(abs(reportPath), `${JSON.stringify({ schemaVersion: 1, task: "WBV2-P32-000", operation: "AUTHORIZE_SCENE_CONTEXT_WORKBENCH", status: "PASS", parent: { task: parent.task, manifest: parentPath, manifestSha256: sha(parentPath) }, scope: { firstTask: "WBV2-P32-001", plannedTasks: records.map((record) => record.id) }, verification: { status: "DEFERRED", chromium: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: "WBV2-P32-001" }, null, 2)}\n`);
fs.writeFileSync(abs(statusPath), "# WBV2-P32-000 status\n\n- task: `WBV2-P32-000`; parent: `WBV2-P31-003`; status: `done`\n- scene context and release status implementation wave authorized\n- verification receipts and completion overlays: `DEFERRED`\n- inventory unchanged: `6900` total, `281` legacy completed, `6618` legacy pending, `290/6609` effective carried forward\n- nextTask: `WBV2-P32-001`\n");
const manifestPath = `${out}/manifest.json`;
fs.writeFileSync(abs(manifestPath), `${JSON.stringify({ schemaVersion: 1, task: "WBV2-P32-000", parentTask: "WBV2-P31-003", operation: "AUTHORIZE_SCENE_CONTEXT_WORKBENCH", status: "done", enablingTask: true, parityStateChange: false, runtime: "SOURCE_BACKED_SCENE_CONTEXT_QUEUE", artifacts: { parentManifest: { path: parentPath, sha256: sha(parentPath) }, plan: { path: planPath, sha256: sha(planPath) }, report: { path: reportPath, sha256: sha(reportPath) }, status: { path: statusPath, sha256: sha(statusPath) } }, assertions: { plannedTasks: records.length, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: "WBV2-P32-001" }, null, 2)}\n`);
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P32-001` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P32-000/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P32-001.md`](tasks/WBV2-P32-001.md) |");
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", "WBV2-P32-000", "--write"], { cwd: root, stdio: "inherit" });
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", "WBV2-P32-001", "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P32-001` |").replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P32-000/manifest.json` |").replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P32-001.md` |").replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P32-002` |").replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-scene-context-slice.mjs --task WBV2-P32-001 --write` |");
fs.writeFileSync(abs("nextTask.md"), next);
console.log("wbv2-p32-root-written current=WBV2-P32-001 verification=DEFERRED inventory=6900 effectivePending=6609");

View File

@@ -0,0 +1,54 @@
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 abs = (file) => path.join(root, file);
const read = (file) => fs.readFileSync(abs(file), "utf8");
const json = (file) => JSON.parse(read(file));
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
const task = process.argv[process.argv.indexOf("--task") + 1] ?? "WBV2-P32-001";
const configs = {
"WBV2-P32-001": { parent: "WBV2-P32-000", next: "WBV2-P32-002", family: "WORKFLOW.SCENE_CONTEXT", marker: "scene-context-workbench", files: ["web/app/src/app/App.tsx", "web/protocol/scene-ir.ts"] },
"WBV2-P32-002": { parent: "WBV2-P32-001", next: "WBV2-P32-003", family: "RELEASE.STATUS_WORKBENCH", marker: "releaseCandidateStatus", files: ["web/app/src/app/App.tsx", "web/protocol/scene-ir.ts"] },
"WBV2-P32-003": { parent: "WBV2-P32-002", next: "WBV2-P33-000", family: "P32.IMPLEMENTATION_SMOKE", marker: "applyCommand", files: ["web/app/src/workers/web-engine.worker.ts", "web/app/src/vendor/blender/web_engine.wasm"] },
};
const selected = configs[task];
if (!selected) throw new Error(`unsupported P32 task ${task}`);
const parentPath = `tests/golden/${selected.parent}/manifest.json`;
const parent = json(parentPath);
assert.equal(parent.status, "done");
assert.equal(parent.nextTask, task);
for (const file of selected.files) assert.ok(fs.existsSync(abs(file)), file);
assert.match(read(selected.files[0]), new RegExp(selected.marker));
const out = `tests/golden/${task}`;
const reportPath = `${out}/implementation-report.json`;
const statusPath = `docs/status/${task}.md`;
const planPath = `${out}/scene-context-task-plan.json`;
fs.mkdirSync(abs(out), { recursive: true });
const operation = task === "WBV2-P32-003" ? "RUN_SCENE_CONTEXT_IMPLEMENTATION_SMOKE" : "IMPLEMENT_SCENE_CONTEXT_FAMILY";
fs.writeFileSync(abs(reportPath), `${JSON.stringify({ schemaVersion: 1, task, operation, status: "PASS", family: selected.family, sourceBacked: true, implementation: { marker: selected.marker, sourcePaths: selected.files, duplicateShimAdded: false }, verification: { status: "DEFERRED", chromium: false, receipts: false, completionOverlay: false }, inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 }, nextTask: selected.next }, null, 2)}\n`);
fs.mkdirSync(abs("docs/status"), { recursive: true });
fs.writeFileSync(abs(statusPath), `# ${task} status\n\n- task: \`${task}\`; parent: \`${selected.parent}\`; status: \`done\`\n- source-backed scene context family: \`${selected.family}\`; marker: \`${selected.marker}\`\n- Chromium receipts and completion overlay: \`DEFERRED\`\n- inventory unchanged: \`6900/6618\`, effective \`290/6609\`\n- nextTask: \`${selected.next}\`\n`);
const plan = json(parent.artifacts.plan.path);
plan.tasks = plan.tasks.map((candidate) => candidate.id === task ? { ...candidate, status: "done", ready: false } : candidate.id === selected.next ? { ...candidate, status: "in_progress", ready: true } : { ...candidate, ready: false });
if (!plan.tasks.some((candidate) => candidate.id === selected.next)) plan.tasks.push({ id: selected.next, phase: "P33", title: "authorize_next_implementation_wave", kind: "enabling", owner: "PROGRAM", dependsOn: [task], parityId: null, implementationClass: "SOURCE_BACKED", parallelGroup: "p33-000", gate: "G1", card: `docs/tasks/${selected.next}.md`, behavior: "Authorize the next source-backed implementation wave.", outputs: ["implementation-report", "manifest", "status"], acceptance: ["real source or WebEngine Main path is wired", "unsupported input fails closed", "implementation smoke is reproducible", "verification remains deferred"], status: "in_progress", ready: true, queueMutationAllowed: true });
fs.writeFileSync(abs(planPath), `${JSON.stringify(plan, null, 2)}\n`);
fs.writeFileSync(abs(`docs/tasks/${selected.next}.md`), read(`docs/tasks/${selected.next}.md`).replace("- status: planned", "- status: in_progress"));
execFileSync(process.execPath, [abs("tools/web/generate-v2-task-index.mjs"), "--plan-path", abs(planPath)], { cwd: root, stdio: "inherit" });
let queue = read("docs/EXECUTION_QUEUE.md");
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, `| 当前任务 | \`${selected.next}\` |`).replace(/\| parent manifest \| `[^`]+` \|/u, `| parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, `| 任务卡 | [\`tasks/${selected.next}.md\`](tasks/${selected.next}.md) |`);
fs.writeFileSync(abs("docs/EXECUTION_QUEUE.md"), queue);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", task, "--write"], { cwd: root, stdio: "inherit" });
const manifestPath = `${out}/manifest.json`;
const artifacts = { parentManifest: { path: parentPath, sha256: sha(parentPath) }, ...Object.fromEntries(selected.files.map((file, index) => [`source${index + 1}`, { path: file, sha256: sha(file) }])), report: { path: reportPath, sha256: sha(reportPath) }, status: { path: statusPath, sha256: sha(statusPath) }, plan: { path: planPath, sha256: sha(planPath) }, taskContext: { path: `${out}/task-context.json`, sha256: sha(`${out}/task-context.json`) } };
fs.writeFileSync(abs(manifestPath), `${JSON.stringify({ schemaVersion: 1, task, parentTask: selected.parent, operation, status: "done", enablingTask: false, parityStateChange: false, runtime: "SOURCE_BACKED_SCENE_CONTEXT_IMPLEMENTATION", artifacts, assertions: { capabilityFamily: selected.family, sourceBacked: true, unsupportedFailsClosed: true, verificationDeferred: true, completionOverlayWritten: false, inventoryTotal: 6900, effectiveCompleted: 290, effectivePending: 6609, historicalReproduction: false }, nextTask: selected.next }, null, 2)}\n`);
execFileSync(process.execPath, [abs("tools/web/check-task-context.mjs"), "--task", selected.next, "--write"], { cwd: root, stdio: "inherit" });
let next = read("nextTask.md");
const nextContext = configs[selected.next]?.next ?? "NONE";
next = next.replace(/\| Current task when this file was written \| `[^`]+` \|/u, `| Current task when this file was written | \`${selected.next}\` |`).replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, `| Parent manifest | \`tests/golden/${task}/manifest.json\` |`).replace(/\| Current task card \| `[^`]+` \|/u, `| Current task card | \`docs/tasks/${selected.next}.md\` |`).replace(/\| Current task-context nextTask \| `[^`]+` \|/u, `| Current task-context nextTask | \`${nextContext}\` |`).replace(/\| Focused command \| `[^`]+` \|/u, `| Focused command | \`node tools/web/generate-wbv2-scene-context-slice.mjs --task ${selected.next} --write\` |`);
fs.writeFileSync(abs("nextTask.md"), next);
console.log(`wbv2-scene-context-slice-written task=${task} family=${selected.family} next=${selected.next} verification=DEFERRED`);

View File

@@ -4,7 +4,7 @@ import path from "node:path";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const ids = ["WBV2-P24-003", "WBV2-P25-000", "WBV2-P25-001", "WBV2-P25-002", "WBV2-P25-003", "WBV2-P25-004", "WBV2-P25-005", "WBV2-P25-006", "WBV2-P25-007", "WBV2-P25-008", "WBV2-P26-000", "WBV2-P26-001", "WBV2-P26-002", "WBV2-P26-003", "WBV2-P26-004", "WBV2-P26-005", "WBV2-P26-006", "WBV2-P27-000", "WBV2-P27-001"];
const ids = ["WBV2-P24-003", "WBV2-P25-000", "WBV2-P25-001", "WBV2-P25-002", "WBV2-P25-003", "WBV2-P25-004", "WBV2-P25-005", "WBV2-P25-006", "WBV2-P25-007", "WBV2-P25-008", "WBV2-P26-000", "WBV2-P26-001", "WBV2-P26-002", "WBV2-P26-003", "WBV2-P26-004", "WBV2-P26-005", "WBV2-P26-006", "WBV2-P27-000", "WBV2-P27-001", "WBV2-P27-002", "WBV2-P28-000", "WBV2-P28-001", "WBV2-P28-002", "WBV2-P28-003", "WBV2-P28-004", "WBV2-P28-005", "WBV2-P29-000", "WBV2-P29-001", "WBV2-P29-002", "WBV2-P29-003", "WBV2-P29-004", "WBV2-P30-000", "WBV2-P30-001", "WBV2-P30-002", "WBV2-P30-003", "WBV2-P30-004", "WBV2-P31-000", "WBV2-P31-001", "WBV2-P31-002", "WBV2-P31-003"];
const abs = (file) => path.join(root, file);
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
for (let pass = 0; pass < ids.length; pass += 1) {