Skip to content

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

fix(release): streamline publication and use channel install tags

lefarcen09d286674824
diff --git a/.github/scripts/motion-registry-smoke.mjs b/.github/scripts/motion-registry-smoke.mjs
index be099b08..65c9cdbf 100644
--- a/.github/scripts/motion-registry-smoke.mjs
+++ b/.github/scripts/motion-registry-smoke.mjs
@@ -67,7 +67,7 @@ export async function registrySmoke(directory) {
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]));
+ const [packed] = JSON.parse(await cli(['pack', metadata.dist.tarball, '--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);
diff --git a/.github/scripts/motion-release.mjs b/.github/scripts/motion-release.mjs
index 6f5fa06c..d7b1f7fa 100644
--- a/.github/scripts/motion-release.mjs
+++ b/.github/scripts/motion-release.mjs
@@ -181,22 +181,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}`;
@@ -262,26 +246,34 @@ export async function publishNpm(directory, inputs, { fetcher = fetch, run = run
return record;
}
-export async function promoteTest(directory, inputs, { fetcher = fetch, run = runFile, env = process.env } = {}) {
+export async function waitForRegistry(candidate, ready, { fetcher = fetch, wait = ms => new Promise(resolve => setTimeout(resolve, ms)), attempts = 60 } = {}) {
+ for (let attempt = 0; attempt < attempts; attempt++) {
+ const state = await registryPackage(candidate, fetcher);
+ if (ready(state)) return state;
+ if (attempt + 1 < attempts) await wait(10_000);
+ }
+ throw new Error('npm registry propagation timed out; retry the failed publication steps');
+}
+
+export async function promoteTest(directory, inputs, { fetcher = fetch, run = runFile, env = process.env, wait, attempts } = {}) {
const candidate = await verifyDownloaded(directory, inputs.expectedSHA256, inputs.version);
await verifyAuthorization(directory, inputs, env);
- const platforms = await platformReports(directory, candidate);
const npm = await json(path.join(directory, 'npm-publication.json'));
assert.equal(npm.tgzSHA256, candidate.tgzSHA256);
- const before = await registryPackage(candidate, fetcher);
+ const before = await waitForRegistry(candidate, state => !!state.version, { fetcher, wait, attempts });
assert(before.version, 'Exact npm version is not public');
assert.equal(before.tags.latest ?? null, npm.previousLatest, 'npm latest changed unexpectedly; stop before channel promotion');
const superseded = before.tags.test && compareReleaseVersions(before.tags.test, candidate.version) > 0;
let status = inputs.action === 'archive-only' ? 'archive-only' : superseded ? 'superseded' : 'already-promoted';
if (inputs.action === 'publish-test' && !superseded && before.tags.test !== candidate.version) {
await run('npm', ['dist-tag', 'add', `${candidate.packageName}@${candidate.version}`, 'test', '--registry=https://registry.npmjs.org/']);
- const after = await registryPackage(candidate, fetcher);
+ const after = await waitForRegistry(candidate, state => state.tags.test === candidate.version, { fetcher, wait, attempts });
assert(after.version); assert.equal(after.tags.test, candidate.version, 'npm test promotion readback failed');
assert.equal(after.tags.latest ?? null, npm.previousLatest, 'npm latest changed unexpectedly');
status = '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, previousTest: before.tags.test ?? null, status };
await writeJSON(path.join(directory, 'test-promotion.json'), record);
return record;
}
@@ -290,11 +282,9 @@ 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 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((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);
@@ -317,15 +307,15 @@ export async function archiveRelease(directory, inputs, config, { run = runFile,
let release = { schemaVersion: 2, 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,
- status: 'registry-verified', publishedAt: new Date().toISOString() };
+ channelPromotion: promotion, templateEnvironment: record.templateEnvironment,
+ nativeChecks: 'post-publication', status: 'registry-verified', publishedAt: new Date().toISOString() };
if (prior) {
const existing = JSON.parse(prior);
for (const key of ['packageName', 'version', 'sourceCommit', 'tgzSHA256', 'integrity']) assert.equal(existing[key], release[key], 'Existing release record differs: ' + key);
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', '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);
diff --git a/.github/scripts/publish-install-guide.mjs b/.github/scripts/publish-install-guide.mjs
index 266b26f2..a96a879c 100644
--- a/.github/scripts/publish-install-guide.mjs
+++ b/.github/scripts/publish-install-guide.mjs
@@ -19,11 +19,21 @@ export function storagePlan(record, { endpoint, bucket, publicOrigin }) {
return { endpoint: api.origin, bucket, publicOrigin: origin.origin, versionKey: `${prefix}/${record.version}/install.md`, legacyVersionKey: `${prefix}/versions/${record.version}/install.md`, fixedKey: `${prefix}/install.md` };
}
+export function movingGuide(text, record) {
+ const tag = record.channel === 'test' ? 'test' : 'latest';
+ return text.replaceAll(`${record.packageName}@${record.version}`, `${record.packageName}@${tag}`)
+ .replace('This guide pins the complete npm application', `Current ${record.channel} version: ${record.version}. Commands follow the npm ${tag} tag for the complete application`)
+ .replace('from this exact package', 'from the installed package')
+ .replace('Pin this exact version when reproducing an issue.', 'Record and pin the installed version when reproducing an issue.')
+ .replace('Release identity: source', 'Guide version identity (the npm tag may advance): source');
+}
+
export async function publishGuide(directory, config, { run = runFile, fetcher = fetch, promote = true } = {}) {
const file = path.join(directory, 'install.md'), record = JSON.parse(await readFile(path.join(directory, 'install-record.json'), 'utf8'));
assert.equal(record.candidate, false, 'Build previews cannot be published');
assert.equal(await sha256(file), record.guideSHA256, 'Generated guide changed after validation');
const plan = storagePlan(record, config), expected = await readFile(file);
+ const current = Buffer.from(movingGuide(expected.toString('utf8'), record));
const args = ['--endpoint-url', plan.endpoint, '--region', 'auto', 's3api'];
const aws = async (operation, rest) => JSON.parse(await run('aws', [...args, operation, '--bucket', plan.bucket, ...rest]) || '{}');
const work = await mkdtemp(path.join(os.tmpdir(), 'motion-install-publish-'));
@@ -32,13 +42,15 @@ export async function publishGuide(directory, config, { run = runFile, fetcher =
try { const response = await aws('get-object', ['--key', key, destination]); return { etag: response.ETag, bytes: await readFile(destination) }; }
catch (error) { if (/NoSuchKey|\(404\)|Not Found/.test(error.message)) return null; throw error; }
};
- const verifyPublic = async key => {
+ const verifyPublic = async (key, bytes = expected) => {
const url = new URL('/' + key, plan.publicOrigin);
const response = await fetcher(url, { redirect: 'error', signal: AbortSignal.timeout(20_000), headers: { 'cache-control': 'no-cache', 'user-agent': 'OpenMotion-install-publisher' } });
assert(response.ok, `Public installation guide returned HTTP ${response.status}`);
- assert(Buffer.from(await response.arrayBuffer()).equals(expected), 'Public installation guide bytes differ');
+ assert(Buffer.from(await response.arrayBuffer()).equals(bytes), 'Public installation guide bytes differ');
};
- const put = (key, condition, cache) => aws('put-object', ['--key', key, '--body', file, '--content-type', 'text/markdown; charset=utf-8', '--cache-control', cache, ...condition]);
+ const currentFile = path.join(work, 'current-install.md');
+ await writeFile(currentFile, current);
+ const put = (key, condition, cache, body = file) => aws('put-object', ['--key', key, '--body', body, '--content-type', 'text/markdown; charset=utf-8', '--cache-control', cache, ...condition]);
const existing = await get(plan.versionKey, path.join(work, 'version.md'));
const legacy = await get(plan.legacyVersionKey, path.join(work, 'legacy-version.md'));
if (legacy) assert(legacy.bytes.equals(expected), 'An immutable legacy version already has different installation instructions');
@@ -61,17 +73,17 @@ export async function publishGuide(directory, config, { run = runFile, fetcher =
await writeJSON(path.join(directory, 'publication.json'), publication);
return publication;
}
- if (version === record.version) assert(previous.bytes.equals(expected), 'Same-version default guide has different bytes');
+ if (version === record.version) assert(previous.bytes.equals(expected) || previous.bytes.equals(current), 'Same-version default guide has different bytes');
}
- const publication = { ...record, ...plan, previousSHA256: previous ? createHash('sha256').update(previous.bytes).digest('hex') : null,
+ const publication = { ...record, ...plan, movingGuideSHA256: createHash('sha256').update(current).digest('hex'), previousSHA256: previous ? createHash('sha256').update(previous.bytes).digest('hex') : null,
previousETag: previous?.etag ?? null, phase: 'before-fixed-promotion' };
await writeJSON(path.join(directory, 'publication.json'), publication);
- if (!previous?.bytes.equals(expected)) {
+ if (!previous?.bytes.equals(current)) {
publication.phase = 'fixed-write-attempted'; await writeJSON(path.join(directory, 'publication.json'), publication);
- await put(plan.fixedKey, previous ? ['--if-match', previous.etag] : ['--if-none-match', '*'], 'public, max-age=60, must-revalidate');
+ await put(plan.fixedKey, previous ? ['--if-match', previous.etag] : ['--if-none-match', '*'], 'public, max-age=60, must-revalidate', currentFile);
}
publication.phase = 'fixed-written-public-unverified'; await writeJSON(path.join(directory, 'publication.json'), publication);
- await verifyPublic(plan.fixedKey);
+ await verifyPublic(plan.fixedKey, current);
publication.phase = 'verified'; await writeJSON(path.join(directory, 'publication.json'), publication);
return publication;
} finally { await rm(work, { recursive: true, force: true }); }
diff --git a/.github/workflows/motion-publish-test.yml b/.github/workflows/motion-publish-test.yml
index d83a9dd0..fa3e7c21 100644
--- a/.github/workflows/motion-publish-test.yml
+++ b/.github/workflows/motion-publish-test.yml
@@ -122,10 +122,11 @@ jobs:
if-no-files-found: warn
registry-mac:
- if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' }}
+ if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.snapshot.result == 'success' }}
env:
MOTION_EXPECTED_SHA256: ${{ needs.verify.outputs.tgz_sha256 }}
- needs: [verify, npm]
+ needs: [verify, snapshot]
+ continue-on-error: true
runs-on: macos-26
timeout-minutes: 40
outputs:
@@ -149,6 +150,12 @@ jobs:
run: |
node .github/scripts/motion-release.mjs verify "$RUNNER_TEMP/candidate"
node .github/scripts/motion-registry-smoke.mjs "$RUNNER_TEMP/candidate"
+ - name: Report post-publication installation failure
+ if: failure()
+ shell: bash
+ run: |
+ echo '::warning::Post-publication native installation check failed. The published version and installation guide remain available; inspect this job before recommending it.'
+ echo 'Native installation check failed after publication; see this job log.' >> "$GITHUB_STEP_SUMMARY"
- uses: actions/[email protected]
id: artifact
if: always()
@@ -159,10 +166,11 @@ jobs:
if-no-files-found: warn
registry-windows:
- if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.npm.result == 'success' }}
+ if: ${{ always() && !cancelled() && needs.verify.result == 'success' && needs.snapshot.result == 'success' }}
env:
MOTION_EXPECTED_SHA256: ${{ needs.verify.outputs.tgz_sha256 }}
- needs: [verify, npm]
+ needs: [verify, snapshot]
+ continue-on-error: true
runs-on: windows-2025
timeout-minutes: 40
outputs:
@@ -186,6 +194,12 @@ jobs:
run: |
node .github/scripts/motion-release.mjs verify "$RUNNER_TEMP/candidate"
node .github/scripts/motion-registry-smoke.mjs "$RUNNER_TEMP/candidate"
+ - name: Report post-publication installation failure
+ if: failure()
+ shell: bash
+ run: |
+ echo '::warning::Post-publication native installation check failed. The published version and installation guide remain available; inspect this job before recommending it.'
+ echo 'Native installation check failed after publication; see this job log.' >> "$GITHUB_STEP_SUMMARY"
- uses: actions/[email protected]
id: artifact
if: always()
@@ -196,12 +210,12 @@ jobs:
if-no-files-found: warn
promote-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' }}
env:
MOTION_EXPECTED_SHA256: ${{ needs.verify.outputs.tgz_sha256 }}
- needs: [verify, npm, registry-mac, registry-windows]
+ needs: [verify, npm]
runs-on: ubuntu-24.04
- timeout-minutes: 15
+ timeout-minutes: 25
outputs:
artifact_id: ${{ steps.artifact.outputs.artifact-id }}
permissions:
@@ -231,19 +245,7 @@ jobs:
github-token: ${{ github.token }}
run-id: ${{ github.run_id }}
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 }}
- 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 with registry propagation retries
run: node .github/scripts/motion-release.mjs promote-test "$RUNNER_TEMP/candidate"
- name: Retain the verified channel result
id: artifact
@@ -256,11 +258,11 @@ jobs:
if-no-files-found: warn
snapshot:
- 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.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, promote-test]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
@@ -283,18 +285,6 @@ jobs:
github-token: ${{ github.token }}
run-id: ${{ github.run_id }}
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 }}
- github-token: ${{ github.token }}
- run-id: ${{ github.run_id }}
- path: ${{ runner.temp }}/candidate
- uses: actions/[email protected]
with:
artifact-ids: ${{ needs.promote-test.outputs.artifact_id }}
@@ -331,5 +321,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 after registry and public readback; native cold-install checks run afterward; a superseded candidate keeps its version snapshot without moving the default. No stable release occurred.\n`);
JS
diff --git a/AGENTS.md b/AGENTS.md
index 66f120ae..1be0ad54 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -55,4 +55,4 @@ Phase one exposes eleven motion_ Tools (nine project tools plus catalog fetch an
Follow [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. Use candidate-install.md for local testing and keep results private. The publication operator enters the exact version and starts the manual workflow; no acceptance checkbox or manual testing gate is required. Record failed and unrun checks honestly. 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; the credential-isolated promotion job moves npm `test` after registry propagation, then archives and updates the guide. Mac/Windows cold installs run afterward as non-blocking checks with visible warnings. 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.md
index 56ad32b3..62e43fc9 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -6,7 +6,7 @@ Read and follow [AGENTS.md](AGENTS.md) before working in this repository. It is
Follow [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. Use candidate-install.md for local testing and keep results private. The publication operator enters the exact version and starts the manual workflow; no acceptance checkbox or manual testing gate is required. Record failed and unrun checks honestly. 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; the credential-isolated promotion job moves npm `test` after registry propagation, then archives and updates the guide. Mac/Windows cold installs run afterward as non-blocking checks with visible warnings. 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 documentation
diff --git a/docs/product/architecture.md b/docs/product/architecture.md
index 78d52810..1dc8a08d 100644
--- a/docs/product/architecture.md
+++ b/docs/product/architecture.md
@@ -266,7 +266,7 @@ 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 → optional local testing → manual 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 records the manual publication operator without requiring an acceptance checkbox. 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 → optional local testing → manual 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 records the manual publication operator without requiring an acceptance checkbox. 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, promoted to test in an npm-OIDC-only job with bounded propagation retries, then archived before conditionally advancing the default guide. Anonymous Mac/Windows cold installs run afterward as non-blocking checks. Failed native checks report warnings without undoing publication. 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.
diff --git a/docs/release-guide.md b/docs/release-guide.md
index b42d5acd..7683ccc7 100644
--- a/docs/release-guide.md
+++ b/docs/release-guide.md
@@ -36,13 +36,13 @@ Mac arm64 and Windows x64 require separate results; absent runners are not passe
1. 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`; test promotion precedes non-blocking native registry checks; 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 registry propagation verification between them:
npm publish /absolute/final-test.tgz --access public --tag candidate
# After both exact-version native checks pass:
npm dist-tag add @openmotion/app@<exact-test-version> test
@@ -65,7 +65,7 @@ Each defect needs exact package/source/OS/host/environment/catalog identity, pro
Ordinary 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. Run Motion test publication from `feature/motion` with that exact version. Starting the manual workflow authorizes publication; no acceptance checkbox is required. 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. Run Motion test publication from `feature/motion` with that exact version. Starting the manual workflow authorizes publication; no acceptance checkbox is required. Candidate lookup and hashes are automatic; no independent approval environment is enabled. The same candidate bytes receive immutable snapshots before the moving guide advances; anonymous native registry checks follow publication and report failures separately. 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.
@@ -74,3 +74,5 @@ The short test/stable version URL contract and historical `/versions/` URLs rema
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.
The new entries require separate trusted default-branch registration and npm trusted-publisher setup before use. Those administrative steps are not performed by this feature PR. Existing R2 credentials are reused only in the final snapshot job. No workflow was dispatched or package published as part of implementing these controls. See [setup, records and recovery](release-workflows.md).
+
+Default installation guides use floating npm tags (`@test` for DEV, `@latest` for stable) and state the current version separately. Versioned guides remain pinned for reproduction. Native cold-install results are post-publication evidence, not a test-channel promotion gate.
diff --git a/docs/release-workflows.md b/docs/release-workflows.md
index 84be2eeb..0255a908 100644
--- a/docs/release-workflows.md
+++ b/docs/release-workflows.md
@@ -6,9 +6,9 @@ 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 |
| Optional local testing | Use `candidate-install.md` and the local tgz in an isolated host; retain completed `acceptance.md` internally |
-| Publish: enter the exact candidate version | 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 exact candidate version | Find the unique candidate automatically, verify its source/hashes, publish the same tgz under `candidate`, advance npm `test`, archive snapshots and update the default guide; native installation checks run afterward |
-**No acceptance checkbox or manual testing gate is required.** Starting the trusted manual workflow authorizes the selected test publication. The operator receipt records who started it and the candidate identity; it does not claim human acceptance. Automated source, hash, scan and native installation checks remain mandatory.
+**No acceptance checkbox or manual testing gate is required.** Starting the trusted manual workflow authorizes the selected test publication. The operator receipt records who started it and the candidate identity; it does not claim human acceptance. Automated source, hash and scan checks remain mandatory. Native installation checks run after publication and report warnings without blocking delivery.
New public test packages use **DEV templates**; stable packages use prod. The `dev` URL path selects the test software channel, whose newly built packages now embed DEV configuration. Package visibility does not grant DEV network access or authorization; no private catalog snapshot or credential is embedded. Existing prod-based test versions are immutable and remain unchanged. Stable publication, npm `latest` promotion and Skills marketplace/platform upload are separate follow-ups; the five Skills are only included in the npm application and registered locally.
@@ -74,10 +74,10 @@ The workflow searches GitHub artifacts by the exact versioned name and requires
It 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.
-5. Shows the exact version, publication phase, versioned installation guide and default guide in the run summary.
+2. Advances npm `test` in a separate npm-OIDC-only job. Registry version/tag propagation is polled for up to ten minutes; a successful tag write is not repeated while waiting. Identical retries do not retag, and newer versions are never regressed.
+3. Archives immutable R2 snapshots, verifies public bytes and updates the default guide. Default DEV commands use `@test`; stable commands use `@latest`, with the current version noted in prose. Versioned historical guides keep exact versions. A same-version pinned default may migrate to this tag form without changing its immutable guide.
+4. Runs separate macOS arm64 and Windows x64 cold installations after the guide is available. They verify the exact npm bytes, native components, setup/repeat setup, eleven Tools and five Skills. Failures produce a visible warning and retained report; they do not block or roll back publication. These checks do not claim human audiovisual acceptance.
+5. Shows publication status and guide links independently of the later installation checks.
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.
@@ -90,7 +90,7 @@ OIDC authenticates the publisher. Automatic npm provenance remains disabled beca
This 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 schema-2 release record; later platform reports are retained as Actions artifacts. 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, promotion outcome. The immutable release record includes channel verification and template environment, and marks native checks as post-publication. 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 +99,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 native validation. Native checks run after publication. Once tag readback passes, `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 start 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 start snapshot-only recovery. It requires an already published identical npm version, fills missing immutable snapshots and subsequently runs native checks. 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/install-guide.test.ts b/tests/install-guide.test.ts
index 52ca93c7..316ea039 100644
--- a/tests/install-guide.test.ts
+++ b/tests/install-guide.test.ts
@@ -4,7 +4,7 @@ import { mkdtemp, mkdir, readFile, writeFile, rm } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { generateInstallGuide, validateGuideSpec, validateGuideIdentity } from '../scripts/install-guide.mjs';
-import { publishGuide, storagePlan } from '../.github/scripts/publish-install-guide.mjs';
+import { movingGuide, publishGuide, storagePlan } from '../.github/scripts/publish-install-guide.mjs';
import { runFile } from '../scripts/runtime-assets.mjs';
const pkg = { name: '@openmotion/app', version: '0.6.4-test.1', private: false, bin: { openmotion: 'scripts/npm-installer.mjs' } };
@@ -162,3 +162,19 @@ test('PR CI has no publication credentials; publication requires a separate manu
assert(!workflow.includes('accepted:') && !workflow.includes('MOTION_ACCEPTED'));
assert(!workflow.split(' snapshot:\n')[0].includes('secrets.'));
});
+
+test('moving guides use channel tags while immutable guides and current version remain exact', async t => {
+ const { directory, record } = await fixture(t), store = storage(directory, record);
+ const exact = await readFile(path.join(directory, 'install.md'), 'utf8');
+ // Existing same-version pinned defaults may migrate once without changing the archive.
+ store.objects.set(store.plan.fixedKey, Buffer.from(exact));
+ await publishGuide(directory, config, store);
+ const current = store.objects.get(store.plan.fixedKey)!.toString();
+ assert(current.includes('@openmotion/app@test'));
+ assert(!current.includes('@openmotion/app@' + record.version));
+ assert(current.includes('Current test version: ' + record.version));
+ assert.equal(store.objects.get(store.plan.versionKey)!.toString(), exact);
+ assert(movingGuide(exact, { ...record, channel: 'stable' }).includes('@openmotion/app@latest'));
+ const count = store.writes.length;
+ await publishGuide(directory, config, store); assert.equal(store.writes.length, count);
+});
diff --git a/tests/release-fixture.mjs b/tests/release-fixture.mjs
index 9ef66958..c8db4ded 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-'));
@@ -43,6 +43,6 @@ export async function candidateFixture(t, branch = 'main') {
registryColdInstall: 'passed', nativePreparation: 'passed', repeatSetup: 'passed', resources: 'passed', mcpTools: 11, skills: 5,
});
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' });
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.mjs
index 4a190988..3f605f09 100644
--- a/tests/release-workflows.test.mjs
+++ b/tests/release-workflows.test.mjs
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
import path from 'node:path';
import { createHash } from 'node:crypto';
import { candidateFixture } from './release-fixture.mjs';
-import { releaseInputs, resolveCandidate, validateSource, validateRun, verifyDownloaded, downloadCandidate, publishNpm, promoteTest, archiveRelease, repository, candidateWorkflow, recoveryWorkflow, publicationWorkflow, candidateJobName, findCandidate, authorizationReceipt, recordAuthorization } from '../.github/scripts/motion-release.mjs';
+import { waitForRegistry, releaseInputs, resolveCandidate, validateSource, validateRun, verifyDownloaded, downloadCandidate, publishNpm, promoteTest, archiveRelease, repository, candidateWorkflow, recoveryWorkflow, publicationWorkflow, candidateJobName, findCandidate, authorizationReceipt, recordAuthorization } from '../.github/scripts/motion-release.mjs';
import { compareReleaseVersions } from '../scripts/release-version.mjs';
import { consumerEnvironment } from '../.github/scripts/motion-registry-smoke.mjs';
import { runFile } from '../scripts/runtime-assets.mjs';
@@ -180,21 +180,14 @@ test('a stale candidate or authorization from another run cannot publish or move
assert.equal(calls, 0);
});
-test('test promotion requires both matching DEV native reports and preserves the old channel on failure', async t => {
+test('test promotion does not wait for native reports and still protects the channel', 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' }]) {
- 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');
- }
- await rm(file); await assert.rejects(promoteTest(f.directory, f.inputs, options), /ENOENT/);
- assert.equal(writes, 0); assert.equal(tag, '0.6.4-test.1');
- await writeFile(file, original);
+ await rm(path.join(f.directory, 'registry-win32-x64.json'));
+ await rm(path.join(f.directory, 'registry-darwin-arm64.json'));
await assert.rejects(promoteTest(f.directory, f.inputs, { ...options, fetcher: registry(f.candidate, true, tag, '0.6.4') }), /latest changed/);
await assert.rejects(promoteTest(f.directory, f.inputs, { ...options, env: { GITHUB_RUN_ID: '801' } }), /another publication run/);
assert.equal(writes, 0);
@@ -236,10 +229,14 @@ test('partial publication retries use the retained producer artifact IDs across
assert.deepEqual(downloads('npm'), ['verify']);
assert.deepEqual(downloads('registry-mac'), ['verify']);
assert.deepEqual(downloads('registry-windows'), ['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.deepEqual(downloads('promote-test'), ['verify', 'npm']);
+ assert.deepEqual(downloads('snapshot'), ['verify', 'npm', 'promote-test']);
+ assert(jobs.snapshot.includes('needs: [verify, npm, promote-test]'));
+ assert(!jobs['promote-test'].includes('needs.registry-'));
+ for (const id of ['registry-mac', 'registry-windows']) {
+ assert(jobs[id].includes('needs: [verify, snapshot]'));
+ assert(jobs[id].includes('continue-on-error: true'));
+ }
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');
@@ -383,15 +380,13 @@ test('interrupted archive resumes identical snapshots, verifies the exact public
await 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', 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' }));
- const before = store.reads.length; await assert.rejects(archiveRelease(f.directory, f.inputs, config, store)); assert.equal(store.reads.length, before);
+
});
test('a superseded npm candidate still keeps immutable snapshots and never advances the moving guide', async t => {
@@ -451,3 +446,12 @@ test('no-publication rehearsal carries one accepted candidate through npm and st
assert.equal(npmWrites, 1, 'Retry never repacks or republishes the accepted bytes');
assert.equal(tagWrites, 1, 'Retry never moves an already verified tag again');
});
+
+ test('registry propagation retries stale version and tag metadata without repeating writes', async t => {
+ const f = await candidateFixture(t); let reads = 0, waits = 0;
+ const fetcher = async () => registry(f.candidate, ++reads >= 3, reads >= 4 ? f.candidate.version : '0.6.4-test.1')();
+ const wait = async ms => { assert.equal(ms, 10000); waits++; };
+ const result = await waitForRegistry(f.candidate, state => state.tags.test === f.candidate.version, { fetcher, wait, attempts: 4 });
+ assert.equal(result.tags.test, f.candidate.version); assert.equal(waits, 3);
+ await assert.rejects(waitForRegistry(f.candidate, () => false, { fetcher, wait, attempts: 2 }), /timed out/);
+});