Skip to content

fix(update): keep release discovery and package size bounds ahead of growth - #562

Open
cunoe wants to merge 5 commits into
mainfrom
fix/update-release-discovery
Open

cunoe wants to merge 5 commits into
mainfrom
fix/update-release-discovery

Conversation

@cunoe

@cunoe cunoe commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The updater (vibeface update check/apply), install.sh and install.ps1 all download every page of GET /repos/leaperone/vibeface/releases?per_page=100 before choosing a version, and each page must fit in 4 MiB. Every product release now attaches about 45 assets, and the listing embeds each asset with its uploader, so a modern product release is about 81 KB of listing JSON.

Measured on 2026-11-13: page 1 is 2.16 MiB (100 releases, 1144 assets). Replaying new product releases on top of it, page 1 passes 4 MiB after about 29–32 more product releases (steady state would be 7.7 MiB per page). From then on every check, apply and install fails with release response exceeds limit on both channels, because the listing is read in full before filtering. At the scheduled Nightly cadence that is days, not months.

Change

Discovery reads tag refs instead of the release listing. Everything after choosing a candidate is unchanged.

  1. GET /git/matching-refs/tags/v returns every product tag in one unpaginated response (106 tags, 49 KB today; nodejs/node returns 975 tags in one response the same way).
  2. Keep the channel's canonical tags newer than the running version (installers: any), in numeric version order.
  3. Fetch GET /releases/tags/{tag} newest first. 404 means a draft or a tag whose release does not exist yet, and is skipped. A response for a different tag fails. Draft or wrong-prerelease releases are skipped, as before.
  4. The existing release.json, tag commit, asset size and digest checks run on that single release object, exactly as they did on the listing entry.
  5. At most 16 candidates are looked up. If none of them is complete, the check fails instead of reporting "no update".

API calls per check stay the same (refs + one release, instead of two listing pages). Downloaded JSON drops from about 2.6 MB to about 130 KB.

Files:

  • apps/cli/src/update/release.rs: check and the pure candidate_tags. get_optional_json reuses the 404-aware download; the manifest keeps its own error context.
  • install.sh: a strict refs mode in json_fields (the value must start with refs/tags/, and the remainder passes the existing character check), tag-only select_release, the per-release lookup, and a shared fetch_optional. The pagination-only releases mode is removed.
  • scripts/install.ps1: the same flow. Select-Release takes tags; Get-OptionalDownload gains a label; Get-OptionalJson is added.
  • packages/docs/releasing.md: the update-channel and first-install sections describe the discovery.

Also in this PR:

  • apps/cli/src/manage.rs (test only): recovery_review_needs_no_replacement_file_and_keeps_selection_explicit, added in feat(cli): add a complete client for Bots and Core operations #556, passes /tmp/original.json to --recovery-file, which must be absolute. That path is not absolute on Windows, so CI / Windows native has been red on main since feat(cli): add a complete client for Bots and Core operations #556. It also skipped windows packaged processes, the only job that runs install.ps1 -SelfTest. Both paths are now built from std::env::temp_dir(), as the neighbouring test does. This also makes the two expected-error assertions fail for the reason they test, not because of the path.
  • Size bounds (scripts/package-npm.mjs, apps/cli/src/update/release.rs, install.sh, scripts/install.ps1). Two sets of bounds are about to be outgrown:
    • The npm package bundles all four platform packages and is checked in collect against a 512 MiB unpacked and 384 MiB packed bound. 0.0.1-nightly.20261112.3 is already 491.6 MB unpacked and 175 MB packed; it was 216 MB on 11-06. When collect fails, publish-product never writes release.json, so no installer or updater sees the release and the Nightly coordinator stops. The bounds are now 2 GiB unpacked and 1 GiB packed, shared by both checks.
    • The updater and both installers refuse platform archives over 128 MiB and over 512 MiB unpacked. The largest archive is 42.9 MiB and grew 1.3–2.7 MiB/day, so it would pass the bound in about 1–2 months. That limit locks itself: an installed updater can never download the release that raises it. The bounds are now 1 GiB packed and 2 GiB unpacked, shipped while nodes can still update.
    • Still open (needs a decision, not in this PR): npm's registry rejects uploads at roughly 200–230 MB according to public reports (no documented limit), and the package is at 175 MB, growing about 15 MB/day. Options are per-platform npm packages, smaller binaries (vibeface-core is 95 MiB, of which 23 MiB is symbol tables), or not gating Nightly completion on npm.
  • install.sh: the unsafe tag-ref test input no longer contains $(...), which shellcheck flagged as SC2016.

