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.
TypeScript agent-skillsagentic-aiai-agentsai-videobyokclaude-codecodexdeepseek-harnessdsh-plugingenerative-ailocal-firstmcpmotionmotion-graphicsmultimodalopenmotionreverse-engineeringvideo-editingvideo-generationworkbuddy
fix(release): retry downloads and separate native installation checks
罗高094299dae71d
diff --git a/.github/scripts/motion-registry-smoke.mjs b/.github/scripts/motion-registry-smoke.mjsindex be099b08..90b79a2c 100644--- a/.github/scripts/motion-registry-smoke.mjs+++ b/.github/scripts/motion-registry-smoke.mjs@@ -1,12 +1,13 @@import assert from 'node:assert/strict';-import { createHash } from 'node:crypto';import { spawn } from 'node:child_process';import { createInterface } from 'node:readline';import { access, mkdir, mkdtemp, readFile, readdir, writeFile } from 'node:fs/promises';import os from 'node:os';import path from 'node:path';import { fileURLToPath } from 'node:url';-import { runFile, sha256, writeJSON } from '../../scripts/runtime-assets.mjs';+import { runFile, writeJSON } from '../../scripts/runtime-assets.mjs';+import { verifyRegistryDownload } from './motion-registry.mjs';+import { verifyDownloaded } from './motion-release.mjs';export function consumerEnvironment(work, source = process.env) {// Consumer code receives OS basics only, never CI credentials or Agent/browser IPC capabilities.@@ -15,6 +16,7 @@ export function consumerEnvironment(work, source = process.env) {return { ...env, CODEX_HOME: path.join(work, 'codex'), npm_config_cache: path.join(work, 'npm-cache'),npm_config_userconfig: path.join(work, 'user.npmrc'), npm_config_globalconfig: path.join(work, 'global.npmrc'),npm_config_registry: 'https://registry.npmjs.org/', npm_config_ignore_scripts: 'true',+ npm_config_fetch_retries: '3', npm_config_fetch_retry_mintimeout: '10000', npm_config_fetch_retry_maxtimeout: '30000',OPENMOTION_TELEMETRY: '0', HYPERFRAMES_NO_TELEMETRY: '1' };}@@ -43,12 +45,12 @@ async function discover(transport, env, version, tools) {}export async function registrySmoke(directory) {- const c = JSON.parse(await readFile(path.join(directory, 'candidate.json')));+ const c = await verifyDownloaded(directory, process.env.MOTION_EXPECTED_SHA256, process.env.MOTION_VERSION);const platform = process.platform + '-' + process.arch;assert(['darwin-arm64', 'win32-x64'].includes(platform), 'Use a supported native runner');const file = path.join(directory, `registry-${platform}.json`);let phase = 'registry-download';- const checkpoint = async next => { phase = next; await writeJSON(file, { status: 'running', phase, version: c.version, platform, tgzSHA256: c.tgzSHA256 }); };+ const checkpoint = async next => { phase = next; console.log('Installation phase: ' + phase); await writeJSON(file, { status: 'running', phase, version: c.version, platform, tgzSHA256: c.tgzSHA256 }); };await checkpoint(phase);try {const work = await mkdtemp(path.join(os.tmpdir(), 'om-registry-')), env = consumerEnvironment(work);@@ -59,18 +61,7 @@ export async function registrySmoke(directory) {const npm = path.join(path.dirname(process.execPath), process.platform === 'win32' ? 'node_modules/npm/bin/npm-cli.js' : '../lib/node_modules/npm/bin/npm-cli.js');const cli = args => runFile(process.execPath, [npm, ...args], { cwd: project, env, timeout: 20 * 60_000 });console.log('Fetching the exact version anonymously from the public registry');- let metadata;- for (let attempt = 0; attempt < 30; attempt++) {- const response = await fetch('https://registry.npmjs.org/@openmotion%2fapp/' + c.version, { signal: AbortSignal.timeout(30_000) });- if (response.ok) { metadata = await response.json(); break; }- assert.equal(response.status, 404, 'Registry lookup failed');- await new Promise(resolve => setTimeout(resolve, 10_000));- }- assert(metadata, 'Registry version did not become visible'); assert.equal(metadata.dist.integrity, c.integrity);- const [packed] = JSON.parse(await cli(['pack', `${c.packageName}@${c.version}`, '--ignore-scripts', '--json', '--pack-destination', work]));- assert.equal(path.basename(packed.filename), packed.filename);- const tgz = path.join(work, packed.filename), bytes = await readFile(tgz);- assert.equal(await sha256(tgz), c.tgzSHA256); assert.equal('sha512-' + createHash('sha512').update(bytes).digest('base64'), c.integrity);+ const { tgz } = await verifyRegistryDownload(directory, { destination: work });await checkpoint('host-install');console.log('Installing the pinned test host in an isolated prefix');await cli(['install', '--prefix', host, '--no-save', '--ignore-scripts', '--no-audit', '--no-fund', '@openai/[email protected]']);diff --git a/.github/scripts/motion-registry.mjs b/.github/scripts/motion-registry.mjsnew file mode 100644index 00000000..679920a9--- /dev/null+++ b/.github/scripts/motion-registry.mjs@@ -0,0 +1,73 @@+import assert from 'node:assert/strict';+import { createHash } from 'node:crypto';+import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';+import os from 'node:os';+import path from 'node:path';+import { checkReleaseVersion } from '../../scripts/release-version.mjs';+import { writeJSON } from '../../scripts/runtime-assets.mjs';++// Bound propagation/network retries; invalid bytes and authorization errors never retry.+export async function registryRead(url, consume, { fetcher = fetch, timeout = 15 * 60_000,+ now = Date.now, sleep = ms => new Promise(resolve => setTimeout(resolve, ms)), log = console.log } = {}) {+ const started = now(), deadline = started + timeout;+ for (let attempt = 1; ; attempt++) {+ let response, retry;+ try {+ response = await fetcher(url, { redirect: 'error', headers: { 'cache-control': 'no-cache' },+ signal: AbortSignal.timeout(Math.max(1, Math.min(30_000, deadline - now()))) });+ retry = [404, 408, 429].includes(response.status) || response.status >= 500;+ log(`Registry attempt ${attempt}: HTTP ${response.status}, ${Math.round((now() - started) / 1000)}s elapsed`);+ if (!retry) {+ assert(response.ok, `Registry request failed: HTTP ${response.status}`);+ return await consume(response);+ }+ } catch (error) {+ if (!(error instanceof TypeError) && !['TimeoutError', 'AbortError'].includes(error.name)) throw error;+ retry = true;+ log(`Registry attempt ${attempt}: network unavailable, ${Math.round((now() - started) / 1000)}s elapsed`);+ }+ await response?.body?.cancel().catch(() => {});+ const remaining = deadline - now();+ assert(remaining > 0, 'REGISTRY_NOT_READY: public download did not become available before the deadline');+ await sleep(Math.min(10_000, remaining));+ }+}++export async function verifyRegistryDownload(directory, { destination, ...options } = {}) {+ await rm(path.join(directory, 'registry-package.json'), { force: true });+ const c = JSON.parse(await readFile(path.join(directory, 'candidate.json')));+ assert.equal(c.packageName, '@openmotion/app');+ checkReleaseVersion(c.version); assert(c.version.includes('-test.'));+ assert.equal(c.tgz, `openmotion-app-${c.version}.tgz`);+ assert.match(c.tgzSHA256, /^[a-f0-9]{64}$/);+ const temporary = destination || await mkdtemp(path.join(os.tmpdir(), 'om-download-'));+ try {+ const metadata = await registryRead(`https://registry.npmjs.org/@openmotion%2fapp/${c.version}`, r => r.json(), options);+ assert.equal(metadata.name, c.packageName); assert.equal(metadata.version, c.version);+ assert.equal(metadata.dist.integrity, c.integrity, 'Published npm version has different bytes');+ const url = new URL(metadata.dist.tarball);+ assert(url.protocol === 'https:' && url.hostname === 'registry.npmjs.org' && !url.username && !url.password, 'Require the public npm tarball origin');+ const bytes = await registryRead(url, async response => {+ assert(Number(response.headers.get('content-length') || 0) < 150 * 1024 * 1024);+ const buffer = Buffer.from(await response.arrayBuffer());+ assert(buffer.length < 150 * 1024 * 1024);+ return buffer;+ }, options);+ assert.equal(createHash('sha256').update(bytes).digest('hex'), c.tgzSHA256, 'Registry tgz SHA256 mismatch');+ assert.equal('sha512-' + createHash('sha512').update(bytes).digest('base64'), c.integrity, 'Registry tgz integrity mismatch');+ const tgz = path.join(temporary, c.tgz);+ await writeFile(tgz, bytes);+ const report = { schemaVersion: 1, status: 'passed', version: c.version, sourceCommit: c.sourceCommit,+ tgzSHA256: c.tgzSHA256, integrity: c.integrity, registryDownload: 'passed', nativeInstallation: 'not-run' };+ await writeJSON(path.join(directory, 'registry-package.json'), report);+ return { tgz, report };+ } finally { if (!destination) await rm(temporary, { recursive: true, force: true }); }+}++export async function registryReport(directory, candidate) {+ const report = JSON.parse(await readFile(path.join(directory, 'registry-package.json')));+ assert.equal(report.schemaVersion, 1);+ assert.equal(report.status, 'passed'); assert.equal(report.registryDownload, 'passed');+ for (const key of ['version', 'sourceCommit', 'tgzSHA256', 'integrity']) assert.equal(report[key], candidate[key], 'Registry report mismatch: ' + key);+ return report;+}diff --git a/.github/scripts/motion-release.mjs b/.github/scripts/motion-release.mjsindex ce070a8b..84ab7383 100644--- a/.github/scripts/motion-release.mjs+++ b/.github/scripts/motion-release.mjs@@ -11,6 +11,7 @@ import { checkReleaseVersion, compareReleaseVersions, testVersion } from '../../import { generateInstallGuide } from '../../scripts/install-guide.mjs';import { publishGuide, storagePlan } from './publish-install-guide.mjs';import { scanPackage, scanSource } from './motion-scan.mjs';+import { registryReport, verifyRegistryDownload } from './motion-registry.mjs';export const repository = 'nexu-io/html-anything';export const candidateWorkflow = '.github/workflows/motion-candidate.yml';@@ -182,22 +183,6 @@ export async function verifyDownloaded(directory, expectedSHA256, version) {return candidate;}-export async function platformReports(directory, candidate) {- const reports = [];- for (const platform of ['darwin-arm64', 'win32-x64']) {- const name = `registry-${platform}.json`, report = await json(path.join(directory, name));- assert.equal(report.status, 'passed'); assert.equal(report.platform, platform);- assert.equal(report.version, candidate.version); assert.equal(report.tgzSHA256, candidate.tgzSHA256);- assert.equal(report.sourceCommit, candidate.sourceCommit);- assert.equal(report.templateEnvironment, 'dev');- assert.equal(report.registryColdInstall, 'passed'); assert.equal(report.nativePreparation, 'passed');- assert.equal(report.repeatSetup, 'passed'); assert.equal(report.resources, 'passed');- assert.equal(report.mcpTools, 11); assert.equal(report.skills, 5);- reports.push({ platform, reportSHA256: await sha256(path.join(directory, name)) });- }- return reports;-}-export async function findCandidate(version, fetcher = fetch) {checkReleaseVersion(version); assert(version.includes('-test.'));const name = `motion-candidate-${version}`;@@ -266,7 +251,7 @@ export async function publishNpm(directory, inputs, { fetcher = fetch, run = runexport async function promoteTest(directory, inputs, { fetcher = fetch, run = runFile, env = process.env } = {}) {const candidate = await verifyDownloaded(directory, inputs.expectedSHA256, inputs.version);await verifyAuthorization(directory, inputs, env);- const platforms = await platformReports(directory, candidate);+ const registryVerification = await registryReport(directory, candidate);const npm = await json(path.join(directory, 'npm-publication.json'));assert.equal(npm.tgzSHA256, candidate.tgzSHA256);const before = await registryPackage(candidate, fetcher);@@ -282,7 +267,7 @@ export async function promoteTest(directory, inputs, { fetcher = fetch, run = rustatus = 'promoted';}const record = { schemaVersion: 1, version: candidate.version, tgzSHA256: candidate.tgzSHA256, action: inputs.action,- publicationRun: env.GITHUB_RUN_ID, platformVerification: platforms, previousTest: before.tags.test ?? null, status };+ publicationRun: env.GITHUB_RUN_ID, registryVerification, platformVerification: { status: 'independent-not-attached', workflow: '.github/workflows/motion-install-check.yml' }, previousTest: before.tags.test ?? null, status };await writeJSON(path.join(directory, 'test-promotion.json'), record);return record;}@@ -291,11 +276,11 @@ export async function archiveRelease(directory, inputs, config, { run = runFile,await writeJSON(path.join(directory, 'release-attempt.json'), { action: inputs.action, tgzSHA256: inputs.expectedSHA256, stage: 'verifying-release', runId: env.GITHUB_RUN_ID });const candidate = await verifyDownloaded(directory, inputs.expectedSHA256);const authorization = await verifyAuthorization(directory, inputs, env);- const platforms = await platformReports(directory, candidate);+ const registryVerification = await registryReport(directory, candidate);const promotion = await json(path.join(directory, 'test-promotion.json'));assert.equal(promotion.version, candidate.version); assert.equal(promotion.tgzSHA256, candidate.tgzSHA256);assert.equal(promotion.action, inputs.action); assert.equal(promotion.publicationRun, env.GITHUB_RUN_ID);- assert.deepEqual(promotion.platformVerification, platforms);+ assert.deepEqual(promotion.registryVerification, registryVerification);assert((inputs.action === 'archive-only' ? ['archive-only'] : ['promoted', 'already-promoted', 'superseded']).includes(promotion.status), 'Require a successful channel verification');const record = await json(path.join(directory, 'install-record.json')), plan = storagePlan(record, config);assert.equal(candidate.tgzSHA256, inputs.expectedSHA256);@@ -315,10 +300,10 @@ export async function archiveRelease(directory, inputs, config, { run = runFile,catch (error) { if (/NoSuchKey|\(404\)|Not Found/.test(error.message)) return null; throw error; }};const prior = await get(`${prefix}/release-record.json`);- let release = { schemaVersion: 2, packageName: candidate.packageName, version: candidate.version, sourceCommit: candidate.sourceCommit,+ let release = { schemaVersion: 3, packageName: candidate.packageName, version: candidate.version, sourceCommit: candidate.sourceCommit,tgzSHA256: candidate.tgzSHA256, integrity: candidate.integrity, candidateRun: candidate.workflow,authorization, publicationRun: env.GITHUB_RUN_ID,- platformVerification: platforms, channelPromotion: promotion, templateEnvironment: record.templateEnvironment,+ registryVerification, platformVerification: { status: 'independent-not-attached', workflow: '.github/workflows/motion-install-check.yml' }, channelPromotion: promotion, templateEnvironment: record.templateEnvironment,status: 'registry-verified', publishedAt: new Date().toISOString() };if (prior) {const existing = JSON.parse(prior);@@ -326,7 +311,7 @@ export async function archiveRelease(directory, inputs, config, { run = runFile,release = existing;}await writeJSON(path.join(directory, 'release-record.json'), release);- const names = [...Object.keys(candidate.files), 'candidate.json', 'registry-darwin-arm64.json', 'registry-win32-x64.json', 'release-record.json'];+ const names = [...Object.keys(candidate.files), 'candidate.json', 'registry-package.json', 'release-record.json'];const objects = [];for (const name of names) {const file = path.join(directory, name), bytes = await readFile(file), key = `${prefix}/${name}`, existing = await get(key);@@ -373,6 +358,10 @@ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meawait writeJSON(path.join(directory, 'publication-package-scan.json'), await scanPackage(path.join(directory, c.tgz), final));} finally { await runFile('git', ['worktree', 'remove', '--force', work], { cwd: extra }).catch(() => {}); }} else if (command === 'verify') await verifyDownloaded(directory, inputs.expectedSHA256, inputs.version);+ else if (command === 'registry') {+ await verifyDownloaded(directory, inputs.expectedSHA256, inputs.version);+ await verifyRegistryDownload(directory);+ }else if (command === 'npm') await publishNpm(directory, inputs);else if (command === 'promote-test') await promoteTest(directory, inputs);else if (command === 'archive') {diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 30ba0d86..caf7245c 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -126,7 +126,7 @@ jobs:run: |node .github/scripts/motion-scan.mjs install "$RUNNER_TEMP/scanner"node .github/scripts/motion-scan.mjs source . "$RUNNER_TEMP/source-scan.json" "$RUNNER_TEMP/scanner/gitleaks"- node --test tests/release-workflows.test.mjs tests/release-scan.test.mjs+ node --test tests/release-workflows.test.mjs tests/release-scan.test.mjs tests/registry-download.test.mjs- name: Install locked Motion dependenciesrun: npm ci --no-audit --no-fund- name: Check and build Studiodiff --git a/.github/workflows/motion-install-check.yml b/.github/workflows/motion-install-check.ymlnew file mode 100644index 00000000..159940f3--- /dev/null+++ b/.github/workflows/motion-install-check.yml@@ -0,0 +1,113 @@+name: Motion installation check+run-name: Motion installation check · ${{ inputs.version || '0.6.4-test.7' }}++on:+ workflow_dispatch:+ inputs:+ version:+ description: 'Existing public test version to check; no publication or channel changes'+ type: string+ required: true+ default: '0.6.4-test.7'+ pull_request:+ branches: [feature/motion]+ paths:+ - '.github/workflows/motion-install-check.yml'+ - '.github/scripts/motion-registry*.mjs'+ - 'tests/registry-download.test.mjs'++permissions:+ contents: read+ actions: read++env:+ MOTION_VERSION: ${{ inputs.version || '0.6.4-test.7' }}++jobs:+ candidate:+ if: github.repository == 'nexu-io/html-anything' && (github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository)+ runs-on: ubuntu-24.04+ timeout-minutes: 10+ outputs:+ artifact_id: ${{ steps.artifact.outputs.artifact-id }}+ tgz_sha256: ${{ steps.download.outputs.tgz_sha256 }}+ steps:+ - uses: actions/[email protected]+ with:+ fetch-depth: 0+ persist-credentials: false+ - uses: actions/setup-node@v6+ with:+ node-version: '26.11.1'+ - name: Resolve and verify the original immutable candidate+ id: download+ env:+ GH_TOKEN: ${{ github.token }}+ run: |+ git fetch origin feature/motion:refs/remotes/origin/feature/motion+ node --input-type=module <<'JS'+ import { appendFile } from 'node:fs/promises';+ import { downloadCandidate, validateSource } from './.github/scripts/motion-release.mjs';+ const c = await downloadCandidate(process.env.MOTION_VERSION, process.env.RUNNER_TEMP + '/candidate');+ await validateSource(process.cwd(), c.sourceCommit, c.version);+ await appendFile(process.env.GITHUB_OUTPUT, `tgz_sha256=${c.tgzSHA256}\n`);+ JS+ - uses: actions/[email protected]+ id: artifact+ with:+ name: installation-candidate-${{ github.run_id }}-${{ github.run_attempt }}+ path: ${{ runner.temp }}/candidate/+ retention-days: 7+ if-no-files-found: error++ install:+ needs: candidate+ strategy:+ fail-fast: false+ matrix:+ include:+ - runner: macos-26+ platform: darwin-arm64+ - runner: windows-2025+ platform: win32-x64+ runs-on: ${{ matrix.runner }}+ timeout-minutes: 60+ env:+ MOTION_EXPECTED_SHA256: ${{ needs.candidate.outputs.tgz_sha256 }}+ steps:+ - uses: actions/[email protected]+ with:+ persist-credentials: false+ - uses: actions/setup-node@v6+ with:+ node-version: '26.11.1'+ - uses: actions/[email protected]+ with:+ artifact-ids: ${{ needs.candidate.outputs.artifact_id }}+ github-token: ${{ github.token }}+ run-id: ${{ github.run_id }}+ path: ${{ runner.temp }}/candidate+ - name: Install the public version and verify native preparation and MCP+ shell: bash+ run: node .github/scripts/motion-registry-smoke.mjs "$RUNNER_TEMP/candidate"+ - name: Retain the platform result even on failure+ if: always()+ uses: actions/[email protected]+ with:+ name: installation-${{ matrix.platform }}-${{ github.run_id }}-${{ github.run_attempt }}+ path: |+ ${{ runner.temp }}/candidate/registry-${{ matrix.platform }}.json+ ${{ runner.temp }}/candidate/registry-package.json+ retention-days: 30+ if-no-files-found: warn+ - name: Show the installation result+ if: always()+ shell: bash+ run: |+ node --input-type=module <<'JS'+ import { appendFile, readFile } from 'node:fs/promises';+ import os from 'node:os';+ const file = process.env.RUNNER_TEMP + `/candidate/registry-${process.platform}-${process.arch}.json`;+ const report = await readFile(file, 'utf8').catch(() => 'No installation report; inspect runner/artifact setup logs.');+ await appendFile(process.env.GITHUB_STEP_SUMMARY, `## Read-only installation check\n\nOS: ${os.release()} / ${process.arch}\n\n\`\`\`json\n${report}\n\`\`\`\n\nNo npm publish, dist-tag, R2 or install.md writes. Real model creation, template service access and desktop playback are not covered.\n`);+ JSdiff --git a/.github/workflows/motion-publish-test.yml b/.github/workflows/motion-publish-test.ymlindex fb20cfbb..b0736b54 100644--- a/.github/workflows/motion-publish-test.yml+++ b/.github/workflows/motion-publish-test.yml@@ -130,50 +130,13 @@ jobs:retention-days: 30if-no-files-found: warn- registry-mac:+ registry:if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' }}env:MOTION_EXPECTED_SHA256: ${{ needs.verify.outputs.tgz_sha256 }}needs: [verify, npm]- runs-on: macos-26- timeout-minutes: 40- outputs:- artifact_id: ${{ steps.artifact.outputs.artifact-id }}- steps:- - uses: actions/[email protected]- with:- ref: ${{ github.sha }}- persist-credentials: false- - uses: actions/setup-node@v6- with:- node-version: '26.11.1'- - uses: actions/[email protected]- with:- artifact-ids: ${{ needs.verify.outputs.artifact_id }}- github-token: ${{ github.token }}- run-id: ${{ github.run_id }}- path: ${{ runner.temp }}/candidate- - name: Anonymous exact-version cold installation and native MCP discovery- shell: bash- run: |- node .github/scripts/motion-release.mjs verify "$RUNNER_TEMP/candidate"- node .github/scripts/motion-registry-smoke.mjs "$RUNNER_TEMP/candidate"- - uses: actions/[email protected]- id: artifact- if: always()- with:- name: registry-darwin-arm64-${{ github.run_id }}-${{ github.run_attempt }}- path: ${{ runner.temp }}/candidate/registry-darwin-arm64.json- retention-days: 30- if-no-files-found: warn-- registry-windows:- if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' }}- env:- MOTION_EXPECTED_SHA256: ${{ needs.verify.outputs.tgz_sha256 }}- needs: [verify, npm]- runs-on: windows-2025- timeout-minutes: 40+ runs-on: ubuntu-24.04+ timeout-minutes: 35outputs:artifact_id: ${{ steps.artifact.outputs.artifact-id }}steps:@@ -190,25 +153,23 @@ jobs:github-token: ${{ github.token }}run-id: ${{ github.run_id }}path: ${{ runner.temp }}/candidate- - name: Anonymous exact-version cold installation and native MCP discovery+ - name: Verify the anonymous exact-version download without executing the packageshell: bash- run: |- node .github/scripts/motion-release.mjs verify "$RUNNER_TEMP/candidate"- node .github/scripts/motion-registry-smoke.mjs "$RUNNER_TEMP/candidate"+ run: node .github/scripts/motion-release.mjs registry "$RUNNER_TEMP/candidate"- uses: actions/[email protected]id: artifactif: always()with:- name: registry-win32-x64-${{ github.run_id }}-${{ github.run_attempt }}- path: ${{ runner.temp }}/candidate/registry-win32-x64.json+ name: registry-package-${{ github.run_id }}-${{ github.run_attempt }}+ path: ${{ runner.temp }}/candidate/registry-package.jsonretention-days: 30if-no-files-found: warnpromote-test:- if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' && needs.registry-mac.result == 'success' && needs.registry-windows.result == 'success' }}+ if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' && needs.registry.result == 'success' }}env:MOTION_EXPECTED_SHA256: ${{ needs.verify.outputs.tgz_sha256 }}- needs: [verify, npm, registry-mac, registry-windows]+ needs: [verify, npm, registry]runs-on: ubuntu-24.04timeout-minutes: 15outputs:@@ -242,17 +203,11 @@ jobs:path: ${{ runner.temp }}/candidate- uses: actions/[email protected]with:- artifact-ids: ${{ needs.registry-mac.outputs.artifact_id }}+ artifact-ids: ${{ needs.registry.outputs.artifact_id }}github-token: ${{ github.token }}run-id: ${{ github.run_id }}path: ${{ runner.temp }}/candidate- - uses: actions/[email protected]- with:- artifact-ids: ${{ needs.registry-windows.outputs.artifact_id }}- github-token: ${{ github.token }}- run-id: ${{ github.run_id }}- path: ${{ runner.temp }}/candidate- - name: Advance npm test only after both native registry checks pass+ - name: Advance npm test only after the exact public bytes are verifiedrun: node .github/scripts/motion-release.mjs promote-test "$RUNNER_TEMP/candidate"- name: Retain the verified channel resultid: artifact@@ -265,11 +220,11 @@ jobs:if-no-files-found: warnsnapshot:- if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' && needs.registry-mac.result == 'success' && needs.registry-windows.result == 'success' && needs.promote-test.result == 'success' }}+ if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' && needs.registry.result == 'success' && needs.promote-test.result == 'success' }}env:MOTION_EXPECTED_SHA256: ${{ needs.verify.outputs.tgz_sha256 }}MOTION_INSTALL_PUBLIC_ORIGIN: ${{ vars.CLOUDFLARE_R2_RELEASES_PUBLIC_ORIGIN }}- needs: [verify, npm, registry-mac, registry-windows, promote-test]+ needs: [verify, npm, registry, promote-test]runs-on: ubuntu-24.04timeout-minutes: 15steps:@@ -294,13 +249,7 @@ jobs:path: ${{ runner.temp }}/candidate- uses: actions/[email protected]with:- artifact-ids: ${{ needs.registry-mac.outputs.artifact_id }}- github-token: ${{ github.token }}- run-id: ${{ github.run_id }}- path: ${{ runner.temp }}/candidate- - uses: actions/[email protected]- with:- artifact-ids: ${{ needs.registry-windows.outputs.artifact_id }}+ artifact-ids: ${{ needs.registry.outputs.artifact_id }}github-token: ${{ github.token }}run-id: ${{ github.run_id }}path: ${{ runner.temp }}/candidate@@ -340,5 +289,5 @@ jobs:const c = JSON.parse(readFileSync(process.env.RUNNER_TEMP + '/candidate/candidate.json'));const a = JSON.parse(readFileSync(process.env.RUNNER_TEMP + '/candidate/release-attempt.json'));const origin = process.env.MOTION_INSTALL_PUBLIC_ORIGIN;- appendFileSync(process.env.GITHUB_STEP_SUMMARY, `## Test publication result\n\nVersion: ${c.version}\n\nSource: ${c.sourceCommit}\n\nResult: ${a.stage}\n\n[Exact-version installation guide](${origin}/open-motion/dev/${c.version}/install.md)\n\n[Default test guide](${origin}/open-motion/dev/install.md)\n\nThe default is advanced only after registry/native checks and public readback; a superseded candidate keeps its version snapshot without moving the default. No stable release occurred.\n`);+ appendFileSync(process.env.GITHUB_STEP_SUMMARY, `## Test publication result\n\nVersion: ${c.version}\n\nSource: ${c.sourceCommit}\n\nResult: ${a.stage}\n\n[Exact-version installation guide](${origin}/open-motion/dev/${c.version}/install.md)\n\n[Default test guide](${origin}/open-motion/dev/install.md)\n\nThe default is advanced only after public package integrity verification and public readback; a superseded candidate keeps its version snapshot without moving the default. No stable release occurred.\n`);JSdiff --git a/AGENTS.md b/AGENTS.mdindex 01344b6f..c59629b1 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -55,4 +55,4 @@ Phase one exposes eleven motion_ Tools (nine project tools plus catalog fetch anFollow [the release workflow manual](docs/release-workflows.md): separate manual candidate-build and test-publication entries, plus snapshot-only recovery. Select `feature/motion` for all three entries; `main` only registers them and is rejected as an execution ref. Blank candidate versions use short workflow-counter `test.N` numbering; keep full run/source identities in the records. Download and accept the local tgz using candidate-install.md; keep completed acceptance.md private. The publication operator enters the accepted version and explicitly confirms acceptance, without manually copying hashes. No independent approval environment is enabled at this stage. Public candidates must use an exact reviewed source SHA integrated into `feature/motion`, a new test version and DEV template defaults. Scan tracked source plus the outer npm tgz and inner application; preserve the positive distribution list and licenses. Keep candidate, native registry installation, real Agent creation and human acceptance evidence separate.-Publication uses the accepted candidate bytes, never a rebuild. Publish under `candidate` first; only the credential-isolated promotion job may move npm `test` after both matching DEV native reports pass. Stable publication, npm `latest` promotion and platform/marketplace Skills distribution are not implemented by these entries. Only the separately authorized manual test publication workflow may use npm OIDC or R2 credentials; validate candidate provenance and hashes first, archive immutable version records, and update the moving guide last. Archive-only work must not move tags or default entries. Never overwrite published versions, put private template payloads/internal acceptance material into public artifacts, or infer merge/publication authorization from green CI. Main registration, npm trust, main cutover and repository rename remain separate operations.+Publication uses the accepted candidate bytes, never a rebuild. Publish under `candidate` first; only the credential-isolated promotion job may move npm `test` after the exact anonymous public download matches the accepted candidate hashes. Mac/Windows installation runs independently through motion-install-check.yml without publishing, tag or storage access; platform results are recorded separately and are not test-publication gates. Stable publication, npm `latest` promotion and platform/marketplace Skills distribution are not implemented by these entries. Only the separately authorized manual test publication workflow may use npm OIDC or R2 credentials; validate candidate provenance and hashes first, archive immutable version records, and update the moving guide last. Archive-only work must not move tags or default entries. Never overwrite published versions, put private template payloads/internal acceptance material into public artifacts, or infer merge/publication authorization from green CI. Main registration, npm trust, main cutover and repository rename remain separate operations.diff --git a/CLAUDE.md b/CLAUDE.mdindex 97bc2a97..a523b7fd 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -6,7 +6,7 @@ Read and follow [AGENTS.md](AGENTS.md) before working in this repository. It isFollow [the release workflow manual](docs/release-workflows.md): separate manual candidate-build and test-publication entries, plus snapshot-only recovery. Select `feature/motion` for all three entries; `main` only registers them and is rejected as an execution ref. Blank candidate versions use short workflow-counter `test.N` numbering; keep full run/source identities in the records. Download and accept the local tgz using candidate-install.md; keep completed acceptance.md private. The publication operator enters the accepted version and explicitly confirms acceptance, without manually copying hashes. No independent approval environment is enabled at this stage. Public candidates must use an exact reviewed source SHA integrated into `feature/motion`, a new test version and DEV template defaults. Scan tracked source plus the outer npm tgz and inner application; preserve the positive distribution list and licenses. Keep candidate, native registry installation, real Agent creation and human acceptance evidence separate.-Publication uses the accepted candidate bytes, never a rebuild. Publish under `candidate` first; only the credential-isolated promotion job may move npm `test` after both matching DEV native reports pass. Stable publication, npm `latest` promotion and platform/marketplace Skills distribution are not implemented by these entries. Only the separately authorized manual test publication workflow may use npm OIDC or R2 credentials; validate candidate provenance and hashes first, archive immutable version records, and update the moving guide last. Archive-only work must not move tags or default entries. Never overwrite published versions, put private template payloads/internal acceptance material into public artifacts, or infer merge/publication authorization from green CI. Main registration, npm trust, main cutover and repository rename remain separate operations.+Publication uses the accepted candidate bytes, never a rebuild. Publish under `candidate` first; only the credential-isolated promotion job may move npm `test` after the exact anonymous public download matches the accepted candidate hashes. Mac/Windows installation runs independently through motion-install-check.yml without publishing, tag or storage access; platform results are recorded separately and are not test-publication gates. Stable publication, npm `latest` promotion and platform/marketplace Skills distribution are not implemented by these entries. Only the separately authorized manual test publication workflow may use npm OIDC or R2 credentials; validate candidate provenance and hashes first, archive immutable version records, and update the moving guide last. Archive-only work must not move tags or default entries. Never overwrite published versions, put private template payloads/internal acceptance material into public artifacts, or infer merge/publication authorization from green CI. Main registration, npm trust, main cutover and repository rename remain separate operations.## Product documentationdiff --git a/docs/product/architecture.md b/docs/product/architecture.mdindex 8f300913..7e16b98a 100644--- a/docs/product/architecture.md+++ b/docs/product/architecture.md@@ -266,9 +266,9 @@ Explicit test/DEV and stable/prod builds produce publishable artifact metadata w## 演进约束-The application npm format is the default; complete platform ZIPs are backups. Ordinary PR CI scans tracked source and both npm archive layers without publication credentials. Separate manual candidate-build and test-publication entries implement build → download/accept → publish. Candidate build, test publication and snapshot recovery run only from feature/motion; main registers their manual entries without aliasing Motion operations. The build freezes the selected dispatch commit (or an explicitly integrated source SHA) and automatically numbers an empty version as the next source patch plus short test.N using the candidate workflow counter with its historical offset, without rewriting the source baseline. Reruns add an attempt suffix; an explicit test-version override remains available. It builds one immutable DEV candidate and generates a local candidate-install.md plus an identity-filled acceptance checklist. Publication resolves a unique unexpired versioned artifact from a completed successful build, validates official ZIP/file hashes and source integration, and requires explicit operator acceptance. No independent approval environment is enabled; the manual operator receipt is not proof of private tests or independent review. The same tgz is published under npm candidate, checked anonymously on separate Mac/Windows runners, then promoted to test in an npm-OIDC-only job before archiving and conditionally advancing the default guide. Failed native checks leave test unchanged; the exact candidate version is already public. R2 failure after tag promotion can leave the guide on the earlier accepted version. Builds can continue during acceptance; publication-only serialization, version checks and ETag writes prevent late older candidates from rolling the moving entry backward. Snapshot-only recovery requires an existing identical npm version and does not move the default. DEV configuration is public; private template contents and credentials remain outside the artifacts. Stable publication is a separate authorized process. Trusted default-branch registration and npm OIDC setup remain separate prerequisites, not enabled by this feature PR. Build, native installation, real Agent creation and human playback remain separate evidence. See [release workflows](../release-workflows.md) and [package checks](../test-packages.md).+The application npm format is the default; complete platform ZIPs are backups. Ordinary PR CI scans tracked source and both npm archive layers without publication credentials. Separate manual candidate-build and test-publication entries implement build → download/accept → publish. Candidate build, test publication and snapshot recovery run only from feature/motion; main registers their manual entries without aliasing Motion operations. The build freezes the selected dispatch commit (or an explicitly integrated source SHA) and automatically numbers an empty version as the next source patch plus short test.N using the candidate workflow counter with its historical offset, without rewriting the source baseline. Reruns add an attempt suffix; an explicit test-version override remains available. It builds one immutable DEV candidate and generates a local candidate-install.md plus an identity-filled acceptance checklist. Publication resolves a unique unexpired versioned artifact from a completed successful build, validates official ZIP/file hashes and source integration, and requires explicit operator acceptance. No independent approval environment is enabled; the manual operator receipt is not proof of private tests or independent review. The same tgz is published under npm candidate, downloaded anonymously and checked against the frozen hashes without execution, then promoted to test in an npm-OIDC-only job before archiving and conditionally advancing the default guide. Failed public-download/hash checks leave test unchanged; the exact candidate version is already public. Mac/Windows native installation is a separate read-only workflow and does not block test publication; its actual platform results remain separate acceptance evidence. R2 failure after tag promotion can leave the guide on the earlier accepted version. Builds can continue during acceptance; publication-only serialization, version checks and ETag writes prevent late older candidates from rolling the moving entry backward. Snapshot-only recovery requires an existing identical npm version and does not move the default. DEV configuration is public; private template contents and credentials remain outside the artifacts. Stable publication is a separate authorized process. Trusted default-branch registration and npm OIDC setup remain separate prerequisites, not enabled by this feature PR. Build, native installation, real Agent creation and human playback remain separate evidence. See [release workflows](../release-workflows.md) and [package checks](../test-packages.md).-Downstream publication jobs consume immutable producer artifact IDs retained across partial retries; native Mac and Windows jobs expose separate report identities. OIDC authenticates publication, but automatic npm provenance is disabled for prebuilt candidates because the publication workflow SHA differs from the application source. Candidate/manifest/hash records provide traceability without claiming a signed build attestation. Stable version construction and URL contracts exist; stable candidate/publication, npm latest promotion and Skills marketplace/platform publication are not implemented. The bundled Skills are installed into local hosts only.+Downstream publication jobs consume immutable producer artifact IDs retained across partial retries; public-download verification exposes its own retained report identity. Independent Mac and Windows checks retain separate reports, without publication credentials or a tag/storage mutation path. OIDC authenticates publication, but automatic npm provenance is disabled for prebuilt candidates because the publication workflow SHA differs from the application source. Candidate/manifest/hash records provide traceability without claiming a signed build attestation. Stable version construction and URL contracts exist; stable candidate/publication, npm latest promotion and Skills marketplace/platform publication are not implemented. The bundled Skills are installed into local hosts only.已确认方向是继续支持多 Agent 接入、可编辑工程与一个工作区内的发现/制作闭环。diff --git a/docs/release-guide.md b/docs/release-guide.mdindex 5763995e..26272300 100644--- a/docs/release-guide.md+++ b/docs/release-guide.md@@ -36,15 +36,15 @@ Mac arm64 and Windows x64 require separate results; absent runners are not passe1. Candidate blockers are resolved; remaining issues have an explicit acceptance owner and workaround. Required host/platform, true Agent creation and human playback results are complete.2. Freeze stable source, dependencies and prod configuration. Build the stable version without `-test` once. The version change changes bytes: verify the **stable tgz** rather than renaming a test archive or copying its hash. Record the source/config delta against the accepted test candidate.3. Repeat stable-package cold installation, prepare, template creation, preview/edit/save/export on all promised targets. Test upgrade from the prior test or stable release with existing projects/material/config retained; exercise compatible rollback or backup/restore. Do not promise older versions can read a migrated format without proof.-4. Confirm the exact public package/scope and authorized publisher. Explicit test/DEV and stable/prod artifacts are publishable; source/unversioned/channel-environment-mismatched manifests stay private. The build does not publish. Test-candidate metadata selects `candidate`; native registry acceptance must precede `test` promotion; stable metadata selects temporary `stage`, not `latest`.+4. Confirm the exact public package/scope and authorized publisher. Explicit test/DEV and stable/prod artifacts are publishable; source/unversioned/channel-environment-mismatched manifests stay private. The build does not publish. Test-candidate metadata selects `candidate`; anonymous exact-byte download verification must precede `test` promotion; Mac/Windows native installation runs independently and remains required evidence for stable acceptance; stable metadata selects temporary `stage`, not `latest`.5. Only after separate publication authorization: publish the verified stable tgz, install that exact registry version, then move `latest` after the registry check passes and announce supported platforms/known issues. A stage tag does not hide a public package. npm tags do not update machines already installed.Maintainer commands below are examples, not automatically executed release steps:```sh-# The manual test workflow performs these two steps with native checks between them:+# The manual test workflow performs these two steps with exact public-download/hash verification between them:npm publish /absolute/final-test.tgz --access public --tag candidate-# After both exact-version native checks pass:+# After exact public-download/hash verification passes:npm dist-tag add @openmotion/app@<exact-test-version> testnpm publish /absolute/final-stable.tgz --access public --tag stage# After exact stable registry-install acceptance and channel authorization:@@ -65,7 +65,7 @@ Each defect needs exact package/source/OS/host/environment/catalog identity, proOrdinary npm/DEV CI builds generate a **candidate-only** guide and retain it as an Actions artifact for 14 days. The publisher rejects candidate previews. Public guides require test/DEV or stable/prod identity; private builds cannot produce them.-Maintainers follow [build → download and accept → publish](release-workflows.md): first run Motion candidate build from `feature/motion` with version empty for automatic numbering (or an explicit new test version), download its frozen candidate and follow the included `candidate-install.md` to install the local tgz in an isolated host. Keep completed `acceptance.md` privately. After acceptance, run Motion test publication from `feature/motion` with that exact version and confirm acceptance. Candidate lookup and hashes are automatic; no independent approval environment is enabled. The same accepted bytes receive anonymous native registry checks and immutable snapshots before the moving test guide can advance. Snapshot-only recovery is a separate maintenance entry. The former CI guide-only upload route is removed so it cannot bypass these checks. Ordinary PR CI remains read-only.+Maintainers follow [build → download and accept → publish](release-workflows.md): first run Motion candidate build from `feature/motion` with version empty for automatic numbering (or an explicit new test version), download its frozen candidate and follow the included `candidate-install.md` to install the local tgz in an isolated host. Keep completed `acceptance.md` privately. After acceptance, run Motion test publication from `feature/motion` with that exact version and confirm acceptance. Candidate lookup and hashes are automatic; no independent approval environment is enabled. The same accepted bytes receive anonymous public-download/hash verification and immutable snapshots before the moving test guide can advance. Mac/Windows installation checks run independently without npm or R2 writes; use their separate results for platform acceptance. Snapshot-only recovery is a separate maintenance entry. The former CI guide-only upload route is removed so it cannot bypass these checks. Ordinary PR CI remains read-only.These manual entries support test versions only. Stable package construction and the stable URL contract exist, but stable candidate/publication, npm `latest` promotion and Skills platform/marketplace distribution still require separate implementation and authorization. Bundling five Skills and registering them locally does not publish them to a platform. Partial retries retain the actual successful producer artifact IDs; automatic npm provenance is disabled for prebuilt candidates while OIDC authentication remains enabled. See the workflow manual for the source/hash evidence and recovery limits.diff --git a/docs/release-workflows.md b/docs/release-workflows.mdindex d8334ad9..2a76fe01 100644--- a/docs/release-workflows.md+++ b/docs/release-workflows.md@@ -6,7 +6,7 @@ Use two manual Actions entries: **Motion candidate build**, then **Motion test p| --- | --- || Build: select `feature/motion`, normally leave version empty | Freeze the current `feature/motion` SHA, check/build/scan once, retain the candidate and show download/install instructions || Download and accept | Use `candidate-install.md` and the local tgz in an isolated host; retain completed `acceptance.md` internally |-| Publish: enter the accepted version and confirm acceptance | Find the unique candidate automatically, verify its source/hashes, publish the same tgz under `candidate`, check native installations, then advance npm `test`, archive snapshots and update the default guide last |+| Publish: enter the accepted version and confirm acceptance | Find the unique candidate automatically, verify its source/hashes, publish the same tgz under `candidate`, verify the anonymous public download, then advance npm `test`, archive snapshots and update the default guide last |**No independent approval environment is enabled at this stage.** The publication checkbox is explicit authorization by the operator, not evidence of an independent review or proof that the tests happened. Anyone able to dispatch the trusted publication workflow can authorize publication; the team must control that access and keep the acceptance record. Adding a separate required reviewer later is a separate decision.@@ -19,12 +19,12 @@ The default `main` currently contains the legacy project. GitHub requires a `worRegister these files together:- `.github/workflows/motion-candidate.yml`, `motion-publish-test.yml` and `motion-publication-recovery.yml`.-- `.github/scripts/motion-release.mjs`, `motion-scan.mjs`, `motion-registry-smoke.mjs`, `publish-install-guide.mjs` and `.github/gitleaks.toml`.+- `.github/scripts/motion-release.mjs`, `motion-scan.mjs`, `motion-registry.mjs`, `motion-registry-smoke.mjs`, `publish-install-guide.mjs` and `.github/gitleaks.toml`.- `scripts/runtime-assets.mjs`, `release-version.mjs`, `install-guide.mjs`, `docs/install.md`, `docs/templates/release-record.md` and `docs/templates/candidate-install.md`.Protect changes to the trusted control files and `feature/motion`; keep default-branch registration aligned. There is no `motion-test-publish` GitHub Environment prerequisite or Review deployments step in this version.-For `@openmotion/app`, open npm **Settings → Trusted publishing → Add trusted publisher → GitHub Actions**. Set owner **`nexu-io`**, repository **`html-anything`**, workflow filename **`motion-publish-test.yml`** (no directory), **leave Environment blank**, and allow **npm publish** plus **Allow npm dist-tag**. The latter is separately required to advance `test` after native acceptance; enabling publish alone is insufficient. If an older entry names an environment, it must be updated to match this workflow before publication. GitHub-hosted runners use Node 26.11.1; credentialed npm jobs explicitly install npm 11.21.2 for OIDC dist-tag support and `id-token: write`; no stored npm token is needed. The recovery caller never calls npm publish or dist-tag. npm does not support a dist-tag dry-run; do not test that command against the real registry without channel-write authorization. See [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/).+For `@openmotion/app`, open npm **Settings → Trusted publishing → Add trusted publisher → GitHub Actions**. Set owner **`nexu-io`**, repository **`html-anything`**, workflow filename **`motion-publish-test.yml`** (no directory), **leave Environment blank**, and allow **npm publish** plus **Allow npm dist-tag**. The latter is separately required to advance `test` after public-package integrity verification; enabling publish alone is insufficient. If an older entry names an environment, it must be updated to match this workflow before publication. GitHub-hosted runners use Node 26.11.1; credentialed npm jobs explicitly install npm 11.21.2 for OIDC dist-tag support and `id-token: write`; no stored npm token is needed. The recovery caller never calls npm publish or dist-tag. npm does not support a dist-tag dry-run; do not test that command against the real registry without channel-write authorization. See [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/).Reuse the existing R2 settings. Only the final snapshot step receives the storage credentials:@@ -74,13 +74,23 @@ The workflow searches GitHub artifacts by the exact versioned name and requiresIt then automatically:1. Publishes only the accepted tgz with `--tag candidate --ignore-scripts --provenance=false`, or verifies an already published identical version. It rejects an older test version than the current npm test channel and never overwrites different bytes.-2. On separate macOS arm64 and Windows x64 runners without publication credentials, anonymously downloads the exact registry version, verifies its hashes, prepares Chromium/FFmpeg/ffprobe, runs isolated setup/repeat setup and checks the eleven Tools/resources and five Skills. These are native technical checks, not real-model or human playback acceptance.-3. In a separate npm-OIDC-only job, requires both successful reports for the same tgz/source and DEV environment before advancing `test`. Verifies the registry result; an identical retry does not retag, and a newer `test` is never regressed.-4. Archives immutable R2 snapshots and checks canonical public bytes. Only then conditionally advances the default test guide. The snapshot job consumes the operator authorization and both native reports, executes the selected trusted `feature/motion` controls and never executes the candidate application.+2. An uncredentialed Linux job waits up to 15 minutes per public request for npm metadata/tarball availability and verifies SHA256 plus SHA512 against the accepted candidate without executing it. HTTP 404/408/429/5xx and transient network failures retry; authorization failures, malformed metadata and hash mismatches stop.+3. A separate npm-OIDC-only job requires the matching public-download report before advancing `test`. An identical retry does not retag, and a newer `test` is never regressed. Native installation runs independently and is not a test-publication gate.+4. Archives immutable R2 snapshots and checks canonical public bytes. Only then conditionally advances the default test guide. The snapshot job consumes the operator authorization and public-download report, executes the selected trusted `feature/motion` controls and never executes the candidate application.5. Shows the exact version, publication phase, versioned installation guide and default guide in the run summary.OIDC authenticates the publisher. Automatic npm provenance remains disabled because the trusted publication workflow SHA may differ from the selected prebuilt application source SHA. Candidate/manifest/lock/hash records provide traceability, not a signed build attestation.+## Independent Mac/Windows installation checks++**Motion installation check** (`motion-install-check.yml`) only reads an existing public test version. It cannot publish npm, change tags or access R2/install.md writes. The candidate-resolution job alone receives a read-only GitHub token; consumer processes receive an allowlisted, isolated environment without CI credentials or browser/Agent IPC access.++After its manual entry is registered on the default branch, select the intended check-code ref, enter an existing version (initial default `0.6.4-test.7`) and run. Before registration, a same-repository PR to `feature/motion` changing the installation workflow, registry helpers or their tests automatically checks the fixed test.7 regression version; fork PRs are skipped. PR execution does not publish or enable a manual entry on main.++The workflow resolves the unique original successful candidate and its source integration/hashes, then independently downloads the exact npm bytes on macOS ARM64 and Windows x64. Both runners perform setup, repeated setup, DEV configuration checks, Chromium/FFmpeg/ffprobe preparation and MCP discovery/resources/Skills checks. No model account, GUI login or model API key is needed. The matrix has `fail-fast: false`: one platform failure cannot cancel the other. Registry requests log attempt/status/elapsed time; installation reports retain the last phase even on failure. Network retries are bounded, and integrity failures remain failures.++Read the run summary and `installation-<platform>-<run>-<attempt>` artifacts. Results bind the package version/source/SHA256, separately from the check workflow SHA. Rerunning this workflow cannot resume publication. Windows Server runner results do not certify Windows 11 desktop behavior; real template service access, a model turn, editor/export use and human audiovisual acceptance remain separate checks. Failed/NOT RUN platform results must be disclosed in internal test handoffs and resolved before stable acceptance. Stable publication is not implemented here.+## Versions and records| Channel | Moving guide, updated last | Immutable guide |@@ -90,7 +100,7 @@ OIDC authenticates the publisher. Automatic npm provenance remains disabled becaThis workflow does not publish stable versions or move npm `latest`. The storage helper supports stable paths without providing a stable publication job. Existing legacy `/versions/<version>/install.md` objects remain immutable.-Each test version archives the exact tgz, manifests, generated blank acceptance checklist, both installation guides, scans, candidate identity, both platform reports and the schema-2 release record. The release record contains package/source identity and the manual operator authorization; it does not claim independent review or attest private test results. Completed private acceptance material is never uploaded. `test-promotion.json` retains the prior tag, exact package, native-report hashes and promotion outcome. The immutable release record includes this channel verification and template environment. Snapshot recovery preserves a prior immutable release record while retaining its own fresh operator authorization in its attempt artifact.+Each test version archives the exact tgz, manifests, generated blank acceptance checklist, both installation guides, scans, candidate identity, the public-download report and the schema-3 release record. The release record contains package/source identity and the manual operator authorization; it does not claim independent review or attest private test results. Completed private acceptance material is never uploaded. `test-promotion.json` retains the prior tag, exact package, public-download identity and promotion outcome. The immutable release record includes this channel verification and template environment. Its platform verification is explicitly `independent-not-attached`; it does not claim Mac/Windows installation passed. Snapshot recovery preserves a prior immutable release record while retaining its own fresh operator authorization in its attempt artifact.Builds have no publication lock, so another version can build during acceptance. Publication and snapshot recovery share one workflow-wide concurrency group with cancellation disabled. GitHub concurrency is not a durable FIFO: it retains one running and one newest pending run; do not enqueue a batch. Publish one accepted version at a time. A superseded candidate can retain version snapshots without moving the default. Default-guide version comparison plus ETag conditional writes prevent late older completion from rolling a newer entry back; unrecognized or conflicting same-version guide bytes require inspection.@@ -99,9 +109,9 @@ Actions artifacts and attempt records expire after **30 days**. R2 snapshots fol## Failure and snapshot recovery- Before clicking publish: building, downloading and testing publish nothing. Discard an unwanted candidate. Fix code under a new version when bytes change.-- After clicking publish: the exact version and `candidate` tag are public even before native validation. A failed native check leaves `test` and the default guide unchanged. Once native checks and tag readback pass, `test` can advance before R2 finishes; if R2 fails it points to a verified version while the guide can remain on the previous version. npm and R2 are not one transaction. Inspect retained npm state and release-attempt/publication files; do not rebuild or blindly republish.+- After clicking publish: the exact version and `candidate` tag are public even before public-download validation. A failed public-download/hash check leaves `test` and the default guide unchanged. Once that verification and tag readback pass, `test` can advance before R2 finishes; if R2 fails it points to a verified version while the guide can remain on the previous version. npm and R2 are not one transaction. Inspect retained npm state and release-attempt/publication files; do not rebuild or blindly republish.- Use **Re-run failed jobs** for a partial publication failure. Consumers use successful producer artifact IDs rather than guessing their own attempt. Re-running publication reuses the existing candidate and original accepted version; it does not rebuild. A candidate build rerun is different: a successful new artifact must be accepted again, and duplicate version artifacts block publication.-- **Motion snapshot recovery** is a separate maintenance entry. Select `feature/motion`, enter the existing candidate version and confirm snapshot-only recovery. It requires an already published identical npm version, repeats native checks and fills missing immutable snapshots. It never builds, publishes npm, moves npm tags or accesses the moving guide. Missing/expired/ambiguous candidates stop.+- **Motion snapshot recovery** is a separate maintenance entry. Select `feature/motion`, enter the existing candidate version and confirm snapshot-only recovery. It requires an already published identical npm version, repeats public-download verification and fills missing immutable snapshots. It never builds, publishes npm, moves npm tags or accesses the moving guide. Missing/expired/ambiguous candidates stop.- Version writes use conditional create and byte comparison. Same bytes resume; different immutable bytes stop. A public readback error blocks promotion. A failure after `fixed-write-attempted` may mean the moving write completed: inspect storage and its canonical URL before retrying.- An unexpected npm `latest` change stops promotion. This workflow does not silently repair tags. Channel rollback is a separate reviewed operation and does not downgrade installed clients or restore their data.diff --git a/tests/registry-download.test.mjs b/tests/registry-download.test.mjsnew file mode 100644index 00000000..29e9e784--- /dev/null+++ b/tests/registry-download.test.mjs@@ -0,0 +1,79 @@+import test from 'node:test';+import assert from 'node:assert/strict';+import { readFile, writeFile } from 'node:fs/promises';+import path from 'node:path';+import { candidateFixture } from './release-fixture.mjs';+import { registryRead, registryReport, verifyRegistryDownload } from '../.github/scripts/motion-registry.mjs';+import { promoteTest } from '../.github/scripts/motion-release.mjs';++function clock(fetcher) {+ let time = 0;+ return { fetcher, timeout: 20_000, now: () => time, sleep: async ms => { time += ms; }, log: () => {} };+}++test('registry propagation, rate limits, server errors and interrupted reads retry within a deadline', async () => {+ for (const unavailable of [404, 408, 429, 503, 'network', 'body']) {+ let calls = 0;+ const options = clock(async (_, request) => {+ assert.equal(request.headers['cache-control'], 'no-cache');+ assert(!request.headers.Authorization);+ if (++calls > 1) return Response.json({ ready: true });+ if (unavailable === 'network') throw new TypeError('fetch failed');+ if (unavailable === 'body') return { ok: true, status: 200, json: async () => { throw new TypeError('terminated'); } };+ return new Response('', { status: unavailable });+ });+ assert.deepEqual(await registryRead('https://registry.npmjs.org/example', r => r.json(), options), { ready: true });+ assert.equal(calls, 2);+ }+ let calls = 0;+ await assert.rejects(registryRead('https://registry.npmjs.org/example', r => r.json(), clock(async () => { calls++; return new Response('', { status: 404 }); })), /REGISTRY_NOT_READY/);+ assert.equal(calls, 3);+ for (const status of [401, 403, 400]) {+ calls = 0;+ await assert.rejects(registryRead('https://registry.npmjs.org/example', r => r.json(), clock(async () => { calls++; return new Response('', { status }); })), new RegExp('HTTP ' + status));+ assert.equal(calls, 1);+ }+});++test('public download verifies both hashes against the frozen candidate without executing or publishing', async t => {+ const f = await candidateFixture(t), bytes = await readFile(path.join(f.directory, f.candidate.tgz));+ const metadata = { name: f.candidate.packageName, version: f.candidate.version,+ dist: { integrity: f.candidate.integrity, tarball: 'https://registry.npmjs.org/@openmotion/app/-/app.tgz' } };+ let wrongBytes = false, downloads = 0;+ const options = clock(async url => {+ if (String(url).endsWith('.tgz')) { downloads++; return new Response(wrongBytes ? 'different bytes' : bytes); }+ return Response.json(metadata);+ });+ const { report } = await verifyRegistryDownload(f.directory, options);+ assert.equal(report.nativeInstallation, 'not-run');+ assert.equal((await registryReport(f.directory, f.candidate)).tgzSHA256, f.candidate.tgzSHA256);+ wrongBytes = true;+ await assert.rejects(verifyRegistryDownload(f.directory, options), /SHA256 mismatch/);+ await assert.rejects(registryReport(f.directory, f.candidate), /ENOENT/, 'A failed download invalidates any stale success report');+ assert.equal(downloads, 2, 'Corrupt bytes must not be retried or passed');+ metadata.dist.integrity = 'different';+ await assert.rejects(verifyRegistryDownload(f.directory, options), /different bytes/);+ assert.equal(downloads, 2);+ metadata.dist.integrity = f.candidate.integrity;+ metadata.dist.tarball = 'https://private.invalid/app.tgz';+ await assert.rejects(verifyRegistryDownload(f.directory, options), /public npm tarball origin/);+ assert.equal(downloads, 2);+});++test('independent platform results do not gate test promotion or masquerade as platform acceptance', async t => {+ const f = await candidateFixture(t);+ await writeFile(path.join(f.directory, 'registry-win32-x64.json'), JSON.stringify({ status: 'failed' }));+ const result = await promoteTest(f.directory, f.inputs, { env: f.env,+ fetcher: async () => Response.json({ versions: { [f.candidate.version]: { dist: { integrity: f.candidate.integrity } } }, 'dist-tags': { test: f.candidate.version, latest: '0.5.0' } }),+ run: async () => { throw Error('Already promoted: no write permitted'); } });+ assert.equal(result.registryVerification.registryDownload, 'passed');+ assert.equal(result.platformVerification.status, 'independent-not-attached');+});++test('standalone installation workflow is read-only and exercises both platforms against test.7 on PRs', async () => {+ const workflow = await readFile(new URL('../.github/workflows/motion-install-check.yml', import.meta.url), 'utf8');+ for (const expected of ['pull_request:', 'workflow_dispatch:', '0.6.4-test.7', 'macos-26', 'windows-2025', 'fail-fast: false', 'downloadCandidate', 'validateSource', 'motion-registry-smoke.mjs', 'if: always()']) assert(workflow.includes(expected), expected);+ assert(!/id-token:|secrets\.|secrets:|npm publish|dist-tag add|s3api|motion-release\.mjs (?:npm|promote-test|archive)/.test(workflow.replace('No npm publish,', 'No publication,')));+ const smoke = workflow.split(' - name: Install the public version')[1].split(' - name: Retain')[0];+ assert(!smoke.includes('GH_TOKEN') && !smoke.includes('github.token'));+});diff --git a/tests/release-fixture.mjs b/tests/release-fixture.mjsindex c354dccc..1c25aeb0 100644--- a/tests/release-fixture.mjs+++ b/tests/release-fixture.mjs@@ -3,7 +3,7 @@ import os from 'node:os';import path from 'node:path';import { fileURLToPath } from 'node:url';import { runFile, sha256, writeJSON } from '../scripts/runtime-assets.mjs';-import { sealCandidate, repository, candidateWorkflow, publicationWorkflow, authorizationReceipt, platformReports } from '../.github/scripts/motion-release.mjs';+import { sealCandidate, repository, candidateWorkflow, publicationWorkflow, authorizationReceipt } from '../.github/scripts/motion-release.mjs';export async function candidateFixture(t, branch = 'main') {const work = await mkdtemp(path.join(os.tmpdir(), 'motion-release-test-'));@@ -42,7 +42,9 @@ export async function candidateFixture(t, branch = 'main') {status: 'passed', templateEnvironment: 'dev', platform, version, sourceCommit: commit, tgzSHA256: candidate.tgzSHA256,registryColdInstall: 'passed', nativePreparation: 'passed', repeatSetup: 'passed', resources: 'passed', mcpTools: 11, skills: 5,});+ const registryVerification = { schemaVersion: 1, status: 'passed', registryDownload: 'passed', nativeInstallation: 'not-run', version, sourceCommit: commit, tgzSHA256: candidate.tgzSHA256, integrity: candidate.integrity };+ await writeJSON(path.join(directory, 'registry-package.json'), registryVerification);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', platformVerification: await platformReports(directory, candidate) });+ await writeJSON(path.join(directory, 'test-promotion.json'), { version, tgzSHA256: candidate.tgzSHA256, action: inputs.action, publicationRun: publicationEnv.GITHUB_RUN_ID, status: 'already-promoted', registryVerification, platformVerification: { status: 'independent-not-attached', workflow: '.github/workflows/motion-install-check.yml' } });return { work, root, build, directory, candidate, inputs, provenance, app, pkg, manifest, authorization, env: publicationEnv };}diff --git a/tests/release-workflows.test.mjs b/tests/release-workflows.test.mjsindex ef1f0b54..8c3eb23c 100644--- a/tests/release-workflows.test.mjs+++ b/tests/release-workflows.test.mjs@@ -181,14 +181,14 @@ test('a stale candidate or authorization from another run cannot publish or moveassert.equal(calls, 0);});-test('test promotion requires both matching DEV native reports and preserves the old channel on failure', async t => {+test('test promotion requires an exact public download report and preserves the old channel on failure', async t => {const f = await candidateFixture(t); let writes = 0, tag = '0.6.4-test.1';const options = { env: f.env, fetcher: () => registry(f.candidate, true, tag)(), run: async (command, args) => {assert.equal(command, 'npm'); assert.deepEqual(args.slice(0, 4), ['dist-tag', 'add', '@openmotion/app@' + f.candidate.version, 'test']);writes++; tag = f.candidate.version;} };- const file = path.join(f.directory, 'registry-win32-x64.json'), original = await readFile(file, 'utf8');- for (const patch of [{ status: 'failed' }, { tgzSHA256: '0'.repeat(64) }, { templateEnvironment: 'prod' }, { nativePreparation: 'failed' }]) {+ const file = path.join(f.directory, 'registry-package.json'), original = await readFile(file, 'utf8');+ for (const patch of [{ status: 'failed' }, { tgzSHA256: '0'.repeat(64) }, { integrity: 'different' }, { registryDownload: 'failed' }]) {await writeFile(file, JSON.stringify({ ...JSON.parse(original), ...patch }));await assert.rejects(promoteTest(f.directory, f.inputs, options));assert.equal(writes, 0); assert.equal(tag, '0.6.4-test.1');@@ -223,24 +223,25 @@ test('test version ordering handles numeric suffixes, stable versions and unsafetest('partial publication retries use the retained producer artifact IDs across attempts', async () => {const workflow = await readFile(new URL('../.github/workflows/motion-publish-test.yml', import.meta.url), 'utf8');const jobs = Object.fromEntries(workflow.split('\njobs:\n')[1].split(/(?=^ [\w-]+:\n)/m).filter(s => s.trim()).map(s => [s.match(/^ ([\w-]+):\n/)[1], s]));- const producers = ['verify', 'npm', 'registry-mac', 'registry-windows', 'promote-test'];+ const producers = ['verify', 'npm', 'registry', 'promote-test'];const render = (value, attempt) => value.replaceAll('${{ github.run_id }}', '800').replaceAll('${{ github.run_attempt }}', String(attempt));for (const id of producers) {assert(jobs[id], 'A platform needs its own retained output: ' + id);assert(jobs[id].includes('artifact_id: ${{ steps.artifact.outputs.artifact-id }}'), 'Expose the actual uploaded artifact ID');assert(jobs[id].includes(' id: artifact\n'));}- for (const id of ['npm', 'registry-mac', 'registry-windows', 'promote-test', 'snapshot']) {+ for (const id of ['npm', 'registry', 'promote-test', 'snapshot']) {assert(jobs[id].includes('if: ${{ always() && !cancelled() && needs.verify.result'), 'Successful retained producers must still supply partial retry consumers: ' + id);}const downloads = id => [...jobs[id].matchAll(/artifact-ids: \$\{\{ needs\.([\w-]+)\.outputs\.artifact_id \}\}/g)].map(m => m[1]);assert.deepEqual(downloads('npm'), ['verify']);- assert.deepEqual(downloads('registry-mac'), ['verify']);- assert.deepEqual(downloads('registry-windows'), ['verify']);+ assert.deepEqual(downloads('registry'), ['verify']);assert.deepEqual(downloads('promote-test'), producers.slice(0, -1));assert.deepEqual(downloads('snapshot'), producers);- assert(jobs.snapshot.includes('needs: [verify, npm, registry-mac, registry-windows, promote-test]'));- assert(jobs['promote-test'].includes('needs.registry-mac.result') && jobs['promote-test'].includes('needs.registry-windows.result'));+ assert(jobs.snapshot.includes('needs: [verify, npm, registry, promote-test]'));+ assert(jobs['promote-test'].includes('needs.registry.result'));+ assert(!workflow.includes('registry-mac') && !workflow.includes('registry-windows'));+ assert(!jobs.registry.includes('id-token: write') && !jobs.registry.includes('secrets.'));assert(jobs['promote-test'].includes('id-token: write') && !jobs.snapshot.includes('id-token: write'));assert(jobs['promote-test'].includes('[email protected]'));assert(jobs.npm.includes(' actions: read\n'), 'The credentialed npm job needs only read access to input artifacts');@@ -250,7 +251,7 @@ test('partial publication retries use the retained producer artifact IDs acrossassert(!step.includes('github.run_attempt'), 'A consumer must not guess the producing attempt');}}- for (const rerun of [[], ['registry-mac'], ['registry-windows'], ['registry-mac', 'registry-windows'], ['npm', 'registry-mac', 'registry-windows'], producers]) {+ for (const rerun of [[], ['registry'], ['npm', 'registry'], producers]) {const stored = new Map(), outputs = {};for (const [index, id] of producers.entries()) {const name = jobs[id].match(/ name: ([^\n]+)/)[1];@@ -384,14 +385,14 @@ test('interrupted archive resumes identical snapshots, verifies the exact publicawait assert.rejects(archiveRelease(f.directory, f.inputs, config, store), /Immutable snapshot/);});-test('archive-only never reads or writes the moving entry, and failed platform acceptance blocks all storage calls', async t => {+test('archive-only never reads or writes the moving entry, and failed public download verification blocks all storage calls', async t => {const f = await candidateFixture(t), store = storage(f.candidate);await writeFile(path.join(f.directory, 'authorization.json'), JSON.stringify({ ...f.authorization, action: 'archive-only' }));await promoteTest(f.directory, { ...f.inputs, action: 'archive-only' }, { fetcher: registry(f.candidate), env: f.env, run: async () => { throw Error('Archive-only cannot write npm'); } });await archiveRelease(f.directory, { ...f.inputs, action: 'archive-only' }, config, store);assert(!store.reads.includes('open-motion/dev/install.md') && !store.writes.includes('open-motion/dev/install.md'));await writeFile(path.join(f.directory, 'authorization.json'), JSON.stringify(f.authorization));- await writeFile(path.join(f.directory, 'registry-win32-x64.json'), JSON.stringify({ status: 'failed' }));+ await writeFile(path.join(f.directory, 'registry-package.json'), JSON.stringify({ status: 'failed' }));const before = store.reads.length; await assert.rejects(archiveRelease(f.directory, f.inputs, config, store)); assert.equal(store.reads.length, before);});@@ -442,7 +443,7 @@ test('no-publication rehearsal carries one accepted candidate through npm and stawait archiveRelease(f.directory, f.inputs, config, store);assert.equal(npmWrites, 1);const release = JSON.parse(store.objects.get(`open-motion/dev/${f.candidate.version}/release-record.json`));- assert.equal(release.schemaVersion, 2); assert.equal(release.authorization.actor, 'operator');+ assert.equal(release.schemaVersion, 3); assert.equal(release.authorization.actor, 'operator');assert.equal(release.authorization.acceptanceConfirmed, true);assert.equal(release.tgzSHA256, f.candidate.tgzSHA256);assert.equal(store.writes.at(-1), 'open-motion/dev/install.md');