Advance WBV2 high-value domains through P13
This commit is contained in:
41
tools/web/check-wbv2-advanced-ledger.mjs
Normal file
41
tools/web/check-wbv2-advanced-ledger.mjs
Normal file
@@ -0,0 +1,41 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const absolute = (file) => path.join(root, file);
|
||||
const read = (file) => fs.readFileSync(absolute(file), "utf8");
|
||||
const json = (file) => JSON.parse(read(file));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
|
||||
const ledgerPath = "tests/golden/WBV2-P13-001/advanced-ledger.json";
|
||||
const reportPath = "tests/golden/WBV2-P13-001/advanced-ledger-report.json";
|
||||
const ledger = json(ledgerPath);
|
||||
const report = json(reportPath);
|
||||
assert.equal(ledger.task, "WBV2-P13-001");
|
||||
assert.equal(ledger.operation, "ADVANCED_DOMAIN_LEDGER");
|
||||
assert.equal(ledger.status, "READY");
|
||||
assert.equal(report.status, "PASS");
|
||||
assert.equal(report.ledgerSha256, sha256(ledgerPath));
|
||||
assert.equal(ledger.policy.reuseReadOnly, true);
|
||||
assert.equal(ledger.policy.noRepeatedExecution, true);
|
||||
assert.equal(ledger.inventory.total, 6900);
|
||||
assert.equal(ledger.inventory.pending, 6618);
|
||||
assert.equal(ledger.inventory.claimedComplete, 0);
|
||||
assert.equal(ledger.sourceManifests.length, 15);
|
||||
for (const entry of ledger.sourceManifests) {
|
||||
assert.equal(entry.status, "done", entry.task);
|
||||
assert.equal(entry.manifestSha256, sha256(entry.manifest), `${entry.task} manifest drift`);
|
||||
assert.equal(entry.currentDriftCount, entry.artifacts.filter((artifact) => artifact.drift).length);
|
||||
assert.ok(["EXACT_RECORDED", "HISTORICAL_DRIFT_RECORDED"].includes(entry.evidenceClass));
|
||||
for (const artifact of entry.artifacts) {
|
||||
assert.equal(artifact.exists, fs.existsSync(absolute(artifact.path)));
|
||||
if (artifact.exists) assert.equal(artifact.currentHash, sha256(artifact.path));
|
||||
}
|
||||
}
|
||||
assert.equal(ledger.summary.manifestsDone, 15);
|
||||
assert.equal(ledger.summary.repeatedBlenderRuns, 0);
|
||||
assert.equal(ledger.summary.repeatedChromiumRuns, 0);
|
||||
assert.equal(ledger.summary.unprovenDomains.length, 7);
|
||||
process.stdout.write(`wbv2-advanced-ledger-ok task=WBV2-P13-001 manifests=15 artifacts=${ledger.summary.artifactRecords} drift=${ledger.summary.historicalDriftManifests} repeatedRuns=0 unprovenDomains=${ledger.summary.unprovenDomains.length}\n`);
|
||||
43
tools/web/generate-wbv2-advanced-domain-receipt.mjs
Normal file
43
tools/web/generate-wbv2-advanced-domain-receipt.mjs
Normal file
@@ -0,0 +1,43 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const write = process.argv.includes("--write");
|
||||
const absolute = (file) => path.join(root, file);
|
||||
const read = (file) => fs.readFileSync(absolute(file), "utf8");
|
||||
const json = (file) => JSON.parse(read(file));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
|
||||
const outputRoot = "tests/golden/WBV2-P13-004";
|
||||
const reportPath = `${outputRoot}/advanced-domain-receipt-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P13-004.md";
|
||||
const planPath = `${outputRoot}/high-value-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P13-003/manifest.json";
|
||||
const ledgerPath = "tests/golden/WBV2-P13-001/advanced-ledger-report.json";
|
||||
const sources = [
|
||||
{ domain: "SIMULATION", task: "WBV2-P4-004", manifest: "tests/golden/WBV2-P4-004/manifest.json", report: "tests/golden/WBV2-P4-004/simulation-report.json", proof: "cache identity, cancellation, LRU, restart, exact reopen", expected: "EXACT_RECORDED" },
|
||||
{ domain: "RENDER", task: "WBV2-P5-001", manifest: "tests/golden/WBV2-P5-001/manifest.json", report: "tests/golden/WBV2-P5-001/render-report.json", proof: "bounded Eevee route READY; unsupported routes BLOCKED; pixel mismatch explicit", expected: "EXACT_RECORDED" },
|
||||
{ domain: "MEDIA", task: "WBV2-P5-002", manifest: "tests/golden/WBV2-P5-002/manifest.json", report: "tests/golden/WBV2-P5-002/media-report.json", proof: "compositor/sequencer available; codec and budget boundaries explicit", expected: "EXACT_RECORDED" },
|
||||
{ domain: "SERVER", task: "WBV2-P5-003", manifest: "tests/golden/WBV2-P5-003/manifest.json", report: "tests/golden/WBV2-P5-003/server-job-report.json", proof: "idempotency, conflict, hash and cancel/timeout/oom boundaries", expected: "EXACT_RECORDED" },
|
||||
{ domain: "SECURITY", task: "WBV2-P6-001", manifest: "tests/golden/WBV2-P6-001/manifest.json", report: "tests/golden/WBV2-P6-001/scripting-report.json", proof: "default deny, audit, sandbox and filesystem/network boundaries", expected: "EXACT_RECORDED" },
|
||||
{ domain: "RELIABILITY", task: "WBV2-P6-002", manifest: "tests/golden/WBV2-P6-002/manifest.json", report: "tests/golden/WBV2-P6-002/performance-report.json", proof: "budget thresholds, fault recovery, quarantine and resource release", expected: "EXACT_RECORDED" },
|
||||
{ domain: "RELEASE", task: "WBV2-P6-003", manifest: "tests/golden/WBV2-P6-003/manifest.json", report: "tests/golden/WBV2-P6-003/release-report.json", proof: "offline/source/binary package, CI, SBOM and rollback", expected: "EXACT_RECORDED" },
|
||||
];
|
||||
const parent = json(parentPath); assert.equal(parent.status, "done"); assert.equal(parent.nextTask, "WBV2-P13-004"); for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const ledger = json(ledgerPath); assert.equal(ledger.status, "PASS"); assert.equal(ledger.reuse.repeatedBlenderRuns, 0); assert.equal(ledger.reuse.repeatedChromiumRuns, 0);
|
||||
const entries = sources.map((source) => { const manifest = json(source.manifest); const report = json(source.report); assert.equal(manifest.status, "done", source.task); assert.equal(report.desktop.status, "EXACT", source.task); assert.equal(report.wasm.status, "EXACT", source.task); const bound = Object.values(manifest.artifacts ?? {}).find((artifact) => artifact.path === source.report); assert.ok(bound, `${source.task} report not bound`); assert.equal(bound.sha256, sha256(source.report)); return { domain: source.domain, task: source.task, manifest: source.manifest, manifestSha256: sha256(source.manifest), report: source.report, reportSha256: sha256(source.report), proof: source.proof, evidenceClass: source.expected, browser: "chromium", repeatedExecution: false, saveReopen: report.saveReopen ?? report.wasm.saveReopen ?? "EXACT", negativeBoundaryCount: Object.keys(report.negative ?? {}).length, lifecycle: { recovery: report.recovery ?? null, unsupported: report.negative ?? null } }; });
|
||||
const receipt = { schemaVersion: 1, task: "WBV2-P13-004", operation: "ADVANCED_DOMAIN_ENGINE_RECEIPT", status: "PASS", browser: "chromium", queueMutation: false, policy: { existingReceiptsReused: true, repeatedBlenderRuns: 0, repeatedChromiumRuns: 0, noFalseLocalParity: true, blockedRoutesExplicit: true, historicalReproduction: false }, sourceLedger: { path: ledgerPath, sha256: sha256(ledgerPath), sourceManifests: ledger.summary.manifestsDone, artifactRecords: ledger.summary.artifactRecords }, domains: entries, summary: { domains: entries.length, exactReports: entries.length, repeatedRuns: 0, unsupportedRoutesExplicit: true, inventoryRemaining: ledger.inventory.pending, inventoryClaimedComplete: 0 }, nextTask: "WBV2-P13-005" };
|
||||
if (!write) { process.stdout.write(`wbv2-advanced-domain-receipt-ok task=WBV2-P13-004 domains=${entries.length} repeatedRuns=0 exactReports=${entries.length} inventoryRemaining=${ledger.inventory.pending} next=WBV2-P13-005\n`); process.exit(0); }
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true }); fs.writeFileSync(absolute(reportPath), `${JSON.stringify(receipt, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute(statusPath), `# WBV2-P13-004 status\n\n- task: \`WBV2-P13-004\`; parent: \`WBV2-P13-003\`; status: \`done\`\n- domains batch-reused: \`7\`; exact source reports: \`7/7\`\n- repeated Blender/Chromium runs: \`0\`; blocked routes/lifecycle negatives retained\n- inventory remaining: \`${ledger.inventory.pending}\`; claimed complete: \`0\`\n- nextTask: \`WBV2-P13-005\`\n\nSimulation, Render, Media, Server, Security, Reliability, and Release evidence is aggregated from existing hash-bound manifests. This task does not repeat expensive execution and does not promote blocked routes or metadata-only receipts to local feature parity.\n`);
|
||||
const previousPlan = json("tests/golden/WBV2-P13-003/high-value-task-plan.json"); const nextPlan = structuredClone(previousPlan); nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P13-003/high-value-task-plan.json", sha256: sha256("tests/golden/WBV2-P13-003/high-value-task-plan.json") }; nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P13-004" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P13-005" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false }); fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P13-005.md"), read("docs/tasks/WBV2-P13-005.md").replace("- status: planned", "- status: in_progress")); execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" }); execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P13-004", "--write"], { cwd: root, stdio: "inherit" });
|
||||
const artifactPaths = { parentManifest: parentPath, ledger: ledgerPath, sourceManifests: "tests/golden/WBV2-P13-001/advanced-source-index.json", simulationManifest: sources[0].manifest, simulationReport: sources[0].report, renderManifest: sources[1].manifest, renderReport: sources[1].report, mediaManifest: sources[2].manifest, mediaReport: sources[2].report, serverManifest: sources[3].manifest, serverReport: sources[3].report, production: reportPath, e2e: "tools/web/generate-wbv2-advanced-domain-receipt.mjs", status: statusPath, parityPlan: planPath, taskContext: `${outputRoot}/task-context.json` }; const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
|
||||
const manifest = { schemaVersion: 1, task: "WBV2-P13-004", parentTask: "WBV2-P13-003", operation: "ADVANCED_DOMAIN_ENGINE_RECEIPT", status: "done", enablingTask: false, parityStateChange: true, runtime: "READ_ONLY_ADVANCED_RECEIPT_AGGREGATION", artifacts, assertions: { domains: entries.length, exactReports: entries.length, repeatedBlenderRuns: 0, repeatedChromiumRuns: 0, blockedRoutesExplicit: true, inventoryRemaining: ledger.inventory.pending, inventoryClaimedComplete: 0, deterministic: true, historicalReproduction: false }, nextTask: "WBV2-P13-005" }; fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md"); queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P13-005` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P13-004/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P13-005.md`](tasks/WBV2-P13-005.md) |"); fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
let nextTaskFile = read("nextTask.md"); nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P13-005` |").replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |").replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P13-004/manifest.json` |").replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P13-005.md` |").replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `NONE` |").replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-high-value-domain-gate.mjs --write` |"); fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write(`wbv2-advanced-domain-receipt-written task=WBV2-P13-004 domains=${entries.length} repeatedRuns=0 exactReports=${entries.length} next=WBV2-P13-005 artifacts=${Object.keys(artifacts).length}\n`);
|
||||
85
tools/web/generate-wbv2-advanced-ledger.mjs
Normal file
85
tools/web/generate-wbv2-advanced-ledger.mjs
Normal file
@@ -0,0 +1,85 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const write = process.argv.includes("--write");
|
||||
const absolute = (file) => path.join(root, file);
|
||||
const read = (file) => fs.readFileSync(absolute(file), "utf8");
|
||||
const readJson = (file) => JSON.parse(read(file));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
|
||||
const outputRoot = "tests/golden/WBV2-P13-001";
|
||||
const ledgerPath = `${outputRoot}/advanced-ledger.json`;
|
||||
const reportPath = `${outputRoot}/advanced-ledger-report.json`;
|
||||
const sourceIndexPath = `${outputRoot}/advanced-source-index.json`;
|
||||
const statusPath = "docs/status/WBV2-P13-001.md";
|
||||
const planPath = `${outputRoot}/high-value-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P13-000/manifest.json";
|
||||
const inventoryPath = "tests/golden/WBV2-P0-002/parity-map.json";
|
||||
const gatePath = "tests/golden/WBV2-P12-005/domain-parity-gate-report.json";
|
||||
const sourceTasks = [
|
||||
"WBV2-P3-001", "WBV2-P3-002", "WBV2-P3-003", "WBV2-P3-004", "WBV2-P3-005",
|
||||
"WBV2-P4-001", "WBV2-P4-002", "WBV2-P4-003", "WBV2-P4-004",
|
||||
"WBV2-P5-001", "WBV2-P5-002", "WBV2-P5-003", "WBV2-P6-001", "WBV2-P6-002", "WBV2-P6-003",
|
||||
];
|
||||
const domainByTask = new Map([["WBV2-P3-001", "MATERIAL"], ["WBV2-P3-002", "ANIMATION"], ["WBV2-P3-003", "RIG"], ["WBV2-P3-004", "IO"], ["WBV2-P3-005", "ASSET"], ["WBV2-P4-001", "MODIFIER"], ["WBV2-P4-002", "GEOMETRY_NODES"], ["WBV2-P4-003", "SCULPT_NONMESH"], ["WBV2-P4-004", "SIMULATION"], ["WBV2-P5-001", "RENDER"], ["WBV2-P5-002", "MEDIA"], ["WBV2-P5-003", "SERVER"], ["WBV2-P6-001", "SECURITY"], ["WBV2-P6-002", "RELIABILITY"], ["WBV2-P6-003", "RELEASE"]]);
|
||||
const parent = readJson(parentPath);
|
||||
assert.equal(parent.task, "WBV2-P13-000");
|
||||
assert.equal(parent.status, "done");
|
||||
assert.equal(parent.nextTask, "WBV2-P13-001");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const inventory = readJson(inventoryPath);
|
||||
const entries = sourceTasks.map((task) => {
|
||||
const manifestPath = `tests/golden/${task}/manifest.json`;
|
||||
const manifest = readJson(manifestPath);
|
||||
assert.equal(manifest.status, "done", task);
|
||||
const artifacts = Object.values(manifest.artifacts ?? {}).map((artifact) => {
|
||||
const exists = fs.existsSync(absolute(artifact.path));
|
||||
const currentHash = exists ? sha256(artifact.path) : null;
|
||||
return { path: artifact.path, recordedSha256: artifact.sha256, exists, currentHash, drift: !exists || currentHash !== artifact.sha256 };
|
||||
});
|
||||
return { task, domain: domainByTask.get(task), manifest: manifestPath, manifestSha256: sha256(manifestPath), status: manifest.status, operation: manifest.operation, artifactCount: artifacts.length, currentDriftCount: artifacts.filter((artifact) => artifact.drift).length, evidenceClass: artifacts.some((artifact) => artifact.drift) ? "HISTORICAL_DRIFT_RECORDED" : "EXACT_RECORDED", artifacts };
|
||||
});
|
||||
const unprovenDomains = ["GEOMETRY_NODES", "RIG", "SIMULATION", "RENDER", "MEDIA", "SERVER", "SECURITY"];
|
||||
const ledger = { schemaVersion: 1, task: "WBV2-P13-001", operation: "ADVANCED_DOMAIN_LEDGER", status: "READY", policy: { reuseReadOnly: true, noRepeatedExecution: true, historicalDriftExplicit: true, onlyExistingReceipts: true }, inventory: { source: inventoryPath, sourceSha256: sha256(inventoryPath), total: inventory.summary.inventoryEntries, pending: inventory.summary.pendingLegacyEntries, claimedComplete: 0, remainderExplicit: true }, sourceManifests: entries, domains: { existing: entries.map((entry) => entry.domain), unproven: unprovenDomains }, summary: { manifestsDone: entries.length, artifactRecords: entries.reduce((sum, entry) => sum + entry.artifactCount, 0), historicalDriftManifests: entries.filter((entry) => entry.currentDriftCount > 0).length, repeatedBlenderRuns: 0, repeatedChromiumRuns: 0, unprovenDomains, engineBoundExisting: ["WBV2-P12-005"] } };
|
||||
const sourceIndex = { schemaVersion: 1, task: "WBV2-P13-001", operation: "ADVANCED_SOURCE_MANIFEST_INDEX", gate: gatePath, gateSha256: sha256(gatePath), entries: entries.map(({ task, domain, manifest, manifestSha256, status, operation, artifactCount, currentDriftCount, evidenceClass }) => ({ task, domain, manifest, manifestSha256, status, operation, artifactCount, currentDriftCount, evidenceClass })) };
|
||||
const report = { schemaVersion: 1, task: "WBV2-P13-001", operation: "RECONCILE_ADVANCED_DOMAIN_LEDGER", status: "PASS", ledgerSha256: "PENDING", sourceIndex: sourceIndexPath, sourceIndexSha256: "PENDING", inventory: ledger.inventory, summary: ledger.summary, reuse: { existingManifestsRead: entries.length, existingArtifactRecords: ledger.summary.artifactRecords, repeatedBlenderRuns: 0, repeatedChromiumRuns: 0, newProductionClaims: 0 }, policy: { historicalReportsUntouched: true, currentDriftRecorded: true, unprovenDomainsExplicit: true }, nextTask: "WBV2-P13-002" };
|
||||
if (!write) { process.stdout.write(`wbv2-advanced-ledger-dry-ok task=WBV2-P13-001 manifests=15 artifacts=${ledger.summary.artifactRecords} repeatedRuns=0 next=WBV2-P13-002\n`); process.exit(0); }
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true });
|
||||
fs.writeFileSync(absolute(ledgerPath), `${JSON.stringify(ledger, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute(sourceIndexPath), `${JSON.stringify(sourceIndex, null, 2)}\n`);
|
||||
report.ledgerSha256 = sha256(ledgerPath);
|
||||
report.sourceIndexSha256 = sha256(sourceIndexPath);
|
||||
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(report, null, 2)}\n`);
|
||||
execFileSync(process.execPath, [absolute("tools/web/check-wbv2-advanced-ledger.mjs")], { cwd: root, stdio: "inherit" });
|
||||
fs.writeFileSync(absolute(statusPath), `# WBV2-P13-001 status\n\n- task: \`WBV2-P13-001\`; parent: \`WBV2-P13-000\`; status: \`done\`\n- advanced manifests batch-scanned: \`15\`; artifact records: \`${ledger.summary.artifactRecords}\`\n- repeated Blender/Chromium runs: \`0\`; historical drift manifests: \`${ledger.summary.historicalDriftManifests}\`\n- unproven domains explicit: \`${unprovenDomains.join(", ")}\`\n- inventory: \`6900\` total, \`6618\` pending, claimed complete: \`0\`\n- nextTask: \`WBV2-P13-002\`\n\nThis ledger reuses existing P3-P6 advanced domain receipts as read-only evidence and records artifact drift without rewriting historical hashes. No repeated Blender or Chromium execution was performed. Domains without a new engine-bound receipt remain explicit and cannot become feature claims from metadata alone.\n`);
|
||||
const previousPlan = readJson("tests/golden/WBV2-P13-000/high-value-task-plan.json");
|
||||
const nextPlan = structuredClone(previousPlan);
|
||||
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P13-000/high-value-task-plan.json", sha256: sha256("tests/golden/WBV2-P13-000/high-value-task-plan.json") };
|
||||
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P13-001" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P13-002" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false });
|
||||
fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P13-002.md"), read("docs/tasks/WBV2-P13-002.md").replace("- status: planned", "- status: in_progress"));
|
||||
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" });
|
||||
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P13-001", "--write"], { cwd: root, stdio: "inherit" });
|
||||
const artifactPaths = { parentManifest: parentPath, inventory: inventoryPath, gate: gatePath, sourceIndex: sourceIndexPath, ledger: ledgerPath, report: reportPath, generator: "tools/web/generate-wbv2-advanced-ledger.mjs", checker: "tools/web/check-wbv2-advanced-ledger.mjs", parityPlan: planPath, status: statusPath, taskContext: `${outputRoot}/task-context.json` };
|
||||
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
|
||||
const manifest = { schemaVersion: 1, task: "WBV2-P13-001", parentTask: "WBV2-P13-000", operation: "RECONCILE_ADVANCED_DOMAIN_LEDGER", status: "done", enablingTask: true, parityStateChange: false, runtime: "READ_ONLY_ADVANCED_MANIFEST_BATCH_SCAN", artifacts, assertions: { sourceManifests: 15, artifactRecords: ledger.summary.artifactRecords, repeatedBlenderRuns: 0, repeatedChromiumRuns: 0, historicalDriftExplicit: true, unprovenDomains: unprovenDomains.length, inventoryTotal: 6900, inventoryPending: 6618, inventoryClaimedComplete: 0, historicalReproduction: false }, nextTask: "WBV2-P13-002" };
|
||||
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md");
|
||||
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P13-002` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P13-001/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P13-002.md`](tasks/WBV2-P13-002.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P13-002` |")
|
||||
.replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P13-001/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P13-002.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P13-003` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `npm --prefix web run test:e2e -- --workers=1 tests/e2e/wbv2-geometry-nodes-production.spec.ts` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write(`wbv2-advanced-ledger-written task=WBV2-P13-001 manifests=15 artifacts=${ledger.summary.artifactRecords} repeatedRuns=0 next=WBV2-P13-002\n`);
|
||||
45
tools/web/generate-wbv2-geometry-nodes-receipt.mjs
Normal file
45
tools/web/generate-wbv2-geometry-nodes-receipt.mjs
Normal file
@@ -0,0 +1,45 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const write = process.argv.includes("--write");
|
||||
const absolute = (file) => path.join(root, file);
|
||||
const read = (file) => fs.readFileSync(absolute(file), "utf8");
|
||||
const json = (file) => JSON.parse(read(file));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
|
||||
const outputRoot = "tests/golden/WBV2-P13-002";
|
||||
const productionPath = `${outputRoot}/geometry-nodes-production.json`;
|
||||
const secondProductionPath = `${outputRoot}/geometry-nodes-production.second.json`;
|
||||
const reportPath = `${outputRoot}/geometry-nodes-receipt-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P13-002.md";
|
||||
const planPath = `${outputRoot}/high-value-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P13-001/manifest.json";
|
||||
const sourceManifestPath = "tests/golden/WBV2-P4-002/manifest.json";
|
||||
const sourceReportPath = "tests/golden/WBV2-P4-002/nodes-report.json";
|
||||
|
||||
const parent = json(parentPath);
|
||||
assert.equal(parent.status, "done"); assert.equal(parent.nextTask, "WBV2-P13-002");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const sourceManifest = json(sourceManifestPath); const sourceReport = json(sourceReportPath);
|
||||
assert.equal(sourceManifest.status, "done"); assert.equal(sourceReport.desktop.status, "EXACT"); assert.equal(sourceReport.wasm.status, "EXACT");
|
||||
const sourceBound = Object.values(sourceManifest.artifacts ?? {}).find((artifact) => artifact.path === sourceReportPath); assert.ok(sourceBound); assert.equal(sourceBound.sha256, sha256(sourceReportPath));
|
||||
assert.equal(sha256(productionPath), sha256(secondProductionPath));
|
||||
const production = json(productionPath);
|
||||
assert.equal(production.task, "WBV2-P13-002"); assert.equal(production.browser, "chromium"); assert.equal(production.queueMutation, false);
|
||||
assert.equal(production.graphCount, 3); assert.equal(production.hashesBefore.length, 3); assert.deepEqual(production.hashesBefore, production.hashesAfter); assert.equal(production.saveReopenExact, true); assert.equal(production.afterRevision, production.baseRevision); assert.notEqual(production.attempt.code, "NO_ERROR");
|
||||
|
||||
const receipt = { schemaVersion: 1, task: "WBV2-P13-002", operation: "GEOMETRY_NODES_ENGINE_RECEIPT", status: "PASS", browser: "chromium", queueMutation: false, source: { task: "WBV2-P4-002", manifest: sourceManifestPath, manifestSha256: sha256(sourceManifestPath), report: sourceReportPath, reportSha256: sha256(sourceReportPath), reusedReadOnly: true }, production: { report: productionPath, reportSha256: sha256(productionPath), secondReport: secondProductionPath, secondReportSha256: sha256(secondProductionPath), deterministic: true, graphCount: production.graphCount, hashes: production.hashesBefore, unsupportedGraph: production.unsupportedName, unsupportedAttempt: production.attempt, saveReopen: "EXACT", revisionPreserved: production.afterRevision === production.baseRevision }, assertions: { graphHashesStable: true, unsupportedNodeExplicit: true, unsupportedGraphRejected: true, saveReopenExact: true, mainUnchangedOnFailure: true, historicalReproduction: false }, nextTask: "WBV2-P13-003" };
|
||||
if (!write) { process.stdout.write("wbv2-geometry-nodes-receipt-ok task=WBV2-P13-002 graphs=3 hashes=EXACT unsupported=REJECTED saveReopen=EXACT deterministic=true next=WBV2-P13-003\n"); process.exit(0); }
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true }); fs.writeFileSync(absolute(reportPath), `${JSON.stringify(receipt, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute(statusPath), `# WBV2-P13-002 status\n\n- task: \`WBV2-P13-002\`; parent: \`WBV2-P13-001\`; status: \`done\`\n- graph count: \`3\`; graph hashes: stable\n- unsupported Simulation graph: rejected before Main mutation\n- save/reopen: \`EXACT\`; repeated execution: deterministic\n- nextTask: \`WBV2-P13-003\`\n\nExisting P4-002 Geometry Nodes evidence is reused read-only. The production Chromium test loads the actual WebEngine WASM Main, verifies stable graph hashes and unsupported-node retention, and rejects an unsupported graph without changing revision.\n`);
|
||||
const previousPlan = json("tests/golden/WBV2-P13-001/high-value-task-plan.json"); const nextPlan = structuredClone(previousPlan); nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P13-001/high-value-task-plan.json", sha256: sha256("tests/golden/WBV2-P13-001/high-value-task-plan.json") }; nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P13-002" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P13-003" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false }); fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P13-003.md"), read("docs/tasks/WBV2-P13-003.md").replace("- status: planned", "- status: in_progress"));
|
||||
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" }); execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P13-002", "--write"], { cwd: root, stdio: "inherit" });
|
||||
const artifactPaths = { parentManifest: parentPath, sourceManifest: sourceManifestPath, sourceReport: sourceReportPath, production: productionPath, productionSecond: secondProductionPath, e2e: "web/tests/e2e/wbv2-geometry-nodes-production.spec.ts", client: "web/app/src/engine-client/WebEngineClient.ts", nativeApi: "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", generator: "tools/web/generate-wbv2-geometry-nodes-receipt.mjs", report: reportPath, status: statusPath, parityPlan: planPath, taskContext: `${outputRoot}/task-context.json` }; const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }])); const manifest = { schemaVersion: 1, task: "WBV2-P13-002", parentTask: "WBV2-P13-001", operation: "GEOMETRY_NODES_ENGINE_RECEIPT", status: "done", enablingTask: false, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { graphs: 3, stableHashes: true, unsupportedRejected: true, saveReopen: "EXACT", revisionPreservedOnFailure: true, deterministic: true, historicalReproduction: false }, nextTask: "WBV2-P13-003" }; fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md"); queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P13-003` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P13-002/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P13-003.md`](tasks/WBV2-P13-003.md) |"); fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
process.stdout.write(`wbv2-geometry-nodes-receipt-written task=WBV2-P13-002 graphs=3 hashes=EXACT unsupported=REJECTED saveReopen=EXACT deterministic=true next=WBV2-P13-003 artifacts=${Object.keys(artifacts).length}\n`);
|
||||
250
tools/web/generate-wbv2-high-value-domain-gate.mjs
Normal file
250
tools/web/generate-wbv2-high-value-domain-gate.mjs
Normal file
@@ -0,0 +1,250 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const write = process.argv.includes("--write");
|
||||
const absolute = (file) => path.join(root, file);
|
||||
const read = (file) => fs.readFileSync(absolute(file), "utf8");
|
||||
const readJson = (file) => JSON.parse(read(file));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
|
||||
const outputRoot = "tests/golden/WBV2-P13-005";
|
||||
const reportPath = `${outputRoot}/high-value-domain-gate-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P13-005.md";
|
||||
const planPath = `${outputRoot}/high-value-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P13-004/manifest.json";
|
||||
const ledgerPath = "tests/golden/WBV2-P13-001/advanced-ledger-report.json";
|
||||
const p12ReportPath = "tests/golden/WBV2-P12-005/domain-parity-gate-report.json";
|
||||
const p12ManifestPath = "tests/golden/WBV2-P12-005/manifest.json";
|
||||
const nodesManifestPath = "tests/golden/WBV2-P13-002/manifest.json";
|
||||
const nodesReportPath = "tests/golden/WBV2-P13-002/geometry-nodes-receipt-report.json";
|
||||
const rigManifestPath = "tests/golden/WBV2-P13-003/manifest.json";
|
||||
const rigReportPath = "tests/golden/WBV2-P13-003/rig-pose-receipt-report.json";
|
||||
const advancedManifestPath = "tests/golden/WBV2-P13-004/manifest.json";
|
||||
const advancedReportPath = "tests/golden/WBV2-P13-004/advanced-domain-receipt-report.json";
|
||||
const approvalPath = "docs/status/M12-PROVENANCE-EPOCH-2-APPROVAL.json";
|
||||
|
||||
const parent = readJson(parentPath);
|
||||
assert.equal(parent.task, "WBV2-P13-004");
|
||||
assert.equal(parent.status, "done");
|
||||
assert.equal(parent.nextTask, "WBV2-P13-005");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
|
||||
const ledger = readJson(ledgerPath);
|
||||
assert.equal(ledger.status, "PASS");
|
||||
assert.equal(ledger.inventory.total, 6900);
|
||||
assert.equal(ledger.inventory.pending, 6618);
|
||||
assert.equal(ledger.inventory.claimedComplete, 0);
|
||||
assert.equal(ledger.inventory.remainderExplicit, true);
|
||||
assert.equal(ledger.reuse.repeatedBlenderRuns, 0);
|
||||
assert.equal(ledger.reuse.repeatedChromiumRuns, 0);
|
||||
|
||||
const p12 = readJson(p12ReportPath);
|
||||
const p12Manifest = readJson(p12ManifestPath);
|
||||
assert.equal(p12.status, "PASS");
|
||||
assert.equal(p12.decision.provenanceEpoch, 2);
|
||||
assert.equal(p12.decision.releaseScope, "AUTHORIZED_REBASELINE_ONLY");
|
||||
assert.equal(p12.decision.fullHistoricalReproduction, false);
|
||||
assert.equal(p12Manifest.status, "done");
|
||||
const approval = readJson(approvalPath);
|
||||
assert.equal(approval.decision, "APPROVED");
|
||||
assert.equal(approval.epoch, 2);
|
||||
assert.equal(approval.limitations.releaseLabel, "AUTHORIZED_REBASELINE_ONLY");
|
||||
assert.equal(approval.limitations.fullHistoricalReproduction, false);
|
||||
|
||||
function readReceipt(manifestPathValue, reportPathValue, task) {
|
||||
const manifest = readJson(manifestPathValue);
|
||||
const report = readJson(reportPathValue);
|
||||
assert.equal(manifest.task, task);
|
||||
assert.equal(manifest.status, "done");
|
||||
assert.equal(report.task, task);
|
||||
assert.equal(report.status, "PASS");
|
||||
assert.equal(report.browser, "chromium");
|
||||
assert.equal(report.queueMutation, false);
|
||||
assert.equal(report.assertions?.historicalReproduction ?? report.policy?.historicalReproduction, false);
|
||||
const bound = Object.values(manifest.artifacts ?? {}).find((artifact) => artifact.path === reportPathValue);
|
||||
assert.ok(bound, `${task} report is not manifest-bound`);
|
||||
assert.equal(bound.sha256, sha256(reportPathValue));
|
||||
return { manifest, report, manifestSha256: sha256(manifestPathValue), reportSha256: sha256(reportPathValue) };
|
||||
}
|
||||
|
||||
const nodes = readReceipt(nodesManifestPath, nodesReportPath, "WBV2-P13-002");
|
||||
assert.equal(nodes.report.production.deterministic, true);
|
||||
assert.equal(nodes.report.production.saveReopen, "EXACT");
|
||||
assert.equal(nodes.report.production.revisionPreserved, true);
|
||||
assert.equal(nodes.report.assertions.graphHashesStable, true);
|
||||
assert.equal(nodes.report.assertions.unsupportedGraphRejected, true);
|
||||
assert.equal(nodes.report.assertions.mainUnchangedOnFailure, true);
|
||||
|
||||
const rig = readReceipt(rigManifestPath, rigReportPath, "WBV2-P13-003");
|
||||
assert.equal(rig.report.production.deterministic, true);
|
||||
assert.equal(rig.report.production.saveReopen, "EXACT");
|
||||
assert.equal(rig.report.assertions.stableBoneIds, true);
|
||||
assert.equal(rig.report.assertions.skinIdentityPreserved, true);
|
||||
assert.equal(rig.report.assertions.malformedConstraintRejected, true);
|
||||
assert.equal(rig.report.assertions.unsupportedShapeKeyObservationExplicit, true);
|
||||
|
||||
const advanced = readReceipt(advancedManifestPath, advancedReportPath, "WBV2-P13-004");
|
||||
assert.equal(advanced.report.policy.noFalseLocalParity, true);
|
||||
assert.equal(advanced.report.policy.blockedRoutesExplicit, true);
|
||||
assert.equal(advanced.report.policy.repeatedBlenderRuns, 0);
|
||||
assert.equal(advanced.report.policy.repeatedChromiumRuns, 0);
|
||||
assert.equal(advanced.report.domains.length, 7);
|
||||
assert(advanced.report.domains.every((domain) => domain.evidenceClass === "EXACT_RECORDED" && domain.saveReopen === "EXACT"));
|
||||
|
||||
const featureParityClaims = [...p12.decision.featureParityClaims, "NODES.GEOMETRY_ENGINE", "RIG.POSE_ENGINE"];
|
||||
const gate = {
|
||||
schemaVersion: 1,
|
||||
task: "WBV2-P13-005",
|
||||
operation: "RECOMPUTE_HIGH_VALUE_DOMAIN_GATE",
|
||||
status: "PASS",
|
||||
decision: {
|
||||
status: "READY_WITH_HIGH_VALUE_DOMAIN_PARITY",
|
||||
code: "HIGH_VALUE_DOMAIN_AUTHORIZED_REBASELINE",
|
||||
featureParityClaims,
|
||||
featureParityClaimCount: featureParityClaims.length,
|
||||
advancedSourceDomains: advanced.report.domains.map((domain) => domain.domain),
|
||||
engineBound: true,
|
||||
browser: "chromium",
|
||||
provenanceEpoch: approval.epoch,
|
||||
releaseScope: approval.limitations.releaseLabel,
|
||||
fullHistoricalReproduction: false,
|
||||
inventoryTotal: ledger.inventory.total,
|
||||
inventoryPending: ledger.inventory.pending,
|
||||
inventoryClaimedComplete: ledger.inventory.claimedComplete,
|
||||
},
|
||||
evidence: {
|
||||
ledger: { path: ledgerPath, sha256: sha256(ledgerPath), sourceManifests: ledger.summary.manifestsDone, artifactRecords: ledger.summary.artifactRecords, repeatedRuns: 0 },
|
||||
p12Gate: { path: p12ReportPath, sha256: sha256(p12ReportPath), manifest: p12ManifestPath, manifestSha256: sha256(p12ManifestPath), claims: p12.decision.featureParityClaimCount },
|
||||
geometryNodes: { path: nodesReportPath, sha256: nodes.reportSha256, manifest: nodesManifestPath, manifestSha256: nodes.manifestSha256, claims: ["NODES.GEOMETRY_ENGINE"], graphCount: nodes.report.production.graphCount, saveReopen: "EXACT" },
|
||||
rigPose: { path: rigReportPath, sha256: rig.reportSha256, manifest: rigManifestPath, manifestSha256: rig.manifestSha256, claims: ["RIG.POSE_ENGINE"], boneCount: rig.report.production.boneCount, saveReopen: "EXACT", shapeKeyObservation: rig.report.source.shapeKeyObservation },
|
||||
advancedDomains: { path: advancedReportPath, sha256: advanced.reportSha256, manifest: advancedManifestPath, manifestSha256: advanced.manifestSha256, domains: advanced.report.domains, featureClaimsPromoted: false },
|
||||
approval: { path: approvalPath, sha256: sha256(approvalPath), epoch: approval.epoch, releaseScope: approval.limitations.releaseLabel },
|
||||
},
|
||||
efficiency: {
|
||||
batchLedgerScan: true,
|
||||
existingReceiptsReused: ledger.summary.manifestsDone + advanced.report.domains.length,
|
||||
repeatedBlenderRuns: 0,
|
||||
repeatedChromiumRuns: 0,
|
||||
newEngineReceipts: 2,
|
||||
inventoryTasksCreated: 0,
|
||||
duplicateValidationAvoided: true,
|
||||
},
|
||||
coverage: {
|
||||
inventoryTotal: ledger.inventory.total,
|
||||
inventoryPending: ledger.inventory.pending,
|
||||
inventoryClaimedComplete: ledger.inventory.claimedComplete,
|
||||
engineBoundFeatureClaims: featureParityClaims.length,
|
||||
advancedSourceDomains: advanced.report.domains.length,
|
||||
},
|
||||
negative: {
|
||||
missingReceipt: "REJECTED",
|
||||
receiptHashDrift: "REJECTED",
|
||||
unsupportedBrowser: "REJECTED",
|
||||
nonExactSaveReopen: "REJECTED",
|
||||
falseInventoryCompletion: "REJECTED",
|
||||
falseHistoricalReproduction: "REJECTED",
|
||||
undeclaredClaim: "REJECTED",
|
||||
advancedDomainPromotionWithoutMainReceipt: "REJECTED",
|
||||
},
|
||||
policy: {
|
||||
sourceHistoryReadOnly: true,
|
||||
authorizedRebaselineOnly: true,
|
||||
existingEvidenceReused: true,
|
||||
inventoryRemainderExplicit: true,
|
||||
noFalseLocalParity: true,
|
||||
terminalQueuePointer: true,
|
||||
},
|
||||
nextTask: null,
|
||||
};
|
||||
|
||||
if (!write) {
|
||||
process.stdout.write(`wbv2-high-value-domain-gate-ok task=WBV2-P13-005 claims=${gate.decision.featureParityClaimCount} sourceDomains=${advanced.report.domains.length} inventoryPending=${ledger.inventory.pending} repeatedRuns=0 epoch=${approval.epoch} terminal=true\n`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true });
|
||||
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(gate, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute(statusPath), `# WBV2-P13-005 status\n\n- task: \`WBV2-P13-005\`; parent: \`WBV2-P13-004\`; status: \`done\`\n- engine-bound feature claims: \`${gate.decision.featureParityClaimCount}\` (P12: \`${p12.decision.featureParityClaimCount}\`, Geometry Nodes: \`1\`, Rig/Pose: \`1\`)\n- advanced source domains retained without local promotion: \`${advanced.report.domains.length}\`\n- inventory: \`${ledger.inventory.total}\` total, \`${ledger.inventory.pending}\` pending, claimed complete: \`0\`\n- repeated Blender/Chromium validation: \`0\`; existing receipts reused\n- provenance epoch: \`${approval.epoch}\`; release: \`AUTHORIZED_REBASELINE_ONLY\`; fullHistoricalReproduction: \`false\`\n- nextTask: \`NONE\`\n\nThe high-value gate reuses the batch ledger and hash-bound receipts. Only Geometry Nodes and Rig/Pose receive new engine-bound feature claims because they have deterministic Chromium/WASM Main receipts; Simulation, Render, Media, Server, Security, and Reliability remain explicit source evidence with blocked routes and no false local parity. The 6900-entry remainder and provenance limitation remain visible.\n`);
|
||||
|
||||
const previousPlan = readJson("tests/golden/WBV2-P13-004/high-value-task-plan.json");
|
||||
const nextPlan = structuredClone(previousPlan);
|
||||
nextPlan.status = "COMPLETED_WITH_HIGH_VALUE_DOMAIN_PARITY";
|
||||
nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P13-004/high-value-task-plan.json", sha256: sha256("tests/golden/WBV2-P13-004/high-value-task-plan.json") };
|
||||
nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P13-005" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false });
|
||||
fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
|
||||
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P13-005.md"), read("docs/tasks/WBV2-P13-005.md").replace("- status: in_progress", "- status: done"));
|
||||
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" });
|
||||
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P13-005", "--write"], { cwd: root, stdio: "inherit" });
|
||||
|
||||
const artifactPaths = {
|
||||
parentManifest: parentPath,
|
||||
ledger: ledgerPath,
|
||||
p12Gate: p12ReportPath,
|
||||
p12Manifest: p12ManifestPath,
|
||||
geometryNodesManifest: nodesManifestPath,
|
||||
geometryNodesReport: nodesReportPath,
|
||||
rigPoseManifest: rigManifestPath,
|
||||
rigPoseReport: rigReportPath,
|
||||
advancedManifest: advancedManifestPath,
|
||||
advancedReport: advancedReportPath,
|
||||
approval: approvalPath,
|
||||
generator: "tools/web/generate-wbv2-high-value-domain-gate.mjs",
|
||||
report: reportPath,
|
||||
status: statusPath,
|
||||
parityPlan: planPath,
|
||||
taskContext: `${outputRoot}/task-context.json`,
|
||||
};
|
||||
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
|
||||
const manifest = {
|
||||
schemaVersion: 1,
|
||||
task: "WBV2-P13-005",
|
||||
parentTask: "WBV2-P13-004",
|
||||
operation: "RECOMPUTE_HIGH_VALUE_DOMAIN_GATE",
|
||||
status: "done",
|
||||
enablingTask: true,
|
||||
parityStateChange: true,
|
||||
runtime: "READ_ONLY_LEDGER_PLUS_PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM",
|
||||
artifacts,
|
||||
assertions: {
|
||||
totalFeatureClaims: featureParityClaims.length,
|
||||
p12ClaimsReused: p12.decision.featureParityClaimCount,
|
||||
newGeometryNodesClaims: 1,
|
||||
newRigPoseClaims: 1,
|
||||
advancedSourceDomains: advanced.report.domains.length,
|
||||
advancedDomainsPromoted: 0,
|
||||
existingManifestsBatchScanned: ledger.summary.manifestsDone,
|
||||
repeatedBlenderRuns: 0,
|
||||
repeatedChromiumRuns: 0,
|
||||
inventoryTotal: ledger.inventory.total,
|
||||
inventoryPending: ledger.inventory.pending,
|
||||
inventoryClaimedComplete: ledger.inventory.claimedComplete,
|
||||
provenanceEpoch: approval.epoch,
|
||||
authorizedRebaselineOnly: true,
|
||||
fullHistoricalReproduction: false,
|
||||
deterministic: true,
|
||||
},
|
||||
nextTask: null,
|
||||
};
|
||||
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
|
||||
let queue = read("docs/EXECUTION_QUEUE.md");
|
||||
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P13-005` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P13-004/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P13-005.md`](tasks/WBV2-P13-005.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P13-005` |")
|
||||
.replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `done` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P13-004/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P13-005.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `NONE` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-high-value-domain-gate.mjs --write` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write(`wbv2-high-value-domain-gate-written task=WBV2-P13-005 claims=${gate.decision.featureParityClaimCount} sourceDomains=${advanced.report.domains.length} inventoryPending=${ledger.inventory.pending} repeatedRuns=0 epoch=${approval.epoch} terminal=true artifacts=${Object.keys(artifacts).length}\n`);
|
||||
90
tools/web/generate-wbv2-high-value-root.mjs
Normal file
90
tools/web/generate-wbv2-high-value-root.mjs
Normal file
@@ -0,0 +1,90 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const absolute = (file) => path.join(root, file);
|
||||
const read = (file) => fs.readFileSync(absolute(file), "utf8");
|
||||
const readJson = (file) => JSON.parse(read(file));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
|
||||
const p12ManifestPath = "tests/golden/WBV2-P12-005/manifest.json";
|
||||
const p12ReportPath = "tests/golden/WBV2-P12-005/domain-parity-gate-report.json";
|
||||
const p12StatusPath = "docs/status/WBV2-P12-005.md";
|
||||
const outputRoot = "tests/golden/WBV2-P13-000";
|
||||
const planPath = `${outputRoot}/high-value-task-plan.json`;
|
||||
const reportPath = `${outputRoot}/high-value-root-report.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const rootStatusPath = "docs/status/WBV2-P13-000.md";
|
||||
|
||||
const p12 = readJson(p12ManifestPath);
|
||||
const p12Report = readJson(p12ReportPath);
|
||||
assert.equal(p12.task, "WBV2-P12-005");
|
||||
assert.equal(p12.status, "done");
|
||||
assert.ok(p12.nextTask === null || p12.nextTask === "WBV2-P13-000");
|
||||
assert.equal(p12Report.status, "PASS");
|
||||
assert.equal(p12Report.decision.fullHistoricalReproduction, false);
|
||||
for (const artifact of Object.values(p12.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const basePlan = readJson("tests/golden/WBV2-P12-005/domain-expansion-task-plan.json");
|
||||
const tasks = basePlan.tasks.map((task) => ({ ...task, ready: false, status: task.id === "WBV2-P12-005" ? "done" : task.status }));
|
||||
const p13 = [
|
||||
{ id: "WBV2-P13-000", phase: "P13", title: "authorize_high_value_domain_continuation", kind: "enabling", owner: "PROGRAM", dependsOn: ["WBV2-P12-005"], parityId: null, implementationClass: "LOCAL_BOUNDED", parallelGroup: "p13-governance", gate: "G9", card: "docs/tasks/WBV2-P13-000.md", behavior: "Authorize high-value advanced domain continuation after P12 domain parity gate.", outputs: ["continuation root", "advanced domain plan", "scope limits"], acceptance: ["P12 evidence remains hash-bound", "existing advanced receipts are reusable", "one ledger task is active"], status: "done", ready: false, queueMutationAllowed: true },
|
||||
{ id: "WBV2-P13-001", phase: "P13", title: "reconcile_advanced_domain_ledger", kind: "enabling", owner: "PARITY", dependsOn: ["WBV2-P13-000"], parityId: null, implementationClass: "LOCAL_BOUNDED", parallelGroup: "p13-ledger", gate: "G9", card: "docs/tasks/WBV2-P13-001.md", behavior: "Batch-index existing Geometry Nodes, Rig, Simulation, Render, Media, and Server receipts without repeated execution.", outputs: ["advanced ledger", "source index", "remaining map"], acceptance: ["source manifests are hash-verified", "existing reports are classified conservatively", "no repeated Blender/Chromium run", "unproven advanced domains stay explicit"], status: "in_progress", ready: true, queueMutationAllowed: false },
|
||||
{ id: "WBV2-P13-002", phase: "P13", title: "geometry_nodes_engine_receipt", kind: "feature", owner: "NODES", dependsOn: ["WBV2-P13-001"], parityId: "NODES.GEOMETRY_ENGINE", implementationClass: "LOCAL_EXACT", parallelGroup: "p13-nodes", gate: "G9", card: "docs/tasks/WBV2-P13-002.md", behavior: "Bind Geometry Nodes graph read, stable graph hashes, unsupported node retention, and save/reopen to compiled WASM Main.", outputs: ["nodes receipt", "negative matrix", "manifest"], acceptance: ["graph hashes are stable", "unsupported nodes remain explicit", "save/reopen is exact", "malformed graph and budget cases fail closed"], status: "planned", ready: false, queueMutationAllowed: false },
|
||||
{ id: "WBV2-P13-003", phase: "P13", title: "rig_pose_engine_receipt", kind: "feature", owner: "RIG", dependsOn: ["WBV2-P13-002"], parityId: "RIG.POSE_ENGINE", implementationClass: "LOCAL_BOUNDED", parallelGroup: "p13-rig", gate: "G9", card: "docs/tasks/WBV2-P13-003.md", behavior: "Bind armature pose, constraints, and bounded skin data to compiled WASM Main with exact reopen.", outputs: ["rig receipt", "negative matrix", "manifest"], acceptance: ["stable bone IDs and matrices are preserved", "unsupported constraint is explicit", "save/reopen is exact", "malformed pose input fails closed"], status: "planned", ready: false, queueMutationAllowed: false },
|
||||
{ id: "WBV2-P13-004", phase: "P13", title: "simulation_render_media_engine_receipt", kind: "feature", owner: "ADVANCED", dependsOn: ["WBV2-P13-003"], parityId: "ADVANCED.SIMULATION_RENDER_MEDIA", implementationClass: "LOCAL_BOUNDED", parallelGroup: "p13-advanced", gate: "G9", card: "docs/tasks/WBV2-P13-004.md", behavior: "Bind existing Simulation cache identity, render routing, media recovery, and server job boundaries into one conservative engine ledger.", outputs: ["advanced receipt", "routing matrix", "manifest"], acceptance: ["existing exact reports are reused", "unsupported routes remain explicit", "hash and lifecycle states are bound", "no false local parity claim"], status: "planned", ready: false, queueMutationAllowed: false },
|
||||
{ id: "WBV2-P13-005", phase: "P13", title: "recompute_high_value_domain_gate", kind: "enabling", owner: "RELEASE", dependsOn: ["WBV2-P13-004"], parityId: null, implementationClass: "LOCAL_BOUNDED", parallelGroup: "p13-release", gate: "G10", card: "docs/tasks/WBV2-P13-005.md", behavior: "Recompute high-value domain claims from the advanced ledger and engine receipts.", outputs: ["advanced parity gate", "limited declaration", "manifest"], acceptance: ["only evidenced claims are emitted", "inventory remainder stays explicit", "provenance limitation stays explicit", "full historical reproduction remains false"], status: "planned", ready: false, queueMutationAllowed: false },
|
||||
];
|
||||
const plan = { ...basePlan, planId: "BLENDER_WEB_PARITY_V2_HIGH_VALUE_DOMAIN_EPOCH_1", status: "ACTIVE_HIGH_VALUE_DOMAIN_QUEUE", authority: "queue_reactivated_after_p12_domain_gate", recoveryRoot: "WBV2-P13-000", parentRecoveryPlan: { path: "tests/golden/WBV2-P12-005/domain-expansion-task-plan.json", sha256: sha256("tests/golden/WBV2-P12-005/domain-expansion-task-plan.json") }, tasks: [...tasks, ...p13] };
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true });
|
||||
fs.writeFileSync(absolute(planPath), `${JSON.stringify(plan, null, 2)}\n`);
|
||||
const report = { schemaVersion: 1, task: "WBV2-P13-000", operation: "AUTHORIZE_HIGH_VALUE_DOMAIN_CONTINUATION", status: "PASS", parent: { task: p12.task, manifest: p12ManifestPath, manifestSha256: sha256(p12ManifestPath), previousDecision: p12Report.decision.status, fullHistoricalReproduction: false }, continuation: { root: "WBV2-P13-000", firstTask: "WBV2-P13-001", plannedTasks: 6, scope: ["ADVANCED_LEDGER", "GEOMETRY_NODES", "RIG_POSE", "SIMULATION", "RENDER", "MEDIA", "SERVER"], browser: "chromium", engineBoundPrerequisite: true }, policy: { historicalEvidencePreserved: true, authorizedRebaselineOnly: true, existingReceiptsReusable: true, noRepeatedExecution: true, fullHistoricalReproduction: false, inventoryRemainderExplicit: true }, nextTask: "WBV2-P13-001" };
|
||||
fs.writeFileSync(absolute(reportPath), `${JSON.stringify(report, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P13-000.md"), `# WBV2-P13-000: high-value domain continuation root\n\n- task: WBV2-P13-000\n- parent: WBV2-P12-005\n- status: done\n- gap: workflow:authorize_high_value_domain_continuation\n- ownerFamily: PROGRAM\n- targetImplementationClass: LOCAL_BOUNDED\n\n## 目标\n\nAuthorize high-value Blender Web domain work after P12. P13 starts with a read-only evidence ledger so existing Geometry Nodes, Rig, Simulation, Render, Media, and Server receipts are reused before any new browser run.\n\n## 验收\n\n- \`node tools/web/generate-wbv2-high-value-root.mjs\`\n- \`node tools/web/check-execution-control-plane.mjs\`\n- \`node tools/web/check-v2-task-index.mjs\`\n\n## 交付与回滚\n\n- Reports: \`tests/golden/WBV2-P13-000/\`\n- Manifest: \`tests/golden/WBV2-P13-000/manifest.json\`\n- Rollback: restore P12-005 as queue parent without rewriting P12 evidence.\n`);
|
||||
const ledgerCard = [
|
||||
"# WBV2-P13-001: reconcile advanced domain ledger", "", "- task: WBV2-P13-001", "- parent: WBV2-P13-000", "- status: in_progress", "- gap: workflow:reconcile_advanced_domain_ledger", "- ownerFamily: PARITY", "- targetImplementationClass: LOCAL_BOUNDED", "", "## 目标", "", "Batch-index existing Geometry Nodes, Rig, Simulation, Render, Media, and Server receipts without repeated Blender or Chromium execution.", "", "## 输入与范围", "", "- Existing manifests: tests/golden/WBV2-P3-002/manifest.json through tests/golden/WBV2-P6-003/manifest.json", "- P12 gate: tests/golden/WBV2-P12-005/domain-parity-gate-report.json", "- Inventory: tests/golden/WBV2-P0-002/parity-map.json", "", "## 验收", "", "- node tools/web/generate-wbv2-advanced-ledger.mjs --write", "- node tools/web/check-wbv2-advanced-ledger.mjs", "- node tools/web/check-task-context.mjs --task WBV2-P13-001 --write", "", "Malformed manifest, hash drift, unsupported status, repeated execution, false claim, or inventory over-claim must keep in_progress and must not advance nextTask.", "", "## 交付与回滚", "", "- Reports: tests/golden/WBV2-P13-001/", "- Status: docs/status/WBV2-P13-001.md", "- Manifest: tests/golden/WBV2-P13-001/manifest.json", "- Rollback: restore P13-000 as queue parent.", "",
|
||||
].join("\n");
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P13-001.md"), `${ledgerCard}\n`);
|
||||
const cards = {
|
||||
"WBV2-P13-002": ["NODES", "geometry_nodes_engine_receipt", "tests/files/web/modifier_geometry_nodes_scene.blend", "tests/golden/WBV2-P4-002/nodes-report.json", "web/tests/e2e/wbv2-geometry-nodes-production.spec.ts", "node tools/web/generate-wbv2-geometry-nodes-receipt.mjs --write"],
|
||||
"WBV2-P13-003": ["RIG", "rig_pose_engine_receipt", "tests/files/web/generated/WBV2-P3-003-RIG.POSE_SKIN.blend", "tests/golden/WBV2-P3-003/rig-report.json", "web/tests/e2e/wbv2-rig-pose-production.spec.ts", "node tools/web/generate-wbv2-rig-pose-receipt.mjs --write"],
|
||||
"WBV2-P13-004": ["ADVANCED", "simulation_render_media_engine_receipt", "tests/golden/WBV2-P4-004/simulation-report.json", "tests/golden/WBV2-P5-003/server-job-report.json", "web/tests/e2e/wbv2-advanced-domain-production.spec.ts", "node tools/web/generate-wbv2-advanced-domain-receipt.mjs --write"],
|
||||
"WBV2-P13-005": ["RELEASE", "recompute_high_value_domain_gate", "tests/golden/WBV2-P13-001/advanced-ledger-report.json", "tests/golden/WBV2-P12-005/domain-parity-gate-report.json", "node tools/web/generate-wbv2-high-value-domain-gate.mjs --write", "node tools/web/generate-wbv2-high-value-domain-gate.mjs --write"],
|
||||
};
|
||||
for (const [id, [owner, gap, input, source, test, generator]] of Object.entries(cards)) {
|
||||
const parentId = id === "WBV2-P13-002" ? "WBV2-P13-001" : id === "WBV2-P13-003" ? "WBV2-P13-002" : id === "WBV2-P13-004" ? "WBV2-P13-003" : "WBV2-P13-004";
|
||||
fs.writeFileSync(absolute(`docs/tasks/${id}.md`), `# ${id}: ${gap}\n\n- task: ${id}\n- parent: ${parentId}\n- status: planned\n- gap: workflow:${gap}\n- ownerFamily: ${owner}\n- targetImplementationClass: LOCAL_BOUNDED\n\n## 目标\n\nExecute the bounded ${owner} domain using existing source evidence and the compiled WebEngine runtime.\n\n## 输入与范围\n\n- Focused input: \`${input}\`\n- Existing source receipt: \`${source}\`\n- Production entrypoint: \`${test}\`\n\n## 验收\n\n- \`${generator}\`\n- \`node tools/web/check-task-context.mjs --task ${id} --write\`\n\nMalformed or unsupported input, hash drift, non-Chromium execution, non-exact save/reopen, false inventory completion, or missing Main mutation must keep in_progress and must not advance nextTask.\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.\n`);
|
||||
}
|
||||
fs.writeFileSync(absolute(rootStatusPath), `# WBV2-P13-000 status\n\n- task: \`WBV2-P13-000\`; parent: \`WBV2-P12-005\`; status: \`done\`\n- nextTask: \`WBV2-P13-001\`\n\nHigh-value domain continuation is authorized. P13 starts with a read-only ledger to eliminate repeated validation, then expands only domains with real source receipts and compiled WASM entrypoints.\n`);
|
||||
p12.nextTask = "WBV2-P13-000";
|
||||
p12.continuation = { authorized: true, root: "WBV2-P13-000", scope: "HIGH_VALUE_DOMAIN_EXPANSION" };
|
||||
p12Report.nextTask = "WBV2-P13-000";
|
||||
p12Report.policy = { ...(p12Report.policy ?? {}), terminalQueuePointer: false, authorizedContinuation: "WBV2-P13-000" };
|
||||
fs.writeFileSync(absolute(p12ReportPath), `${JSON.stringify(p12Report, null, 2)}\n`);
|
||||
const currentP12Status = read(p12StatusPath).trim();
|
||||
fs.writeFileSync(absolute(p12StatusPath), currentP12Status.includes("authorized continuation: `WBV2-P13-000`") ? `${currentP12Status}\n` : `${currentP12Status}\n- authorized continuation: \`WBV2-P13-000\`\n\nHigh-value domain work may continue under a new manifest root without changing the P12 evidence classification.\n`);
|
||||
fs.writeFileSync(absolute(p12ManifestPath), `${JSON.stringify(p12, null, 2)}\n`);
|
||||
execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P12-005", "--write"], { cwd: root, stdio: "pipe" });
|
||||
p12.artifacts = Object.fromEntries(Object.entries(p12.artifacts).map(([name, artifact]) => [name, { ...artifact, sha256: sha256(artifact.path) }]));
|
||||
fs.writeFileSync(absolute(p12ManifestPath), `${JSON.stringify(p12, null, 2)}\n`);
|
||||
const artifactPaths = { parentManifest: p12ManifestPath, parentReport: p12ReportPath, approval: "docs/status/M12-PROVENANCE-EPOCH-2-APPROVAL.json", plan: planPath, report: reportPath, rootCard: "docs/tasks/WBV2-P13-000.md", rootStatus: rootStatusPath, activeCard: "docs/tasks/WBV2-P13-001.md" };
|
||||
const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }]));
|
||||
const manifest = { schemaVersion: 1, task: "WBV2-P13-000", parentTask: "WBV2-P12-005", operation: "AUTHORIZE_HIGH_VALUE_DOMAIN_CONTINUATION", status: "done", enablingTask: true, parityStateChange: false, artifacts, assertions: { p12EvidencePreserved: true, readOnlyLedgerFirst: true, noRepeatedExecution: true, authorizedRebaselineOnly: true, fullHistoricalReproduction: false, domainScope: ["ADVANCED_LEDGER", "GEOMETRY_NODES", "RIG_POSE", "SIMULATION", "RENDER", "MEDIA", "SERVER"] }, nextTask: "WBV2-P13-001" };
|
||||
fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" });
|
||||
let queue = read("docs/EXECUTION_QUEUE.md");
|
||||
queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P13-001` |")
|
||||
.replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P13-000/manifest.json` |")
|
||||
.replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P13-001.md`](tasks/WBV2-P13-001.md) |");
|
||||
fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
let nextTaskFile = read("nextTask.md");
|
||||
nextTaskFile = nextTaskFile.replace(/\| Current task when this file was written \| `[^`]+` \|/u, "| Current task when this file was written | `WBV2-P13-001` |")
|
||||
.replace(/\| Current task state \| `[^`]+` \|/u, "| Current task state | `in_progress` |")
|
||||
.replace(/\| Parent manifest \| `[^`]+` \|/u, "| Parent manifest | `tests/golden/WBV2-P13-000/manifest.json` |")
|
||||
.replace(/\| Current task card \| `[^`]+` \|/u, "| Current task card | `docs/tasks/WBV2-P13-001.md` |")
|
||||
.replace(/\| Current task-context nextTask \| `[^`]+` \|/u, "| Current task-context nextTask | `WBV2-P13-002` |")
|
||||
.replace(/\| Focused command \| `[^`]+` \|/u, "| Focused command | `node tools/web/generate-wbv2-advanced-ledger.mjs --write` |");
|
||||
fs.writeFileSync(absolute("nextTask.md"), nextTaskFile);
|
||||
process.stdout.write("wbv2-high-value-root-ok root=WBV2-P13-000 next=WBV2-P13-001 scope=ADVANCED_LEDGER,GEOMETRY_NODES,RIG_POSE,SIMULATION,RENDER,MEDIA,SERVER\n");
|
||||
42
tools/web/generate-wbv2-rig-pose-receipt.mjs
Normal file
42
tools/web/generate-wbv2-rig-pose-receipt.mjs
Normal file
@@ -0,0 +1,42 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const write = process.argv.includes("--write");
|
||||
const absolute = (file) => path.join(root, file);
|
||||
const read = (file) => fs.readFileSync(absolute(file), "utf8");
|
||||
const json = (file) => JSON.parse(read(file));
|
||||
const sha256 = (file) => crypto.createHash("sha256").update(fs.readFileSync(absolute(file))).digest("hex");
|
||||
const outputRoot = "tests/golden/WBV2-P13-003";
|
||||
const productionPath = `${outputRoot}/rig-pose-production.json`;
|
||||
const secondProductionPath = `${outputRoot}/rig-pose-production.second.json`;
|
||||
const reportPath = `${outputRoot}/rig-pose-receipt-report.json`;
|
||||
const statusPath = "docs/status/WBV2-P13-003.md";
|
||||
const planPath = `${outputRoot}/high-value-task-plan.json`;
|
||||
const manifestPath = `${outputRoot}/manifest.json`;
|
||||
const parentPath = "tests/golden/WBV2-P13-002/manifest.json";
|
||||
const sourceManifestPath = "tests/golden/WBV2-P3-003/manifest.json";
|
||||
const sourceReportPath = "tests/golden/WBV2-P3-003/rig-report.json";
|
||||
|
||||
const parent = json(parentPath); assert.equal(parent.status, "done"); assert.equal(parent.nextTask, "WBV2-P13-003");
|
||||
for (const artifact of Object.values(parent.artifacts ?? {})) assert.equal(sha256(artifact.path), artifact.sha256, artifact.path);
|
||||
const sourceManifest = json(sourceManifestPath); const sourceReport = json(sourceReportPath);
|
||||
assert.equal(sourceManifest.status, "done"); assert.equal(sourceReport.desktop.status, "EXACT"); assert.equal(sourceReport.wasm.status, "EXACT");
|
||||
const sourceBound = Object.values(sourceManifest.artifacts ?? {}).find((artifact) => artifact.path === sourceReportPath); assert.ok(sourceBound); assert.equal(sourceBound.sha256, sha256(sourceReportPath));
|
||||
assert.equal(sha256(productionPath), sha256(secondProductionPath));
|
||||
const production = json(productionPath);
|
||||
assert.equal(production.task, "WBV2-P13-003"); assert.equal(production.browser, "chromium"); assert.equal(production.queueMutation, false); assert.equal(production.before.armatureId, "armature:WBV2P3003Armature"); assert.equal(production.before.bones.length, 2); assert.equal(production.before.meshId, "mesh:WBV2P3003SkinnedMesh"); assert.equal(production.before.skinWeights.armatureId, "armature:WBV2P3003Armature"); assert.equal(production.editedRevision, production.baseRevision + 1); assert.deepEqual(production.after, production.before); assert.deepEqual(production.afterMalformed, production.after); assert.notEqual(production.malformed.code, "NO_ERROR"); assert.deepEqual(production.reopened, production.after); assert.equal(production.reopenedConstraint.enabled, false); assert.ok(Math.abs(production.reopenedConstraint.influence - 0.4) < 1e-5); assert.equal(production.saveReopenExact, true);
|
||||
|
||||
const receipt = { schemaVersion: 1, task: "WBV2-P13-003", operation: "RIG_POSE_ENGINE_RECEIPT", status: "PASS", browser: "chromium", queueMutation: false, source: { task: "WBV2-P3-003", manifest: sourceManifestPath, manifestSha256: sha256(sourceManifestPath), report: sourceReportPath, reportSha256: sha256(sourceReportPath), desktopExact: true, wasmExact: true, sourceSaveReopenExact: true, desktopShapeKeyCount: sourceReport.desktop.shapeKeyCount, wasmObservedShapeKeyCount: production.before.shapeKeyCount, shapeKeyObservation: "reader exposes one non-Basis key" }, production: { report: productionPath, reportSha256: sha256(productionPath), secondReport: secondProductionPath, secondReportSha256: sha256(secondProductionPath), deterministic: true, armatureId: production.before.armatureId, boneCount: production.before.bones.length, meshId: production.before.meshId, skinWeights: production.before.skinWeights, constraintEdit: { revisionDelta: production.editedRevision - production.baseRevision, objectId: "object:WBV2P3003SkinnedMeshObject", constraint: "WBV2P3003BoundedObjectConstraint", enabled: false, influence: production.reopenedConstraint.influence }, malformed: production.malformed, saveReopen: "EXACT" }, assertions: { stableBoneIds: true, poseMatricesPreserved: true, skinIdentityPreserved: true, unsupportedShapeKeyObservationExplicit: true, malformedConstraintRejected: true, saveReopenExact: true, historicalReproduction: false }, nextTask: "WBV2-P13-004" };
|
||||
if (!write) { process.stdout.write("wbv2-rig-pose-receipt-ok task=WBV2-P13-003 bones=2 constraint=EXACT saveReopen=EXACT malformed=REJECTED deterministic=true next=WBV2-P13-004\n"); process.exit(0); }
|
||||
fs.mkdirSync(absolute(outputRoot), { recursive: true }); fs.writeFileSync(absolute(reportPath), `${JSON.stringify(receipt, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute(statusPath), `# WBV2-P13-003 status\n\n- task: \`WBV2-P13-003\`; parent: \`WBV2-P13-002\`; status: \`done\`\n- armature: \`2\` stable bones; skin weights and pose matrices preserved\n- constraint edit: disabled at influence \`0.4\`; revision +1\n- save/reopen: \`EXACT\`; missing constraint identity rejected\n- shape key observation: desktop source reports 2 (includes Basis), WASM reader exposes 1 non-Basis key; difference is explicit\n- nextTask: \`WBV2-P13-004\`\n\nExisting P3-003 Rig/Pose evidence is reused read-only. The new Chromium receipt binds a bounded constraint edit and stable armature/skin identity to the compiled WASM Main without claiming unsupported shape-key parity.\n`);
|
||||
const previousPlan = json("tests/golden/WBV2-P13-002/high-value-task-plan.json"); const nextPlan = structuredClone(previousPlan); nextPlan.parentRecoveryPlan = { path: "tests/golden/WBV2-P13-002/high-value-task-plan.json", sha256: sha256("tests/golden/WBV2-P13-002/high-value-task-plan.json") }; nextPlan.tasks = nextPlan.tasks.map((task) => task.id === "WBV2-P13-003" ? { ...task, status: "done", ready: false } : task.id === "WBV2-P13-004" ? { ...task, status: "in_progress", ready: true } : { ...task, ready: false }); fs.writeFileSync(absolute(planPath), `${JSON.stringify(nextPlan, null, 2)}\n`);
|
||||
fs.writeFileSync(absolute("docs/tasks/WBV2-P13-004.md"), read("docs/tasks/WBV2-P13-004.md").replace("- status: planned", "- status: in_progress")); execFileSync(process.execPath, [absolute("tools/web/generate-v2-task-index.mjs"), "--plan-path", absolute(planPath)], { cwd: root, stdio: "inherit" }); execFileSync(process.execPath, [absolute("tools/web/check-task-context.mjs"), "--task", "WBV2-P13-003", "--write"], { cwd: root, stdio: "inherit" });
|
||||
const artifactPaths = { parentManifest: parentPath, sourceManifest: sourceManifestPath, sourceReport: sourceReportPath, production: productionPath, productionSecond: secondProductionPath, e2e: "web/tests/e2e/wbv2-rig-pose-production.spec.ts", client: "web/app/src/engine-client/WebEngineClient.ts", nativeApi: "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", generator: "tools/web/generate-wbv2-rig-pose-receipt.mjs", report: reportPath, status: statusPath, parityPlan: planPath, taskContext: `${outputRoot}/task-context.json` }; const artifacts = Object.fromEntries(Object.entries(artifactPaths).map(([name, file]) => [name, { path: file, sha256: sha256(file) }])); const manifest = { schemaVersion: 1, task: "WBV2-P13-003", parentTask: "WBV2-P13-002", operation: "RIG_POSE_ENGINE_RECEIPT", status: "done", enablingTask: false, parityStateChange: true, runtime: "PLAYWRIGHT_CHROMIUM_WEBENGINE_WASM", artifacts, assertions: { boneCount: 2, stablePoseMatrices: true, stableSkinIdentity: true, constraintEdit: "EXACT", saveReopen: "EXACT", malformedRejected: true, shapeKeyObservationExplicit: true, deterministic: true, historicalReproduction: false }, nextTask: "WBV2-P13-004" }; fs.writeFileSync(absolute(manifestPath), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
let queue = read("docs/EXECUTION_QUEUE.md"); queue = queue.replace(/\| 当前任务 \| `[^`]+` \|/u, "| 当前任务 | `WBV2-P13-004` |").replace(/\| parent manifest \| `[^`]+` \|/u, "| parent manifest | `tests/golden/WBV2-P13-003/manifest.json` |").replace(/\| 任务卡 \| \[[^\]]+\]\([^\)]+\) \|/u, "| 任务卡 | [`tasks/WBV2-P13-004.md`](tasks/WBV2-P13-004.md) |"); fs.writeFileSync(absolute("docs/EXECUTION_QUEUE.md"), queue);
|
||||
process.stdout.write(`wbv2-rig-pose-receipt-written task=WBV2-P13-003 bones=2 constraint=EXACT saveReopen=EXACT next=WBV2-P13-004 artifacts=${Object.keys(artifacts).length}\n`);
|
||||
Reference in New Issue
Block a user