From 370873511d26a152525b7fbf9608416649583637 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 26 Apr 2026 15:25:20 +0300 Subject: [PATCH] =?UTF-8?q?feat(verify-snapshots):=20=D0=BF=D0=BB=D0=B0?= =?UTF-8?q?=D1=82=D1=84=D0=BE=D1=80=D0=BC=D0=B5=D0=BD=D0=BD=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=B8=D1=84=D0=B8=D0=BA=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20epf-init=20=D0=B8=20erf-init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EPF_SKILLS превращён из «skip» в реальную сборку через epf-build — строится .epf или .erf по расширению из map. Имя источника берётся из caseData.params.name. erf-init добавлен в DEFAULT_SKILLS. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/skills/verify-snapshots.mjs | 41 +++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/tests/skills/verify-snapshots.mjs b/tests/skills/verify-snapshots.mjs index eb0651b0..bf30a01f 100644 --- a/tests/skills/verify-snapshots.mjs +++ b/tests/skills/verify-snapshots.mjs @@ -325,9 +325,11 @@ const STANDALONE_SKILLS = new Set([ // schema and we know if it's accepted. const SKD_PLATFORM_VERIFY = new Set(['skd-compile', 'skd-edit']); -// EPF/ERF skills — need epf-build to verify, not LoadConfigFromFiles -const EPF_SKILLS = new Set([ - 'epf-init', 'erf-init', 'template-add', 'help-add', +// EPF/ERF skills — verified by epf-build on the produced source. +// Map skill -> output extension (.epf/.erf). +const EPF_SKILLS = new Map([ + ['epf-init', '.epf'], + ['erf-init', '.erf'], ]); // CFE skills — two-stage load: base config → extension @@ -360,7 +362,8 @@ async function verifyCase(skillName, caseName, skillConfig, caseData, opts) { // Determine config dir const setupType = skillConfig.setup || 'empty-config'; const isStandalone = STANDALONE_SKILLS.has(skillName); - const isEpf = EPF_SKILLS.has(skillName); + const epfExt = EPF_SKILLS.get(skillName); + const isEpf = !!epfExt; const isCfInit = CONFIG_INIT_SKILLS.has(skillName); // For 'empty-config': workDir is the config (setup creates it) // For cf-init: workDir becomes the config after the script runs @@ -567,8 +570,32 @@ async function verifyCase(skillName, caseName, skillConfig, caseData, opts) { } if (isEpf) { - result.passed = true; - log('platform-load', true, 'skipped (EPF — verified by integration/platform-epf)'); + const name = caseData.params?.name; + if (!name) { + result.errors.push(`EPF/ERF verify requires params.name`); + return result; + } + const sourceFile = join(workDir, `${name}.xml`); + if (!existsSync(sourceFile)) { + result.errors.push(`EPF/ERF source not found: ${sourceFile}`); + return result; + } + const outDir = join(workDir, '__build'); + mkdirSync(outDir, { recursive: true }); + const outFile = join(outDir, `${name}${epfExt}`); + try { + execSkill(opts.runtime, 'epf-build/scripts/epf-build', [ + '-V8Path', opts.v8ctx.v8path, + '-SourceFile', sourceFile, + '-OutputFile', outFile, + ], 180_000); + log('epf-build', true, `platform built ${epfExt}`); + result.passed = true; + } catch (e) { + const detail = (e.stderr || e.stdout || e.message).trim(); + log('epf-build', false, detail); + result.errors.push(`epf-build failed: ${detail.substring(0, 1000)}`); + } return result; } @@ -752,7 +779,7 @@ const DEFAULT_SKILLS = [ 'meta-compile', 'form-compile', 'form-compile-from-object', 'form-add', 'form-edit', 'role-compile', 'subsystem-compile', 'subsystem-edit', 'cf-init', 'cf-edit', 'meta-edit', 'interface-edit', - 'epf-init', 'template-add', 'help-add', + 'epf-init', 'erf-init', 'template-add', 'help-add', 'cfe-init', 'cfe-borrow', 'cfe-patch-method', 'skd-compile', 'skd-edit', 'mxl-compile', ];