From 937ac09d78d475cf3c678b640c0305c334f512f1 Mon Sep 17 00:00:00 2001 From: BurntToasters <61037367+BurntToasters@users.noreply.github.com> Date: Sat, 7 Nov 2026 20:44:18 -0800 Subject: [PATCH 1/2] Release: Stop builds from re-dating AppStream metadata and sync platform schemas. Every build ran update-metainfo.js through sync-version, which set the current release entry's date to today. A release machine running on a later day than the release commit left run.rosie.rosi.metainfo.xml modified, so test:all refused the quality-gate proof. Builds now leave an existing entry's date alone; a new version still gets today's date, and --redate changes it on request for release preparation. The Linux and Windows capability schemas missed the permissions for the commands added in this branch, so a Linux build regenerated linux-schema.json and also dirtied the tree. They are byte-identical to the desktop schema again, as they were before. --- scripts/update-metainfo.failure-modes.md | 63 ++++++----- scripts/update-metainfo.js | 23 ++-- src-tauri/gen/schemas/linux-schema.json | 132 ++++++++++++++++++++++ src-tauri/gen/schemas/windows-schema.json | 120 ++++++++++++++++++++ 4 files changed, 301 insertions(+), 37 deletions(-) diff --git a/scripts/update-metainfo.failure-modes.md b/scripts/update-metainfo.failure-modes.md index ae32a49..8080389 100644 --- a/scripts/update-metainfo.failure-modes.md +++ b/scripts/update-metainfo.failure-modes.md @@ -1,31 +1,38 @@ -# AppStream date refresh failure modes +# AppStream release date failure modes -Written before the code (AGENTS.md). Covers the date refresh in -`scripts/update-metainfo.js`: when `package.json` still has the version of an -existing `` entry, the entry's date is set to today (UTC). `npm run -sync-version` runs the script, so `tauri:dev`, `tauri:build`, `npm run u` and -`workspace:bootstrap` all refresh the date. +Written before the code (AGENTS.md). Covers `scripts/update-metainfo.js`, which +`npm run sync-version` runs on every build (`tauri:dev`, `tauri:build`, every +`build:*`, `npm run u`, `workspace:bootstrap`). -1. The entry already has today's date. Rewriting the file anyway changes - nothing but can still touch it. Expected: no write, reports up to date. -2. The entry has an older date. Expected: only that entry's `date` value - changes; every other byte and every other release entry stays the same. -3. The entry carries other attributes (`type`, `urgency`), puts `date` before - `version`, or has child elements (``). Expected: only the - `date` value changes; the attributes, their order and the children stay. +Rule since 5.1.0-beta.1: a build never changes the date of a release entry that +already exists. The date is written once, when the entry for a new +`package.json` version is added, and changed only on request with `--redate` +(release preparation, committed with the release). Before this rule every build +re-dated the current entry to today (UTC), so a release machine running on a +later day than the release commit left `run.rosie.rosi.metainfo.xml` modified +and `test:all` refused the quality-gate proof. + +1. The current version's entry exists, with any date. Expected: a plain run + writes nothing and reports up to date, on any day. This is the build path. +2. `--redate` and the entry has an older date. Expected: only that entry's + `date` value changes to today (UTC); every other byte and every other + release entry stays the same. +3. `--redate` and the entry carries other attributes (`type`, `urgency`), puts + `date` before `version`, or has child elements (``). Expected: + only the `date` value changes; the attributes, their order and the children + stay. 4. Another entry's version starts with the current one (`5.0.2` and `5.0.20`, - or `5.0.2` and `5.0.2-beta.1`). Expected: only the exact version is - re-dated. -5. The entry has no `date`. Expected: today's date is added, as before. -6. A stable version with stale prereleases of the same base version and a - stale date. Expected: one write that removes the prereleases and refreshes - the date. -7. `--check`. Expected: never writes. A date that differs from today is not an - error, otherwise the check fails every day after the release commit. -8. A release VM runs on a later UTC day than the release commit. The refresh - dirties the tree and `test:all` refuses the proof. Accepted: release VMs - must run on the same UTC day as the commit, or the entry must be - recommitted with that day's date. -9. Only the entry for the current `package.json` version is refreshed. Older - entries keep their dates, so a later version bump never re-dates shipped - releases. + or `5.0.2` and `5.0.2-beta.1`). Expected: only the exact version is ever + touched. +5. The entry has no `date`. Expected: today's date is added, since an entry + without a date is invalid AppStream. +6. A stable version with stale prereleases of the same base version. Expected: + one write that removes the prereleases; the stable entry's date changes only + with `--redate`. +7. `--check`. Expected: never writes, and a date that differs from today is not + an error. +8. A release machine runs on a later UTC day than the release commit. Expected: + the build leaves the file unchanged, so `test:all` can record its proof. +9. A new version is not listed yet. Expected: an entry with today's date is + added at the top, and older entries keep their dates, so a version bump + never re-dates shipped releases. diff --git a/scripts/update-metainfo.js b/scripts/update-metainfo.js index 77126d6..b702e90 100644 --- a/scripts/update-metainfo.js +++ b/scripts/update-metainfo.js @@ -48,6 +48,7 @@ function run({ packagePath = pkgPath, metadataPath = xmlPath, check = false, + redate = false, } = {}) { if (!fs.existsSync(packagePath)) { throw new Error(`package.json not found at ${packagePath}`); @@ -101,8 +102,8 @@ function run({ let updatedSection = releasesSectionMatch[0]; if (existingReleaseMatch) { - // The current version's date follows the day the script last ran, so it - // ends up as the release day. Older entries are never re-dated. + // Builds never re-date an existing entry; only --redate does, so a + // release machine on a later day leaves the file unchanged. // See update-metainfo.failure-modes.md. const currentDateMatch = existingReleaseMatch[0].match(/\bdate="([^"]+)"/); if (currentDateMatch) { @@ -115,17 +116,17 @@ function run({ } return { updated: false, version, date: currentDateMatch[1] }; } - const redated = existingReleaseMatch[0].replace( - /\bdate="[^"]+"/, - `date="${dateStr}"`, - ); + const redated = redate + ? existingReleaseMatch[0].replace(/\bdate="[^"]+"/, `date="${dateStr}"`) + : existingReleaseMatch[0]; updatedSection = pruned.replace(existingReleaseMatch[0], redated); + const date = redate ? dateStr : currentDateMatch[1]; if (updatedSection === releasesSectionMatch[0]) { - return { updated: false, version, date: dateStr }; + return { updated: false, version, date }; } const updatedXml = xml.replace(releasesSectionRegex, updatedSection); fs.writeFileSync(metadataPath, updatedXml, "utf8"); - return { updated: true, version, date: dateStr }; + return { updated: true, version, date }; } if (check) { throw new Error( @@ -178,7 +179,11 @@ function isDirectExecution( if (isDirectExecution()) { try { - const result = run({ check: process.argv.slice(2).includes("--check") }); + const args = process.argv.slice(2); + const result = run({ + check: args.includes("--check"), + redate: args.includes("--redate"), + }); if (result.updated) { console.log( `Updated AppStream release to ${result.version} (${result.date})`, diff --git a/src-tauri/gen/schemas/linux-schema.json b/src-tauri/gen/schemas/linux-schema.json index c8e4edf..3d5a157 100644 --- a/src-tauri/gen/schemas/linux-schema.json +++ b/src-tauri/gen/schemas/linux-schema.json @@ -368,6 +368,12 @@ "const": "allow-cancel-queue", "markdownDescription": "Enables the cancel_queue command without any pre-configured scope." }, + { + "description": "Enables the cancel_update_download command without any pre-configured scope.", + "type": "string", + "const": "allow-cancel-update-download", + "markdownDescription": "Enables the cancel_update_download command without any pre-configured scope." + }, { "description": "Enables the cancel_video_info command without any pre-configured scope.", "type": "string", @@ -380,6 +386,12 @@ "const": "allow-check-deno-installed", "markdownDescription": "Enables the check_deno_installed command without any pre-configured scope." }, + { + "description": "Enables the check_for_updates command without any pre-configured scope.", + "type": "string", + "const": "allow-check-for-updates", + "markdownDescription": "Enables the check_for_updates command without any pre-configured scope." + }, { "description": "Enables the clear_download_activity command without any pre-configured scope.", "type": "string", @@ -404,6 +416,12 @@ "const": "allow-detect-gpu", "markdownDescription": "Enables the detect_gpu command without any pre-configured scope." }, + { + "description": "Enables the download_update command without any pre-configured scope.", + "type": "string", + "const": "allow-download-update", + "markdownDescription": "Enables the download_update command without any pre-configured scope." + }, { "description": "Enables the download_video command without any pre-configured scope.", "type": "string", @@ -416,12 +434,24 @@ "const": "allow-e2e-cancel-close-request", "markdownDescription": "Enables the e2e_cancel_close_request command without any pre-configured scope." }, + { + "description": "Enables the e2e_configure_updater command without any pre-configured scope.", + "type": "string", + "const": "allow-e2e-configure-updater", + "markdownDescription": "Enables the e2e_configure_updater command without any pre-configured scope." + }, { "description": "Enables the e2e_emit_stale_download_events command without any pre-configured scope.", "type": "string", "const": "allow-e2e-emit-stale-download-events", "markdownDescription": "Enables the e2e_emit_stale_download_events command without any pre-configured scope." }, + { + "description": "Enables the e2e_native_notices command without any pre-configured scope.", + "type": "string", + "const": "allow-e2e-native-notices", + "markdownDescription": "Enables the e2e_native_notices command without any pre-configured scope." + }, { "description": "Enables the e2e_network_pipelining_probe command without any pre-configured scope.", "type": "string", @@ -434,12 +464,24 @@ "const": "allow-e2e-updater-install-probe", "markdownDescription": "Enables the e2e_updater_install_probe command without any pre-configured scope." }, + { + "description": "Enables the e2e_updater_probe command without any pre-configured scope.", + "type": "string", + "const": "allow-e2e-updater-probe", + "markdownDescription": "Enables the e2e_updater_probe command without any pre-configured scope." + }, { "description": "Enables the export_settings command without any pre-configured scope.", "type": "string", "const": "allow-export-settings", "markdownDescription": "Enables the export_settings command without any pre-configured scope." }, + { + "description": "Enables the extract_queue_urls command without any pre-configured scope.", + "type": "string", + "const": "allow-extract-queue-urls", + "markdownDescription": "Enables the extract_queue_urls command without any pre-configured scope." + }, { "description": "Enables the get_app_platform command without any pre-configured scope.", "type": "string", @@ -518,6 +560,12 @@ "const": "allow-install-deno", "markdownDescription": "Enables the install_deno command without any pre-configured scope." }, + { + "description": "Enables the install_update command without any pre-configured scope.", + "type": "string", + "const": "allow-install-update", + "markdownDescription": "Enables the install_update command without any pre-configured scope." + }, { "description": "Enables the is_flatpak command without any pre-configured scope.", "type": "string", @@ -584,6 +632,18 @@ "const": "allow-reset-stats", "markdownDescription": "Enables the reset_stats command without any pre-configured scope." }, + { + "description": "Enables the resolve_download_options command without any pre-configured scope.", + "type": "string", + "const": "allow-resolve-download-options", + "markdownDescription": "Enables the resolve_download_options command without any pre-configured scope." + }, + { + "description": "Enables the resolve_preset_options command without any pre-configured scope.", + "type": "string", + "const": "allow-resolve-preset-options", + "markdownDescription": "Enables the resolve_preset_options command without any pre-configured scope." + }, { "description": "Enables the restart_app command without any pre-configured scope.", "type": "string", @@ -608,6 +668,12 @@ "const": "allow-select-download-location", "markdownDescription": "Enables the select_download_location command without any pre-configured scope." }, + { + "description": "Enables the set_update_channel command without any pre-configured scope.", + "type": "string", + "const": "allow-set-update-channel", + "markdownDescription": "Enables the set_update_channel command without any pre-configured scope." + }, { "description": "Enables the show_notification command without any pre-configured scope.", "type": "string", @@ -644,6 +710,12 @@ "const": "deny-cancel-queue", "markdownDescription": "Denies the cancel_queue command without any pre-configured scope." }, + { + "description": "Denies the cancel_update_download command without any pre-configured scope.", + "type": "string", + "const": "deny-cancel-update-download", + "markdownDescription": "Denies the cancel_update_download command without any pre-configured scope." + }, { "description": "Denies the cancel_video_info command without any pre-configured scope.", "type": "string", @@ -656,6 +728,12 @@ "const": "deny-check-deno-installed", "markdownDescription": "Denies the check_deno_installed command without any pre-configured scope." }, + { + "description": "Denies the check_for_updates command without any pre-configured scope.", + "type": "string", + "const": "deny-check-for-updates", + "markdownDescription": "Denies the check_for_updates command without any pre-configured scope." + }, { "description": "Denies the clear_download_activity command without any pre-configured scope.", "type": "string", @@ -680,6 +758,12 @@ "const": "deny-detect-gpu", "markdownDescription": "Denies the detect_gpu command without any pre-configured scope." }, + { + "description": "Denies the download_update command without any pre-configured scope.", + "type": "string", + "const": "deny-download-update", + "markdownDescription": "Denies the download_update command without any pre-configured scope." + }, { "description": "Denies the download_video command without any pre-configured scope.", "type": "string", @@ -692,12 +776,24 @@ "const": "deny-e2e-cancel-close-request", "markdownDescription": "Denies the e2e_cancel_close_request command without any pre-configured scope." }, + { + "description": "Denies the e2e_configure_updater command without any pre-configured scope.", + "type": "string", + "const": "deny-e2e-configure-updater", + "markdownDescription": "Denies the e2e_configure_updater command without any pre-configured scope." + }, { "description": "Denies the e2e_emit_stale_download_events command without any pre-configured scope.", "type": "string", "const": "deny-e2e-emit-stale-download-events", "markdownDescription": "Denies the e2e_emit_stale_download_events command without any pre-configured scope." }, + { + "description": "Denies the e2e_native_notices command without any pre-configured scope.", + "type": "string", + "const": "deny-e2e-native-notices", + "markdownDescription": "Denies the e2e_native_notices command without any pre-configured scope." + }, { "description": "Denies the e2e_network_pipelining_probe command without any pre-configured scope.", "type": "string", @@ -710,12 +806,24 @@ "const": "deny-e2e-updater-install-probe", "markdownDescription": "Denies the e2e_updater_install_probe command without any pre-configured scope." }, + { + "description": "Denies the e2e_updater_probe command without any pre-configured scope.", + "type": "string", + "const": "deny-e2e-updater-probe", + "markdownDescription": "Denies the e2e_updater_probe command without any pre-configured scope." + }, { "description": "Denies the export_settings command without any pre-configured scope.", "type": "string", "const": "deny-export-settings", "markdownDescription": "Denies the export_settings command without any pre-configured scope." }, + { + "description": "Denies the extract_queue_urls command without any pre-configured scope.", + "type": "string", + "const": "deny-extract-queue-urls", + "markdownDescription": "Denies the extract_queue_urls command without any pre-configured scope." + }, { "description": "Denies the get_app_platform command without any pre-configured scope.", "type": "string", @@ -794,6 +902,12 @@ "const": "deny-install-deno", "markdownDescription": "Denies the install_deno command without any pre-configured scope." }, + { + "description": "Denies the install_update command without any pre-configured scope.", + "type": "string", + "const": "deny-install-update", + "markdownDescription": "Denies the install_update command without any pre-configured scope." + }, { "description": "Denies the is_flatpak command without any pre-configured scope.", "type": "string", @@ -860,6 +974,18 @@ "const": "deny-reset-stats", "markdownDescription": "Denies the reset_stats command without any pre-configured scope." }, + { + "description": "Denies the resolve_download_options command without any pre-configured scope.", + "type": "string", + "const": "deny-resolve-download-options", + "markdownDescription": "Denies the resolve_download_options command without any pre-configured scope." + }, + { + "description": "Denies the resolve_preset_options command without any pre-configured scope.", + "type": "string", + "const": "deny-resolve-preset-options", + "markdownDescription": "Denies the resolve_preset_options command without any pre-configured scope." + }, { "description": "Denies the restart_app command without any pre-configured scope.", "type": "string", @@ -884,6 +1010,12 @@ "const": "deny-select-download-location", "markdownDescription": "Denies the select_download_location command without any pre-configured scope." }, + { + "description": "Denies the set_update_channel command without any pre-configured scope.", + "type": "string", + "const": "deny-set-update-channel", + "markdownDescription": "Denies the set_update_channel command without any pre-configured scope." + }, { "description": "Denies the show_notification command without any pre-configured scope.", "type": "string", diff --git a/src-tauri/gen/schemas/windows-schema.json b/src-tauri/gen/schemas/windows-schema.json index 3f16208..3d5a157 100644 --- a/src-tauri/gen/schemas/windows-schema.json +++ b/src-tauri/gen/schemas/windows-schema.json @@ -368,6 +368,12 @@ "const": "allow-cancel-queue", "markdownDescription": "Enables the cancel_queue command without any pre-configured scope." }, + { + "description": "Enables the cancel_update_download command without any pre-configured scope.", + "type": "string", + "const": "allow-cancel-update-download", + "markdownDescription": "Enables the cancel_update_download command without any pre-configured scope." + }, { "description": "Enables the cancel_video_info command without any pre-configured scope.", "type": "string", @@ -380,6 +386,12 @@ "const": "allow-check-deno-installed", "markdownDescription": "Enables the check_deno_installed command without any pre-configured scope." }, + { + "description": "Enables the check_for_updates command without any pre-configured scope.", + "type": "string", + "const": "allow-check-for-updates", + "markdownDescription": "Enables the check_for_updates command without any pre-configured scope." + }, { "description": "Enables the clear_download_activity command without any pre-configured scope.", "type": "string", @@ -404,6 +416,12 @@ "const": "allow-detect-gpu", "markdownDescription": "Enables the detect_gpu command without any pre-configured scope." }, + { + "description": "Enables the download_update command without any pre-configured scope.", + "type": "string", + "const": "allow-download-update", + "markdownDescription": "Enables the download_update command without any pre-configured scope." + }, { "description": "Enables the download_video command without any pre-configured scope.", "type": "string", @@ -416,12 +434,24 @@ "const": "allow-e2e-cancel-close-request", "markdownDescription": "Enables the e2e_cancel_close_request command without any pre-configured scope." }, + { + "description": "Enables the e2e_configure_updater command without any pre-configured scope.", + "type": "string", + "const": "allow-e2e-configure-updater", + "markdownDescription": "Enables the e2e_configure_updater command without any pre-configured scope." + }, { "description": "Enables the e2e_emit_stale_download_events command without any pre-configured scope.", "type": "string", "const": "allow-e2e-emit-stale-download-events", "markdownDescription": "Enables the e2e_emit_stale_download_events command without any pre-configured scope." }, + { + "description": "Enables the e2e_native_notices command without any pre-configured scope.", + "type": "string", + "const": "allow-e2e-native-notices", + "markdownDescription": "Enables the e2e_native_notices command without any pre-configured scope." + }, { "description": "Enables the e2e_network_pipelining_probe command without any pre-configured scope.", "type": "string", @@ -434,12 +464,24 @@ "const": "allow-e2e-updater-install-probe", "markdownDescription": "Enables the e2e_updater_install_probe command without any pre-configured scope." }, + { + "description": "Enables the e2e_updater_probe command without any pre-configured scope.", + "type": "string", + "const": "allow-e2e-updater-probe", + "markdownDescription": "Enables the e2e_updater_probe command without any pre-configured scope." + }, { "description": "Enables the export_settings command without any pre-configured scope.", "type": "string", "const": "allow-export-settings", "markdownDescription": "Enables the export_settings command without any pre-configured scope." }, + { + "description": "Enables the extract_queue_urls command without any pre-configured scope.", + "type": "string", + "const": "allow-extract-queue-urls", + "markdownDescription": "Enables the extract_queue_urls command without any pre-configured scope." + }, { "description": "Enables the get_app_platform command without any pre-configured scope.", "type": "string", @@ -518,6 +560,12 @@ "const": "allow-install-deno", "markdownDescription": "Enables the install_deno command without any pre-configured scope." }, + { + "description": "Enables the install_update command without any pre-configured scope.", + "type": "string", + "const": "allow-install-update", + "markdownDescription": "Enables the install_update command without any pre-configured scope." + }, { "description": "Enables the is_flatpak command without any pre-configured scope.", "type": "string", @@ -590,6 +638,12 @@ "const": "allow-resolve-download-options", "markdownDescription": "Enables the resolve_download_options command without any pre-configured scope." }, + { + "description": "Enables the resolve_preset_options command without any pre-configured scope.", + "type": "string", + "const": "allow-resolve-preset-options", + "markdownDescription": "Enables the resolve_preset_options command without any pre-configured scope." + }, { "description": "Enables the restart_app command without any pre-configured scope.", "type": "string", @@ -614,6 +668,12 @@ "const": "allow-select-download-location", "markdownDescription": "Enables the select_download_location command without any pre-configured scope." }, + { + "description": "Enables the set_update_channel command without any pre-configured scope.", + "type": "string", + "const": "allow-set-update-channel", + "markdownDescription": "Enables the set_update_channel command without any pre-configured scope." + }, { "description": "Enables the show_notification command without any pre-configured scope.", "type": "string", @@ -650,6 +710,12 @@ "const": "deny-cancel-queue", "markdownDescription": "Denies the cancel_queue command without any pre-configured scope." }, + { + "description": "Denies the cancel_update_download command without any pre-configured scope.", + "type": "string", + "const": "deny-cancel-update-download", + "markdownDescription": "Denies the cancel_update_download command without any pre-configured scope." + }, { "description": "Denies the cancel_video_info command without any pre-configured scope.", "type": "string", @@ -662,6 +728,12 @@ "const": "deny-check-deno-installed", "markdownDescription": "Denies the check_deno_installed command without any pre-configured scope." }, + { + "description": "Denies the check_for_updates command without any pre-configured scope.", + "type": "string", + "const": "deny-check-for-updates", + "markdownDescription": "Denies the check_for_updates command without any pre-configured scope." + }, { "description": "Denies the clear_download_activity command without any pre-configured scope.", "type": "string", @@ -686,6 +758,12 @@ "const": "deny-detect-gpu", "markdownDescription": "Denies the detect_gpu command without any pre-configured scope." }, + { + "description": "Denies the download_update command without any pre-configured scope.", + "type": "string", + "const": "deny-download-update", + "markdownDescription": "Denies the download_update command without any pre-configured scope." + }, { "description": "Denies the download_video command without any pre-configured scope.", "type": "string", @@ -698,12 +776,24 @@ "const": "deny-e2e-cancel-close-request", "markdownDescription": "Denies the e2e_cancel_close_request command without any pre-configured scope." }, + { + "description": "Denies the e2e_configure_updater command without any pre-configured scope.", + "type": "string", + "const": "deny-e2e-configure-updater", + "markdownDescription": "Denies the e2e_configure_updater command without any pre-configured scope." + }, { "description": "Denies the e2e_emit_stale_download_events command without any pre-configured scope.", "type": "string", "const": "deny-e2e-emit-stale-download-events", "markdownDescription": "Denies the e2e_emit_stale_download_events command without any pre-configured scope." }, + { + "description": "Denies the e2e_native_notices command without any pre-configured scope.", + "type": "string", + "const": "deny-e2e-native-notices", + "markdownDescription": "Denies the e2e_native_notices command without any pre-configured scope." + }, { "description": "Denies the e2e_network_pipelining_probe command without any pre-configured scope.", "type": "string", @@ -716,12 +806,24 @@ "const": "deny-e2e-updater-install-probe", "markdownDescription": "Denies the e2e_updater_install_probe command without any pre-configured scope." }, + { + "description": "Denies the e2e_updater_probe command without any pre-configured scope.", + "type": "string", + "const": "deny-e2e-updater-probe", + "markdownDescription": "Denies the e2e_updater_probe command without any pre-configured scope." + }, { "description": "Denies the export_settings command without any pre-configured scope.", "type": "string", "const": "deny-export-settings", "markdownDescription": "Denies the export_settings command without any pre-configured scope." }, + { + "description": "Denies the extract_queue_urls command without any pre-configured scope.", + "type": "string", + "const": "deny-extract-queue-urls", + "markdownDescription": "Denies the extract_queue_urls command without any pre-configured scope." + }, { "description": "Denies the get_app_platform command without any pre-configured scope.", "type": "string", @@ -800,6 +902,12 @@ "const": "deny-install-deno", "markdownDescription": "Denies the install_deno command without any pre-configured scope." }, + { + "description": "Denies the install_update command without any pre-configured scope.", + "type": "string", + "const": "deny-install-update", + "markdownDescription": "Denies the install_update command without any pre-configured scope." + }, { "description": "Denies the is_flatpak command without any pre-configured scope.", "type": "string", @@ -872,6 +980,12 @@ "const": "deny-resolve-download-options", "markdownDescription": "Denies the resolve_download_options command without any pre-configured scope." }, + { + "description": "Denies the resolve_preset_options command without any pre-configured scope.", + "type": "string", + "const": "deny-resolve-preset-options", + "markdownDescription": "Denies the resolve_preset_options command without any pre-configured scope." + }, { "description": "Denies the restart_app command without any pre-configured scope.", "type": "string", @@ -896,6 +1010,12 @@ "const": "deny-select-download-location", "markdownDescription": "Denies the select_download_location command without any pre-configured scope." }, + { + "description": "Denies the set_update_channel command without any pre-configured scope.", + "type": "string", + "const": "deny-set-update-channel", + "markdownDescription": "Denies the set_update_channel command without any pre-configured scope." + }, { "description": "Denies the show_notification command without any pre-configured scope.", "type": "string", From 3ee586f2c94d774697ce403cfd8609a8954c843d Mon Sep 17 00:00:00 2001 From: BurntToasters <61037367+BurntToasters@users.noreply.github.com> Date: Sat, 7 Nov 2026 20:47:11 -0800 Subject: [PATCH 2/2] update yt-dlp --- assets/YT-DLP-NOTICES.txt | 6 +-- ...t-dlp-2026.10.26-THIRD_PARTY_LICENSES.txt} | 0 assets/ytdlp-checksums.json | 18 ++++---- build-setup.md | 6 ++- package.json | 1 + scripts/fetch-ytdlp.cjs | 43 ++++++++++++++++--- src-tauri/tauri.conf.json | 2 +- 7 files changed, 55 insertions(+), 21 deletions(-) rename assets/{yt-dlp-2026.10.21-THIRD_PARTY_LICENSES.txt => yt-dlp-2026.10.26-THIRD_PARTY_LICENSES.txt} (100%) diff --git a/assets/YT-DLP-NOTICES.txt b/assets/YT-DLP-NOTICES.txt index b05198d..118fe9c 100644 --- a/assets/YT-DLP-NOTICES.txt +++ b/assets/YT-DLP-NOTICES.txt @@ -30,9 +30,9 @@ obligation: The authoritative, version-specific list of bundled components and their licenses is published by the yt-dlp project at: - https://github.com/yt-dlp/yt-dlp/blob/2026.10.21/THIRD_PARTY_LICENSES.txt -The exact notice for the bundled 2026.10.21 binaries is included at - assets/yt-dlp-2026.10.21-THIRD_PARTY_LICENSES.txt + https://github.com/yt-dlp/yt-dlp/blob/2026.10.26/THIRD_PARTY_LICENSES.txt +The exact notice for the bundled 2026.10.26 binaries is included at + assets/yt-dlp-2026.10.26-THIRD_PARTY_LICENSES.txt and copied into the app's bundled licenses view and resource directory. Written Source Offer (GPLv2 Section 3(b)) diff --git a/assets/yt-dlp-2026.10.21-THIRD_PARTY_LICENSES.txt b/assets/yt-dlp-2026.10.26-THIRD_PARTY_LICENSES.txt similarity index 100% rename from assets/yt-dlp-2026.10.21-THIRD_PARTY_LICENSES.txt rename to assets/yt-dlp-2026.10.26-THIRD_PARTY_LICENSES.txt diff --git a/assets/ytdlp-checksums.json b/assets/ytdlp-checksums.json index 32c9126..6313d8c 100644 --- a/assets/ytdlp-checksums.json +++ b/assets/ytdlp-checksums.json @@ -1,16 +1,16 @@ { - "_comment": "Pinned yt-dlp release. Hashes are copied from the GPG-verified upstream SHA2-256SUMS; scripts/fetch-ytdlp.cjs refuses any download that disagrees. Bump with: node scripts/fetch-ytdlp.cjs --update ", - "version": "2026.10.21", - "source": "https://github.com/yt-dlp/yt-dlp/releases/tag/2026.10.21", + "_comment": "Pinned yt-dlp release. Hashes are copied from the GPG-verified upstream SHA2-256SUMS; scripts/fetch-ytdlp.cjs refuses any download that disagrees. Bump with: npm run ytdlp:update or node scripts/fetch-ytdlp.cjs --update ", + "version": "2026.10.26", + "source": "https://github.com/yt-dlp/yt-dlp/releases/tag/2026.10.26", "files": { - "yt-dlp.exe": "33121d192d706e62f684a06f80918e3f3a8ba52ac3a65213b6951c39c7d9f555", - "yt-dlp_arm64.exe": "1380a9f105302764e6a5d383c2f07238ae242f0f4fbf3414aea00e56619a79b3", - "yt-dlp_macos": "7a6fe71d7d680f1fb0ac18d4949873d77db2859e90017c0f44bd94b23be4ee40", - "yt-dlp_linux": "d8bd33fca9d5b23bd5b9952b3fca36db5c46331933fda9f598a3da14ce2c243f", - "yt-dlp_linux_aarch64": "e137c2171b0b8ef648e6136e86aa70c65923e93e434f01c93901d64744b190aa" + "yt-dlp.exe": "f5389d3698ecde4ef06f4e6b1ce0294fe9ac1396228c8990b8d3416d6d177a7d", + "yt-dlp_arm64.exe": "0066dbac3c124028e2dcae2a197fccee33cd91f456313d24f7af89fd54590e98", + "yt-dlp_macos": "0f922c15ccc0b83eefa1c8bc9104e434318c4bf16e408e1ee93b7745a6efe0aa", + "yt-dlp_linux": "767ba9dce7052aa196f8b12652f433d76de128ba168966fa84b6394d5e6c6795", + "yt-dlp_linux_aarch64": "e87e9533e89fe5889abaa21f5114dfe7756d6aa6219b83551add04d48b18e483" }, "license": { - "file": "yt-dlp-2026.10.21-THIRD_PARTY_LICENSES.txt", + "file": "yt-dlp-2026.10.26-THIRD_PARTY_LICENSES.txt", "sha256": "472aefe951c7db35e1657c1d13fd337140511ed6f2b329205105ad441c5a02b7" } } diff --git a/build-setup.md b/build-setup.md index a4f2c3e..f2a5b03 100644 --- a/build-setup.md +++ b/build-setup.md @@ -110,8 +110,10 @@ the bundled license file, the Tauri resource path, and the notices. A yt-dlp bump needs a patch release because the binaries ship inside the installers. Target turnaround: merge the watch PR and ship the patch release -within five business days of it opening. Manual bump: run the `--update` command -above, then `npm run ytdlp:fetch:all` and `npm run ytdlp:check`. +within five business days of it opening. To bump manually to the latest +release, run `npm run ytdlp:update`; for a specific tag, run +`node scripts/fetch-ytdlp.cjs --update `, then +`npm run ytdlp:fetch:all` and `npm run ytdlp:check`. `scripts/copy-bundled-licenses.js` reads the yt-dlp version and license file from `assets/ytdlp-checksums.json`, so a bump needs no script edit. diff --git a/package.json b/package.json index 4ad1914..d231f4a 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "ytdlp:check": "node scripts/check-ytdlp.cjs", "ytdlp:fetch": "node scripts/fetch-ytdlp.cjs --missing-only", "ytdlp:fetch:all": "node scripts/fetch-ytdlp.cjs --all --missing-only", + "ytdlp:update": "node scripts/fetch-ytdlp.cjs --update latest && npm run ytdlp:fetch:all && npm run ytdlp:check", "get:ffmpeg": "dotenv -e .env -- node scripts/get-ffmpeg.cjs", "get:ffmpeg:all": "dotenv -e .env -- node scripts/get-ffmpeg.cjs --all && node scripts/check-ffmpeg.cjs --all --generate-checksums", "ffmpeg:ensure": "dotenv -e .env -- node scripts/get-ffmpeg.cjs --missing-only", diff --git a/scripts/fetch-ytdlp.cjs b/scripts/fetch-ytdlp.cjs index 1300ba5..72842c7 100644 --- a/scripts/fetch-ytdlp.cjs +++ b/scripts/fetch-ytdlp.cjs @@ -16,8 +16,9 @@ * node scripts/fetch-ytdlp.cjs --missing-only skip files already valid * node scripts/fetch-ytdlp.cjs --all every tracked binary * node scripts/fetch-ytdlp.cjs --target explicit Rust triple(s) - * node scripts/fetch-ytdlp.cjs --update bump the manifest from - * the signed upstream sums and fetch the matching license file + * node scripts/fetch-ytdlp.cjs --update + * bump the manifest from the signed upstream sums and fetch the matching + * license file; `latest` is GitHub's newest release (npm run ytdlp:update) * node scripts/fetch-ytdlp.cjs --allow-unsigned-sums * Only when gpg is unavailable outside CI. Refused when CI or * ROSI_RELEASE is set, and refused with --update. @@ -427,9 +428,9 @@ function parseArgs(argv, env = process.env) { index += 1; } else if (arg === "--update") { const value = argv[index + 1]; - if (!value || !VERSION_PATTERN.test(value)) { + if (!value || (value !== "latest" && !VERSION_PATTERN.test(value))) { fail( - "--update requires a yt-dlp version such as 2026.08.19 (invalid version)", + "--update requires a yt-dlp version such as 2026.08.19 or 'latest'", ); } options.update = value; @@ -468,6 +469,32 @@ function releaseBase(version) { return `https://github.com/${REPO}/releases/download/${version}/`; } +/** Resolves GitHub's latest non-prerelease release to its validated tag. */ +async function resolveLatestVersion() { + const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "ytdlp-latest-")); + const releasePath = path.join(tempDir, "latest-release.json"); + try { + await downloadFile( + `https://api.github.com/repos/${REPO}/releases/latest`, + releasePath, + ); + let release; + try { + release = JSON.parse(fs.readFileSync(releasePath, "utf8")); + } catch { + fail("GitHub returned invalid JSON for the latest yt-dlp release"); + } + const version = release?.tag_name; + if (typeof version !== "string" || !VERSION_PATTERN.test(version)) { + fail(`Unexpected latest yt-dlp release tag: ${String(version)}`); + } + log(`Latest yt-dlp GitHub release: ${version}`); + return version; + } finally { + fs.rmSync(tempDir, { recursive: true, force: true }); + } +} + function localMatches(name, manifest) { const file = path.join(ASSETS_DIR, name); return fs.existsSync(file) && sha256File(file) === manifest.files[name]; @@ -612,7 +639,7 @@ async function updateManifest(version) { _comment: "Pinned yt-dlp release. Hashes are copied from the GPG-verified upstream " + "SHA2-256SUMS; scripts/fetch-ytdlp.cjs refuses any download that disagrees. " + - "Bump with: node scripts/fetch-ytdlp.cjs --update ", + "Bump with: npm run ytdlp:update or node scripts/fetch-ytdlp.cjs --update ", version, source: `https://github.com/${REPO}/releases/tag/${version}`, files, @@ -653,7 +680,11 @@ function replaceOnce(filePath, from, to) { async function main(argv) { const options = parseArgs(argv); if (options.update) { - await updateManifest(options.update); + const version = + options.update === "latest" + ? await resolveLatestVersion() + : options.update; + await updateManifest(version); return; } await fetchBinaries(options); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 1d619b0..b61a9e8 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -65,7 +65,7 @@ ], "resources": { "../assets/YT-DLP-NOTICES.txt": "yt-dlp/YT-DLP-NOTICES.txt", - "../assets/yt-dlp-2026.10.21-THIRD_PARTY_LICENSES.txt": "yt-dlp/THIRD_PARTY_LICENSES.txt", + "../assets/yt-dlp-2026.10.26-THIRD_PARTY_LICENSES.txt": "yt-dlp/THIRD_PARTY_LICENSES.txt", "../resources/ffmpeg/NOTICE.txt": "ffmpeg/NOTICE.txt", "../resources/ffmpeg/ffmpeg_license.txt": "ffmpeg/LICENSE.txt", "../resources/ffmpeg/SOURCE_OFFER.txt": "ffmpeg/SOURCE_OFFER.txt"