Skip to content

The agent that grows with you

feat(release): derive canaries from stable build identity

ethernet14b1e7220b05
diff --git a/.github/workflows/canary-release.yml b/.github/workflows/canary-release.yml
index aa005b4fb70..bbed0319f4e 100644
--- a/.github/workflows/canary-release.yml
+++ b/.github/workflows/canary-release.yml
@@ -1,37 +1,17 @@
name: Canary Release
-# Publishes the canary prerelease channel: a dated prerelease versioned
-# NEXT-MINOR over the newest stable tag
-# (v<stable.minor+1>.0-canary.<YYYYMMDDHHMMSS>), so a canary always
-# outversions every stable build of the current line and loses to the
-# next stable minor — which is exactly how the electron-updater channel
-# switch works in both directions (see hermes_cli/update_channel.py).
-# Second-precision suffix: manual dispatches can publish several
-# canaries per day; the scheduled run publishes at most one because
-# release.py skips when HEAD has no new commits since the last canary.
+# Every main push is eligible for a canary. GitHub's concurrency semantics keep
+# the in-progress build and only the newest pending push, so the pipeline itself
+# bounds the rate without a cron, debounce, path filter or manual trigger.
#
-# ALL of it lives in scripts/release.py --canary: the tag math, the
-# skip gate, the draft release, and the dispatch of the desktop build.
-# This workflow only supplies a schedule and credentials, which is why
-# `release.py --canary --publish` by hand does exactly what the cron
-# does — same tag, same draft, same build, same auto-publish.
-#
-# The desktop build uploads the installers to the Cloudflare R2 release
-# bucket and publishes the draft when the whole matrix is green. Its final
-# protected channel_releases canary step advances the R2 head from those same
-# receipts, after the published-release read-back. This scheduler must not
-# advance a head: dispatch success is not native acceptance. A failed
-# matrix leaves a draft: inspectable, re-runnable, and unreachable by
-# users. The prune job deletes both the GitHub releases+tags and the R2
-# canary objects older than 14 days.
-#
-# schedule: is the ONE sanctioned time trigger in this repo (nightly
-# exemption). Everything else stays event-driven.
+# Source identity is the exact stable version plus build metadata:
+# v<stable>+canary.<YYYYMMDDTHHMMSSZ>. It compares equal to the stable; only
+# the protected R2 canary head moves subscribers. Superseded pending runs have
+# conclusion=cancelled; only conclusion=failure is a canary failure signal.
on:
- schedule:
- - cron: '0 8 * * *' # daily, 0300 EST / 0800 UTC, middle of the night when most stuff will be moving less
- workflow_dispatch: {}
+ push:
+ branches: [main]
permissions:
contents: write # tag push + release create/delete for prune
diff --git a/.github/workflows/desktop-bundled-release.yml b/.github/workflows/desktop-bundled-release.yml
index a8a303dca39..6e3ad61e415 100644
--- a/.github/workflows/desktop-bundled-release.yml
+++ b/.github/workflows/desktop-bundled-release.yml
@@ -96,7 +96,7 @@ on:
workflow_dispatch:
inputs:
tag:
- description: 'Release tag to bundle (vX.Y.Z or vX.Y.0-canary.YYYYMMDDHHMMSS). Must exist on the repo.'
+ description: 'Release tag to bundle (vX.Y.Z or vX.Y.Z+canary.YYYYMMDDTHHMMSSZ). Must exist on the repo.'
required: false
type: string
default: ''
@@ -299,11 +299,11 @@ jobs:
[ "$GITHUB_REF" = "refs/tags/$TAG" ] || exit 1
[ "$(git rev-parse HEAD)" = "$GITHUB_SHA" ] || exit 1
;;
- '') [[ "$TAG" == *-canary.* ]] || { echo 'Use Stable Release for stable tags' >&2; exit 1; } ;;
+ '') [[ "$TAG" == *+canary.* ]] || { echo 'Use Stable Release for stable tags' >&2; exit 1; } ;;
*) echo 'Unknown release phase' >&2; exit 1 ;;
esac
case "$TAG" in
- v[0-9]*.[0-9]*.[0-9]*-canary.20[0-9][0-9][0-9][0-9][0-9][0-9]*)
+ v[0-9]*.[0-9]*.[0-9]*+canary.20[0-9][0-9][0-9][0-9][0-9][0-9]T[0-9][0-9][0-9][0-9][0-9][0-9]Z)
echo "canary tag: $TAG"
;;
v[0-9]*.[0-9]*.[0-9]*)
@@ -315,7 +315,7 @@ jobs:
fi
;;
*)
- echo "::error::'$TAG' is not a release tag (vX.Y.Z or vX.Y.0-canary.YYYYMMDDHHMMSS)"
+ echo "::error::'$TAG' is not a release tag (vX.Y.Z or vX.Y.Z+canary.YYYYMMDDTHHMMSSZ)"
exit 1
;;
esac
@@ -334,7 +334,7 @@ jobs:
fi
echo "tag $TAG resolves to $SHA (on origin/main)"
case "$TAG" in
- *-canary.*) echo "channel=canary" >> "$GITHUB_OUTPUT" ;;
+ *+canary.*) echo "channel=canary" >> "$GITHUB_OUTPUT" ;;
*) echo "channel=stable" >> "$GITHUB_OUTPUT" ;;
esac
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
@@ -559,7 +559,7 @@ jobs:
run: |
python scripts/bundles/desktop.py --prepared "$env:RUNNER_TEMP/desktop-job/prepared.json" --variant bundled
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- if (-not $env:CHANNEL_BUILD -and -not $env:HERMES_BUILD_COMMIT -and $env:HERMES_PAYLOAD_TAG -notlike "*-canary.*") {
+ if (-not $env:CHANNEL_BUILD -and -not $env:HERMES_BUILD_COMMIT -and $env:HERMES_PAYLOAD_TAG -notlike "*+canary.*") {
python scripts/bundles/desktop.py --prepared "$env:RUNNER_TEMP/desktop-job/prepared.json" --variant store
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
@@ -621,7 +621,7 @@ jobs:
# appears after the selected packages (including Store on stable) upload.
run: |
args=(--include '*.msix')
- if [ "$RELEASE_PHASE" = candidate ] || { [ "$HERMES_DESKTOP_VARIANT" = bundled ] && [[ "$HERMES_PAYLOAD_TAG" == *-canary.* ]]; }; then
+ if [ "$RELEASE_PHASE" = candidate ] || { [ "$HERMES_DESKTOP_VARIANT" = bundled ] && [[ "$HERMES_PAYLOAD_TAG" == *+canary.* ]]; }; then
python -m scripts.bundles.release_artifacts record --platform windows --arch "${TARGET##*-}" \
--root apps/desktop/release --tag "$HERMES_PAYLOAD_TAG" --commit "$RELEASE_COMMIT" \
--out "apps/desktop/release/metadata-windows-${TARGET##*-}.json"
@@ -951,7 +951,7 @@ jobs:
# Per-arch feed inputs stay in the tag archive until both legs pass.
run: |
args=(--include '*.dmg' --include '*.zip' --include '*.blockmap' --include '*-mac.yml')
- if [ "$RELEASE_PHASE" = candidate ] || { [ "$HERMES_DESKTOP_VARIANT" = bundled ] && [[ "$HERMES_PAYLOAD_TAG" == *-canary.* ]]; }; then
+ if [ "$RELEASE_PHASE" = candidate ] || { [ "$HERMES_DESKTOP_VARIANT" = bundled ] && [[ "$HERMES_PAYLOAD_TAG" == *+canary.* ]]; }; then
python -m scripts.bundles.release_artifacts record --platform macos --arch "${TARGET##*-}" \
--root apps/desktop/release --tag "$HERMES_PAYLOAD_TAG" --commit "$RELEASE_COMMIT" \
--out "apps/desktop/release/metadata-macos-${TARGET##*-}.json"
@@ -1365,8 +1365,9 @@ jobs:
run: |
node --input-type=module -e '
import identity from "./apps/desktop/product-identity.cjs";
- import { OUT_OF_STORE_PUBLISHER } from "./scripts/msix-shared.mjs";
- console.log(JSON.stringify({identity: identity.msixAppIdWithOrg, publisher: OUT_OF_STORE_PUBLISHER}));
+ import { appIdentity, OUT_OF_STORE_PUBLISHER } from "./scripts/msix-shared.mjs";
+ const build = appIdentity(process.cwd() + "/apps/desktop");
+ console.log(JSON.stringify({identity: identity.msixAppIdWithOrg, publisher: OUT_OF_STORE_PUBLISHER, version: build.version}));
' > staged/expected-identity.json
python - <<'PY'
import json, os, re
@@ -1381,8 +1382,8 @@ jobs:
raise ValueError('Missing assembly version in receipt-bound bundle name')
version = match[1]
if (any(str(int(part)) != part or int(part) > 65535 for part in version.split('.'))
- or version.rsplit('.', 1)[0] != os.environ['HERMES_PAYLOAD_TAG'].split('-')[0].removeprefix('v')):
- raise ValueError('Assembly version differs from the release tag base')
+ or version != expected['version']):
+ raise ValueError('Assembly version differs from the admitted build identity')
# publish-appinstaller compares this version to the baked envelope.
main(['publish-appinstaller', '--root', 'staged', '--bundle', str(bundle),
'--tag', os.environ['HERMES_PAYLOAD_TAG'], '--variant', 'bundled',
@@ -2151,7 +2152,7 @@ jobs:
always()
&& inputs.build_commit == '' && inputs.channel == ''
&& inputs.upload_release == true
- && contains(inputs.tag, '-canary.')
+ && contains(inputs.tag, '+canary.')
&& needs.build-win32.result == 'success'
&& needs.build-darwin.result == 'success'
&& needs.build-linux.result == 'success'
diff --git a/apps/desktop/electron/app-version.test.ts b/apps/desktop/electron/app-version.test.ts
index 5b6c229589e..2a2d9577175 100644
--- a/apps/desktop/electron/app-version.test.ts
+++ b/apps/desktop/electron/app-version.test.ts
@@ -6,7 +6,7 @@ import type { InstallStamp } from './install-stamp'
describe('artifact version identity', (): void => {
it.each([
['v1.2.3', 'stable'],
- ['v1.2.4-canary.20260911010101', 'canary'],
+ ['v1.2.4+canary.20260911T010101Z', 'canary'],
[null, null]
] as const)(
'reports the client version and fixed channel for %s, not a remote runtime',
diff --git a/apps/desktop/electron/feature-flags.test.ts b/apps/desktop/electron/feature-flags.test.ts
index 20f58054b59..aaa362ca6a6 100644
--- a/apps/desktop/electron/feature-flags.test.ts
+++ b/apps/desktop/electron/feature-flags.test.ts
@@ -23,8 +23,9 @@ test('--local in argv opts into local models on any channel and platform', () =>
})
test('isCanaryTag recognizes canary stamps and rejects stable/dev tags', () => {
- assert.equal(isCanaryTag('v0.28.0-canary.20260818'), true)
- assert.equal(isCanaryTag('v0.28.0-canary.20260818123456'), true)
+ assert.equal(isCanaryTag('v0.28.0+canary.20260818T123456Z'), true)
+ assert.equal(isCanaryTag('v0.28.0-canary.20260818'), false)
+ assert.equal(isCanaryTag('v0.28.0+canary.20260818123456'), false)
assert.equal(isCanaryTag('v0.28.0'), false)
assert.equal(isCanaryTag(''), false)
assert.equal(isCanaryTag(null), false)
diff --git a/apps/desktop/electron/feature-flags.ts b/apps/desktop/electron/feature-flags.ts
index 197b0b45485..e481411473a 100644
--- a/apps/desktop/electron/feature-flags.ts
+++ b/apps/desktop/electron/feature-flags.ts
@@ -6,7 +6,7 @@ const featureFlags = {
export type FeatureFlags = { [K in keyof typeof featureFlags]: boolean }
export function isCanaryTag(tag: string | null | undefined): boolean {
- return /-canary\./.test(tag || '')
+ return /\+canary\.20\d{6}T\d{6}Z$/.test(tag || '')
}
export interface FeatureFlagInput {
diff --git a/apps/desktop/electron/product-identity.test.ts b/apps/desktop/electron/product-identity.test.ts
index b007d80ceab..42e6264d583 100644
--- a/apps/desktop/electron/product-identity.test.ts
+++ b/apps/desktop/electron/product-identity.test.ts
@@ -88,7 +88,7 @@ test('baked runtime identity never evaluates ambient build selectors', async ():
test('nonstable runtime pins userData before the app name can change', async (): Promise<void> => {
const stable: ProductIdentity = await identityForVariant('bundled')
- process.env.HERMES_PAYLOAD_TAG = 'v0.28.0-canary.20260818'
+ process.env.HERMES_PAYLOAD_TAG = 'v0.28.0+canary.20260818T000000Z'
const canary: ProductIdentity = await identityForVariant('bundled')
const runtime: { applyDesktopIdentity: typeof applyDesktopIdentity } = await import('./product-identity')
const root: string = fs.mkdtempSync(path.join(os.tmpdir(), 'identity-userdata-'))
@@ -138,7 +138,7 @@ test.each([
const identities: ProductIdentity[] = [stable]
for (const [tag, commit, expectedCli, expectedChannel] of [
- ['v1.2.3-canary.20260818', '', `${cli}-canary`, canaryChannel],
+ ['v1.2.3+canary.20260818T000000Z', '', `${cli}-canary`, canaryChannel],
['', 'abcdef1234567890abcdef1234567890abcdef12', `${cli}-abcdef1`, null],
['', '1234567890abcdef1234567890abcdef12345678', `${cli}-1234567`, null]
] as const) {
@@ -212,7 +212,7 @@ test('packaging isolates boot metadata and executable names without renaming rel
assert.equal(stable.extraMetadata.productName || pkg.productName, pkg.productName)
for (const build of ['canary', 'abcdef1234567890abcdef1234567890abcdef12']) {
- process.env.HERMES_PAYLOAD_TAG = build === 'canary' ? 'v0.28.0-canary.20260818' : ''
+ process.env.HERMES_PAYLOAD_TAG = build === 'canary' ? 'v0.28.0+canary.20260818T000000Z' : ''
process.env.HERMES_BUILD_COMMIT = build === 'canary' ? '' : build
const identity: ProductIdentity = await identityForVariant('bundled')
const config: PackagingConfiguration = load()
@@ -275,7 +275,7 @@ test('store inherits the bundled app identity (shared userData) but swaps the MS
})
test('nonstable builds cannot claim the official Store package', async (): Promise<void> => {
- process.env.HERMES_PAYLOAD_TAG = 'v0.28.0-canary.20260818'
+ process.env.HERMES_PAYLOAD_TAG = 'v0.28.0+canary.20260818T000000Z'
await assert.rejects(identityForVariant('store'), /Store.*stable/)
delete process.env.HERMES_PAYLOAD_TAG
process.env.HERMES_BUILD_COMMIT = 'abcdef1234567890abcdef1234567890abcdef12'
diff --git a/apps/desktop/electron/updater/channel-protocol.ts b/apps/desktop/electron/updater/channel-protocol.ts
index db116665034..800ad3fc93c 100644
--- a/apps/desktop/electron/updater/channel-protocol.ts
+++ b/apps/desktop/electron/updater/channel-protocol.ts
@@ -85,7 +85,7 @@ export interface ChannelManifest {
const SHA256 = /^[a-f0-9]{64}$/
const COMMIT = /^[a-f0-9]{40}$/
const BUILD_ID = /^[a-f0-9]{32}$/
-const VERSION = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/
+const VERSION = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?(?:\+[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/
function parseChannelJson(body: string): unknown {
const parsed: unknown = JSON.parse(body)
@@ -376,11 +376,15 @@ function request(fields: Fields): ChannelRequest {
throw new Error('Noncanonical request publicBase')
}
- const releaseTag = fields.optional('releaseTag', /^v\d+\.\d+\.\d+(?:-canary\.\d+)?$/)
+ const releaseTag = fields.optional(
+ 'releaseTag',
+ /^v\d+\.\d+\.\d+(?:\+canary\.20\d{6}T\d{6}Z)?$/
+ )
+ const canaryRelease: boolean = /\+canary\./.test(releaseTag || '')
const windowsVersion = fields.text(
'windowsVersion',
- releaseTag?.includes('-canary.') ? /^\d+\.\d+\.\d+\.\d+$/ : /^\d+\.\d+\.\d+\.0$/
+ canaryRelease ? /^\d+\.\d+\.\d+\.\d+$/ : /^\d+\.\d+\.\d+\.0$/
)
if (windowsVersion.split('.').some((part: string): boolean => Number(part) > 65535)) {
diff --git a/apps/desktop/electron/updater/channel.test.ts b/apps/desktop/electron/updater/channel.test.ts
index 6a4d6d01694..f0d65becf18 100644
--- a/apps/desktop/electron/updater/channel.test.ts
+++ b/apps/desktop/electron/updater/channel.test.ts
@@ -221,7 +221,7 @@ test('protected canary accepts bounded Windows revisions without relaxing stable
}
}
]
- f.manifest.request.releaseTag = 'v1.2.4-canary.20260913001000'
+ f.manifest.request.releaseTag = 'v1.2.4+canary.20260913T001000Z'
f.manifest.request.version = f.manifest.request.releaseTag.slice(1)
f.manifest.request.windowsVersion = '1.2.4.10'
f.publish()
diff --git a/apps/desktop/electron/updater/checkout-source.test.ts b/apps/desktop/electron/updater/checkout-source.test.ts
index 5fade69b769..e7e0bc23b4e 100644
--- a/apps/desktop/electron/updater/checkout-source.test.ts
+++ b/apps/desktop/electron/updater/checkout-source.test.ts
@@ -161,7 +161,7 @@ function buildManifest(
channel,
repository: 'NousResearch/hermes-agent',
commit: sha,
- sourceVersion: tag.replace(/^v/, '').split('-')[0],
+ sourceVersion: tag.replace(/^v/, '').split('+')[0],
releaseTag: tag,
sequence,
version: tag.replace(/^v/, ''),
@@ -237,7 +237,7 @@ it('carries each install channel from Python publication checks into the source
commits.push(git(['rev-parse', 'HEAD']))
}
- const tags: Record<'stable' | 'canary', string> = { stable: 'v1.2.3', canary: 'v1.2.4-canary.20260911123456' }
+ const tags: Record<'stable' | 'canary', string> = { stable: 'v1.2.3', canary: 'v1.2.3+canary.20260911T123456Z' }
for (const channel of ['stable', 'canary'] as const) {
const sha: string = commits[channel === 'stable' ? 1 : 2]
diff --git a/apps/desktop/product-identity.cjs b/apps/desktop/product-identity.cjs
index cdd3dd709ec..1a0afddcb21 100644
--- a/apps/desktop/product-identity.cjs
+++ b/apps/desktop/product-identity.cjs
@@ -36,11 +36,11 @@ const light = variant === 'light'
const name = variants[store ? 'bundled' : (variant || '')]
// The electron-updater feed channel this build PUBLISHES to. A canary
-// tag (vX.Y.0-canary.YYYYMMDDHHMMSS) writes canary.yml / light-canary.yml;
+// tag (vX.Y.Z+canary.YYYYMMDDTHHMMSSZ) writes canary.yml / light-canary.yml;
// stable tags write latest.yml / light.yml. Keyed on the payload tag so
// the one release workflow serves both channels — a canary build can
// never overwrite the stable feed file, and vice versa.
-const canary = /-canary\.20\d{6}(?:\d{6})?$/.test(process.env.HERMES_PAYLOAD_TAG || '')
+const canary = /\+canary\.20\d{6}T\d{6}Z$/.test(process.env.HERMES_PAYLOAD_TAG || '')
// Nonstable installs own their package family and local desktop state. The
// seven-character commit suffix also names the CLI and fits MSIX's name cap.
diff --git a/apps/desktop/scripts/msix-manifest-roundtrip.test.mjs b/apps/desktop/scripts/msix-manifest-roundtrip.test.mjs
index f223d49d131..b083564b39e 100644
--- a/apps/desktop/scripts/msix-manifest-roundtrip.test.mjs
+++ b/apps/desktop/scripts/msix-manifest-roundtrip.test.mjs
@@ -82,14 +82,14 @@ test('stable tag: the build-time quad round-trips into the manifest Version', ()
test('canary tag: the build-time quad round-trips into the manifest Version', () => {
const app = makeFakeDesktop('0.27.1')
- const { version, xml } = buildManifest(app, 'v0.27.2-canary.20260829010203')
- assert.equal(version, '2026.5761.123.0')
+ const { version, xml } = buildManifest(app, 'v0.27.1+canary.20260829T010203Z')
+ assert.equal(version, '26.829.1.203')
assert.equal(identityVersion(xml), version)
})
test('manifest Version components are 16-bit (makeappx rejects anything larger)', () => {
const app = makeFakeDesktop('0.27.1')
- const { xml } = buildManifest(app, 'v0.27.2-canary.20260829010203')
+ const { xml } = buildManifest(app, 'v0.27.1+canary.20260829T010203Z')
for (const part of identityVersion(xml).split('.')) {
const n = Number(part)
assert.ok(Number.isInteger(n) && n >= 0 && n <= 65535, `component ${part} outside 16 bits`)
@@ -98,7 +98,7 @@ test('manifest Version components are 16-bit (makeappx rejects anything larger)'
test('a later build stamps a strictly larger quad than an earlier one', () => {
const app = makeFakeDesktop('0.27.1')
- const early = Number(buildManifest(app, 'v0.27.2-canary.20260815080000').version.split('.')[1])
- const late = Number(buildManifest(app, 'v0.27.2-canary.20260829010203').version.split('.')[1])
+ const early = Number(buildManifest(app, 'v0.27.1+canary.20260815T080000Z').version.split('.')[1])
+ const late = Number(buildManifest(app, 'v0.27.1+canary.20260829T010203Z').version.split('.')[1])
assert.ok(late > early, `${late} must exceed ${early}`)
})
diff --git a/apps/desktop/scripts/msix-shared.test.mjs b/apps/desktop/scripts/msix-shared.test.mjs
index be88f9d1a9a..c3abe0f3b58 100644
--- a/apps/desktop/scripts/msix-shared.test.mjs
+++ b/apps/desktop/scripts/msix-shared.test.mjs
@@ -57,10 +57,10 @@ test('stable and canary use their own native build-time quads', () => {
})
try {
const stable = msix.appIdentity(desktop, 'v0.27.1')
- const canary = msix.appIdentity(desktop, 'v0.27.2-canary.20260829010203')
+ const canary = msix.appIdentity(desktop, 'v0.27.1+canary.20260829T010203Z')
assert.equal(stable.version, '2026.5761.123.0')
assert.equal(canary.version, '26.829.1.203')
- assert.equal(canary.fileVersion, '0.27.2-canary.20260829010203')
+ assert.equal(canary.fileVersion, '0.27.1+canary.20260829T010203Z')
} finally {
fs.rmSync(desktop, { recursive: true, force: true })
}
diff --git a/apps/desktop/scripts/side-by-side-launchers.test.mjs b/apps/desktop/scripts/side-by-side-launchers.test.mjs
index a49eadbccf4..68208bdb255 100644
--- a/apps/desktop/scripts/side-by-side-launchers.test.mjs
+++ b/apps/desktop/scripts/side-by-side-launchers.test.mjs
@@ -9,7 +9,7 @@ import * as msix from './before-build.mjs'
const { appExecutionAliasExtensions } = msix
test('the Store bundler rejects nonstable selectors before platform tools or staging', () => {
- for (const args of [['--commit', 'a'.repeat(40)], ['--tag', 'v0.28.0-canary.20260818']]) {
+ for (const args of [['--commit', 'a'.repeat(40)], ['--tag', 'v0.28.0+canary.20260818T000000Z']]) {
const result = spawnSync(process.execPath, [path.resolve(import.meta.dirname, '../../../scripts/bundle-store-msixbundle.mjs'), ...args], {
encoding: 'utf8', env: { ...process.env, HERMES_BUILD_COMMIT: '', HERMES_PAYLOAD_TAG: '' }
})
diff --git a/apps/desktop/scripts/side-by-side.windows.test.mjs b/apps/desktop/scripts/side-by-side.windows.test.mjs
index 96cad8b74e7..293eccb1167 100644
--- a/apps/desktop/scripts/side-by-side.windows.test.mjs
+++ b/apps/desktop/scripts/side-by-side.windows.test.mjs
@@ -96,8 +96,8 @@ foreach ($asset in @(@('Square44x44Logo.png',44,44), @('Square150x150Logo.png',1
})
const cases = [
['stable', { HERMES_PAYLOAD_TAG: 'v1.2.3' }],
- ['canary', { HERMES_PAYLOAD_TAG: 'v1.2.4-canary.20260902000000' }],
- ['canary-update', { HERMES_PAYLOAD_TAG: 'v1.2.4-canary.20260903000000' }],
+ ['canary', { HERMES_PAYLOAD_TAG: 'v1.2.3+canary.20260902T000000Z' }],
+ ['canary-update', { HERMES_PAYLOAD_TAG: 'v1.2.3+canary.20260903T000000Z' }],
['commit-a', { HERMES_BUILD_COMMIT: commitA, HERMES_PAYLOAD_VERSION: '1.2.4' }],
['commit-b', { HERMES_BUILD_COMMIT: commitB, HERMES_PAYLOAD_VERSION: '1.2.4' }],
...[65535, 65536, 0xffffffff].map(sequence => [`channel-${sequence}`, { _HERMES_CHANNEL_REQUEST_JSON: JSON.stringify(channelRequest(sequence)) }]),
diff --git a/apps/desktop/scripts/sign-msix.test.mjs b/apps/desktop/scripts/sign-msix.test.mjs
index 06a9e1c53ed..2c8c381fcdc 100644
--- a/apps/desktop/scripts/sign-msix.test.mjs
+++ b/apps/desktop/scripts/sign-msix.test.mjs
@@ -24,16 +24,16 @@ test('shouldSignFile rejects the Store-submission variant (Partner Center re-sig
// cannot customize CN and CA/B requires the legal entity name — so
// SignerSign would fail 0x8007000B. Partner Center signs on ingestion.
assert.equal(
- shouldSignFile('release/Store-HermesBundled-0.28.0-canary.20260828211829-win-x64.msix'),
+ shouldSignFile('release/Store-HermesBundled-0.28.0+canary.20260828T211829Z-win-x64.msix'),
false
)
assert.equal(
- shouldSignFile('release/Store-HermesBundled-0.28.0-canary.20260828211829-win-arm64.msixbundle'),
+ shouldSignFile('release/Store-HermesBundled-0.28.0+canary.20260828T211829Z-win-arm64.msixbundle'),
false
)
// The out-of-store artifacts keep the only signature Windows validates.
assert.equal(
- shouldSignFile('release/HermesBundled-0.28.0-canary.20260828211829-win-x64.msix'),
+ shouldSignFile('release/HermesBundled-0.28.0+canary.20260828T211829Z-win-x64.msix'),
true
)
})
diff --git a/apps/desktop/scripts/store-package-version.test.mjs b/apps/desktop/scripts/store-package-version.test.mjs
index adee2e2fe92..f210c573319 100644
--- a/apps/desktop/scripts/store-package-version.test.mjs
+++ b/apps/desktop/scripts/store-package-version.test.mjs
@@ -32,7 +32,7 @@ function fixture() {
test('Store manifest and envelope agree while executable app semver and sideload sequence remain unchanged', () => {
const { app } = fixture()
- const tag = 'v0.27.1-canary.20260907001718'
+ const tag = 'v0.27.1'
const identity = appIdentity(app, tag)
const staged = fs.readFileSync(stageStoreManifest(app, tag), 'utf8')
const appInfo = new AppInfo({ metadata: { name: 'hermes', version: tag.slice(1) }, config: { buildNumber: '32863' } }, undefined, {})
@@ -44,8 +44,7 @@ test('Store manifest and envelope agree while executable app semver and sideload
expect(identity.fileVersion).toBe(tag.slice(1))
expect(appInfo.version).toBe(tag.slice(1))
expect(appInfo.getVersionInWeirdWindowsForm(true)).toBe('0.27.1.32863')
- const stable = appIdentity(app, 'v0.27.1').version.split('.').map(Number)
- expect(stable[2]).toBeGreaterThan(Number(version.split('.')[2]))
+
})
test('Store calendar ordering survives minute, hour, day and year boundaries and rejects reserved revision', () => {
@@ -65,7 +64,7 @@ test('Store calendar ordering survives minute, hour, day and year boundaries and
expect(() => storeManifestTemplate('${version}', '0.27.1.32863')).toThrow()
expect(() => storeManifestTemplate('${version}', '0.27.1.0')).toThrow()
expect(() => storePackageVersionAt(NaN)).toThrow()
- expect(() => storePackageVersion('v0.27.1-canary.20260231000000', '.')).toThrow('Invalid canary')
+ expect(() => storePackageVersion('v0.27.1+canary.20260231T000000Z', '.')).toThrow('Invalid canary')
})
test('commit builds cannot stage a Store manifest', () => {
diff --git a/apps/desktop/src/lib/update-copy.test.ts b/apps/desktop/src/lib/update-copy.test.ts
index 3e33e266d24..77e83afae93 100644
--- a/apps/desktop/src/lib/update-copy.test.ts
+++ b/apps/desktop/src/lib/update-copy.test.ts
@@ -87,9 +87,9 @@ describe('resolveUpdateCopy', () => {
target: 'client',
shownItems: 0,
mechanism: 'electron-updater',
- latestTag: 'v0.29.0-canary.20260906000000',
+ latestTag: 'v0.29.0+canary.20260906T000000Z',
copy
}).body
- ).toBe(copy.availableBodyRelease('v0.29.0-canary.20260906000000'))
+ ).toBe(copy.availableBodyRelease('v0.29.0+canary.20260906T000000Z'))
})
})
diff --git a/hermes_cli/release_channels.py b/hermes_cli/release_channels.py
index 19bcada43ea..c8811ec9dff 100644
--- a/hermes_cli/release_channels.py
+++ b/hermes_cli/release_channels.py
@@ -148,11 +148,15 @@ def validate_request(value: object, *, repository: str | None = None,
if (request.get("version"), request.get("windowsVersion")) != versions:
raise ChannelError("Channel package version does not match sequence")
else:
- _match(r"v[0-9]+\.[0-9]+\.[0-9]+(?:-canary\.[0-9]+)?", request.get("releaseTag"), "legacy release tag")
+ _match(
+ r"v[0-9]+\.[0-9]+\.[0-9]+(?:\+canary\.20[0-9]{6}T[0-9]{6}Z)?",
+ request.get("releaseTag"),
+ "release tag",
+ )
if request.get("version") != request["releaseTag"][1:]:
- raise ChannelError("Legacy package version mismatch")
- # Canary revisions encode minutes since the stable baseline; only stable
- # packages reserve revision zero.
+ raise ChannelError("Release package version mismatch")
+ # Stable uses the Store quad with revision zero; canary uses its UTC
+ # yy.mmdd.hh.mmss package version.
pattern = r"[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" if policy == "canary-release" else r"[0-9]+\.[0-9]+\.[0-9]+\.0"
quad = _match(pattern, request.get("windowsVersion"), "Windows version")
if any(int(part) > 65535 for part in quad.split(".")):
diff --git a/hermes_cli/update_channel.py b/hermes_cli/update_channel.py
index d656fc4ee8a..83ec1372b74 100644
--- a/hermes_cli/update_channel.py
+++ b/hermes_cli/update_channel.py
@@ -48,13 +48,15 @@ CHANNEL_STABLE = "stable"
CHANNEL_CANARY = "canary"
-# A canary release tag: v<major>.<minor>.<patch>-canary.<YYYYMMDDHHMMSS>,
-# or the legacy date-only shape. THIS is the single authority for the
-# canary tag shape — scripts/release.py (produces them) and
-# scripts/write_install_stamp.py (validates the feed key) import it rather
-# than re-typing the rule. Canaries are current-stable patch+1, so any
-# patch is accepted here.
-_CANARY_TAG_RE = re.compile(r"^v(?:0|[1-9]\d*)\.\d+\.\d+-canary\.20\d{6}(?:\d{6})?$")
+# A canary source identity: the exact stable version plus a full UTC build
+# timestamp in SemVer build metadata. Build metadata is precedence-invisible,
+# so channel movement comes only from the R2 head, never version comparison.
+# THIS is the single authority; producers and consumers import it rather than
+# re-typing the shape.
+_CANARY_TAG_RE = re.compile(
+ r"^v(?:0|[1-9]\d{0,2})\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)"
+ r"\+canary\.20\d{6}T\d{6}Z$"
+)
# A stable release tag: v<major>.<minor>.<patch>, no suffix. The major is
# capped at three digits so the historical CalVer tags (v2026.7.20) can never
@@ -65,22 +67,33 @@ STABLE_TAG_RE = re.compile(r"^v(?:0|[1-9]\d{0,2})\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*
def is_canary_tag(tag: Any) -> bool:
- """True when ``tag`` is a canary release tag."""
- return isinstance(tag, str) and bool(_CANARY_TAG_RE.match(tag.strip()))
+ """True for a canonical canary source identity."""
+ if not isinstance(tag, str):
+ return False
+ value = tag.strip()
+ return bool(_CANARY_TAG_RE.fullmatch(value))
+
+
+def canary_timestamp(tag: Any) -> str | None:
+ """Return the UTC receipt stamp from a canonical canary tag."""
+ if not is_canary_tag(tag):
+ return None
+ return tag.strip().split("+canary.", 1)[1]
def canary_tag_for_date(version: str, date_utc: str) -> str:
- """The canary tag name for a UTC timestamp: next PATCH over ``version``
- (the newest stable's patch + 1), second-precision UTC suffix —
- v0.27.5-canary.20260818103000 when stable is v0.27.4. A canary
- outversions every stable at or below its patch and loses to the next
- stable patch, which is exactly the channel-switch upgrade path
- (canary→stable = wait for that patch bump to ship as stable).
+ """Return ``v<stable>+canary.<full UTC timestamp>``.
+
+ The stable core is unchanged. The suffix is build metadata, so the source
+ identity compares equal to the stable and only the R2 channel head moves a
+ canary subscriber.
"""
- parts = version.lstrip("v").split(".")
- major, minor = int(parts[0]), int(parts[1])
- patch = int(parts[2]) if len(parts) >= 3 else 0
- return f"v{major}.{minor}.{patch + 1}-canary.{date_utc}"
+ core = version.removeprefix("v")
+ if not STABLE_TAG_RE.fullmatch("v" + core):
+ raise ValueError(f"invalid stable version for canary: {version!r}")
+ if not re.fullmatch(r"20\d{6}T\d{6}Z", date_utc):
+ raise ValueError(f"invalid canary UTC timestamp: {date_utc!r}")
+ return f"v{core}+canary.{date_utc}"
diff --git a/scripts/bundles/channel_artifacts.py b/scripts/bundles/channel_artifacts.py
index f7a982c3d25..55b73d83665 100644
--- a/scripts/bundles/channel_artifacts.py
+++ b/scripts/bundles/channel_artifacts.py
@@ -47,8 +47,9 @@ def assemble(request: dict, native: dict, root: Path, *, artifact_prefix: str) -
if all(row.get("receiverProtocol") == 1 for row in rows):
manifest["receiverProtocol"] = 1
tag = request.get("releaseTag", "")
+ from hermes_cli.update_channel import is_canary_tag
record = {"name": request["channel"], "repository": request["repository"], "identity": request["identity"],
- "policy": ("canary-release" if "-canary." in tag else "stable-release") if tag else "preview", "head": None}
+ "policy": ("canary-release" if is_canary_tag(tag) else "stable-release") if tag else "preview", "head": None}
validate_manifest(manifest, record, base)
descriptor = root / "win32" / "stable.appinstaller"
write_appinstaller(descriptor, identity=windows[0]["identity"], publisher=windows[0]["publisher"],
diff --git a/scripts/bundles/desktop.py b/scripts/bundles/desktop.py
index 70dbe46b0f6..bba80fb5bdf 100644
--- a/scripts/bundles/desktop.py
+++ b/scripts/bundles/desktop.py
@@ -25,11 +25,12 @@ def capture(argv: list[str], repo: Path) -> str:
def release_version(repo: Path, tag: str) -> str:
+ from hermes_cli.update_channel import is_canary_tag
from scripts.termux.deb_version import channel_for_tag
channel_for_tag(tag) # shared release tag grammar, not a second version parser
version = tomllib.loads((repo / "pyproject.toml").read_text(encoding="utf-8-sig"))["project"]["version"]
- if "-canary." not in tag and tag != "v" + version:
+ if not is_canary_tag(tag) and tag != "v" + version:
raise ValueError(f"tag {tag} does not match project version {version}")
return tag[1:]
diff --git a/scripts/generate_icons.py b/scripts/generate_icons.py
index a560dea9604..c79ed06f74d 100644
--- a/scripts/generate_icons.py
+++ b/scripts/generate_icons.py
@@ -109,7 +109,10 @@ except ImportError:
# Copy of hermes_cli.update_channel._CANARY_TAG_RE: this renderer runs in an
# isolated icon-build venv (Nix, Docker, PM) where the application package is
# absent. tests/scripts/test_icon_flavors.py pins it to the canonical one.
-_CANARY_TAG_RE = re.compile(r"^v(?:0|[1-9]\d*)\.\d+\.\d+-canary\.20\d{6}(?:\d{6})?$")
+_CANARY_TAG_RE = re.compile(
+ r"^v(?:0|[1-9]\d{0,2})\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)"
+ r"\+canary\.20\d{6}T\d{6}Z$"
+)
# The nous dark background (#0d1117) — fixed dark tile/background everywhere.
DARK_HEX = "#0d1117"
diff --git a/scripts/msix-shared.mjs b/scripts/msix-shared.mjs
index 6952c642eb2..d93947b2151 100644
--- a/scripts/msix-shared.mjs
+++ b/scripts/msix-shared.mjs
@@ -73,20 +73,16 @@ export function contentTypeFor(filename) {
return undefined
}
-// The canary tag base + embedded UTC stamp: v0.27.2-canary.20260829034013
-// (8- or 14-digit; the shorter legacy form is midnight of that day). The
-// base is the next PATCH over the newest stable, so the first three MSIX
-// components come from it (0.27.2) and outversion the stable line
-// structurally — cross-line monotonicity is free.
-const CANARY_TAG_RE = /^v(\d+\.\d+\.\d+)-canary\.(20\d{6}(?:\d{6})?)$/
+const CANARY_TAG_RE = /^v(\d+\.\d+\.\d+)\+canary\.(20\d{6}T\d{6}Z)$/
const STABLE_TAG_RE = /^v\d+\.\d+\.\d+$/
/**
- * @param {string} stamp YYYYMMDD[HHMMSS] UTC stamp
+ * @param {string} stamp YYYYMMDDTHHMMSSZ
* @returns {number} epoch seconds
*/
function stampToEpoch(stamp) {
- const parts = /^(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?(\d{2})?$/.exec(stamp)
+ const compact = stamp.replace('T', '').replace(/Z$/, '')
+ const parts = /^(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?(\d{2})?$/.exec(compact)
if (!parts) return 0
const [, y, mo, d, h, mi, s] = parts
return Date.UTC(Number(y), Number(mo) - 1, Number(d), Number(h ?? 0), Number(mi ?? 0), Number(s ?? 0)) / 1000
@@ -147,9 +143,11 @@ export function nativeQuad(ref, epochSeconds) {
function releaseEpoch(tag, gitRoot) {
const canary = CANARY_TAG_RE.exec(tag)
if (canary) {
- const epoch = stampToEpoch(canary[2])
- const roundtrip = new Date(epoch * 1000).toISOString().replace(/[-:T]/g, '').slice(0, canary[2].length)
- if (roundtrip !== canary[2]) throw new Error('Invalid canary calendar timestamp')
+ const stamp = canary[2]
+ const epoch = stampToEpoch(stamp)
+ const compact = new Date(epoch * 1000).toISOString().replace(/[-:T]/g, '').replace(/\.000Z$/, '')
+ const expected = `${compact.slice(0, 8)}T${compact.slice(8)}Z`
+ if (expected !== stamp) throw new Error('Invalid canary calendar timestamp')
return epoch
}
const timestamp = execFileSync('git', ['for-each-ref', '--format=%(creatordate:unix)', `refs/tags/${tag}`], {
diff --git a/scripts/release.py b/scripts/release.py
index 9f9385ccfd5..35446e32386 100755
--- a/scripts/release.py
+++ b/scripts/release.py
@@ -36,7 +36,10 @@ from pathlib import Path
# is import-light: only os/sys + version constants).
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
-from hermes_cli.update_channel import _CANARY_TAG_RE, STABLE_TAG_RE, canary_tag_for_date # noqa: E402
+from hermes_cli.update_channel import ( # noqa: E402
+ _CANARY_TAG_RE, STABLE_TAG_RE, canary_tag_for_date, canary_timestamp,
+ is_canary_tag,
+)
REPO_ROOT = Path(__file__).resolve().parent.parent
VERSION_FILE = REPO_ROOT / "hermes_cli" / "__init__.py"
@@ -2248,15 +2251,13 @@ def remote_github_repo(remote: str) -> str | None:
return match.group(1) if match else None
-# Stable tags are matched with STABLE_TAG_RE and canary prerelease tags
+# Stable tags are matched with STABLE_TAG_RE and canary tags
# with _CANARY_TAG_RE, both imported from hermes_cli.update_channel — the
# single authority for both tag shapes (the stable major is capped at three
-# digits so legacy CalVer tags like v2026.7.20 never match; the canary shape
-# is v<major>.<minor>.<any patch>-canary.<YYYYMMDDHHMMSS>, plus the legacy
-# date-only form). The suffix keeps canaries out of every stable selector.
-# Second precision so manual fires can publish several canaries per day;
-# the identifier is pure numeric and fixed-length, so semver prerelease
-# comparison (numeric) and lexical sort both order it chronologically.
+# digits so historical CalVer tags like v2026.7.20 never match; the canary
+# identity is the exact stable core plus full UTC build metadata.
+# Second precision allows several canaries per day; the fixed-width UTC stamp
+# sorts chronologically even though SemVer ignores it for precedence.
def release_tag_for_version(semver: str) -> str:
@@ -2280,14 +2281,10 @@ def get_last_tag():
def get_last_canary_tag():
- """The newest canary tag, or None. Date order == version order within
- one minor; across minors the -v:refname sort already ranks the newer
- minor first."""
- tags = git("tag", "--list", "v[0-9]*-canary.*", "--sort=-v:refname")
- for tag in (tags.split("\n") if tags else []):
- if _CANARY_TAG_RE.fullmatch(tag):
- return tag
- return None
+ """The newest canonical canary receipt, by embedded build time."""
+ raw = git("tag", "--list", "v*+canary.*")
+ tags = [tag for tag in (raw.split("\n") if raw else []) if is_canary_tag(tag)]
+ return max(tags, key=lambda tag: canary_timestamp(tag) or "", default=None)
def get_current_version():
@@ -2716,33 +2713,13 @@ def generate_changelog(commits, tag_name, semver, repo_url="https://github.com/N
return "\n".join(lines)
-def _canary_timestamp(tag: str) -> str | None:
- """The YYYYMMDD[HHMMSS] UTC stamp embedded in a canary tag, or None."""
- if not _CANARY_TAG_RE.fullmatch(tag):
- return None
- return tag.split("-canary.", 1)[1]
-
-
-def _stamp_epoch(stamp: str) -> int | None:
- """Epoch seconds for a YYYYMMDD or YYYYMMDDHHMMSS UTC stamp."""
- try:
- if len(stamp) == 14:
- return int(datetime.strptime(stamp, "%Y%m%d%H%M%S").replace(tzinfo=timezone.utc).timestamp())
- if len(stamp) == 8:
- return int(datetime.strptime(stamp, "%Y%m%d").replace(tzinfo=timezone.utc).timestamp())
- except ValueError:
- pass
- return None
-
-
def cmd_canary(args) -> None:
- """--canary: tag + draft today's canary prerelease.
+ """--canary: tag + draft a canary source identity.
- Owns ALL the tag math (the workflow passes only --publish/--remote):
- next-MINOR over the newest stable tag, dated suffix, changelog since
- the last canary (or last stable for the first one). No version-file
- bump, no commit — the tag points at HEAD as-is, and the stamp's
- displayVersion carries the canary version from the tag.
+ The source identity is the newest stable version plus a full UTC timestamp
+ in SemVer build metadata. It therefore compares equal to that stable; only
+ the R2 canary head moves subscribers. No version-file bump or commit is
+ created — the receipt tag points at HEAD as-is.
Created as a DRAFT prerelease, for the same reason the stable path
drafts: a published release with no installers attached is a release
@@ -2756,7 +2733,7 @@ def cmd_canary(args) -> None:
canary — the skip-if-no-new-commits gate lives HERE, not in workflow
YAML.
"""
- date_utc = args.date or datetime.now(timezone.utc).strftime("%Y%m%d%H%M%S")
+ date_utc = args.date or datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
stable_tag = get_last_tag()
if stable_tag is None:
print("✗ No stable release tag exists; a canary needs a stable line to version over.")
@@ -2770,25 +2747,6 @@ def cmd_canary(args) -> None:
print(f"✓ {tag_name} already exists — nothing to do.")
return
- # The canary MSIX build number is minutes-since-the-last-stable (see
- # msix-shared.mjs). Two canaries of the same LINE cut within the SAME
- # minute would share a build number → identical MSIX version → App
- # Installer refuses the second over the first. Refuse the second cut
- # loudly instead of shipping an uninstallable equal-version package.
- # (A same-minute cut on a NEW line — after a fresh stable — is fine: the
- # patch bump already outversions the old line, so no collision.)
- prev_ts = _canary_timestamp(prev_canary) if prev_canary else None
- same_line = bool(prev_canary) and prev_canary.split("-canary.", 1)[0] == tag_name.split("-canary.", 1)[0]
- prev_min = _stamp_epoch(prev_ts) // 60 if prev_ts and _stamp_epoch(prev_ts) is not None else None
- cur_min = _stamp_epoch(date_utc) // 60 if _stamp_epoch(date_utc) is not None else None
- if same_line and prev_min is not None and prev_min == cur_min:
- print(
- f"✗ {tag_name} is in the same minute as {prev_canary} — they would "
- "share an MSIX build number (minutes since the last stable). Wait a "
- "minute and re-run."
- )
- return
-
if prev_canary:
head = git("rev-parse", "HEAD")
if head and head == git("rev-parse", f"{prev_canary}^{{commit}}"):
@@ -2800,23 +2758,6 @@ def cmd_canary(args) -> None:
print(f"✓ No new commits since {since} — nothing to do.")
return
- # MSIX version components are 16-bit (makeappx rejects >65535). The
- # canary build number is minutes-since-the-last-stable, which crosses
- # the cap at 45.5 days. A canary cut on a stable base older than 45
- # days cannot carry a legal build number — fail loudly, never clamp (a
- # clamped number would break monotonicity and the update path).
- stable_epoch = git("log", "-1", "--format=%ct", stable_tag)
- canary_epoch = _stamp_epoch(date_utc)
- if stable_epoch.isdigit() and canary_epoch is not None:
- days_old = (canary_epoch - int(stable_epoch)) / 86400
- if days_old > 45:
- print(
- f"✗ {stable_tag} is {days_old:.1f} days old — a canary cut now "
- "would overflow the 16-bit MSIX build number (minutes since "
- "this stable). Cut a stable release first."
- )
- sys.exit(1)
-
version = tag_name.lstrip("v")
print(f"Canary: {tag_name} ({len(commits)} commits since {since})")
changelog = generate_changelog(
@@ -2868,9 +2809,10 @@ def cmd_canary(args) -> None:
sys.exit(1)
changelog_file.unlink(missing_ok=True)
print(f"✓ Canary prerelease drafted: {result.stdout.strip()}")
- # The build stages the installers to the R2 bucket and, for a canary
- # tag, publishes it when the whole matrix is green.
- dispatch_desktop_build(tag_name, gh_repo)
+ # The build stages the installers to the R2 bucket and publishes only when
+ # the full matrix is green. A release that never starts is a hard failure.
+ if not dispatch_desktop_build(tag_name, gh_repo):
+ raise SystemExit(1)
# Record the tag for any workflow step that wants it. release.py
# starts the build itself, so nothing consumes this today; it stays
# because a step output is the cheap, conventional handle for "which
@@ -2881,28 +2823,29 @@ def cmd_canary(args) -> None:
f.write(f"tag={tag_name}\n")
+def _canary_date(tag: str) -> str | None:
+ """The YYYYMMDD receipt date for a canonical canary tag."""
+ if not is_canary_tag(tag):
+ return None
+ return tag.split("+canary.", 1)[1][:8]
+
+
def prune_old_canaries(args) -> None:
"""--prune-canaries: delete canary releases+tags older than 14 days.
Keep-on-doubt: any parse failure keeps the release. The keep window is
- dated by the tag's own YYYYMMDD suffix, not the release timestamp, so
- a re-published old tag never resets its clock.
+ dated by the tag's own UTC suffix, not the release timestamp, so a
+ re-published old tag never resets its clock.
"""
push_remote = resolve_push_remote(args.remote)
gh_repo = remote_github_repo(push_remote)
cutoff = (datetime.now(timezone.utc) - timedelta(days=14)).strftime("%Y%m%d")
-
- tags = git("tag", "--list", "v[0-9]*-canary.*", "--sort=-v:refname")
+ tags = git("tag", "--list", "v*+canary.*", "--sort=-creatordate")
doomed = []
for tag in (tags.split("\n") if tags else []):
- m = _CANARY_TAG_RE.fullmatch(tag)
- # Compare on the DATE prefix only: the suffix may be 8 (legacy) or
- # 14 (timestamped) digits, and a 14-digit string compared against
- # an 8-digit cutoff would be decided by length, not by day.
- # (_CANARY_TAG_RE carries no capture group, so slice the suffix
- # out of the tag itself.)
- if m and tag.split("-canary.", 1)[1][:8] < cutoff:
+ date = _canary_date(tag)
+ if date is not None and date < cutoff:
doomed.append(tag)
if not doomed:
print("✓ No canaries older than 14 days.")
@@ -2931,8 +2874,8 @@ def main():
parser.add_argument("--bump", choices=["major", "minor", "patch"],
help="Which semver component to bump")
parser.add_argument("--canary", action="store_true",
- help="Tag + publish today's canary prerelease "
- "(v<stable.minor+1>.0-canary.<YYYYMMDDHHMMSS>); no-op when "
+ help="Tag + publish a stable-core canary "
+ "(v<stable>+canary.<YYYYMMDDTHHMMSSZ>); no-op when "
"HEAD has no new commits since the last canary")
parser.add_argument("--build-commit", type=str, metavar="REV",
help="Preview an exact-commit build into releases/commit/<sha>/ on R2. "
diff --git a/scripts/releases/channel_releases.py b/scripts/releases/channel_releases.py
index ba556184088..4c47498aedf 100644
--- a/scripts/releases/channel_releases.py
+++ b/scripts/releases/channel_releases.py
@@ -95,14 +95,15 @@ def match_accepted_packages(manifest: dict, accepted: dict) -> None:
def admit_transaction(policy: str, env: dict, *, run=stable.output) -> tuple[str, str]:
"""A callable CLI is not permission to bypass the existing workflow gate."""
- from scripts.releases.semver import is_valid_version
+ from scripts.releases.semver import is_release_version
from hermes_cli.release_channels import require_commit, validate_repository
+ from hermes_cli.update_channel import is_canary_tag
repository = validate_repository(env.get("GITHUB_REPOSITORY"))
tag = env.get("RELEASE_TAG", "")
- if not tag.startswith("v") or not is_valid_version(tag[1:]):
+ if not tag.startswith("v") or not is_release_version(tag[1:]):
raise ChannelError("Invalid protected release tag")
- if (policy == "canary-release") != ("-canary." in tag):
+ if (policy == "canary-release") != is_canary_tag(tag):
raise ChannelError("Protected release policy/tag mismatch")
if env.get("GITHUB_ACTIONS") != "true" or env.get("GITHUB_EVENT_NAME") != "workflow_dispatch":
raise ChannelError("Protected heads require the accepted release workflow")
@@ -160,7 +161,8 @@ def verify_bootstrap(request: dict, manifest: dict, base: str, repository: str)
tag = request.get("releaseTag", "")
if not tag or manifest.get("request") != request:
raise ChannelError("Bootstrap requires published release metadata")
- canary = "-canary." in tag
+ from hermes_cli.update_channel import is_canary_tag
+ canary = is_canary_tag(tag)
reader = ChannelReader(base, repository)
if canary:
verify_canary_outputs(request, manifest, reader)
diff --git a/scripts/releases/channels.py b/scripts/releases/channels.py
index b115f6363c6..c91aab55d57 100644
--- a/scripts/releases/channels.py
+++ b/scripts/releases/channels.py
@@ -204,9 +204,9 @@ class ChannelPublisher:
raise ChannelError("Protected release policy mismatch")
if record["state"] != "active":
raise ChannelError("Retired channel is permanently closed to publication")
- from scripts.releases.semver import is_valid_version
+ from scripts.releases.semver import is_canary_version, is_release_version
version = request["version"]
- if not is_valid_version(version) or ("-canary." in version) != (policy == "canary-release"):
+ if not is_release_version(version) or is_canary_version(version) != (policy == "canary-release"):
raise ChannelError("Release version does not match protected policy")
self.authorize(action, record)
if release_gate(request) is not True:
@@ -349,12 +349,23 @@ class ChannelPublisher:
if policy is not None and record["head"] is not None:
from scripts.releases.semver import compare
from scripts.releases.stable import windows_version
+ from hermes_cli.update_channel import canary_timestamp
previous_head = record["head"]
previous = self.store.get(previous_head["manifestKey"])
if previous is None or hashlib.sha256(previous[0]).hexdigest() != previous_head["sha256"]:
raise ChannelError("Previous protected manifest is unavailable or changed")
previous_request = validate_manifest(decode_json(previous[0]), record, self.public_base)["request"]
- if (compare(request["version"], previous_request["version"]) <= 0
+ if policy == "canary-release":
+ current_stamp = canary_timestamp(request["releaseTag"])
+ previous_stamp = canary_timestamp(previous_request["releaseTag"])
+ source_increases = (
+ current_stamp is not None
+ and previous_stamp is not None
+ and current_stamp > previous_stamp
+ )
+ else:
+ source_increases = compare(request["version"], previous_request["version"]) > 0
+ if (not source_increases
or windows_version(request["windowsVersion"]) <= windows_version(previous_request["windowsVersion"])):
raise ChannelError("Protected native versions must increase; stale completion refused")
if self.verify_build is None or self.verify_build(request, manifest) is not True:
diff --git a/scripts/releases/darwin.py b/scripts/releases/darwin.py
index a62902e6419..0bfd4b9aaad 100644
--- a/scripts/releases/darwin.py
+++ b/scripts/releases/darwin.py
@@ -5,8 +5,8 @@ import re
from typing import Any, Callable
from . import r2 as r2_module
-from .semver import compare, is_valid_version
-from hermes_cli.update_channel import is_canary_tag
+from .semver import compare, is_release_version
+from hermes_cli.update_channel import canary_timestamp, is_canary_tag
ARCHES = ("arm64", "x64")
_HASH_PATTERN = re.compile(r"^[A-Za-z0-9+/]{86}==$")
@@ -30,7 +30,7 @@ def parse_mac_feed(text: str) -> dict[str, Any]:
feed = yaml.safe_load(text)
if (
not isinstance(feed, dict)
- or not is_valid_version(str(feed.get("version", "")))
+ or not is_release_version(str(feed.get("version", "")))
or not isinstance(feed.get("files"), list)
or not feed["files"]
):
@@ -81,7 +81,7 @@ def merge_mac_feeds(legs: dict[str, str], tag: str, light: bool = False) -> dict
import hermes_yaml as yaml # lazy
version = tag[1:] if isinstance(tag, str) and tag.startswith("v") else ""
- if not is_valid_version(version):
+ if not is_release_version(version):
raise ValueError("Invalid macOS release tag")
selection = _darwin_feed("canary" if is_canary_tag(tag) else "stable", light)
expected = [f"{arch}-{selection['fileName']}" for arch in ARCHES]
@@ -116,6 +116,7 @@ def merge_mac_feeds(legs: dict[str, str], tag: str, light: bool = False) -> dict
"key": f"{selection['directory']}/{selection['fileName']}",
"text": text,
"files": merged["files"],
+ "tag": tag,
"version": version,
}
@@ -137,7 +138,15 @@ def publish_mac_feed(
if live:
old_feed = parse_mac_feed(live["text"])
next_feed = parse_mac_feed(plan["text"])
- order = compare(plan["version"], str(old_feed["version"]))
+ old_url = str(old_feed["files"][0]["url"])
+ old_tag = old_url.split("/releases/tag/", 1)[1].split("/", 1)[0]
+ old_canary = canary_timestamp(old_tag)
+ next_canary = canary_timestamp(plan.get("tag"))
+ order = (
+ (next_canary > old_canary) - (next_canary < old_canary)
+ if next_canary is not None and old_canary is not None
+ else compare(plan["version"], str(old_feed["version"]))
+ )
if order < 0:
raise ValueError("Refusing to move the macOS feed backward")
if order == 0:
diff --git a/scripts/releases/handoff.py b/scripts/releases/handoff.py
index da3575bda88..0bd396dcd1c 100644
--- a/scripts/releases/handoff.py
+++ b/scripts/releases/handoff.py
@@ -10,7 +10,7 @@ import tempfile
from pathlib import Path, PurePosixPath
from scripts.releases import r2
-from scripts.releases.semver import is_valid_version
+from scripts.releases.semver import is_release_version
class MissingReceipt(ValueError):
@@ -18,7 +18,7 @@ class MissingReceipt(ValueError):
def validate_identity(tag: str, commit: str, name: str) -> None:
- if (not isinstance(tag, str) or not tag.startswith("v") or not is_valid_version(tag[1:])
+ if (not isinstance(tag, str) or not tag.startswith("v") or not is_release_version(tag[1:])
or not re.fullmatch(r"[a-f0-9]{40}", commit or "")
or not re.fullmatch(r"[a-z0-9]+(?:-[a-z0-9]+)*", name or "")):
raise ValueError("Invalid release handoff identity")
diff --git a/scripts/releases/r2.py b/scripts/releases/r2.py
index 5ca27670e56..35ab16fb1a5 100644
--- a/scripts/releases/r2.py
+++ b/scripts/releases/r2.py
@@ -440,7 +440,7 @@ def _stream_and_hash(url: str, creds: dict[str, str], now: str, algorithm: str):
# ---------------------------------------------------------------------------
def channel_for_tag(tag: str) -> str:
- """'stable' for a stable tag, 'canary' for a -canary.<ts> tag."""
+ """Return the release channel encoded by a canonical tag."""
from hermes_cli.update_channel import is_canary_tag
return "canary" if is_canary_tag(tag) else "stable"
@@ -818,7 +818,7 @@ def canary_doomed_keys(keys: list[str], cutoff: str) -> list[str]:
doomed = []
for key in keys:
match = tag_re.search(key)
- if match and match.group(0).split("-canary.", 1)[1][:8] < cutoff:
+ if match and match.group(0).split("+canary.", 1)[1][:8] < cutoff:
doomed.append(key)
return doomed
diff --git a/scripts/releases/semver.py b/scripts/releases/semver.py
index 06c2b77af49..b260eb14355 100644
--- a/scripts/releases/semver.py
+++ b/scripts/releases/semver.py
@@ -1,70 +1,47 @@
-"""Compare the stable and canary versions accepted by release feeds.
+"""Compare stable and canary versions accepted by release feeds.
-Two canary shapes are release versions. The current one is build metadata
-(``X.Y.Z+canary.<stamp>``) and compares equal to its stable, which is the
-point: "newer?" comes from the channel record. The legacy prerelease shape
-(``X.Y.Z-canary.<14 digits>``) sorts before its stable, so a feed published
-before the migration still orders correctly.
+Canary identity uses SemVer build metadata (``X.Y.Z+canary.<stamp>``) and
+compares equal to its stable. Channel records, not SemVer precedence, decide
+which canary is newer.
"""
from __future__ import annotations
import re
-from hermes_cli.update_channel import _CANARY_TAG_RE, STABLE_TAG_RE
+from hermes_cli.update_channel import STABLE_TAG_RE
_CANARY_VERSION_RE = re.compile(r"^[0-9.]+[+]canary[.]20\d{6}T\d{6}Z$")
def is_canary_version(version: str) -> bool:
- """True for the build-metadata canary identity and nothing else."""
+ """True for the canonical build-metadata canary identity."""
if not isinstance(version, str) or not _CANARY_VERSION_RE.fullmatch(version):
return False
return bool(STABLE_TAG_RE.fullmatch("v" + version.split("+", 1)[0]))
-def _is_legacy_canary(version: str) -> bool:
- return isinstance(version, str) and bool(_CANARY_TAG_RE.fullmatch("v" + version)) and len(
- version.partition("-")[2].split(".", 1)[1]) == 14
+def is_stable_version(version: str) -> bool:
+ """True for a final stable version."""
+ return isinstance(version, str) and bool(STABLE_TAG_RE.fullmatch("v" + version))
def is_valid_version(version: str) -> bool:
- """A stable version or a legacy canary prerelease — the grammar the
- existing feeds and gates were published with."""
- if not isinstance(version, str):
- return False
- core, sep, _tail = version.partition("-")
- if sep:
- return _is_legacy_canary(version) and bool(STABLE_TAG_RE.fullmatch("v" + core))
- return bool(STABLE_TAG_RE.fullmatch("v" + version))
+ """True for a stable version or canonical canary identity."""
+ return is_stable_version(version) or is_canary_version(version)
def is_release_version(version: str) -> bool:
- """True for a stable version, a legacy canary, or a build-metadata canary."""
- return is_valid_version(version) or is_canary_version(version)
+ """True for a stable version or canonical canary identity."""
+ return is_valid_version(version)
def _core(version: str) -> list[int]:
- return [int(part) for part in version.split("+", 1)[0].split("-", 1)[0].split(".")]
+ return [int(part) for part in version.split("+", 1)[0].split(".")]
def compare(a: str, b: str) -> int:
- """Compare two release versions.
-
- Build metadata is ignored, so a ``+canary`` identity compares equal to the
- stable it was built from. A legacy ``-canary`` prerelease sorts before the
- stable of the same core, stamps compared numerically. ValueError on
- anything that is not a release version — feed publication fails loudly.
- """
+ """Compare release versions while ignoring build metadata."""
if not is_release_version(a) or not is_release_version(b):
raise ValueError(f"invalid release version(s): {a!r}, {b!r}")
ka, kb = _core(a), _core(b)
- if ka != kb:
- return -1 if ka < kb else 1
- a_pre, b_pre = "-" in a.split("+", 1)[0], "-" in b.split("+", 1)[0]
- if a_pre == b_pre:
- if not a_pre:
- return 0
- a_stamp = int(a.split("+", 1)[0].split("-", 1)[1].split(".", 1)[1])
- b_stamp = int(b.split("+", 1)[0].split("-", 1)[1].split(".", 1)[1])
- return -1 if a_stamp < b_stamp else (1 if a_stamp > b_stamp else 0)
- return -1 if a_pre else 1
+ return (ka > kb) - (ka < kb)
diff --git a/scripts/render-builds-table.py b/scripts/render-builds-table.py
index 075300e1de5..110a90e67af 100644
--- a/scripts/render-builds-table.py
+++ b/scripts/render-builds-table.py
@@ -64,7 +64,7 @@ DEFAULT_REPO = "NousResearch/hermes-agent"
# Hermes-0.28.0-mac-arm64.dmg (bundled)
# HermesBundled-0.28.0-win-x64.msix (bundled)
_ASSET_RE = re.compile(
- r"^(?P<app>HermesBundled|HermesLight)-(?P<version>[^-]+(?:-canary\.\d{8}(?:\d{6})?)?)"
+ r"^(?P<app>HermesBundled|HermesLight)-(?P<version>[^-]+)"
r"-(?P<os>mac|win|linux)-(?P<arch>x64|arm64)\.(?P<ext>dmg|msix|AppImage)$"
)
@@ -176,19 +176,19 @@ def filter_names_for_version(names: list[str], version: str) -> list[str]:
# A row needs a unique receipt-listed artifact and its uploaded object.
_COMMIT_EXPECTED = [
("Windows x64 (MSIX)", "win32-x64",
- r"^HermesBundled-[^-]+(?:-canary\.\d+)?-win-x64\.msix$"),
+ r"^HermesBundled-[^-]+-win-x64\.msix$"),
("Windows ARM64 (MSIX)", "win32-arm64",
- r"^HermesBundled-[^-]+(?:-canary\.\d+)?-win-arm64\.msix$"),
+ r"^HermesBundled-[^-]+-win-arm64\.msix$"),
("Windows universal bundle (MSIXBUNDLE)", "windows-universal",
- r"^HermesBundled-[^-]+(?:-canary\.\d+)?-win\.msixbundle$"),
+ r"^HermesBundled-[^-]+-win\.msixbundle$"),
("macOS Apple Silicon (DMG)", "darwin-arm64",
- r"^HermesBundled-[^-]+(?:-canary\.\d+)?-mac-arm64\.dmg$"),
+ r"^HermesBundled-[^-]+-mac-arm64\.dmg$"),
("macOS Intel (DMG)", "darwin-x64",
- r"^HermesBundled-[^-]+(?:-canary\.\d+)?-mac-x64\.dmg$"),
+ r"^HermesBundled-[^-]+-mac-x64\.dmg$"),
("macOS Apple Silicon (ZIP)", "darwin-arm64",
- r"^HermesBundled-[^-]+(?:-canary\.\d+)?-mac-arm64\.zip$"),
+ r"^HermesBundled-[^-]+-mac-arm64\.zip$"),
("macOS Intel (ZIP)", "darwin-x64",
- r"^HermesBundled-[^-]+(?:-canary\.\d+)?-mac-x64\.zip$"),
+ r"^HermesBundled-[^-]+-mac-x64\.zip$"),
("Termux aarch64 (.deb)", "termux", r"^.*\.deb$"),
]
@@ -488,6 +488,13 @@ def supersedes(existing_page: str | None, tag: str) -> bool:
recorded = recorded_build(existing_page)
if not recorded:
return True
+ from hermes_cli.update_channel import canary_timestamp, is_canary_tag
+ if is_canary_tag(recorded) != is_canary_tag(tag):
+ return False
+ if is_canary_tag(tag):
+ recorded_stamp = canary_timestamp(recorded)
+ tag_stamp = canary_timestamp(tag)
+ return recorded_stamp is not None and tag_stamp is not None and recorded_stamp <= tag_stamp
try:
return semver.compare(recorded.lstrip("v"), tag.lstrip("v")) <= 0
except ValueError:
diff --git a/scripts/stage-msixbundle.mjs b/scripts/stage-msixbundle.mjs
index d99fb7f9ef6..2cab23e3ab7 100644
--- a/scripts/stage-msixbundle.mjs
+++ b/scripts/stage-msixbundle.mjs
@@ -3,7 +3,7 @@
// envelope. Every mode stops at the artifact; CI stages it for native smoke
// before the separate release Python publisher can write an App Installer feed.
// Usage: node scripts/stage-msixbundle.mjs --tag vX.Y.Z --candidate
-// node scripts/stage-msixbundle.mjs --tag vX.Y.Z-canary.STAMP
+// node scripts/stage-msixbundle.mjs --tag vX.Y.Z+canary.YYYYMMDDTHHMMSSZ
import { execFileSync } from 'node:child_process'
import fs from 'node:fs'
import path from 'node:path'
@@ -81,7 +81,7 @@ if (process.platform !== 'win32') {
process.exit(1)
}
-const canary = /-canary\./.test(tag)
+const canary = /\+canary\.20\d{6}T\d{6}Z$/.test(tag)
if (!commitBuild && !channelRequest && !canary && !candidate) throw new Error('Stable bundles must use the staged stable-release workflow')
const desktop = path.join(REPO_ROOT, 'apps', 'desktop')
diff --git a/scripts/termux/build_deb.sh b/scripts/termux/build_deb.sh
index aa4d8a5f7be..345718d7976 100644
--- a/scripts/termux/build_deb.sh
+++ b/scripts/termux/build_deb.sh
@@ -6,7 +6,7 @@
#
# Inputs (all required):
# --repo <dir> hermes-agent checkout (tag must exist; provenance)
-# --tag <tag> immutable release tag (vX.Y.Z or vX.Y.Z-canary.<ts>)
+# --tag <tag> immutable release tag (vX.Y.Z or vX.Y.Z+canary.<UTC timestamp>)
# --payload <dir> dir containing python/, node/, app/ (git archive of
# the tag) and wheelhouse/ (from termux_build.sh)
# --out <dir> output dir; <out>/hermes-agent_<v>_aarch64.deb lands here
diff --git a/scripts/termux/deb_version.py b/scripts/termux/deb_version.py
index c3065876e5d..e32fa0c41d8 100644
--- a/scripts/termux/deb_version.py
+++ b/scripts/termux/deb_version.py
@@ -5,12 +5,11 @@ Pure function; imported by scripts/termux/build_deb.sh and unit-tested by
tests/scripts/test_termux_deb_version.py (Task 4 of .hermes/plans/2026-08-31_termux-deb.md).
Mapping:
- v1.2.3 -> 1.2.3-1
- v1.2.3-canary.2026083112 -> 1.2.3~canary.2026083112-1
+ v1.2.3 -> 1.2.3-1
+ v1.2.3+canary.20260831T120000Z -> 1.2.3~canary.20260831T120000Z-1
-The ``~`` ranks the nightly below the corresponding stable in dpkg's version
-ordering. No digit cap on any component: the repo's CalVer line (v2026.9.x)
-is a valid major.
+The ``~`` ranks the canary below the corresponding stable in dpkg's version
+ordering.
``--channel`` derives the release channel from the SAME tag regex: a tag with
a nightly timestamp is ``nightly``, everything else is ``stable``. This is the
@@ -23,13 +22,9 @@ from __future__ import annotations
import re
import sys
-# The canary timestamp shape MUST match the canonical _CANARY_TAG_RE in
-# hermes_cli/update_channel.py (exactly 8 or 14 digits, 20-prefixed) and
-# channel_for_tag in scripts/releases/r2.py. Cross-referenced by
-# tests/scripts/test_termux_deb_version.py::test_canary_tag_shape_matches_canonical.
_TAG_RE = re.compile(
- r"^v(?P<major>0|[1-9]\d*)\.(?P<minor>\d+)\.(?P<patch>\d+)"
- r"(?:-canary\.(?P<ts>20\d{6}(?:\d{6})?))?$"
+ r"^v(?P<major>0|[1-9]\d{0,2})\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)"
+ r"(?:\+canary\.(?P<ts>20\d{6}T\d{6}Z))?$"
)
@@ -38,7 +33,7 @@ def _match_tag(tag: str) -> re.Match[str]:
if m is None:
raise ValueError(
f"malformed release tag {tag!r}: expected v<MAJOR>.<MINOR>.<PATCH> "
- "or v<MAJOR>.<MINOR>.<PATCH>-canary.<timestamp>"
+ "or v<MAJOR>.<MINOR>.<PATCH>+canary.<UTC timestamp>"
)
return m
@@ -61,7 +56,7 @@ def channel_for_tag(tag: str) -> str:
malformed-tag rejection is identical.
"""
m = _match_tag(tag)
- return "canary" if m.group("ts") is not None else "stable"
+ return "canary" if m.group("ts") else "stable"
def main(argv: list[str]) -> int:
diff --git a/scripts/termux/termux_build.sh b/scripts/termux/termux_build.sh
index c089c0552bb..0217fb5e7c1 100755
--- a/scripts/termux/termux_build.sh
+++ b/scripts/termux/termux_build.sh
@@ -15,7 +15,7 @@
#
# Inputs (host mode, all required):
# --repo <dir> hermes-agent checkout to build from (must contain the tag)
-# --tag <tag> immutable release tag (vX.Y.Z or vX.Y.Z-canary.<ts>)
+# --tag <tag> immutable release tag (vX.Y.Z or vX.Y.Z+canary.<UTC timestamp>)
# --out <dir> output dir (wheelhouse/ + index.json + SHA256SUMS land here)
set -Eeuo pipefail
diff --git a/scripts/write_install_stamp.py b/scripts/write_install_stamp.py
index 085c1fb7595..6fee9112312 100644
--- a/scripts/write_install_stamp.py
+++ b/scripts/write_install_stamp.py
@@ -270,7 +270,7 @@ def build_stamp(
):
raise SystemExit(
f"write_install_stamp: HERMES_DESKTOP_VARIANT={payload} requires "
- f"HERMES_PAYLOAD_TAG=vX.Y.Z or vX.Y.<n>-canary.YYYYMMDDHHMMSS (got {tag!r})"
+ f"HERMES_PAYLOAD_TAG=vX.Y.Z or vX.Y.Z+canary.YYYYMMDDTHHMMSSZ (got {tag!r})"
)
stamp = {
diff --git a/tests-js/bundle-inputs.test.mjs b/tests-js/bundle-inputs.test.mjs
index 501f2253d6e..01589bf75a2 100644
--- a/tests-js/bundle-inputs.test.mjs
+++ b/tests-js/bundle-inputs.test.mjs
@@ -81,7 +81,7 @@ test.each(['windows', 'macos'])('%s rejects malformed and incompatible pairs', p
expect(() => validateBundleInputs(fixture(platform), platform, 'arm64')).toThrow('architecture')
const pair = fixture(platform)
if (platform === 'macos') {
- pair.new.tag = 'v1.3.0-canary.20260907000000'; pair.new.version = pair.new.tag.slice(1)
+ pair.new.tag = 'v1.3.0+canary.20260907T000000Z'; pair.new.version = pair.new.tag.slice(1)
expect(() => validateBundleInputs(pair, platform, 'x64')).toThrow('channel')
pair.new.tag = pair.old.tag; pair.new.version = pair.old.version
expect(() => validateBundleInputs(pair, platform, 'x64')).toThrow('increase')
diff --git a/tests-js/bundle-smoke-metadata.test.mjs b/tests-js/bundle-smoke-metadata.test.mjs
index 8940c29086e..2a91032eed0 100644
--- a/tests-js/bundle-smoke-metadata.test.mjs
+++ b/tests-js/bundle-smoke-metadata.test.mjs
@@ -19,7 +19,7 @@ test('fresh-install provenance admits tagless commit stamps without relaxing upd
['source', 'git'], ['branch', 'main'], ['dirty', true], ['updateMechanism', 'electron-updater']]) {
expect(() => verifyBundleStamp({ ...stamp, [key]: value }, { commit, platform })).toThrow(key)
}
- const tag = 'v1.2.3-canary.20260913000000'
+ const tag = 'v1.2.3+canary.20260913T000000Z'
const tagged = { ...stamp, tag, source: 'git', branch: 'main', displayVersion: tag.slice(1),
updateMechanism: platform === 'darwin' ? 'electron-updater' : 'app-installer' }
expect(verifyBundleStamp(tagged, { commit, tag, platform })).toBe(tag.slice(1))
@@ -30,7 +30,7 @@ test('fresh-install provenance admits tagless commit stamps without relaxing upd
test('identity uses the production bundled variant and exact input tokens, not inherited build flags', () => {
const stable = bundleIdentity(commit, 'v1.2.3')
- const canary = bundleIdentity(commit, 'v1.2.3-canary.20260913000000')
+ const canary = bundleIdentity(commit, 'v1.2.3+canary.20260913T000000Z')
const tagless = bundleIdentity(commit)
expect(stable.appId).not.toBe(canary.appId)
expect(stable.msixIdentity).not.toBe(tagless.msixIdentity)
diff --git a/tests-js/desktop-builder.test.mjs b/tests-js/desktop-builder.test.mjs
index 80e28aebe51..4931854d574 100644
--- a/tests-js/desktop-builder.test.mjs
+++ b/tests-js/desktop-builder.test.mjs
@@ -99,7 +99,7 @@ test('desktop compiler consumes explicit immutable inputs, replaces variants, an
put(input.stamp, JSON.stringify({ schemaVersion: 1, payload: 'bundled', updateMechanism: 'microsoft-store', commit: 'b'.repeat(40), tag: null }))
// Ambient variant/tag must not override explicit stamp inputs or cached CJS identity.
execFileSync(process.execPath, [join(repo, 'scripts/build/desktop.mjs'), ...Object.entries(input).flatMap(([key, value]) => [`--${key === 'nativeDeps' ? 'native-deps' : key}`, value])], {
- cwd: tmpdir(), env: { ...process.env, PATH: '', HERMES_DESKTOP_VARIANT: 'light', HERMES_PAYLOAD_TAG: 'v1.0.0-canary.20260911' }, stdio: 'pipe',
+ cwd: tmpdir(), env: { ...process.env, PATH: '', HERMES_DESKTOP_VARIANT: 'light', HERMES_PAYLOAD_TAG: 'v1.0.0+canary.20260911T000000Z' }, stdio: 'pipe',
})
expect(run().identity.store).toBe(true)
expect(run().identity.light).toBe(false)
diff --git a/tests-js/macos-bundled-helpers.test.mjs b/tests-js/macos-bundled-helpers.test.mjs
index 964abb9d6ca..e9da3a629d8 100644
--- a/tests-js/macos-bundled-helpers.test.mjs
+++ b/tests-js/macos-bundled-helpers.test.mjs
@@ -37,7 +37,7 @@ test('installed stamp independently binds payload, mechanism, commit and tag', (
test.each([
['arm64', 'stable', 'v0.29.0', 'arm64-stable-mac.yml'],
- ['x64', 'canary', 'v0.30.0-canary.20260907000000', 'canary-mac.yml'],
+ ['x64', 'canary', 'v0.30.0+canary.20260907T000000Z', 'canary-mac.yml'],
])('%s %s feed binds parsed YAML to copied artifact bytes', async (arch, channel, tag, name) => {
const outDir = scratch()
const zip = path.join(outDir, 'payload.zip')
diff --git a/tests-js/macos-publish-config.test.mjs b/tests-js/macos-publish-config.test.mjs
index 66454f7b992..83e8742afc3 100644
--- a/tests-js/macos-publish-config.test.mjs
+++ b/tests-js/macos-publish-config.test.mjs
@@ -7,9 +7,9 @@ const root = fileURLToPath(new URL('../', import.meta.url))
it.each([
['bundled', 'v0.28.0', 'stable', false],
- ['bundled', 'v0.29.0-canary.20260906000000', 'canary', false],
+ ['bundled', 'v0.29.0+canary.20260906T000000Z', 'canary', false],
['light', 'v0.28.0', 'stable', true],
- ['light', 'v0.29.0-canary.20260906000000', 'canary', true]
+ ['light', 'v0.29.0+canary.20260906T000000Z', 'canary', true]
])('packaging and runtime agree for %s %s', (variant, tag, channel, light) => {
const result = execFileSync(process.execPath, ['-e', "const c=require('./apps/desktop/electron-builder.config.cjs'); console.log(JSON.stringify({publish:c.mac.publish,notarize:c.mac.notarize,targets:c.mac.target}))"], {
cwd: root,
diff --git a/tests/ci/test_desktop_bundle_smoke.py b/tests/ci/test_desktop_bundle_smoke.py
index 2bfc6e9a78d..cd6e4ede8ec 100644
--- a/tests/ci/test_desktop_bundle_smoke.py
+++ b/tests/ci/test_desktop_bundle_smoke.py
@@ -18,7 +18,7 @@ from tests.ci.test_desktop_release_tag_admission import _BASH, _child_env, _work
from tests.scripts.test_release_r2 import r2_server # noqa: F401
SHA = 'a' * 40
-TAG = 'v0.28.0-canary.20260818101010'
+TAG = 'v0.28.0+canary.20260818T101010Z'
def smoke_workflow():
@@ -308,7 +308,7 @@ def test_stable_phase_and_canary_gates_require_smoke_but_preserve_other_phases(t
def test_canary_publisher_consumes_staged_bytes_and_writes_pointer_last(tmp_path, r2_server):
- tag = 'v0.28.1-canary.20260818101010'
+ tag = 'v0.28.1+canary.20260818T101010Z'
env = {**transport_env(tmp_path, r2_server), 'HERMES_DESKTOP_VARIANT': 'bundled',
'HERMES_PAYLOAD_TAG': tag, 'RELEASE_TAG': tag}
# Use the real assembly identity derivation with a stable base available.
@@ -350,10 +350,11 @@ def test_canary_publisher_consumes_staged_bytes_and_writes_pointer_last(tmp_path
staged = shell_step(tmp_path, r2_server, 'assemble-win32-bundle', 'Stage universal bundles to R2', env)
assert staged.returncode == 0, staged.stdout + staged.stderr
assert all(key.startswith(f'releases/tag/{tag}/') for key in r2_server.store)
- # A newer stable becomes visible after assembly but before publication.
+ # A newer stable becomes visible after assembly but cannot alter the
+ # timestamp-derived canary identity.
git('-c', 'commit.gpgsign=false', 'commit', '--allow-empty', '-qm', 'new stable', date='2026-08-18T11:10:10Z')
git('tag', 'v0.28.1')
- assert assembly_identity()['version'] != version
+ assert assembly_identity()['version'] == version
for name in ('Retrieve the tested universal bundle', 'Publish identical tested bytes without rebuilding'):
result = shell_step(tmp_path, r2_server, 'publish-win32-updater', name, env)
assert result.returncode == 0, result.stdout + result.stderr
diff --git a/tests/ci/test_desktop_release_tag_admission.py b/tests/ci/test_desktop_release_tag_admission.py
index e0ccc1af7da..fbb9fb37eab 100644
--- a/tests/ci/test_desktop_release_tag_admission.py
+++ b/tests/ci/test_desktop_release_tag_admission.py
@@ -168,7 +168,7 @@ def _run_admission(clone: Path, tag: str) -> subprocess.CompletedProcess:
env = _child_env(
TAG=tag,
GITHUB_OUTPUT=str(gh_output),
- RELEASE_PHASE="" if "-canary." in tag else "candidate",
+ RELEASE_PHASE="" if "+canary." in tag else "candidate",
GITHUB_REF=f"refs/tags/{tag}",
GITHUB_SHA=_git("rev-parse", "HEAD", cwd=clone),
# checkout@v6 runs run-steps with `bash -e -o pipefail`; -e/-o are on
@@ -205,9 +205,9 @@ def test_tag_not_on_origin_main_is_refused(tmp_path: Path):
(clone / "rogue.txt").write_text("unreviewed\n", encoding="utf-8")
_git("add", "-A", cwd=clone)
_git("commit", "-m", "rogue", cwd=clone)
- _git("tag", "v0.1.3-canary.20260830120000", cwd=clone)
+ _git("tag", "v0.1.2+canary.20260830T120000Z", cwd=clone)
- proc = _run_admission(clone, "v0.1.3-canary.20260830120000")
+ proc = _run_admission(clone, "v0.1.2+canary.20260830T120000Z")
assert proc.returncode != 0, "a tag off origin/main must not be admitted"
assert "not an ancestor of origin/main" in proc.stdout + proc.stderr
# And nothing was exported for the signing jobs to consume.
diff --git a/tests/ci/test_desktop_store_eligibility.py b/tests/ci/test_desktop_store_eligibility.py
index c1f5a40ad26..d917b9d0a56 100644
--- a/tests/ci/test_desktop_store_eligibility.py
+++ b/tests/ci/test_desktop_store_eligibility.py
@@ -13,7 +13,7 @@ from tests.ci.test_desktop_release_tag_admission import _BASH, _child_env, _work
@pytest.mark.parametrize('tag,commit,store', [
('v0.28.0', '', True),
- ('v0.28.0-canary.20260818', '', False),
+ ('v0.28.0+canary.20260818T000000Z', '', False),
('', 'a' * 40, False),
])
def test_bundle_only_requests_store_for_stable(tmp_path, tag, commit, store):
@@ -51,7 +51,7 @@ def test_bundle_only_requests_store_for_stable(tmp_path, tag, commit, store):
@pytest.mark.platforms('windows')
@pytest.mark.parametrize('tag,commit,store', [
- ('v0.28.0', '', True), ('v0.28.0-canary.20260818', '', False), ('', 'a' * 40, False),
+ ('v0.28.0', '', True), ('v0.28.0+canary.20260818T000000Z', '', False), ('', 'a' * 40, False),
])
def test_native_windows_build_selects_store_only_for_stable(tmp_path, tag, commit, store):
jobs = _workflow()['jobs']
diff --git a/tests/ci/test_protected_canary_publication.py b/tests/ci/test_protected_canary_publication.py
index d94376a144f..962e903c37a 100644
--- a/tests/ci/test_protected_canary_publication.py
+++ b/tests/ci/test_protected_canary_publication.py
@@ -39,7 +39,7 @@ def step_script(job, name):
def canary(tmp_path, r2_server, monkeypatch):
_, clone = _seed_repo(tmp_path)
commit = _git("rev-parse", "HEAD", cwd=clone)
- tag = "v0.1.3-canary.20260913001000"
+ tag = "v0.1.2+canary.20260913T001000Z"
_git("tag", tag, cwd=clone)
_git("push", "origin", tag, cwd=clone)
desktop = clone / "apps/desktop"
@@ -260,7 +260,7 @@ def test_published_canary_workflow_advances_only_after_every_gate(canary, r2_ser
assert r2_server.store == after
# A later canary really advances the existing head and native quad, rather
# than merely succeeding at the empty-channel bootstrap case.
- newer_tag = "v0.1.3-canary.20260913001100"
+ newer_tag = "v0.1.2+canary.20260913T001100Z"
_git("tag", newer_tag, cwd=clone)
_git("push", "origin", newer_tag, cwd=clone)
newer = {**env, "RELEASE_TAG": newer_tag, "HERMES_PAYLOAD_TAG": newer_tag,
diff --git a/tests/ci/test_tag_builds_summary.py b/tests/ci/test_tag_builds_summary.py
index 05871c3f3cf..d364cde402a 100644
--- a/tests/ci/test_tag_builds_summary.py
+++ b/tests/ci/test_tag_builds_summary.py
@@ -5,6 +5,7 @@ import sys
import pytest
+from scripts.releases import r2
from tests.ci.test_commit_build_staging import shell_step
from tests.ci.test_desktop_release_tag_admission import _workflow
from tests.scripts.test_release_r2 import r2_server # noqa: F401
@@ -23,11 +24,11 @@ def test_admitted_failure_publishes_tag_info_without_promoting_channel(tmp_path,
render = next(step for step in job["steps"] if step.get("name") == "Render")
assert render["env"]["RELEASE_NEEDS"] == "${{ toJSON(needs) }}"
- tag = "v0.28.0-canary.20260818101010"
+ tag = "v0.28.0+canary.20260818T101010Z"
run_url = "https://github.example/o/r/actions/runs/12345"
base = f"http://127.0.0.1:{r2_server.server_port}/hermes-releases"
channel_key = "releases/canary/index.html"
- previous = b'<meta name="hermes-build" content="v0.27.0-canary.20260817101010">'
+ previous = b'<meta name="hermes-build" content="v0.27.0+canary.20260817T101010Z">'
r2_server.store[channel_key] = (previous, "text/html")
helper = tmp_path / "bin"
helper.mkdir()
@@ -65,7 +66,8 @@ def test_admitted_failure_publishes_tag_info_without_promoting_channel(tmp_path,
key = f"releases/tag/{tag}/index.html"
assert key in r2_server.store, result.stdout + result.stderr
page = r2_server.store[key][0].decode()
- assert f'href="https://github.com/o/r/releases/tag/{tag}"' in page
+ release_url = r2.public_url_for("https://github.com/o/r/releases/tag", tag)
+ assert f'href="{release_url}"' in page
assert "Build incomplete" in page
assert "build-win32 (failure)" in page and "publish-win32-updater (skipped)" in page
assert "No downloadable artifacts" in page
@@ -74,7 +76,7 @@ def test_admitted_failure_publishes_tag_info_without_promoting_channel(tmp_path,
assert f'<td>{name} ({info["result"]})</td><td><a href="{run_url}">View build run</a>' in page
assert base not in page
assert render["env"]["RUN_URL"] == "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- assert f"{base}/{key}" in result.stdout
+ assert r2.public_url_for(base, key) in result.stdout
assert r2_server.store[channel_key][0] == previous
assert set(r2_server.store) == {channel_key, key}
diff --git a/tests/hermes_cli/test_release_channels.py b/tests/hermes_cli/test_release_channels.py
index 2cde0922e06..78783bc2e39 100644
--- a/tests/hermes_cli/test_release_channels.py
+++ b/tests/hermes_cli/test_release_channels.py
@@ -108,7 +108,7 @@ def test_legacy_bootstrap_uses_real_archive_keys_and_source_main_has_no_bundle()
preview = pub.create("temporary")
request = pub.allocate("temporary", "a" * 40, "2.0.0")
manifest, _ = seed_manifest(pub, request, objects)
- for name, policy, tag in [("stable", "stable-release", "v2.0.0"), ("canary", "canary-release", "v2.1.0-canary.20260913000100")]:
+ for name, policy, tag in [("stable", "stable-release", "v2.0.0"), ("canary", "canary-release", "v2.1.0+canary.20260913T000100Z")]:
legacy = deepcopy(manifest)
legacy["request"].update(channel=name, buildId=("a" if name == "stable" else "b") * 32,
releaseTag=tag, version=tag[1:], windowsVersion="2.0.0.0" if name == "stable" else "2.1.0.10")
diff --git a/tests/hermes_cli/test_source_release_channels.py b/tests/hermes_cli/test_source_release_channels.py
index cddd16fa32b..543df7b53d8 100644
--- a/tests/hermes_cli/test_source_release_channels.py
+++ b/tests/hermes_cli/test_source_release_channels.py
@@ -35,11 +35,11 @@ def releases(tmp_path, monkeypatch, request):
git(origin, "add", ".")
git(origin, "commit", "-m", label)
commits.append(git(origin, "rev-parse", "HEAD"))
- tags = {"stable": "v1.2.3", "canary": "v1.2.4-canary.20260911125822"}
+ tags = {"stable": "v1.2.3", "canary": "v1.2.3+canary.20260911T125822Z"}
git(origin, "tag", "-a", tags["stable"], commits[1], "-m", "stable")
git(origin, "tag", "-a", tags["canary"], commits[2], "-m", "canary")
git(origin, "tag", "v99.0.0", commits[3])
- git(origin, "tag", "v99.0.1-canary.20260912125822", commits[3])
+ git(origin, "tag", "v99.0.1+canary.20260912T125822Z", commits[3])
checkout = tmp_path / "checkout"
git(tmp_path, "clone", str(origin), str(checkout))
git(checkout, "config", "user.name", "Release Fixture")
@@ -236,7 +236,7 @@ def test_missing_pointers_fall_back_only_to_published_releases(releases, channel
published = releases.responses[f"/repos/NousResearch/hermes-agent/releases/tags/{releases.tags[channel]}"]
releases.responses["/repos/NousResearch/hermes-agent/releases/latest"] = published
releases.responses["/repos/NousResearch/hermes-agent/releases?per_page=100&page=1"] = [
- {"tag_name": "v99.0.1-canary.20260912125822", "draft": True, "prerelease": True},
+ {"tag_name": "v99.0.1+canary.20260912T125822Z", "draft": True, "prerelease": True},
published,
]
assert resolve_source_release(channel, ["git"], releases.root) == (
diff --git a/tests/hermes_cli/test_update_channel.py b/tests/hermes_cli/test_update_channel.py
index 5877276d9a5..9cec708d80a 100644
--- a/tests/hermes_cli/test_update_channel.py
+++ b/tests/hermes_cli/test_update_channel.py
@@ -125,15 +125,15 @@ class TestResolve:
('self', None, None, 'canary', 'canary'),
('self', None, None, 'yolo', 'yolo'),
('electron-updater', 'v1.2.3', None, None, 'stable'),
- ('electron-updater', 'v1.2.3-canary.20260819171926', None, 'stable', 'canary'),
- ('app-installer', 'v1.2.3-canary.20260819171926', None, None, 'canary'),
- ('microsoft-store', 'v1.2.3-canary.20260819171926', None, None, 'canary'),
- ('electron-updater', 'v1.2.3-canary.20260818', None, None, 'canary'),
+ ('electron-updater', 'v1.2.3+canary.20260819T171926Z', None, 'stable', 'canary'),
+ ('app-installer', 'v1.2.3+canary.20260819T171926Z', None, None, 'canary'),
+ ('microsoft-store', 'v1.2.3+canary.20260819T171926Z', None, None, 'canary'),
+ ('electron-updater', 'v1.2.3-canary.20260818', None, None, 'stable'),
('electron-updater', None, None, 'canary', 'stable'),
('external', 'v1.2.3', 'bundled', 'main', 'stable'),
('external', 'v1.2.3', 'light', 'main', 'stable'),
- ('external', 'v1.2.4-canary.20260911125822', 'bundled', 'main', 'canary'),
- ('external', 'v1.2.4-canary.20260911125822', 'light', 'main', 'canary'),
+ ('external', 'v1.2.4+canary.20260911T125822Z', 'bundled', 'main', 'canary'),
+ ('external', 'v1.2.4+canary.20260911T125822Z', 'light', 'main', 'canary'),
])
def test_channel_policy(self, tmp_path, mechanism, tag, payload, record, expected):
if mechanism is not None:
@@ -361,7 +361,7 @@ class TestSetChannelCLI:
from hermes_cli.main import cmd_update
self._home(tmp_path, monkeypatch)
- _stamp(tmp_path, "self", "v0.28.0-canary.20260818")
+ _stamp(tmp_path, "self", "v0.28.0+canary.20260818T000000Z")
with pytest.raises(SystemExit) as exc:
cmd_update(self._args(set_channel="stable"))
assert exc.value.code == 0
diff --git a/tests/install/e2e-assets/bundle-manifest.cjs b/tests/install/e2e-assets/bundle-manifest.cjs
index 3906ceaa0a3..56cf16e09be 100644
--- a/tests/install/e2e-assets/bundle-manifest.cjs
+++ b/tests/install/e2e-assets/bundle-manifest.cjs
@@ -2,7 +2,7 @@
const fs = require('node:fs')
const semver = require('semver')
-const TAG = /^v\d+\.\d+\.\d+(?:-canary\.\d{14})?$/
+const TAG = /^v\d+\.\d+\.\d+(?:\+canary\.20\d{6}T\d{6}Z)?$/
const COMMIT = /^[0-9a-f]{40}$/
const SHA256 = /^[0-9a-f]{64}$/
const FORMATS = { windows: '.msixbundle', macos: '.zip' }
@@ -78,7 +78,7 @@ function validateBundleInputs(value, platform, arch) {
} else {
if (value.new.teamId !== value.old.teamId) throw new Error('Update must preserve signing team')
if (!semver.gt(value.new.version, value.old.version)) throw new Error('New package version must increase')
- if (value.old.tag.includes('-canary.') !== value.new.tag.includes('-canary.')) throw new Error('Bundle transition must stay on one update channel')
+ if (value.old.tag.includes('+canary.') !== value.new.tag.includes('+canary.')) throw new Error('Bundle transition must stay on one update channel')
}
return value
}
diff --git a/tests/install/e2e-assets/bundle-smoke-metadata.mjs b/tests/install/e2e-assets/bundle-smoke-metadata.mjs
index 8a32c0d789e..f79e702dcff 100644
--- a/tests/install/e2e-assets/bundle-smoke-metadata.mjs
+++ b/tests/install/e2e-assets/bundle-smoke-metadata.mjs
@@ -18,7 +18,7 @@ function admitChannelRequest(request, commit, tag) {
export function bundleIdentity(commit, tag = '', channelRequest = null) {
if (!/^[a-f0-9]{40}$/.test(commit)) throw new Error('Expected exact full lowercase commit SHA')
- if (tag && !/^v\d+\.\d+\.\d+(?:-canary\.20\d{6}(?:\d{6})?)?$/.test(tag)) throw new Error('Invalid release tag')
+ if (tag && !/^v\d+\.\d+\.\d+(?:\+canary\.20\d{6}T\d{6}Z)?$/.test(tag)) throw new Error('Invalid release tag')
if (channelRequest !== null) {
const request = admitChannelRequest(channelRequest, commit, tag)
return { appId: request.identity.appId, msixIdentity: request.identity.msixAppIdWithOrg,
diff --git a/tests/install/e2e-assets/mac-bundled-feed.mjs b/tests/install/e2e-assets/mac-bundled-feed.mjs
index c5a3d27199c..2a26bd0ec7b 100644
--- a/tests/install/e2e-assets/mac-bundled-feed.mjs
+++ b/tests/install/e2e-assets/mac-bundled-feed.mjs
@@ -79,7 +79,7 @@ export async function materializeFeed({ outDir, zipPath, version, tag, arch, rel
if (!zipName.endsWith('.zip')) {
throw new Error(`feed: expected a .zip artifact, got ${zipName}`)
}
- const channel = tag.includes('-canary.') ? 'canary' : 'stable'
+ const channel = tag.includes('+canary.') ? 'canary' : 'stable'
const sha512 = await sha512Base64(zipPath)
const text = buildMacFeedText({ version, tag, zipName, sha512, size: zipStat.size, releaseDate })
diff --git a/tests/scripts/test_appinstaller.py b/tests/scripts/test_appinstaller.py
index 76790ff3344..9cba0114506 100644
--- a/tests/scripts/test_appinstaller.py
+++ b/tests/scripts/test_appinstaller.py
@@ -14,7 +14,7 @@ from tests.scripts.test_release_r2 import r2_server # noqa: F401
def test_canary_publication_verifies_native_identity_and_uploads_bundle_before_pointer(tmp_path, r2_server, variant):
import zipfile
- tag, version = 'v1.2.4-canary.20260902000000', '1.2.4.1440'
+ tag, version = 'v1.2.4+canary.20260902T000000Z', '1.2.4.1440'
identity, publisher = f'Fixture.{variant}.Canary', 'CN=Fixture & Team'
bundle = tmp_path / 'app.msixbundle'
manifest = ET.Element('Bundle')
diff --git a/tests/scripts/test_commit_bundle_entrypoints.py b/tests/scripts/test_commit_bundle_entrypoints.py
index 691d8e01725..5ddb3bed1cd 100644
--- a/tests/scripts/test_commit_bundle_entrypoints.py
+++ b/tests/scripts/test_commit_bundle_entrypoints.py
@@ -83,7 +83,7 @@ def test_desktop_build_reaches_the_managed_payload_with_commit_ref(tmp_path, mon
[email protected]("tag,commit", [(None, "a" * 40), ("v1.2.3-canary.20260911120000", None)])
[email protected]("tag,commit", [(None, "a" * 40), ("v1.2.3+canary.20260911T120000Z", None)])
def test_store_build_rejects_nonstable_before_reading_or_preparing_repo(tmp_path, tag, commit):
absent = tmp_path / "must-not-be-created"
with pytest.raises(ValueError, match="Store.*stable"):
diff --git a/tests/scripts/test_desktop_preparation.py b/tests/scripts/test_desktop_preparation.py
index c3573573c42..0bffb5fce38 100644
--- a/tests/scripts/test_desktop_preparation.py
+++ b/tests/scripts/test_desktop_preparation.py
@@ -115,7 +115,7 @@ def test_source_admission_rejects_dirty_checkout_and_invalid_store_before_writes
source, commit = _project(tmp_path)
work = tmp_path / "work"
cache = tmp_path / "cache"
- for tag, selected in [(None, commit), ("v1.2.0-canary.20260911120000", None)]:
+ for tag, selected in [(None, commit), ("v1.2.0+canary.20260911T120000Z", None)]:
with pytest.raises(ValueError, match="Store.*stable"):
BuildRequest.create(source, tag=tag, commit=selected, variant="store", work=work, cache=cache, bundle_env={})
(source / "package.json").write_text("{}", encoding="utf-8")
diff --git a/tests/scripts/test_icon_flavors.py b/tests/scripts/test_icon_flavors.py
index 414234e02d8..e3ce61449d0 100644
--- a/tests/scripts/test_icon_flavors.py
+++ b/tests/scripts/test_icon_flavors.py
@@ -148,16 +148,14 @@ def test_renderer_canary_rule_is_the_canonical_one(monkeypatch):
assert spec is not None and spec.loader is not None
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
- for tag in ("v1.2.3-canary.20260911", "v1.2.3-canary.20260911010203", "v2026.9.15-canary.20260916120000",
- "v1.2.3", "v1.2.3-canary.2026091101", "v1.2.3-canary.20260911010203123", "01.2.3-canary.20260911", ""):
+ for tag in ("v1.2.3+canary.20260911T010203Z", "v2026.9.15+canary.20260916T120000Z",
+ "v1.2.3", "v1.2.3-canary.20260911010203", "v1.2.3+canary.20260911010203", ""):
assert bool(module._CANARY_TAG_RE.match(tag)) == is_canary_tag(tag), tag
def test_canary_changes_only_desktop_background_preserving_art_and_native_geometry(generate):
stable = generate("v1.2.3")
- canary = generate("v1.2.3-canary.20260911010203")
- legacy = generate("v1.2.3-canary.20260911")
- assert (canary / "apps/desktop/assets/icon.png").read_bytes() == (legacy / "apps/desktop/assets/icon.png").read_bytes()
+ canary = generate("v1.2.3+canary.20260911T010203Z")
for path in (stable / "apps/desktop").rglob("*"):
if not path.is_file():
continue
diff --git a/tests/scripts/test_release_canary_git.py b/tests/scripts/test_release_canary_git.py
index 45d736cf151..4c74343ae97 100644
--- a/tests/scripts/test_release_canary_git.py
+++ b/tests/scripts/test_release_canary_git.py
@@ -11,106 +11,134 @@ from tests.scripts.test_release_tags import release, release_repo # noqa: F401
@pytest.fixture
def canary_repo(tmp_path, monkeypatch, release_repo):
git = release_repo
- remote = tmp_path / 'remote.git'
- git('init', '--bare', '-q', str(remote))
- git('remote', 'add', 'origin', 'https://github.com/fixture/release')
+ remote = tmp_path / "remote.git"
+ git("init", "--bare", "-q", str(remote))
+ git("remote", "add", "origin", "https://github.com/fixture/release")
calls = []
actual_run = subprocess.run
def run(argv, *args, **kwargs):
- if argv[0] != 'gh':
- if argv[:2] == ['git', 'push']:
- argv = ['git', '-c', f'url.{remote.as_uri()}.insteadOf=https://github.com/fixture/release', *argv[1:]]
+ if argv[0] != "gh":
+ if argv[:2] == ["git", "push"]:
+ argv = ["git", "-c", f"url.{remote.as_uri()}.insteadOf=https://github.com/fixture/release", *argv[1:]]
return actual_run(argv, *args, **kwargs)
calls.append(argv)
- if argv[1:3] == ['release', 'create']:
- assert git('--git-dir', str(remote), 'rev-parse', argv[3] + '^{commit}') == git('rev-parse', 'HEAD')
- elif argv[1:3] == ['workflow', 'run']:
- assert any(c[1:3] == ['release', 'create'] for c in calls)
+ if argv[1:3] == ["release", "create"]:
+ assert git("--git-dir", str(remote), "rev-parse", argv[3] + "^{commit}") == git("rev-parse", "HEAD")
+ elif argv[1:3] == ["workflow", "run"]:
+ assert any(call[1:3] == ["release", "create"] for call in calls)
else:
- assert argv[1:3] == ['repo', 'view']
- return subprocess.CompletedProcess(argv, 0, stdout='main\n', stderr='')
+ assert argv[1:3] == ["repo", "view"]
+ return subprocess.CompletedProcess(argv, 0, stdout="main\n", stderr="")
- monkeypatch.setattr(subprocess, 'run', run)
+ monkeypatch.setattr(subprocess, "run", run)
which = release.shutil.which
- monkeypatch.setattr(release.shutil, 'which', lambda name: 'gh' if name == 'gh' else which(name))
- monkeypatch.setattr(release, 'generate_changelog', lambda *a, **kw: 'fixture notes')
- monkeypatch.delenv('GITHUB_OUTPUT', raising=False)
+ monkeypatch.setattr(release.shutil, "which", lambda name: "gh" if name == "gh" else which(name))
+ monkeypatch.setattr(release, "generate_changelog", lambda *args, **kwargs: "fixture notes")
+ monkeypatch.delenv("GITHUB_OUTPUT", raising=False)
return git, remote, calls
[email protected]('previous,stable_date,admitted', [
- ('v1.2.4-canary.20260818103045', '2026-08-01T00:00:00Z', False),
- ('v1.2.3-canary.20260818103045', '2026-08-01T00:00:00Z', True),
- (None, '2026-06-01T00:00:00Z', False),
- (None, '2026-08-01T00:00:00Z', True),
-])
-def test_canary_cut_binds_pushed_head_before_draft_and_dispatch(canary_repo, monkeypatch, previous, stable_date, admitted):
+def test_canary_cut_keeps_the_stable_core_and_dispatches_exactly_once(canary_repo):
git, remote, calls = canary_repo
- monkeypatch.setenv('GIT_COMMITTER_DATE', stable_date)
- git('commit', '--allow-empty', '-qm', 'stable')
- git('tag', 'v1.2.3')
- if previous:
- git('tag', previous)
- git('commit', '--allow-empty', '-qm', 'feat: next')
- tag = 'v1.2.4-canary.20260818103000'
- args = SimpleNamespace(date='20260818103000', publish=True, no_changelog=True, remote='origin')
- if stable_date.startswith('2026-06'):
- with pytest.raises(SystemExit) as error:
- release.cmd_canary(args)
- assert error.value.code == 1
- else:
- release.cmd_canary(args)
- if not admitted:
- assert calls == []
- assert tag not in git('tag', '--list').splitlines()
- return
- create = next(c for c in calls if c[1:3] == ['release', 'create'])
- assert create[3] == tag and {'--draft', '--prerelease', '--verify-tag'} <= set(create)
- dispatch = next(c for c in calls if c[1:3] == ['workflow', 'run'])
- assert dispatch == ['gh', 'workflow', 'run', 'desktop-bundled-release.yml', '--ref', 'main',
- '-f', f'tag={tag}', '-f', 'upload_release=true', '--repo', 'fixture/release']
- assert git('--git-dir', str(remote), 'rev-parse', tag + '^{commit}') == git('rev-parse', 'HEAD')
+ git("commit", "--allow-empty", "-qm", "stable")
+ git("tag", "v1.2.3")
+ git("commit", "--allow-empty", "-qm", "feat: next")
+ tag = "v1.2.3+canary.20260818T103000Z"
+ args = SimpleNamespace(
+ date="20260818T103000Z", publish=True, no_changelog=True, remote="origin"
+ )
+
+ release.cmd_canary(args)
+
+ create = next(call for call in calls if call[1:3] == ["release", "create"])
+ assert create[3] == tag
+ assert {"--draft", "--prerelease", "--verify-tag"} <= set(create)
+ dispatch = next(call for call in calls if call[1:3] == ["workflow", "run"])
+ assert dispatch == [
+ "gh", "workflow", "run", "desktop-bundled-release.yml", "--ref", "main",
+ "-f", f"tag={tag}", "-f", "upload_release=true", "--repo", "fixture/release",
+ ]
+ assert git("--git-dir", str(remote), "rev-parse", tag + "^{commit}") == git("rev-parse", "HEAD")
+
+ calls.clear()
+ release.cmd_canary(args)
+ assert calls == []
+
+
+def test_unchanged_head_does_not_cut_another_timestamp(canary_repo):
+ git, _remote, calls = canary_repo
+ git("commit", "--allow-empty", "-qm", "stable")
+ git("tag", "v1.2.3")
+ git("commit", "--allow-empty", "-qm", "feat: next")
+ first = SimpleNamespace(date="20260818T103000Z", publish=True, no_changelog=True, remote="origin")
+ release.cmd_canary(first)
calls.clear()
- release.cmd_canary(args) # existing tag
- args.date = '20260818103100'
- release.cmd_canary(args) # unchanged HEAD
+
+ second = SimpleNamespace(date="20260818T103001Z", publish=True, no_changelog=True, remote="origin")
+ release.cmd_canary(second)
+
assert calls == []
-def test_tag_shapes_and_real_prune_cutoff(canary_repo, monkeypatch, capsys):
+def test_tag_shape_and_prune_use_canonical_receipts(canary_repo, monkeypatch, capsys):
git, _, calls = canary_repo
- assert release.canary_tag_for_date('0.27.4', '20260818103000') == 'v0.27.5-canary.20260818103000'
- assert release.canary_tag_for_date('v1.4.0', '20261231235959') == 'v1.4.1-canary.20261231235959'
- tags = ['v0.27.1-canary.20260801', 'v0.27.1-canary.20260801235959',
- 'v0.27.1-canary.20260804', 'v0.27.1-canary.20260804235959',
- 'v0.27.1-canary.invalid', 'v0.27.1', 'v2026.7.20']
+ assert release.canary_tag_for_date("0.27.4", "20260818T103000Z") == "v0.27.4+canary.20260818T103000Z"
+ assert release.canary_tag_for_date("v1.4.0", "20261231T235959Z") == "v1.4.0+canary.20261231T235959Z"
+ tags = [
+ "v0.27.1+canary.20260801T000000Z",
+ "v0.27.1+canary.20260801T235959Z",
+ "v0.27.1+canary.20260804T000000Z",
+ "v0.27.1+canary.20260804T235959Z",
+ "v0.27.1+canary.invalid",
+ "v0.27.1",
+ "v2026.7.20",
+ ]
for tag in tags:
- git('tag', tag)
+ git("tag", tag)
+
class Clock(datetime):
@classmethod
def now(cls, tz=None):
return cls(2026, 8, 18, tzinfo=timezone.utc)
- monkeypatch.setattr(release, 'datetime', Clock)
- release.prune_old_canaries(SimpleNamespace(remote='origin', publish=False))
- assert {line.removeprefix('Would delete ') for line in capsys.readouterr().out.splitlines()
- if line.startswith('Would delete ')} == set(tags[:2])
- assert calls == [] and set(git('tag', '--list').splitlines()) == set(tags)
+
+ monkeypatch.setattr(release, "datetime", Clock)
+ release.prune_old_canaries(SimpleNamespace(remote="origin", publish=False))
+ deleted = {
+ line.removeprefix("Would delete ")
+ for line in capsys.readouterr().out.splitlines()
+ if line.startswith("Would delete ")
+ }
+ assert deleted == set(tags[:2])
+ assert calls == []
+ assert set(git("tag", "--list").splitlines()) == set(tags)
def test_stable_dispatch_and_failure(monkeypatch, tmp_path):
calls = []
- monkeypatch.setattr(release, 'REPO_ROOT', tmp_path)
- monkeypatch.setattr(release.shutil, 'which', lambda _: 'gh')
- monkeypatch.setattr(release.subprocess, 'run', lambda cmd, **kw: (
- calls.append(cmd) or subprocess.CompletedProcess(cmd, 0, '', '')))
- assert release.dispatch_desktop_build('v1.2.3', 'owner/repo')
- assert calls == [['gh', 'workflow', 'run', 'stable-release.yml', '--ref', 'v1.2.3',
- '-f', 'tag=v1.2.3', '--repo', 'owner/repo']]
+ monkeypatch.setattr(release, "REPO_ROOT", tmp_path)
+ monkeypatch.setattr(release.shutil, "which", lambda _: "gh")
+ monkeypatch.setattr(
+ release.subprocess,
+ "run",
+ lambda command, **kwargs: calls.append(command)
+ or subprocess.CompletedProcess(command, 0, "", ""),
+ )
+ assert release.dispatch_desktop_build("v1.2.3", "owner/repo")
+ assert calls == [[
+ "gh", "workflow", "run", "stable-release.yml", "--ref", "v1.2.3",
+ "-f", "tag=v1.2.3", "--repo", "owner/repo",
+ ]]
with pytest.raises(ValueError):
- release.dispatch_desktop_build('v1.2.3/other', 'owner/repo')
- monkeypatch.setattr(release.subprocess, 'run', lambda cmd, **kw: subprocess.CompletedProcess(cmd, 1, '', 'refused'))
- assert release.dispatch_desktop_build('v1.2.3', 'owner/repo') is False
- monkeypatch.setattr(release.shutil, 'which', lambda _: None)
- assert release.dispatch_desktop_build('v1.2.4-canary.20260818103000', 'owner/repo') is False
+ release.dispatch_desktop_build("v1.2.3/other", "owner/repo")
+ monkeypatch.setattr(
+ release.subprocess,
+ "run",
+ lambda command, **kwargs: subprocess.CompletedProcess(command, 1, "", "refused"),
+ )
+ assert release.dispatch_desktop_build("v1.2.3", "owner/repo") is False
+ monkeypatch.setattr(release.shutil, "which", lambda _: None)
+ assert release.dispatch_desktop_build(
+ "v1.2.3+canary.20260818T103000Z", "owner/repo"
+ ) is False
diff --git a/tests/scripts/test_release_darwin.py b/tests/scripts/test_release_darwin.py
index 0c4cee7cddf..d43874ceab6 100644
--- a/tests/scripts/test_release_darwin.py
+++ b/tests/scripts/test_release_darwin.py
@@ -23,7 +23,7 @@ from scripts.releases.darwin import (
def _inputs(version="0.28.0", light=False):
- channel = "canary" if "-canary." in version else "stable"
+ channel = "canary" if "+canary." in version else "stable"
bytes_by_key = {}
legs = {}
for i, arch in enumerate(("arm64", "x64")):
@@ -55,10 +55,10 @@ def base64_sha512(data: bytes) -> str:
def test_real_prune_protects_live_macos_artifacts_and_fails_closed(r2_server, monkeypatch):
- legs, _bytes = _inputs("0.28.0-canary.20200101000000")
- plan = merge_mac_feeds(legs, "v0.28.0-canary.20200101000000")
+ legs, _bytes = _inputs("0.28.0+canary.20200101T000000Z")
+ plan = merge_mac_feeds(legs, "v0.28.0+canary.20200101T000000Z")
references = mac_feed_references(plan["text"])
- stale = "releases/tag/v0.27.0-canary.20200101000000/unreferenced.zip"
+ stale = "releases/tag/v0.27.0+canary.20200101T000000Z/unreferenced.zip"
for key in [plan["key"], *references, stale]:
r2_server.store[key] = (b"x", '"e"')
r2_server.store[plan["key"]] = (plan["text"].encode(), '"e"')
@@ -90,8 +90,8 @@ def test_merges_native_legs_and_preserves_release_metadata():
]
assert r2.cache_control_for(plan["key"]) == "no-store"
selection = _darwin_feed("canary", True)
- light_legs, _ = _inputs("0.29.0-canary.20260906000000", light=True)
- light_plan = merge_mac_feeds(light_legs, "v0.29.0-canary.20260906000000", light=True)
+ light_legs, _ = _inputs("0.29.0+canary.20260906T000000Z", light=True)
+ light_plan = merge_mac_feeds(light_legs, "v0.29.0+canary.20260906T000000Z", light=True)
assert light_plan["key"] == f"{selection['directory']}/{selection['fileName']}"
@@ -122,17 +122,17 @@ def test_rejects_broken_legs_instead_of_publishing(kind):
def test_semver_grammar_rejects_non_release_versions():
# The Python port never imports npm semver; it implements exactly the
- # release grammar (vMAJOR.MINOR.PATCH[-canary.<14 digits>]) and fails
+ # release grammar (vMAJOR.MINOR.PATCH[+canary.<full UTC timestamp>]) and fails
# loudly on anything else instead of guessing an order.
from scripts.releases.semver import compare, is_valid_version
- assert is_valid_version("0.28.0") and is_valid_version("0.28.0-canary.20260904101010")
+ assert is_valid_version("0.28.0") and is_valid_version("0.28.0+canary.20260904T101010Z")
# Legacy CalVer (four-digit major) is not a release version anywhere.
assert not is_valid_version("0.28") and not is_valid_version("2026.7.20")
assert not is_valid_version("0.28.0-beta.1")
assert compare("0.28.0", "0.27.9") == 1
- assert compare("0.28.0-canary.20260904101010", "0.28.0") == -1 # prerelease < release
- assert compare("0.28.0-canary.20260904101010", "0.28.0-canary.20260904101011") == -1
+ assert compare("0.28.0+canary.20260904T101010Z", "0.28.0") == 0
+ assert compare("0.28.0+canary.20260904T101010Z", "0.28.0+canary.20260904T101011Z") == 0
with pytest.raises(ValueError):
compare("nonsense", "0.28.0")
diff --git a/tests/scripts/test_release_handoff.py b/tests/scripts/test_release_handoff.py
index 6f33159657d..00897716eed 100644
--- a/tests/scripts/test_release_handoff.py
+++ b/tests/scripts/test_release_handoff.py
@@ -1,6 +1,7 @@
"""Release handoffs use exact R2 bytes without advancing a channel."""
import copy
import json
+from urllib.parse import unquote
import pytest
@@ -8,7 +9,7 @@ from scripts.releases import handoff, r2
from tests.scripts.test_release_r2 import r2_server # noqa: F401
[email protected]('tag', ['v1.2.3', 'v1.2.3-canary.20260908232538', None])
[email protected]('tag', ['v1.2.3', 'v1.2.3+canary.20260908T232538Z', None])
def test_stage_and_fetch_bind_tag_commit_and_files_without_feed_writes(tmp_path, monkeypatch, r2_server, tag):
commit = "a" * 40
identity = ['--tag', tag, '--commit', commit] if tag else ['--commit-build', commit]
@@ -32,7 +33,7 @@ def test_stage_and_fetch_bind_tag_commit_and_files_without_feed_writes(tmp_path,
assert {row["path"] for row in receipt["files"]} == {p.relative_to(root).as_posix() for p in root.rglob("*") if p.is_file()}
assert all(key.startswith(prefix) for key in r2_server.store)
puts = [path for method, path, _ in r2_server.requests if method == "PUT"]
- assert puts[-1].endswith(receipt_key)
+ assert unquote(puts[-1]).endswith(receipt_key)
assert all(headers.get("If-None-Match") == "*" for method, _, headers in r2_server.requests if method == "PUT")
downloaded = tmp_path / "downloaded"
diff --git a/tests/scripts/test_release_r2.py b/tests/scripts/test_release_r2.py
index 0c70df3c91d..3c9cb772f95 100644
--- a/tests/scripts/test_release_r2.py
+++ b/tests/scripts/test_release_r2.py
@@ -135,8 +135,8 @@ def test_disposable_scope_streams_lists_and_never_touches_production(r2_server,
'05ba50acfb54042fac330848af50877e5fb477c4f2063c2f77f9cc80855eb1e9'),
('GET', '/hermes-releases', {'list-type': '2', 'prefix': 'HermesBundled-0.28.0-', 'max-keys': '1000'},
EMPTY_SHA, 'auto/s3', '3ec423c452a318664c85fbcc25667ad07201aedce688e3bb6b345b4baaa39d90'),
- ('DELETE', '/hermes-releases/HermesBundled-0.28.0-canary.20260818-win-arm64.msix', {},
- EMPTY_SHA, 'auto/s3', 'ec5ccb76f701193b28aaca052cabbf2f084e9c71ffc64b872fa51d4e70dc6e55'),
+ ('DELETE', '/hermes-releases/HermesBundled-0.28.0+canary.20260818T000000Z-win-arm64.msix', {},
+ EMPTY_SHA, 'auto/s3', '40dba7bf7356837cf496d950605dfc2c62d82ca2b30aa45c8c0dc8dab7bc1bd1'),
])
def test_independent_sigv4_vectors(method, path, query, payload, scope, signature):
host = 'example.com' if scope == 'us-east-1/service' else 'abc123.r2.cloudflarestorage.com'
@@ -307,11 +307,11 @@ def test_referenced_feed_bundle_filenames_reads_main_package_only():
def test_feed_referenced_keys_protects_bundle_and_absolute_tag_uris():
tag_feed = CANARY_FEED_XML.replace(
'Uri="https://r2.example/releases/win32/canary/HermesBundled-0.27.2.9-win.msixbundle"',
- 'Uri="https://r2.example/releases/tag/v0.27.2-canary.20260829/HermesBundled-0.27.2-win-x64.msix"',
+ 'Uri="https://r2.example/releases/tag/v0.27.2+canary.20260829T000000Z/HermesBundled-0.27.2-win-x64.msix"',
)
keys = feed_referenced_keys("releases/win32/canary", tag_feed)
assert "releases/win32/canary/HermesBundled-0.27.2-win-x64.msix" in keys
- assert "releases/tag/v0.27.2-canary.20260829/HermesBundled-0.27.2-win-x64.msix" in keys
+ assert "releases/tag/v0.27.2+canary.20260829T000000Z/HermesBundled-0.27.2-win-x64.msix" in keys
CANARY_DIR = "releases/win32/canary"
@@ -677,13 +677,13 @@ def test_list_cli_paginates_and_decodes_keys(r2_server, capsys):
b'<Foo Uri="https://x/old.msixbundle" />', b'<MainPackage Uri="https://x/old.msixbundle" />',
b'<AppInstaller><MainBundle Uri="https://x/old.msixbundle" />'])
def test_real_prune_retention_and_second_feed_failure(r2_server, capsys, bad_feed):
- tag_reference = 'releases/tag/v0.27.2-canary.20260801/live.msixbundle'
+ tag_reference = 'releases/tag/v0.27.2+canary.20260801T000000Z/live.msixbundle'
second = f'<AppInstaller><MainBundle Uri="https://cdn.example/{tag_reference}" /></AppInstaller>'
- doomed = {f'{CANARY_DIR}/old.msixbundle', 'releases/tag/v0.27.2-canary.20260801000000/old.zip'}
+ doomed = {f'{CANARY_DIR}/old.msixbundle', 'releases/tag/v0.27.2+canary.20260801T000000Z/old.zip'}
kept = {f'{CANARY_DIR}/HermesBundled-0.27.2.9-win.msixbundle', f'{CANARY_DIR}/live.msixbundle',
f'{CANARY_DIR}/fresh.msixbundle', f'{CANARY_DIR}/unknown.msixbundle', tag_reference,
'releases/win32/stable/old.msixbundle', 'releases/unknown/old.msixbundle',
- 'releases/tag/v0.28.0/old.zip', 'releases/tag/v0.28.0-canary.20260904/today.zip'}
+ 'releases/tag/v0.28.0/old.zip', 'releases/tag/v0.28.0+canary.20260904T000000Z/today.zip'}
r2_server.store.update({key: (b'artifact', '"e"') for key in doomed | kept})
r2_server.store[f'{CANARY_DIR}/canary.appinstaller'] = (CANARY_FEED_XML.encode(), '"e"')
r2_server.store[f'{CANARY_DIR}/second.appinstaller'] = (second.encode() if bad_feed is None else bad_feed, '"e"')
diff --git a/tests/scripts/test_release_tags.py b/tests/scripts/test_release_tags.py
index 543f9066293..e274eac5642 100644
--- a/tests/scripts/test_release_tags.py
+++ b/tests/scripts/test_release_tags.py
@@ -55,11 +55,11 @@ def test_real_tag_order_and_remote_selection(release_repo):
for tag in ('v2026.7.7', 'v2026.7.20'):
git('tag', tag)
assert release.get_last_tag() == 'v2026.7.20'
- for tag in ('v0.9.0', 'v0.20.0', 'v0.19.0', 'v0.21.0-canary.20260818090000',
- 'v0.21.0-canary.20260818171500', 'v0.21.0-canary.20260818'):
+ for tag in ('v0.9.0', 'v0.20.0', 'v0.19.0', 'v0.20.0+canary.20260818T090000Z',
+ 'v0.20.0+canary.20260818T171500Z'):
git('tag', tag)
assert release.get_last_tag() == 'v0.20.0'
- assert release.get_last_canary_tag() == 'v0.21.0-canary.20260818171500'
+ assert release.get_last_canary_tag() == 'v0.20.0+canary.20260818T171500Z'
with pytest.raises(SystemExit, match='no git remotes'):
release.resolve_push_remote(None)
git('remote', 'add', 'origin', 'https://github.com/o/r')
diff --git a/tests/scripts/test_render_builds_publication.py b/tests/scripts/test_render_builds_publication.py
index 17f6ae55428..95e00957081 100644
--- a/tests/scripts/test_render_builds_publication.py
+++ b/tests/scripts/test_render_builds_publication.py
@@ -5,6 +5,7 @@ from pathlib import Path
import re
import subprocess
import sys
+from urllib.parse import unquote
from urllib.request import urlopen
import pytest
@@ -34,7 +35,7 @@ def release_body(monkeypatch):
return state
[email protected]('tag', ['v1.2.3', 'v1.2.3-canary.20260818101010'])
[email protected]('tag', ['v1.2.3', 'v1.2.3+canary.20260818T101010Z'])
def test_tag_publication_pending_rerun_stale_and_dry_run(monkeypatch, r2_server, release_body, tag):
base = f'http://127.0.0.1:{r2_server.server_port}/hermes-releases'
version = tag[1:]
@@ -63,18 +64,19 @@ def test_tag_publication_pending_rerun_stale_and_dry_run(monkeypatch, r2_server,
body = release_body['body']
assert 'runs/2' not in body and body.count('## Downloads') == 1
assert body.count(rbt.MARKER) == body.count(rbt.END_MARKER) == 1
- expected = {f'{base}/{prefix}{name}' for name in visible}
+ expected = {rbt.r2.public_url_for(base, prefix + name) for name in visible}
assert set(re.findall(r'\]\((http[^)]+)\)', body)) == expected
with urlopen(f'{base}/{prefix}index.html', timeout=5) as response:
page = response.read().decode()
- assert set(re.findall(r'href="(http[^"]+)"', page)) == expected | {f'https://github.com/o/r/releases/tag/{tag}'}
+ release_url = rbt.r2.public_url_for('https://github.com/o/r/releases/tag', tag)
+ assert set(re.findall(r'href="(http[^"]+)"', page)) == expected | {release_url}
assert rbt.recorded_build(page) == tag and 'Bundle environment' not in page
assert all(name not in page and name not in body for name in hidden)
assert 'linux-arm64' not in page
for url in expected:
with urlopen(url, timeout=5) as response:
- assert response.read() == url.rsplit('/', 1)[1].encode()
- channel_key = 'releases/canary/index.html' if '-canary.' in tag else 'releases/stable/index.html'
+ assert response.read() == unquote(url.rsplit('/', 1)[1]).encode()
+ channel_key = 'releases/canary/index.html' if '+canary.' in tag else 'releases/stable/index.html'
assert r2_server.store[channel_key][0].decode() == page
render()
assert release_body['body'] == body
@@ -96,7 +98,7 @@ def test_tag_publication_pending_rerun_stale_and_dry_run(monkeypatch, r2_server,
@pytest.mark.parametrize('asset_present', [False, True])
@pytest.mark.parametrize('result', ['failure', 'cancelled', 'skipped'])
def test_incomplete_tag_keeps_channel_and_links_diagnostics(monkeypatch, r2_server, release_body, asset_present, result):
- tag = 'v1.2.3-canary.20260818101010'
+ tag = 'v1.2.3+canary.20260818T101010Z'
base = f'http://127.0.0.1:{r2_server.server_port}/hermes-releases'
key = f'releases/tag/{tag}/HermesBundled-{tag[1:]}-win-x64.msix'
r2_server.store['releases/canary/index.html'] = (b'previous good page', '"e"')
@@ -111,26 +113,26 @@ def test_incomplete_tag_keeps_channel_and_links_diagnostics(monkeypatch, r2_serv
for output in (page, release_body['body']):
assert 'Build incomplete' in output and f'publish-win32-updater ({result})' in output
assert run in output
- assert (base + '/' + key in output) == asset_present
+ assert (rbt.r2.public_url_for(base, key) in output) == asset_present
assert ('No downloadable artifacts' in page) == (not asset_present)
assert r2_server.store['releases/canary/index.html'][0] == b'previous good page'
@pytest.mark.parametrize('version,name', [
('1.2.3', 'HermesBundled-1.2.3-win-x64.msix'),
- ('1.2.3-canary.20260818', 'HermesBundled-1.2.3-canary.20260818-win-x64.msix'),
+ ('1.2.3+canary.20260818T000000Z', 'HermesBundled-1.2.3+canary.20260818T000000Z-win-x64.msix'),
])
def test_exact_version_and_flat_name_boundaries(version, name):
- names = [name, 'HermesBundled-1.2.3-canary.20260817-win-x64.msix', 'HermesBundled-1.2.4-win-x64.msix', name + '.blockmap']
+ names = [name, 'HermesBundled-1.2.3+canary.20260817T000000Z-win-x64.msix', 'HermesBundled-1.2.4-win-x64.msix', name + '.blockmap']
assert rbt.filter_names_for_version(names, version) == [name]
assert rbt.parse_assets([name])['HermesBundled'][('win', 'x64')] == (name, 'msix')
@pytest.mark.parametrize('current,tag,allowed', [
(None, 'v1.2.3', True), ('garbage', 'v1.2.3', True),
- ('v1.2.3', 'v1.2.3-canary.20260818101010', False),
- ('v1.2.3-canary.20260818101010', 'v1.2.3-canary.20260818101009', False),
- ('v1.2.3-canary.20260818101010', 'v1.2.3-canary.20260818101011', True),
+ ('v1.2.3', 'v1.2.3+canary.20260818T101010Z', False),
+ ('v1.2.3+canary.20260818T101010Z', 'v1.2.3+canary.20260818T101009Z', False),
+ ('v1.2.3+canary.20260818T101010Z', 'v1.2.3+canary.20260818T101011Z', True),
])
def test_channel_order_boundaries(current, tag, allowed):
page = rbt.render_page(current, {}, 'https://cdn.example') if current and current != 'garbage' else current
diff --git a/tests/scripts/test_stable_release.py b/tests/scripts/test_stable_release.py
index 9daa481eca3..1ee2f30cad8 100644
--- a/tests/scripts/test_stable_release.py
+++ b/tests/scripts/test_stable_release.py
@@ -71,7 +71,7 @@ def test_transitions_bind_all_arches_identity_version_and_archive():
validate_candidates(old, old["tag"], old["commit"], BASE)
new = candidates("v1.2.4", "b" * 40, "2" * 64)
require_stable_identity(new["tag"], new["commit"], "refs/tags/v1.2.4")
- for tag, ref in [("v1.2.4", "refs/heads/main"), ("v1.2.4-canary.20260907143420", "refs/tags/v1.2.4-canary.20260907143420")]:
+ for tag, ref in [("v1.2.4", "refs/heads/main"), ("v1.2.4+canary.20260907T143420Z", "refs/tags/v1.2.4+canary.20260907T143420Z")]:
with pytest.raises(ValueError):
require_stable_identity(tag, new["commit"], ref)
transitions = plan_transitions(old, new, BASE)
diff --git a/tests/scripts/test_termux_deb_version.py b/tests/scripts/test_termux_deb_version.py
index 90d394a323d..1d314c1fc88 100644
--- a/tests/scripts/test_termux_deb_version.py
+++ b/tests/scripts/test_termux_deb_version.py
@@ -34,13 +34,7 @@ def test_apt_readers_accept_bom_and_keep_archive_bytes(tmp_path, bom):
("v26.8.31", "26.8.31-1", "stable"),
("v126.8.31", "126.8.31-1", "stable"),
("v1.234.567", "1.234.567-1", "stable"),
- ("v0.20.6-canary.20260831", "0.20.6~canary.20260831-1", "canary"),
- ("v0.20.6-canary.20260831120000", "0.20.6~canary.20260831120000-1", "canary"),
- # The repo's CalVer line: a 4-digit major must pass BOTH the stable and
- # the canary shape (handoff/validate_identity rejected v2026.9.15-canary
- # while the same-minor stable passed — the major cap was canary-only).
- ("v2026.9.14", "2026.9.14-1", "stable"),
- ("v2026.9.15-canary.20260916120000", "2026.9.15~canary.20260916120000-1", "canary"),
+ ("v0.20.6+canary.20260831T120000Z", "0.20.6~canary.20260831T120000Z-1", "canary"),
])
def test_tag_mapping(tag, version, channel):
assert deb_version_for_tag(tag) == version
@@ -52,20 +46,17 @@ def test_canary_shape_matches_the_stable_shape_on_every_component():
# a canary cut over the newest stable must never be rejected when the
# stable tag itself is accepted.
from hermes_cli.update_channel import _CANARY_TAG_RE
- from scripts.releases.semver import is_valid_version
+ from scripts.releases.semver import is_release_version
- assert _CANARY_TAG_RE.fullmatch("v1.9.15-canary.20260916120000")
- assert is_valid_version("1.9.15-canary.20260916120000")
- # A legacy CalVer core is refused as a stable, so its canary is refused too.
- assert not is_valid_version("2026.9.15") and not is_valid_version("2026.9.15-canary.20260916120000")
- # And the malformed-tag negatives stay malformed.
- assert not is_valid_version("1.9.15-canary.2026091612")
- assert not is_valid_version("1.9.15-canary.20260916120000123")
+ assert _CANARY_TAG_RE.fullmatch("v1.9.15+canary.20260916T120000Z")
+ assert is_release_version("1.9.15+canary.20260916T120000Z")
+ assert not is_release_version("2026.9.15+canary.20260916T120000Z")
+ assert not is_release_version("1.9.15-canary.20260916120000")
@pytest.mark.parametrize("tag", [
"", "1.2.3", "v1.2", "v1.2.3.4", "v1.2.3-", "v1.2.3-canary", "v1.2.3-canary.abc",
- "v1.2.3-beta.1", "v1.2.x", "v-1.2.3",
+ "v1.2.3-beta.1", "v1.2.x", "v-1.2.3", "v2026.9.15",
"v1.2.3-canary.202608311", "v1.2.3-canary.12345678", "v1.2.3-canary.202608311200001",
])
def test_malformed_tags_rejected_by_both_mappings(tag):
@@ -77,7 +68,8 @@ def test_malformed_tags_rejected_by_both_mappings(tag):
@pytest.mark.parametrize("args,status,output", [
(["v9.8.7"], 0, "9.8.7-1"),
(["--channel", "v9.8.7"], 0, "stable"),
- (["--channel", "v9.8.7-canary.20260831120000"], 0, "canary"),
+ (["--channel", "v9.8.7+canary.20260831T120000Z"], 0, "canary"),
+
(["v1.2"], 1, ""), (["--channel", "v1.2"], 1, ""),
])
def test_cli_dispatch(args, status, output):
@@ -90,7 +82,7 @@ def test_cli_dispatch(args, status, output):
@pytest.mark.skipif(shutil.which("dpkg") is None, reason="requires native dpkg")
def test_dpkg_orders_canary_and_numeric_versions():
- tags = ["v1.2.3-canary.20260831000000", "v1.2.3-canary.20260831235959", "v1.2.3", "v1.2.10"]
+ tags = ["v1.2.3+canary.20260831T000000Z", "v1.2.3+canary.20260831T235959Z", "v1.2.3", "v1.2.10"]
versions = list(map(deb_version_for_tag, tags))
for earlier, later in zip(versions, versions[1:]):
subprocess.run(["dpkg", "--compare-versions", earlier, "lt", later], check=True)