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): preserve retry artifact identities and correct provenance policy
罗高b69eeab8dab7
diff --git a/.github/scripts/motion-release.mjs b/.github/scripts/motion-release.mjsindex d71e2651..e58948a5 100644--- a/.github/scripts/motion-release.mjs+++ b/.github/scripts/motion-release.mjs@@ -170,7 +170,8 @@ export async function publishNpm(directory, inputs, { fetcher = fetch, run = runpreviousLatest: before.tags.latest ?? null, status: before.version ? 'already-published-identical' : 'publish-started' };await writeJSON(path.join(directory, 'npm-publication.json'), record);if (!before.version) {- await run('npm', ['publish', path.join(directory, candidate.tgz), '--access', 'public', '--tag', 'test', '--ignore-scripts', '--registry=https://registry.npmjs.org/']);+ // OIDC authenticates this publisher; its main SHA is not the prebuilt application's source.+ await run('npm', ['publish', path.join(directory, candidate.tgz), '--access', 'public', '--tag', 'test', '--ignore-scripts', '--provenance=false', '--registry=https://registry.npmjs.org/']);record.status = 'published-awaiting-registry'; await writeJSON(path.join(directory, 'npm-publication.json'), record);}return record;diff --git a/.github/workflows/motion-publish-test.yml b/.github/workflows/motion-publish-test.ymlindex b7b88e5b..9737abb9 100644--- a/.github/workflows/motion-publish-test.yml+++ b/.github/workflows/motion-publish-test.yml@@ -45,6 +45,8 @@ jobs:if: github.repository == 'nexu-io/html-anything' && github.ref == 'refs/heads/main'runs-on: ubuntu-24.04timeout-minutes: 15+ outputs:+ artifact_id: ${{ steps.artifact.outputs.artifact-id }}steps:- uses: actions/[email protected]with:@@ -63,6 +65,7 @@ jobs:node .github/scripts/motion-scan.mjs install "$RUNNER_TEMP/scanner"node .github/scripts/motion-release.mjs rescan "$RUNNER_TEMP/candidate" "$PWD" "$RUNNER_TEMP/scanner/gitleaks"- uses: actions/[email protected]+ id: artifactwith:name: verified-candidate-${{ github.run_id }}-${{ github.run_attempt }}path: ${{ runner.temp }}/candidate/@@ -74,8 +77,11 @@ jobs:environment: motion-test-publishruns-on: ubuntu-24.04timeout-minutes: 15+ outputs:+ artifact_id: ${{ steps.artifact.outputs.artifact-id }}permissions:contents: read+ actions: readid-token: writesteps:- uses: actions/[email protected]@@ -88,11 +94,14 @@ jobs:registry-url: 'https://registry.npmjs.org'- uses: actions/[email protected]with:- name: verified-candidate-${{ github.run_id }}-${{ github.run_attempt }}+ artifact-ids: ${{ needs.verify.outputs.artifact_id }}+ github-token: ${{ github.token }}+ run-id: ${{ github.run_id }}path: ${{ runner.temp }}/candidate- name: Publish the accepted bytes with npm trusted publishing, or verify an identical existing versionrun: node .github/scripts/motion-release.mjs npm "$RUNNER_TEMP/candidate"- name: Retain npm publication state even after a partial failure+ id: artifactif: always()uses: actions/[email protected]with:@@ -101,18 +110,12 @@ jobs:retention-days: 30if-no-files-found: warn- registry-install:- needs: npm- runs-on: ${{ matrix.runner }}+ registry-mac:+ needs: [verify, npm]+ runs-on: macos-26timeout-minutes: 40- strategy:- fail-fast: false- matrix:- include:- - runner: macos-26- platform: darwin-arm64- - runner: windows-2025- platform: win32-x64+ outputs:+ artifact_id: ${{ steps.artifact.outputs.artifact-id }}steps:- uses: actions/[email protected]with:@@ -123,7 +126,43 @@ jobs:node-version: '26.11.1'- uses: actions/[email protected]with:- name: verified-candidate-${{ github.run_id }}-${{ github.run_attempt }}+ 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:+ needs: [verify, npm]+ runs-on: windows-2025+ 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 discoveryshell: bash@@ -131,15 +170,16 @@ jobs: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: artifactif: always()with:- name: registry-${{ matrix.platform }}-${{ github.run_id }}-${{ github.run_attempt }}- path: ${{ runner.temp }}/candidate/registry-${{ matrix.platform }}.json+ name: registry-win32-x64-${{ github.run_id }}-${{ github.run_attempt }}+ path: ${{ runner.temp }}/candidate/registry-win32-x64.jsonretention-days: 30if-no-files-found: warnsnapshot:- needs: registry-install+ needs: [verify, npm, registry-mac, registry-windows]environment: motion-test-publishruns-on: ubuntu-24.04timeout-minutes: 15@@ -153,16 +193,27 @@ jobs:node-version: '26.11.1'- uses: actions/[email protected]with:- name: verified-candidate-${{ github.run_id }}-${{ github.run_attempt }}+ artifact-ids: ${{ needs.verify.outputs.artifact_id }}+ github-token: ${{ github.token }}+ run-id: ${{ github.run_id }}path: ${{ runner.temp }}/candidate- uses: actions/[email protected]with:- pattern: registry-*-${{ github.run_id }}-${{ github.run_attempt }}- merge-multiple: true+ artifact-ids: ${{ needs.npm.outputs.artifact_id }}+ github-token: ${{ github.token }}+ run-id: ${{ github.run_id }}path: ${{ runner.temp }}/candidate- uses: actions/[email protected]with:- name: npm-publication-${{ github.run_id }}-${{ github.run_attempt }}+ 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 }}+ github-token: ${{ github.token }}+ run-id: ${{ github.run_id }}path: ${{ runner.temp }}/candidate- name: Archive exact-version snapshots, verify canonical public bytes, then promote the default guide lastenv:diff --git a/docs/npm-installation.md b/docs/npm-installation.mdindex 3fcbd77d..4fd78ba9 100644--- a/docs/npm-installation.md+++ b/docs/npm-installation.md@@ -108,6 +108,6 @@ For defects, include exact package/app version, source SHA, OS/CPU, Node/Agent v## Shared Agent installation entry-The hosted [installation guide template](install.md) provides the short Agent entry. Ordinary CI retains a candidate preview; the controlled guide mode fetches an already published exact npm version before any R2 upload. Repository R2 configuration, channel acceptance and an executable manual workflow entry are required before upload. See [hosted instruction publication](release-guide.md#hosted-installation-instructions).+The hosted [installation guide template](install.md) provides the short Agent entry. Ordinary CI retains a candidate preview; the separate test publication workflow verifies the accepted candidate, publishes the same bytes, checks the exact registry installation and archives immutable version instructions before advancing the moving test guide. Repository R2 configuration, channel acceptance and enabled manual workflow entries are prerequisites. See [hosted instruction publication](release-guide.md#hosted-installation-instructions).Maintainers: see [manual candidate and test publication workflows](release-workflows.md) for fixed source/version selection, immutable snapshots, registry verification and recovery. A candidate artifact is not a published npm version.diff --git a/docs/product/architecture.md b/docs/product/architecture.mdindex 49a1fb08..af9a6445 100644--- a/docs/product/architecture.md+++ b/docs/product/architecture.md@@ -189,6 +189,8 @@ Explicit test/stable prod builds produce publishable artifact metadata with testThe 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. Two manual controls implement candidate build and test publication: a fixed integrated source SHA produces one immutable prod candidate; publication verifies its originating workflow, hashes and acceptance-record digest, publishes the same tgz to npm test, runs anonymous native registry checks on separate Mac/Windows runners, and archives version snapshots before conditionally advancing the default guide. Snapshot-only recovery does not move the default. Private DEV template artifacts remain outside these public workflows. Stable publication is a separate authorized process. Trusted default-branch registration, a protected publication environment and npm OIDC setup remain administrator 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; a stable candidate/publication workflow is not implemented.+已确认方向是继续支持多 Agent 接入、可编辑工程与一个工作区内的发现/制作闭环。每次变更整体审视本文,判断产品定位、核心流程、模块职责、依赖、数据与接口边界、当前能力和限制是否仍准确一致。确有变化时按需修订相关章节,保持全文一致并保留必要的决策理由;架构仍准确时无需修改文档或新增变更记录。diff --git a/docs/release-guide.md b/docs/release-guide.mdindex 3cb7c150..dfee5d0d 100644--- a/docs/release-guide.md+++ b/docs/release-guide.md@@ -64,6 +64,8 @@ Ordinary npm/prod CI builds generate a **candidate-only** guide and retain it asMaintainers now use the two separate manual entries described in [candidate build and test publication](release-workflows.md). The candidate entry has no publication credentials; the test publication entry accepts the candidate run/hash and completed acceptance-record digest, verifies the same bytes, performs anonymous native registry installation and archives snapshots before updating the moving test guide. The former CI guide-only upload route is removed so it cannot bypass these gates. 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/channel promotion still require a separate implementation and authorization. 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.+The short test/stable version URL contract and historical `/versions/` URLs remain as documented in that manual. Test software uses prod template defaults; private DEV template testing stays separate.The configured destination bucket is `open-design-releases` and the public origin is `https://releases.open-design.ai`. After stable publication, the website can give the Agent a short prompt: "Read `https://releases.open-design.ai/open-motion/install.md`, install OpenMotion MCP and Skills for my current supported Agent host, preserve existing projects/settings, and report installation and preparation results." Use `https://releases.open-design.ai/open-motion/dev/install.md` for the test software channel. The test guide now pins `@openmotion/[email protected]`, with an immutable copy at `open-motion/dev/0.6.4-test.6/install.md`; both canonical public URLs were verified byte-for-byte against guide SHA256 `4b6f6b25c782c23d5529d225c6c0506d524b245a242f54d84fbf8d4dd61f4f05` after the [upload run](https://github.com/nexu-io/html-anything/actions/runs/42633147999). The short test.6 URL was added by [run 42638072025](https://github.com/nexu-io/html-anything/actions/runs/42638072025), with the same verified bytes as the retained legacy `/versions/0.6.4-test.6/install.md` URL. The older test.5 and test.4 immutable instructions remain unchanged; test.4 records the historical `@open-design/motion` name. Their existence does not imply those old npm versions were published. The stable entry is untouched and currently returns HTTP 404. Guide publication and npm publication remain separate operations.diff --git a/docs/release-workflows.md b/docs/release-workflows.mdindex 6e22e455..04fa354c 100644--- a/docs/release-workflows.md+++ b/docs/release-workflows.md@@ -2,6 +2,15 @@These workflows implement controlled delivery of the complete `@openmotion/app` npm application. They do not run on a push, PR merge, tag or schedule. This feature PR does not enable them on the default branch, configure npm trust, publish anything, change `main` or rename the repository.+| Capability | Test version | Stable version |+| --- | --- | --- |+| Package builder | Supports `X.Y.Z-test.N[.N]` | Supports `X.Y.Z` |+| Manual candidate and publication workflows | Implemented here; require administrator enablement | Not implemented |+| npm channel | `test` | Planned: verify under `stage`, then separately authorize `latest` |+| Hosted guide paths | Test moving/versioned paths | Stable moving/versioned paths supported by the storage helper; no stable publication job |++Both public channels use prod template defaults. A test software version does not select private DEV templates. Stable acceptance rules exist in [the acceptance guide](release-guide.md); they are not an automated stable release pipeline.+## Administrator setup before first useThe current default `main` contains the legacy project. GitHub requires a manual workflow to be registered on the default branch before showing its Run workflow entry. Register the reviewed release controls on `main` through a separately authorized PR; do not copy the Motion application or force-push its history. Both entries must run with **Use workflow from: main**. Feature-branch invocations fail closed.@@ -63,12 +72,14 @@ An independent environment reviewer approves the protected jobs. A rerun or workThe pipeline then:1. Verifies the originating repository, manual workflow/main ref, successful run/attempt, GitHub artifact digest and all candidate hashes; rechecks integrated source ancestry and rescans source plus both archives using the trusted control policy.-2. In the protected npm job, publishes **only the accepted tgz bytes** with `--tag test --ignore-scripts`. An existing identical version resumes without another publish; a different integrity fails. `archive-only` requires an existing identical version and never changes npm tags.+2. In the protected npm job, publishes **only the accepted tgz bytes** with `--tag test --ignore-scripts --provenance=false`. An existing identical version resumes without another publish; a different integrity fails. `archive-only` requires an existing identical version and never changes npm tags.3. On separate macOS 26 arm64 and Windows Server 2025 x64 runners, downloads the exact registry version anonymously using empty npm configs and a fresh cache, verifies SHA256/SHA512, installs a pinned Codex CLI into a temporary prefix, runs isolated setup/repeat setup, prepares Chromium/FFmpeg/ffprobe, and checks MCP Tools/resources and installed Skill files. This is native technical acceptance; Windows Server results do not replace Windows desktop/real model/human playback acceptance. No model credentials are provided.4. Requires both platform reports, confirms exact registry identity and test tag, rejects an unexpected `latest` change, then writes immutable R2 snapshots and checks the **canonical public bytes**. Only after all of these succeed does `publish-test` conditionally advance the default test guide using its prior ETag. `archive-only` never reads or writes the default guide.The workflow does not move `latest`, publish a stable version, create a GitHub Release, announce a release or update installed clients. Keep the package pinned by exact version in every guide. Node/Agent and checked native downloads remain prerequisites as documented in [installation](npm-installation.md).+OIDC still authenticates the publisher. Automatic npm provenance is explicitly disabled: it would describe the publication workflow's `main` SHA, while the accepted application was built from a different selected source SHA. `candidate.json`, the embedded manifest, source/lock hashes and the immutable release record provide the actual application identity and candidate build reference. These records are not a signed build-provenance attestation. Supporting such an attestation requires a separate implementation that binds the real candidate build and its inputs; do not substitute the workflow SHA or rewrite GitHub's source context.+## Immutable snapshots and moving entries| Channel | Moving guide, updated last | Immutable guide |@@ -86,6 +97,7 @@ Actions retains each npm publication state and R2 attempt/prior default instruct- A failed source/package scan blocks the candidate or publication before credentials are used. Gitleaks 8.30.1 is checksum-pinned; source-controlled ignore files and inline allow markers cannot bypass the trusted policy. Reports expose rule/path/line, never matched secrets. Targeted rules also reject private files, internal links and personal paths. Narrow exceptions cover the already public DEV routing hostname, synthetic redaction fixtures and the exact approved public analytics ingestion identifier. Scans cover the selected source tree and final package, **not all historical Git objects** or business classification of every binary asset; reviewers still inspect content, dependencies and licenses.- npm success followed by registry/platform/R2 failure leaves the default guide unchanged. Inspect `npm-publication.json`, the failed job and `release-attempt.json`/`publication.json`. The npm version may already be public; do not rebuild, overwrite or blindly republish it. Rerun with the same candidate/hash/acceptance digest after fixing infrastructure. If bytes change, start a new version.+- GitHub's **Re-run failed jobs** and **Re-run all jobs** are supported. Verify, npm and each native platform expose their actual immutable upload ID as a job output. A downstream retry downloads those retained producer IDs within the same workflow run instead of guessing names from its own attempt number. Mac and Windows have separate outputs, so a failed Mac check can rerun while retaining the successful Windows report. Each attempt still creates new artifacts; previous attempts and the original candidate are not overwritten. Expired/deleted producer artifacts fail the download rather than falling back to another package.- Snapshot writes use conditional create and byte comparison. Identical existing objects resume; any different version object stops the run. A CDN readback failure stops promotion. A failure after `fixed-write-attempted` may mean the default write completed: inspect storage and canonical URL before recovery.- `archive-only` is for an identical existing npm version and missing immutable snapshots. It does not restore a missing npm `test` tag or roll back a moving guide. Those are separate reviewed channel/recovery actions. An unexpected `latest` change requires investigation; this workflow does not silently remove or rewrite it.- Reverting a guide or npm tag does not downgrade clients or restore project data. Use an accepted compatible reinstall or retained backup according to [recovery](release-guide.md#recovery-and-feedback). If no compatible prior version exists, state that.diff --git a/tests/release-workflows.test.mjs b/tests/release-workflows.test.mjsindex 54a165dd..9675bb5e 100644--- a/tests/release-workflows.test.mjs+++ b/tests/release-workflows.test.mjs@@ -61,7 +61,8 @@ function registry(candidate, exists = true, tag = candidate.version, latest = '0test('npm publishes only new exact bytes; identical retry and archive-only never write, mismatches fail', async t => {const f = await candidateFixture(t); let calls = 0;- const run = async (command, args) => { calls++; assert.equal(command, 'npm'); assert(args.includes('--ignore-scripts') && args.includes('test')); assert.equal(args[1], path.join(f.directory, f.candidate.tgz)); };+ assert.notEqual(f.candidate.sourceCommit, f.candidate.workflow.sha, 'Application and workflow source identities are independent');+ const run = async (command, args) => { calls++; assert.equal(command, 'npm'); assert(args.includes('--ignore-scripts') && args.includes('test')); assert(args.includes('--provenance=false'), 'Do not attest the publication main SHA as the prebuilt application source'); assert.equal(args[1], path.join(f.directory, f.candidate.tgz)); };await publishNpm(f.directory, f.inputs, { run, fetcher: registry(f.candidate, false) }); assert.equal(calls, 1);await publishNpm(f.directory, f.inputs, { run, fetcher: registry(f.candidate) });await publishNpm(f.directory, { ...f.inputs, action: 'archive-only' }, { run, fetcher: registry(f.candidate) }); assert.equal(calls, 1);@@ -69,6 +70,43 @@ test('npm publishes only new exact bytes; identical retry and archive-only neverawait assert.rejects(publishNpm(f.directory, f.inputs, { run, fetcher: registry({ ...f.candidate, integrity: 'different' }) }), /different bytes/); assert.equal(calls, 1);});+test('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'];+ 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'));+ }+ 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('snapshot'), producers);+ assert(jobs.snapshot.includes('needs: [verify, npm, registry-mac, registry-windows]'));+ assert(jobs.npm.includes(' actions: read\n'), 'The credentialed npm job needs only read access to input artifacts');+ for (const job of Object.values(jobs)) {+ for (const step of job.split(/(?=^ - )/m).filter(s => s.includes('uses: actions/download-artifact@'))) {+ assert(step.includes('github-token: ${{ github.token }}') && step.includes('run-id: ${{ github.run_id }}'), 'Resolve exact IDs through the run-scoped REST API');+ assert(!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]) {+ const stored = new Map(), outputs = {};+ for (const [index, id] of producers.entries()) {+ const name = jobs[id].match(/ name: ([^\n]+)/)[1];+ const oldID = String(100 + index); stored.set(oldID, render(name, 1)); outputs[id] = oldID;+ if (rerun.includes(id)) { const newID = String(200 + index); stored.set(newID, render(name, 2)); outputs[id] = newID; }+ }+ for (const id of downloads('snapshot')) {+ assert(stored.has(outputs[id]), 'The exact producer artifact remains available');+ assert.equal(stored.get(outputs[id]).endsWith(rerun.includes(id) ? '-2' : '-1'), true);+ }+ }+});+function storage(candidate) {const objects = new Map([['open-motion/dev/install.md', Buffer.from('previous entry')]]), writes = [], reads = [];let failKey;