Validation

  • cargo fmt --all -- --check, cargo clippy -p vibeface --all-targets --locked -- -D warnings, python3 scripts/ci.py test --tier fast --packages vibeface (113 passed). New unit test: candidate_tags_keep_newer_channel_tags_in_version_order.
  • Live GitHub probe (temporary, not committed) through the real HTTP path:
    • 106 refs parsed; candidates newer than 20261110.4 come out as .3 > .2 > .1.
    • v0.0.1-nightly.20261112.3 resolves to source 8a06a332.
    • .2 (no release.json) is skipped; v0.0.1-nightly.20261031.16 (tag without a release) is a 404 and skipped.
    • check(nightly) from the current build reports no newer release; check(stable) reports no release.
  • bash -n install.sh, bash install.sh --self-test. New cases:
    • tag-ref parsing, including refs/heads/*, a crafted refs/abcdev1.0.0, $(...), .. and nested paths;
    • draft, wrong prerelease flag and missing release are skipped;
    • a lookup that returns another tag fails;
    • the 16-lookup bound on both sides.
      Mutation check: disabling the draft/prerelease check, the bound, the refs/tags/ prefix check or the tag-mismatch check each makes the self-test fail.
  • Live install: install.sh --channel nightly into a temporary root installs 0.0.1-nightly.20261112.3 (8a06a332, x86_64 Linux); --channel stable fails with "no published Stable release".
  • node --check scripts/package-npm.mjs and node scripts/package-npm.mjs --self-test pass with the new bounds.
  • Not run locally: shellcheck, actionlint and the www portal build (tools not installed here), and install.ps1 -SelfTest, which only runs under Windows PowerShell 5.1 in verify-windows-node.py. Remote: CI / Core passed on fbc67da8 (22/22, including shellcheck, actionlint and the installer self-test); CI / Windows native windows rust (cli) passes with the test fix. The packaged processes job, which runs install.ps1 -SelfTest, only runs with a package artifact, so CI / Desktop full-validation is dispatched on the final head. The first round failed on shellcheck SC2016 in the new test (fixed) and on the Windows CLI failure above, which comes from main.

Not in this PR

Other update and release findings from the same investigation (desktop self-update, updater on hosts without a systemd user bus, Nightly coordinator robustness) are reported separately. The arm64 desktop release failure is handled by #561.

The updater downloaded every page of the release listing before choosing a
version. Each product release now attaches about 45 assets, so the first
page already returns 2.2 MiB and would pass the 4 MiB response limit after
about 30 more product releases, failing every check and apply.

List the product tag refs instead (one small response), keep the channel's
tags newer than the running version in numeric order, and fetch only those
releases, newest first. A missing or draft release answers 404 and is
skipped; everything after that keeps the existing verification. Probing is
capped at 16 candidates and reports an error instead of 'no update' when
none of them is complete.
install.sh and install.ps1 read every page of the release listing with the
same 4 MiB page limit as the updater, so they would stop installing at the
same point. Both now list the product tag refs, order the channel's tags by
version and look up those releases one at a time, newest first. A release
that is missing, a draft or carries the wrong prerelease flag is skipped
before its completion manifest is read; a lookup that answers for another
tag fails. At most 16 candidates are looked up.

The self-tests cover tag-ref parsing (including refs outside refs/tags and
unsafe names), the three skip cases, the tag mismatch and the lookup bound
on both sides of 16; the pagination-only cases are removed. The release
notes describe the new discovery.
shellcheck reports SC2016 for the literal $(id) test input. A semicolon is
rejected by the same character check without looking like an expansion.
…ew test

The test added in #556 passes /tmp/original.json to --recovery-file, which
must be absolute. That path is not absolute on Windows, so the first parse
fails there and the Windows CLI scope has been red on main; the two
expected-error assertions also passed on Windows for the wrong reason.
Build both paths from the temp directory, as the neighbouring test does.
Two sets of size bounds are about to be outgrown by the packages they
check.

The npm package bundles all four platform packages and is verified in
collect with a 512 MiB decompression bound and a 384 MiB compressed bound.
0.0.1-nightly.20261112.3 is already 491.6 MB unpacked and 175 MB packed,
after 216 MB on 2026-11-06. Once collect fails on the bound, publish-product
never writes release.json, so no installer or updater sees the release and
the Nightly coordinator stops. Raise the bounds to 2 GiB unpacked and 1 GiB
packed, shared by both checks.

The updater and both installers refuse platform archives over 128 MiB and
packages over 512 MiB unpacked. The largest archive is 42.9 MiB today and
grew 1.3-2.7 MiB a day, so it would pass the bound in one to two months.
That limit locks itself: an installed updater can never download the
release that raises it. Raise it to 1 GiB packed and 2 GiB unpacked now,
while nodes can still take the update.
@cunoe cunoe changed the title fix(update): discover releases through tag refs before the release listing outgrows its limit fix(update): keep release discovery and package size bounds ahead of growth Nov 13, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

本轮不合并。

对照 main @ 64562374:Ready,但 CONFLICTING。冲突落在 apps/cli/src/update/release.rs、install.sh、packages/docs/releasing.md、scripts/install.ps1。#566 小时发布和后续发布路径改动之后,发现逻辑需要按当前 main 重做。

描述里 Core CI 属于 fbc67da8。当前 head 6c15e67e 的 ci-gate、Linux x64 包验收和 Desktop acceptance gate 失败,不能当作已验收。上限放宽是产品取舍,冲突未解前不自动合。清理轮次不代 rebase,也不另开 updater discovery PR。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

本轮不合并。

Ready,但对照 main @ 07191092 为 CONFLICTING。冲突落在 apps/cli/src/update/release.rs、install.sh、scripts/install.ps1 和 packages/docs/releasing.md。描述里的 Core CI 属于旧提交 fbc67da8,当前 head 6c15e67e 的检查不能再当作通过。

发现路径改动仍有价值,但冲突未解前不代 rebase,也不另开 updater listing / install.sh discovery PR。请作者从当前 main 重做并用当前 head 重验收。等下一轮。

View PR

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本轮不合并。

Ready,但对照 main @ 4ee0dcf2 为 CONFLICTING。tag-ref 发现仍未进 main,动机成立,但当前 head 6c15e67e 的检查记录仍指向更早的 fbc67da8。请作者自行 rebase 并复跑 install.sh --self-test、CLI 更新发现测试和 install.ps1 路径。不会另开 updater listing PR,也不会在冲突未解时代 rebase。

Open in Web View Automation 

Sent by Cursor Automation: Vibeface 清理

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant