Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

fix(release): validate native counts against candidate manifest

罗高fa00998cfed9
diff --git a/.github/scripts/motion-release.mjs b/.github/scripts/motion-release.mjs
index c7e026ac..793ffc35 100644
--- a/.github/scripts/motion-release.mjs
+++ b/.github/scripts/motion-release.mjs
@@ -304,6 +304,7 @@ export async function promoteTest(directory, inputs, { fetcher = fetch, run = ru
export async function stableReports(directory, candidate) {
channelVersion(candidate.version, 'stable');
+ const manifest = await json(path.join(directory, 'release-npm.json'));
const reports = [];
for (const platform of ['darwin-arm64', 'win32-x64']) {
const file = path.join(directory, `registry-${platform}.json`), report = await json(file);
@@ -311,7 +312,8 @@ export async function stableReports(directory, candidate) {
for (const key of ['version', 'sourceCommit', 'tgzSHA256']) assert.equal(report[key], candidate[key], 'Native report mismatch: ' + key);
assert.equal(report.templateEnvironment, 'prod');
for (const key of ['registryColdInstall', 'nativePreparation', 'repeatSetup', 'resources']) assert.equal(report[key], 'passed', 'Native check failed: ' + key);
- assert.equal(report.mcpTools, 11); assert.equal(report.skills, 5);
+ assert.equal(report.mcpTools, manifest.mcp.tools.length, 'Native report mismatch: mcpTools');
+ assert.equal(report.skills, manifest.skills.length, 'Native report mismatch: skills');
reports.push({ platform, reportSHA256: await sha256(file), report });
}
return reports;
diff --git a/docs/product/changes.md b/docs/product/changes.md
index 73458c65..49ca1ae8 100644
--- a/docs/product/changes.md
+++ b/docs/product/changes.md
@@ -1,5 +1,10 @@
# 公开变更记录
+## 2026-11-12: Match stable installation reports to the candidate manifest
+
+- Stable promotion and archive recovery compare native MCP Tool and Skill counts with the verified candidate manifest. Packages with compatibility Skill aliases no longer fail the obsolete five-Skill assertion, while mismatched reports still block promotion.
+- Regression coverage includes ten-Skill promotion and archiving, older five-Skill candidates, and missing or extra Tools/Skills on either platform. Registry and storage writes are mocked; publication remains a separate authorized operation.
+
## 2026-11-12: Save SVG styles and initialize the initial project on open
- SVG inline-style edits use the existing source patcher, guarded file writer and edit history when the pinned engine cannot persist SVG targets. Missing element identities and concurrent source changes still reject the edit and keep navigation blocked.
diff --git a/tests/release-fixture.mjs b/tests/release-fixture.mjs
index 51024e39..c68bd627 100644
--- a/tests/release-fixture.mjs
+++ b/tests/release-fixture.mjs
@@ -19,6 +19,8 @@ export async function candidateFixture(t, branch = 'main', options = {}) {
const application = path.join(pkg, 'payload', `openmotion-application-${version}-${templateEnvironment}.tar.gz`);
await runFile('tar', ['-czf', application, '-C', app, '.']);
const manifest = { schemaVersion: 1, version, format: 'npm', templateEnvironment, commit,
+ mcp: { tools: Array.from({ length: 11 }, (_, index) => `openmotion_tool_${index}`) },
+ skills: options.skills || ['production', 'director', 'template-to-video', 'recreate', 'video-to-template'].flatMap(name => ['openmotion-' + name, 'motion-' + name]),
application: { url: './' + path.basename(application), sha256: await sha256(application) },
locks: { npm: await sha256(path.join(app, 'package-lock.json')), native: await sha256(path.join(app, 'scripts/runtime-lock.json')) },
runtime: { targets: { mac: { platform: 'darwin', arch: 'arm64' } } } };
@@ -41,7 +43,7 @@ export async function candidateFixture(t, branch = 'main', options = {}) {
await writeJSON(path.join(directory, 'authorization.json'), authorization);
for (const platform of ['darwin-arm64', 'win32-x64']) await writeJSON(path.join(directory, `registry-${platform}.json`), {
status: 'passed', templateEnvironment, platform, version, sourceCommit: commit, tgzSHA256: candidate.tgzSHA256,
- registryColdInstall: 'passed', nativePreparation: 'passed', repeatSetup: 'passed', resources: 'passed', mcpTools: 11, skills: 5,
+ registryColdInstall: 'passed', nativePreparation: 'passed', repeatSetup: 'passed', resources: 'passed', mcpTools: manifest.mcp.tools.length, skills: manifest.skills.length,
});
await writeJSON(path.join(directory, 'npm-publication.json'), { tgzSHA256: candidate.tgzSHA256, previousLatest: '0.5.0' });
await writeJSON(path.join(directory, 'test-promotion.json'), { version, tgzSHA256: candidate.tgzSHA256, action: inputs.action, publicationRun: publicationEnv.GITHUB_RUN_ID, status: 'already-promoted' });
diff --git a/tests/stable-release.test.mjs b/tests/stable-release.test.mjs
index fc48891b..d66cc0d2 100644
--- a/tests/stable-release.test.mjs
+++ b/tests/stable-release.test.mjs
@@ -50,6 +50,7 @@ test('stable selection is explicit and rejects prerelease/prod or stable/DEV cha
test('stable stage, native acceptance, latest and exact/prod guides use the same immutable bytes', async t => {
const f = await candidateFixture(t, 'main', { version: '0.6.4' }), store = services(f);
+ assert.equal(f.manifest.skills.length, 10);
await publishNpm(f.directory, f.inputs, store);
assert.equal(store.getLatest(), '0.5.0');
const native = path.join(f.directory, 'registry-win32-x64.json'), original = await readFile(native, 'utf8');
@@ -72,6 +73,32 @@ test('stable stage, native acceptance, latest and exact/prod guides use the same
assert.equal(store.writes.length, 2, 'Retry does not republish or move latest again');
});
+test('stable rejects native tool and Skill counts that differ from the candidate on either platform', async t => {
+ const f = await candidateFixture(t, 'main', { version: '0.6.7' }), store = services(f);
+ await publishNpm(f.directory, f.inputs, store);
+ for (const platform of ['darwin-arm64', 'win32-x64']) {
+ const file = path.join(f.directory, `registry-${platform}.json`), original = await readFile(file, 'utf8');
+ for (const patch of [{ skills: 5 }, { skills: 9 }, { skills: 11 }, { mcpTools: 10 }, { mcpTools: 12 }]) {
+ await writeFile(file, JSON.stringify({ ...JSON.parse(original), ...patch }));
+ await assert.rejects(promoteStable(f.directory, f.inputs, store), /Native report mismatch: (skills|mcpTools)/);
+ await assert.rejects(archiveRelease(f.directory, f.inputs, config, store), /Native report mismatch: (skills|mcpTools)/);
+ assert.equal(store.getLatest(), '0.5.0');
+ assert.equal(store.writes.length, 1, 'Mismatched reports must not promote latest');
+ assert.equal(store.objects.size, 0, 'Mismatched reports must not archive the release');
+ }
+ await writeFile(file, original);
+ }
+ assert.equal((await promoteStable(f.directory, f.inputs, store)).status, 'promoted');
+});
+
+test('stable accepts an older candidate with only the five canonical Skills', async t => {
+ const skills = ['production', 'director', 'template-to-video', 'recreate', 'video-to-template'].map(name => 'openmotion-' + name);
+ const f = await candidateFixture(t, 'main', { version: '0.6.5', skills }), store = services(f);
+ await publishNpm(f.directory, f.inputs, store);
+ assert.equal((await promoteStable(f.directory, f.inputs, store)).status, 'promoted');
+ await archiveRelease(f.directory, f.inputs, config, store);
+});
+
test('stable recovery never publishes, changes tags or touches the moving guide; newer latest is preserved', async t => {
const f = await candidateFixture(t, 'main', { version: '0.6.4' }), store = services(f);
await publishNpm(f.directory, f.inputs, store);