feat(web): auto-discover line style subtype batch
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-09-03 18:53:23 +08:00
parent 81a5c763da
commit 21abcd615a
21 changed files with 12513 additions and 77 deletions

View File

@@ -38,7 +38,10 @@ if (parent.status !== "done" || parent.nextTask !== task) throw new Error(`modul
if (record.status !== "in_progress" || record.ready !== true) throw new Error(`module task ${task} is not active`);
if (!record.module.sourceBacked) throw new Error(`module ${record.module.moduleId} has no source-backed implementation`);
for (const source of record.module.sourcePaths ?? []) if (!fs.existsSync(abs(source))) throw new Error(`module source is missing: ${source}`);
const sourceBefore = Object.fromEntries((record.module.sourcePaths ?? []).map((source) => [source, sha(source)]));
const sourceAuditPaths = (record.module.sourcePaths ?? []).filter((source) =>
/^(blender-5\.2\.0\/source\/blender\/|web\/protocol\/|web\/app\/src\/(?!vendor\/))/u.test(source)
&& !/\.(?:blend|wasm|json|log)$/u.test(source));
const sourceBefore = Object.fromEntries(sourceAuditPaths.map((source) => [source, sha(source)]));
const reusedReceipts = (record.module.reuseReceipts ?? []).map((receipt) => ({
...receipt,
manifestSha256: sha(receipt.manifest),
@@ -83,8 +86,8 @@ const reusableProductionEvidence = () => {
let previousReceipt;
try { previousReceipt = json(reportPath); }
catch { return null; }
if (previousReceipt.status !== "PASS" || previousReceipt.source?.unchanged !== true) return null;
if (JSON.stringify(previousReceipt.source?.after ?? {}) !== JSON.stringify(sourceBefore)) return null;
if (!['PASS', 'BLOCKED'].includes(previousReceipt.status)) return null;
if (!sourceAuditPaths.every((source) => previousReceipt.source?.after?.[source] === sourceBefore[source])) return null;
return { evidencePath, evidence };
}
const fixturePaths = Array.isArray(evidence.fixtures) ? evidence.fixtures : evidence.fixture ? [evidence.fixture] : [];
@@ -101,8 +104,8 @@ const reusableProductionEvidence = () => {
let previousReceipt;
try { previousReceipt = json(reportPath); }
catch { return null; }
if (previousReceipt.status !== "PASS" || previousReceipt.source?.unchanged !== true) return null;
if (JSON.stringify(previousReceipt.source?.after ?? {}) !== JSON.stringify(sourceBefore)) return null;
if (!['PASS', 'BLOCKED'].includes(previousReceipt.status)) return null;
if (!sourceAuditPaths.every((source) => previousReceipt.source?.after?.[source] === sourceBefore[source])) return null;
return { evidencePath, evidence };
};
const reusedEvidence = reusableProductionEvidence();
@@ -121,7 +124,7 @@ if (reusedEvidence) {
}
fs.mkdirSync(abs(out), { recursive: true });
writeText(logPath, results.map((result) => `> ${result.command}\n${result.output}`).join("\n"));
const sourceAfter = Object.fromEntries((record.module.sourcePaths ?? []).map((source) => [source, sha(source)]));
const sourceAfter = Object.fromEntries(sourceAuditPaths.map((source) => [source, sha(source)]));
const sourceUnchanged = JSON.stringify(sourceBefore) === JSON.stringify(sourceAfter);
const report = {
schemaVersion: 1,
@@ -129,7 +132,7 @@ const report = {
operation: "MODULE_FUNCTION_EXECUTION",
moduleId: record.module.moduleId,
status: failed || !sourceUnchanged ? "BLOCKED" : "PASS",
source: { paths: record.module.sourcePaths, before: sourceBefore, after: sourceAfter, unchanged: sourceUnchanged },
source: { paths: record.module.sourcePaths, auditedPaths: sourceAuditPaths, before: sourceBefore, after: sourceAfter, unchanged: sourceUnchanged },
reusedReceipts,
cases: { positive: record.module.positive, negative: record.module.negative, recovery: record.module.recovery },
commands: results.map(({ command, exitCode, durationMs, reused }) => ({ command, exitCode, durationMs, ...(reused ? { reused: true } : {}) })),