development.md now points to ARTCRAFT_CATALOG_DIR and releasing.md for building without network access.
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* feat: discover developer builds from the signed catalog first
* test: exercise catalog discovery and bounded fallback end to end
* fix: use actual reconciliation time and preserve unstarted nightly checks
* fix(nightly): retain failed catalog attempts when fallback is held
- cargo fmt, and clippy::question_mark in feed.rs (the CI gate failed on both).
- screenshots: a picture-specific answer from the GitHub fallback is kept instead of the primary network failure, so one unpublished picture no longer skips the rest; the web build now tries the fallback too.
- build.rs: track ARTCRAFT_CATALOG_DIR's contents with rerun-if-changed.
- package.ps1: reuse the build-verified catalog and icons from artcraft-catalog-cache (works offline), read apps independent of key order and indentation, check each icon's SHA-256, and stop overwriting $line, which New-InstallerArt later uses as a pen colour. Drop the BOM the PR added.
Fedora Atomic desktops (Silverblue, Bazzite) link /home to var/home, and the
Nightly storage checks refuse any alias on the path from /, so Developer build
storage was always unavailable there. Resolve aliases only in the OS-owned
per-user folders; the launcher's own folders are still checked strictly.
* Keep a Windows RC's release identity, and keep Open when a chosen version won't install
Windows Installer keeps only the numbers of a version, so PhotoCraft
v0.24.0-rc.1 read back as 0.24.0. Choosing the release candidate again
counted as going back, with nothing published to put back, and going back
to the latest release was refused as installed version is newer.
After an MSI install the launcher now records the release it installed,
tied to that registration's product code, and detection uses it only for
that registration with the same numbers. The version dialog's Install asks
to go back by name (InstallChosen), so the latest-release track can go back
and keeps following releases. A copy registered as numbers only with no
release of its own can go back to the newest stable release once the person
agrees that a failure reinstalls the published pre-release with those
numbers. A chosen version that isn't installed keeps Open on the card, with
the install beside it, greyed out with the reason when it would be refused.
Fixes#1617Fixes#1616
* Address review of going back by name
- Refuse a release picked by name on a repository-managed Flatpak before
its repository update runs.
- Before asking about the pre-release fallback, check it has a package of
the same kind to put back.
- Never offer the pre-release fallback for a copy whose release the
launcher recorded.
- After a failed downgrade, record the put-back release without touching
the app's other install record.
- Resume a paused by-name install with the same request.
- The version dialog installs the latest release its list names, and
waits while the check still has an older one on screen.
- Grey out going back for Debian, RPM and pacman copies, which the
backend never does.
- Count InstallChosen in the refused-install test.
* Keep the chosen request through a killed connection; record a put-back from the installer
A connection-caused pause is a pause, not a failure. protocol::is_paused recognises every
pause outcome, the backend reports the connection one as PAUSED_BY_CONNECTION, and the UI
keeps the InstallChosen it sent (release and agreed fallback) so Resume replays it; the
descriptive message is still shown.
After a failed Windows Installer downgrade, the release is recorded only when the install
reports it put the previous package back, with the product code of the registration that
put-back created, read from the installer's own log for the package it ran. The registry is
no longer compared to guess which registration the restore made.
The fallback decision reads a recorded release only where detection reads it: the same
registration and the same major.minor.patch numbers (detect::record_describes).
* Take the put-back's registration from the registrations a downgrade leaves behind
Before an MSI downgrade starts, snapshot the app's Windows Installer product codes; when the
downgrade reports that it put the previous package back, the restore is the single code that
is new afterwards and carries the previous release's numbers
(msi_downgrade::put_back_registration). A registration that was already on the machine can
never be taken for it, two new codes or none record nothing, and the log parsing that never
matched msiexec's UTF-16 logs is gone.
Say at the recorded-copy check why record_describes may answer no for a release candidate the
launcher recorded, and why that is harmless.
* Say where the put-back registration comes from
* Record a same-code restore after a complete removal
Reinstalling the very same package brings back the product code it already
had, so requiring a registration that is new since the snapshot left an
unrecorded release unrecorded even though the launcher had just put its
checked package back.
A failed downgrade now says which put-back happened: none, one after the
installed copy was removed in full, or one after a removal that stopped with
part of the app already gone. After a complete removal the restore is the one
registration carrying the previous release's numbers, whether or not its code
was listed before; after a partial removal that code must still be new, so a
leftover is never taken for the restore. Either way exactly one candidate is
required, and several record nothing.
Tests cover the same-code restore, the leftover after a partial removal, two
candidates on both paths, and the outcomes each route reports.
* Say what the removal step actually covers
An all-users downgrade removes the machine-wide records and leaves the
account's own per-user record out, so "removed in full" claimed more than the
step does. Say instead that every registration the removal step covers was
removed, and test that a record it never covered can sit beside the restore
without becoming a second candidate.
* Remove a registration only from the listing the downgrade snapshotted
The snapshot a put-back is judged against and the set the removal step
removes were two separate registry listings taken apart, so a registration
that appeared in between could be removed while the snapshot never knew of it
and later be taken for the restore after a partial removal. List once, then
use that same listing as both the snapshot and what the removal step works
on: the account's own rows are still left out of an elevated removal, and
codes the snapshot already held are still excluded from being the restore.
Also make the case-insensitivity test use a product code that has letters, so
lowercasing it in the snapshot actually proves the comparison.
* Record nothing after a removal that stopped partway
A partial removal leaves registrations behind that cannot be told apart from
the restore: one that appeared since the snapshot can carry the previous
release's numbers just as the restore does, even when the put-back reused a
product code the app already had. Only a put-back after a completed removal
is recorded now — the single registration carrying the previous release's
numbers — so partial and ambiguous removals stay conservative, as the refusal
and package rules already are. The new-code rule and the cases that only it
covered go with it.
* Say when the put-back registration is worked out
* WIP: generalise the Nightly capability table and roster (does not compile yet)
* nightly: copy the whole app registry table and write the adapter Debug by hand
CAPABILITIES now holds every target in craft-common-actions nightly-apps.json
(commit 2b4eb3d9), checked in unchanged as crates/native/tests/fixtures/
nightly-apps.json: three rows for each of the 15 apps, so Windows, Linux and
macOS are each named for the app they belong to. PhotoCraft's three rows are
unchanged. It stays a hand-reviewed source table, never a build input: a
registry change fails the fixture test in review instead of admitting a
download by itself.
What the rows add beyond the registry, reviewed with launcher-nightly-platforms:
a Linux row starts <app>-bin from its <app> launcher script and carries
<app>-nightly.png (PhotoCraft starts its GUI directly and has no extra
program); a macOS row is "<Display> Nightly.app" with the ai.storyteller.<app>
.nightly identifier, <app>-nightly.icns and the <Display> executable; a Windows
row is the flat portable ZIP with its own <app>.exe.
Debug is written by hand as <Display><Os>V1 because nightly_lookup puts
{adapter:?} into the scheduling key it persists: a derived Debug would rename
PhotoCraftWindowsV1, PhotoCraftLinuxV1 and PhotoCraftMacV1, and every existing
user's saved Nightly scheduling state would be dropped by an upgrade.
Tests: the table equals the checked-in registry target for target, including
each row's badge and macOS bundle; PhotoCraft's three Debug names are pinned
and all 45 are unique; CADCraft is admitted and launched with its own profile
root, and refused with another app's asset name, package identity, profile,
version, associations or format.
* nightly: pin the persisted scheduling key of every known app and platform
The Nightly scheduling state is saved under nightly_lookup::key, which ends in
the adapter's Debug name. Pin the exact key strings for PhotoCraft on Windows,
Linux and macOS, for CADCraft, and for an app with no Nightly row, so a Debug
change cannot quietly orphan saved scheduling state again.
* Generalise the Unix nightly checks on the source-owned row
nightly_unix now reads each platform's flavor from its capability row: the
Linux and macOS stable fences are built from the row's own app names, the mac
bundle entry, layout and metadata/signature checks use the row's bundle,
executable and `<Display>Version`, only the entrypoint and the row's binary may
be executable, and a row with a launcher script accepts a shebang script beside
its x86_64 ELF binary. verify_program and archive extraction match on the row's
os() instead of PhotoCraft's adapter values.
Tests: the Linux and macOS fences, cadcraft's flat layout and content rules, and
the script/ELF structural checks, all Linux-runnable.
* Authenticate each app's Windows Nightly and fence its stable folders
- authenticate_windows now takes the row, so Authenticode must vouch for that app's
own <app>.exe and every other staged file is read as a textual notice; the pinned
publisher, root, EKUs and the held-handle install and Open checks are unchanged.
- install_signed looks the row up for the app it is installing, so a Windows Nightly
for any app goes through the same signature gate as PhotoCraft's.
- The new Windows fence keeps an app's Nightly data and cache clear of its stable
folders: %APPDATA% and %LOCALAPPDATA% by display name and catalog id, the
Program Files-free portable default, the launcher's own apps folder and the path
the stable record names. A missing APPDATA or LOCALAPPDATA refuses, and the
comparison folds case the way Windows does. It is compiled in tests on every
platform, so Linux CI checks the list and the overlap rules.
- macOS Nightly availability is now the reviewed team pin alone; each app's stable
team is checked when its own row is admitted.
* Nightly startup recovery and roster tests cover every app
The transaction refresh at startup now runs for every app with a separate
Nightly channel and an adapter for this platform, and each failure names its
own app. Scheduling-wide errors name the first app in the sweep.
Tests: the roster equals the registry's apps with targets, and each is in the
catalog with the same repository; a non-roster app refuses a Nightly on the
Stable track; an unreadable record is reported once per app. The examples that
assumed PhotoCraft was the only separate channel now use SolidCraft and
PdfCraft, while FilmCraft stays as a separate-channel case.
* nightly: fit the ordinary-track tests, fmt and lints to the one-roster rule
PhotoCraft's three row constants are test-only now (`#[cfg(test)]`): production
reaches every row through for_app, so the lib target no longer reports them as
dead code. Adapter's Debug reads the display name through the accessor, which
keeps that accessor live in every build - on Linux only macOS code and tests
used it, so the lib build warned again.
The two source tests that expected a third-party Nightly on the ordinary track
now assert the rule that replaced it: a Nightly is never an ordinary or
pre-release candidate for any app. A saved nightly-only cache is therefore
neither served nor replayable through its stale ETag, and the single-page
lookup shape is kept, so the tests are updated rather than dropped.
Also rustfmt on the WIP's entry() predicate and clippy's two redundant closures
in source.rs, and in nightly_unix_tests CADCraft now has a macOS row, so the
fence test asserts its own bundle instead of "no row means no macOS Nightly".
* nightly: take clippy's two Windows lints in the signing and fence modules
The Windows payload helper's one input lifetime is elided, and the fence tests
borrow their one-element slice with std::slice::from_ref instead of cloning it.
No behaviour change: the fence list, the adapter's own executable and the
pinned publisher are untouched.
* nightly: fit the whole roster's discovery into the Developer Builds budget
Fifteen apps in one roster outgrew the hourly GitHub budget: every sweep made all
of them due at once, the budget refused the eighth lookup, and the apps behind it
waited a full six hours only to lose again in the same order.
Cadence now follows ownership. An app whose Nightly is installed is checked every
hour, because that copy is what its user is running. An app nobody has installed
is checked on the existing six-hour cadence, and an automatic sweep takes at most
three of those, so the whole roster stays inside six hours without spending an
hour's budget at once. Manual checks still take everything that is due.
A sweep now chooses in a fixed order - installed copies first, then apps never
looked up, then the longest-waiting - instead of catalog order, so no app can be
starved by luck of the alphabet.
The launcher's own budget refusal is now told apart from a server's: only that
refusal sets NightlyHttpError::over_budget. When a sweep meets one it puts that
app and every app behind it back where they were and stops, persisting no
failure for a request that was never made, so they keep their place in the queue.
The Developer Builds page asks on its own hourly clock instead of six-hourly; the
backend's cadence stays the real gate, so this costs nothing when nothing is due.
Tests: all fifteen apps verified within six simulated hours under the real
DEVELOPER_BUILDS budget with deferral in place; installed hourly versus others at
six hours; the sweep's order and its three-app discovery allowance; defer
restoring a key and finish forgetting it; the budget refusal flagged and a
transport failure not.
* nightly: keep looking past a page of nightlies for every app, not just the roster
The bounded page-2 search was gated on an app having its own Nightly channel.
Now that no app is offered a Nightly on its ordinary track, a community app whose
first page is all nightlies would record "no release" - and, in the single-answer
path, cache that wrong answer under page 1's ETag for an hour. Both places look
further now; the ORDINARY_PAGES bound and the "nothing was cached" refusal are
unchanged, and a multi-page answer still keeps no page-1 ETag.
Test: solidcraft and filmcraft each answer v0.9.0 from page 2 behind a page of
nightlies, after exactly two requests, with no ETag stored.
* nightly: keep the sweep-order test inside the cadence and tidy two messages
The ordering test's two old apps were 3 h and 2 h old, inside the six-hour
discovery cadence, so begin correctly left them out and the test would have
failed. They are 8 h and 7 h old now, which keeps the oldest-first check.
Also the UI's comment about the hourly request reads as one sentence again, and
the single-answer path says a Nightly is not an ordinary release instead of
naming a separate channel that most apps do not have.
* nightly: correct the two tests the new pacing exposed
The six-hour simulation asserted the budget refuses something; with the sweep
pacing it never does, which is the point, so that assertion is gone. The
third-party lookup test's fake returned a full page of nightlies for every URL,
so the widened page-2 search kept going to its bound and reported an incomplete
answer; its second page is now empty, which is what "no release behind the
nightlies" looks like, and it asserts the one extra request.
* nightly: check the apps a capped sweep chose, not one alphabetically unlucky app
An automatic sweep takes at most three not-installed apps now, and it picks them in
queue order rather than catalog order, so the backend test that assumed photocraft
was in every scheduled sweep no longer holds: it was not among the three.
The test now asserts what the sweep promises - exactly three apps marked attempted,
none of them verified, and nothing promoted - instead of naming one.
Also the page-2 hunk that landed in the wrong source test is reverted (that test's
page 2 carries v0.9.0 again), and the third-party lookup test stops on an empty
page 2 in both closures, renamed to what it now shows: one page past the nightlies.
* nightly: make the budget simulation spend the hour first so deferral is what it proves
Ten of the hour's fifteen requests are spent before the first sweep, so the first
automatic sweep is refused outright and its three chosen apps are deferred. The
five sweeps after it are still enough to verify all fifteen apps inside six hours,
which is the point: a budget refusal never costs an app its turn.
* nightly: gate the Unix-only accessors, and follow the roster in two tests
`binary`, `badge` and `bundle` are read by the Unix layout and macOS bundle
checks, plus tests, so on a Windows build they were dead code and Windows
clippy -D warnings refused them. They are `#[cfg(any(unix, test))]` now.
The settings migration test expected only PhotoCraft's saved Nightly tracks to
migrate away; every roster app's do, so filmcraft's does too while the community
app's keeps its own. The new crowded-page test is formatted the way rustfmt
wants it.
* nightly: build the row table from one macro per platform instead of 45 literals
SonarCloud's quality gate refused the duplicated 45-row table (30.8% on new code
against 3%), and it was right: every row retyped the same platform convention.
Each platform now has one `row!` arm that builds its row from the app id, display
name and repository, with `concat!` deriving the Nightly package identity, the
entry point, the extra `<app>-bin` program, the badge and the macOS `.app`
bundle. Each app is three short lines, and the values are unchanged: the
registry-equality test still passes as written, which is what proves nothing moved.
PhotoCraft's Linux row takes the `none` form because it starts its GUI directly.
fmt, clippy -D warnings for native, the full native library tests and Windows GNU
clippy for native and ui-egui all pass on this tree.
* web: keep looking past a page of Nightlies in the browser's prerelease lookup
The desktop reads past a page of Nightlies; the browser stopped at page one and
reported "no release" for a community app whose ordinary release was one page
further. It now paginates the same way: 30 releases a page, past a full page that
holds no ordinary candidate, and an unfinished lookup at the bound is an error,
never LatestRelease::None. The fetch is one helper, so the 404 and rate-limit
handling is written once.
The bound is now one constant in core (release::ORDINARY_PAGES, 5) used by both
desktop lookups and by the browser, so the two cannot drift apart again.
* nightly: defer a sweep that runs out of time, and forget deferrals on invalidate
The shared 30-second sweep deadline was reported as an ordinary failure, so the
apps behind a slow one were stamped as attempted and failed, and the same slow app
could take the deadline again next hour. A deadline refusal is the launcher's own
limit, not the app's fault: a new `withheld` constructor marks it `over_budget`,
which the backend already answers by deferring that app and every app behind it and
stopping the sweep. The per-app request and byte limits stay ordinary failures,
because the app behind one did not cause it.
`invalidate` now clears `deferred_from` as well as `complete`, so a sweep that
began before Nightly was switched off cannot put a record back through `defer` and
make a verified record fresh again without a lookup.
Tests: an expired deadline is flagged as a deferrable refusal and makes no
request; and a deferral after `invalidate` leaves the record incomplete and does
not roll back its attempt.
* nightly: refuse a malformed registry row instead of reading it as no program
The fixture test read `binary` with `as_str()`, so a missing or non-string field
looked exactly like the normalised "same as the entrypoint" case and the registry
check missed the malformed row. It is read with expect() first, and only then
normalised: equal to the entrypoint means no extra program, anything else is one.
* nightly: read the stable ownership record with a bound on Windows, as on Unix
The Windows fence read installed.json whole and checked its size afterwards, so a
huge record could be allocated before it was refused. It now reads 1 MiB plus one
byte, which the existing size check refuses.
* nightly: recheck the recorded version while the verified Windows exe is held
On Windows launch checked the recorded version before authenticate_windows opened
and held the executable, so a same-user process could replace the file in that
window with another build signed by the pinned publisher. The version is read again
after the hold - the handle denies writes, replacement and deletion, so those are
the bytes that will start - and a mismatch refuses before the profile is created or
any process starts. An unreadable version is a mismatch.
* nightly: blame a spent deadline on the app that spent it, not on the one behind it
`withheld` marked every exit on the shared 30-second deadline as over_budget, including
the ones an app spends itself. The sweep defers an over_budget refusal, so a slow app
went back to the front of the queue every sweep, took the deadline again and deferred
everyone behind it - the starvation this was meant to fix, made permanent.
A deadline already gone before this app made any request was spent by the apps ahead
of it, so that is still `withheld`: the app keeps its turn. A deadline this app spends
is now an ordinary failure on its own record, so it waits its normal cadence and the
next app gets a turn; the first app of every sweep therefore always makes progress.
Tests: a deadline used up before a lookup starts is a deferrable refusal and makes no
request; a page that arrives after the deadline is a failure with over_budget false.
* nightly: say the page is waiting for GitHub when the budget holds a sweep back
When the launcher's own GitHub budget refused the sweep, the Developer Builds page
said "No developer builds are available yet" with a fresh "Last verified", which
reads as a finished check that found nothing. Nothing was asked.
The backend now reports when the budget will let it ask again: GitHubBudget has a
read-only `next_free` that answers with the same instant `take` refuses with, Http
exposes it for a priority, and the sweep puts it in CheckFinished's
rate_limited_until when it was held back. It is not a server backoff and nothing
persists it.
The page keeps that time, clears it when the next check starts, and while it is in
the future shows "Waiting for GitHub's hourly limit. Checking again at {time}."
instead of the "nothing found" line, so no verification is stamped for a sweep that
did not run. Apps verified earlier keep their cards and their own status lines.
The new English line is translated in all fourteen complete catalogs, as the i18n
coverage test requires.
Tests: the state test drives CheckStarted and a held-back CheckFinished through the
state machine, asserting the hold is kept, rendered with the local clock, dropped
once it has passed, and cleared by the next check.
* nightly: keep the new waiting line English, as feature PRs must
AGENTS.md rule 16: a feature PR carries English only, and translations land in
storytold/craft-i18n. The row is a fallback row in every catalog - the English text
as its value - rather than fourteen translations invented here.
* nightly: reuse the next-check line and share one budget rule with `take`
The waiting line named GitHub's hourly limit, which is usually not the hold: it is
the launcher's own Developer Builds budget, with GitHub's count only sometimes the
short one. It also needed fourteen catalog rows, and a feature PR carries English
only (AGENTS.md rule 16), so those rows are gone.
The page now reuses "Next GitHub check at {time}", the string the stable page
already shows for the same kind of hold: accurate, consistent across both pages,
already translated.
`next_free` had copied `take`'s window, reserve and refill arithmetic line for line,
so the two could drift and show a time the budget would not honour. Both answer from
one private `wait(&State, priority, now)` now; `take` keeps its retain and push.
* web: a later page that 404s leaves the prerelease lookup unfinished
The browser's pre-release pagination treated any 404 as "this repository has no
releases". That is only true of the first page: a later page vanishing mid-search
means the lookup did not finish, so it is `Err(None)` now, never
`LatestRelease::None`.
The decision is one small pure function next to the page's entry point, because
`latest` needs a browser window and this crate has no wasm test harness. It is
tested on the host: page 1 gives `LatestRelease::None`, pages 2, 3 and 5 give an
error.
* web: drop the release type the paginated lookup no longer names
`latest` infers the parsed release's type now, so importing `Release` was unused and
`-D warnings` refused the wasm build.
* nightly: ask again as soon as a budget hold passes, instead of waiting the hour
The page stored the launcher's own retry time when a sweep was held back, but the
automatic-check gate only looked at the hourly attempt time. A hold that expired ten
minutes later therefore left the deferred apps untouched for another fifty minutes.
An expired hold now makes the next automatic check eligible on its own, and the hold
is cleared as soon as a request goes out (a fresh one, if any, arrives with the next
CheckFinished). Consent, the 60-second request coalescing and server backoff are
unchanged, and a sweep that completed without a hold keeps the hourly gate.
Test: an attempt an hour old with a hold to t+600 asks nothing at t+599, asks once at
t+600 with the hold cleared, and still coalesces a tick later.
* nightly: cover a partly refused sweep end to end on the page
Dylan asked for the regression at the fake-backend level rather than only at the gate:
one sweep where PhotoCraft verifies and the launcher's budget refuses the rest, so the
backend defers FilmCraft and puts its attempt time back. The test drives the page's
state machine through that and asserts:
- nothing is asked while the hold is still running;
- exactly one request goes out the moment it expires, which is the sweep that picks up
the deferred app, and the hold is spent;
- a second tick a second later is still coalesced;
- with Nightly switched off, an expired hold asks nothing (consent is not inferred);
- an app's server backoff still gates the request until it passes;
- a hold that is still in the future is waited out, and asking resumes when it passes.
* nightly: let a running budget hold decide the next check, and prove the version reads under it
Dylan's edge: the gate was `hold_expired || hourly_due`, so a hold that was still
running did not stop a check the hourly gate already wanted - or one where there was
no attempt at all. The hold now decides by itself: while it runs nothing is asked,
and once it passes the page asks at once instead of waiting out the hour of a sweep
that never ran. A sweep that finished without a hold keeps the hourly gate, and
consent, coalescing and server backoff still guard the request.
Test: `a_future_hold_holds_even_when_the_hourly_gate_would_ask` runs two shapes of an
already-due page - an attempt two hours old and no attempt at all - and asserts
nothing is asked while the hold runs and that asking resumes the moment it passes.
Also, for QA's Windows guest run: the production-publisher test now reads the staged
exe's ProductVersion before authenticating, keeps the returned handle alive, and reads
it again under the hold, asserting both are readable and equal and printing
"PASS version readable under the hold". That proves the Open recheck can read the
version through the FILE_SHARE_READ hold on a real machine.
Every window the tests draw the launcher in has it. The Fonts page's tests and screenshots drive next's panel, and the runtime's font load redraws the frame that installs a CJK face, so that frame is already Chinese.
Craft Font Manager's panel and its sources are craft-ui components on next. framework.rs installs the runtime in each window and hands it the launcher's colours as a theme, its zoom and its settings; the launcher keeps its own zoom keys, and Escape still reaches its dialogs. The runtime's close path takes the close request craft-quit took.
The panel starts unfiltered and takes no preview service, look or language: next has no such calls.
craft-libs next's own egui is b15ffe9b. craft-atomic needs rustix 1.1.6, so the exact pin moves to the version the lock holds transitively. craft-font-manager's panel is the ui feature. The desktop takes the crates that host craft-ui's runtime, which also own the close path craft-quit had; craft-ui is desktop only.
A pull request event whose payload lacks the full-ci label, such as a push that arrives together
with the labelling, joined the pull request's group and cancelled the labelled run, while its own
job was skipped. The group now uses the same condition as the job's if:, so such events get a
group of their own.
* Include pre-releases no longer asks GitHub about every app on every check
With pre-releases on, the release feed was skipped and every app went to
GitHub's API on each 12-minute check, about 95 requests an hour against
GitHub's limit of 60 per network address. The feed is now fetched as usual,
GitHub keeps to the fallback's pace (hourly per app once loaded), and a newer
stable release in the feed replaces a saved older beta or RC between asks.
Adds docs/github-budget.md (spec and plan for #713) and the glossary terms.
Part of #713.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* One GitHub budget per launcher, so background checks can't use up GitHub's limit
Every GitHub API request (release checks, version lists, nightly
discovery) now counts against one budget: 30 an hour for the stable
launcher, 15 for the Developer Builds backend, kept on disk as a rolling
hour beside each one's release cache. The launcher also stops 10 short of
GitHub's own X-RateLimit-Remaining, which every machine on the network
shares. When requests run short, background checks wait so the user's own
action still gets an answer: user, then installed apps, apps not
installed, the nightly track, then nightly discovery. A check pressed
again within 2 minutes reuses the last answers. While a request is held
back, saved answers stay and the footer says when GitHub is next asked.
Part of #713.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pinned versions and the nightly track stop asking GitHub on every check
A pinned version never changes, so once its release is in the saved
version list GitHub isn't asked about it again. Version lists are now
saved in the release cache on disk and stand in for an hour (was 15
minutes, in memory). An app following the nightly is asked about at most
every three hours, the saved list answering in between, unless the user
presses check.
Part of #713.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pre-releases on: show the feed's stable release while GitHub has nothing saved
Between GitHub's asks, an app with no saved GitHub answer for the
pre-release track (pre-releases just turned on) showed nothing until
GitHub's next turn, though the feed listed its stable release
(CodeRabbit on #1602).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pre-releases: test the check plan's hourly pace, and ask again when the setting changes
The last-asked record is now keyed by app and pre-release setting, so an answer under one
setting doesn't stand in for the other. check_plan's feed decision moves into remote_plan so a
test can drive it without a live feed.
* GitHub budget: fix the review findings
- Nightly discovery held back by the budget no longer saves a server backoff, so the user's own
check on the Developer Builds page still runs (CodeRabbit, backend.rs:737).
- GitHub's X-RateLimit-Reset is trusted for at most an hour, as source.rs does for refusals, so a
computer clock behind GitHub's can't lock every request out.
- Each request counts against GitHub's remaining count before it answers, and an older answer
can't raise the count within the same window.
- The 2-minute forced-check reuse starts only from a forced check, not from any check, so a
check right after launch or a settings change still asks GitHub (CodeRabbit, backend.rs:782).
- Requests that carry ARTCRAFT_LAUNCHER_GITHUB_TOKEN skip the budget; the token has its own limit.
- The footer's clock time goes through jiff instead of hand-rolled arithmetic.
- The two new footer strings get translations in every catalog instead of English copies, so the
translated notice they replace doesn't regress. This departs from AGENTS.md rule 16 (English
only in feature PRs): storytold/craft-i18n may replace them.
Each fix has a test that fails with the fix reverted.
* Pinned and nightly pacing: fix the review findings
- A pressed check on the Nightly track asks GitHub now, past a saved version list however
recent (chosen_within with a max age of 0) (CodeRabbit, source.rs:428).
- Opening Choose version asks again for a list saved more than 15 minutes ago (CHOOSER_FRESH,
the in-memory lifetime before #713); background tracks keep the hour.
- The Nightly track keeps its own last-asked record, apart from the stable track's.
- A request the launcher's budget held back says so instead of "GitHub's request limit was
reached" (CodeRabbit, source.rs:253).
- releases.json saves hold a lock across snapshot and write, so an older snapshot can't land
after a newer one.
Each behaviour fix has a test that fails with it reverted, except the save lock, which is a few
lines checkable by reading (a stress test didn't catch the race reliably, so it isn't added).
* Clock: read the hour and minute through core's jiff so the web build compiles
ui-egui only depends on jiff off the web, so the clock moves to core::time::clock_from_unix
beside civil_from_unix, and local_time adds the zone's offset the same way civil_at does.
* GitHub budget: answer CodeRabbit's second pass
- A late answer from a window GitHub has since refilled no longer lowers the new window's
count; only answers naming the same window merge, and a later window replaces it.
- A check pressed again within the reuse window still looks past a feed that is behind
GitHub, so it keeps the newer release the forced check found instead of the feed's.
- The budget-refusal tests use a client without the environment's GitHub token.
* Pre-releases: a refused GitHub turn leaves the feed's release standing
With pre-releases on, a due GitHub lookup that fails with nothing saved (refused by the budget,
say) now answers with the stable release the feed lists instead of an error.
* Pinned and nightly pacing: a list stamped ahead is never fresh, and tests skip the token
- A saved version list whose time is ahead of the clock (set back since) isn't reused, so
a pressed Nightly check (max age 0) always asks GitHub.
- The zero-budget tests use a client without the environment's GitHub token.
* Releases: keep the newer of the feed's release and GitHub's saved one
A check reusing a forced one's answers, or a GitHub turn that fell back to a saved release
(over budget, say), now keeps the feed's stable release when it is newer than what GitHub had
saved, and keeps a saved release (an RC, say) that is newer than the feed's. A live GitHub
answer is unchanged.
* fmt: wrap the CacheFile test initializer after adding versions
* Releases: a GitHub rate limit is not reported as a budget hold
When GitHub itself refuses, held_back_why stays silent even if a budget
wait is also recorded, and a stale version list is not reused.
* Nightly: a due check asks GitHub past a recent version list
A due automatic check was going through chosen(), which reuses a list
saved up to an hour ago. If Choose version had just refreshed that list,
the check still advanced the three-hour timer and could miss a Nightly
published in between. Due checks now use the same chosen_within(..., 0)
path as a pressed check.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
* Include pre-releases no longer asks GitHub about every app on every check
With pre-releases on, the release feed was skipped and every app went to
GitHub's API on each 12-minute check, about 95 requests an hour against
GitHub's limit of 60 per network address. The feed is now fetched as usual,
GitHub keeps to the fallback's pace (hourly per app once loaded), and a newer
stable release in the feed replaces a saved older beta or RC between asks.
Adds docs/github-budget.md (spec and plan for #713) and the glossary terms.
Part of #713.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* One GitHub budget per launcher, so background checks can't use up GitHub's limit
Every GitHub API request (release checks, version lists, nightly
discovery) now counts against one budget: 30 an hour for the stable
launcher, 15 for the Developer Builds backend, kept on disk as a rolling
hour beside each one's release cache. The launcher also stops 10 short of
GitHub's own X-RateLimit-Remaining, which every machine on the network
shares. When requests run short, background checks wait so the user's own
action still gets an answer: user, then installed apps, apps not
installed, the nightly track, then nightly discovery. A check pressed
again within 2 minutes reuses the last answers. While a request is held
back, saved answers stay and the footer says when GitHub is next asked.
Part of #713.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pre-releases on: show the feed's stable release while GitHub has nothing saved
Between GitHub's asks, an app with no saved GitHub answer for the
pre-release track (pre-releases just turned on) showed nothing until
GitHub's next turn, though the feed listed its stable release
(CodeRabbit on #1602).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pre-releases: test the check plan's hourly pace, and ask again when the setting changes
The last-asked record is now keyed by app and pre-release setting, so an answer under one
setting doesn't stand in for the other. check_plan's feed decision moves into remote_plan so a
test can drive it without a live feed.
* GitHub budget: fix the review findings
- Nightly discovery held back by the budget no longer saves a server backoff, so the user's own
check on the Developer Builds page still runs (CodeRabbit, backend.rs:737).
- GitHub's X-RateLimit-Reset is trusted for at most an hour, as source.rs does for refusals, so a
computer clock behind GitHub's can't lock every request out.
- Each request counts against GitHub's remaining count before it answers, and an older answer
can't raise the count within the same window.
- The 2-minute forced-check reuse starts only from a forced check, not from any check, so a
check right after launch or a settings change still asks GitHub (CodeRabbit, backend.rs:782).
- Requests that carry ARTCRAFT_LAUNCHER_GITHUB_TOKEN skip the budget; the token has its own limit.
- The footer's clock time goes through jiff instead of hand-rolled arithmetic.
- The two new footer strings get translations in every catalog instead of English copies, so the
translated notice they replace doesn't regress. This departs from AGENTS.md rule 16 (English
only in feature PRs): storytold/craft-i18n may replace them.
Each fix has a test that fails with the fix reverted.
* Clock: read the hour and minute through core's jiff so the web build compiles
ui-egui only depends on jiff off the web, so the clock moves to core::time::clock_from_unix
beside civil_from_unix, and local_time adds the zone's offset the same way civil_at does.
* GitHub budget: answer CodeRabbit's second pass
- A late answer from a window GitHub has since refilled no longer lowers the new window's
count; only answers naming the same window merge, and a later window replaces it.
- A check pressed again within the reuse window still looks past a feed that is behind
GitHub, so it keeps the newer release the forced check found instead of the feed's.
- The budget-refusal tests use a client without the environment's GitHub token.
* Pre-releases: a refused GitHub turn leaves the feed's release standing
With pre-releases on, a due GitHub lookup that fails with nothing saved (refused by the budget,
say) now answers with the stable release the feed lists instead of an error.
* Releases: keep the newer of the feed's release and GitHub's saved one
A check reusing a forced one's answers, or a GitHub turn that fell back to a saved release
(over budget, say), now keeps the feed's stable release when it is newer than what GitHub had
saved, and keeps a saved release (an RC, say) that is newer than the feed's. A live GitHub
answer is unchanged.
* GitHub budget: keep a reused check at User priority, and say when the launcher held back
- A forced check reused within two minutes can still ask GitHub when the feed is behind; it
now keeps User priority so the budget doesn't treat it as a background request.
- A budget refusal is reported as the launcher holding back, not as GitHub's own limit, and
the wait is rounded up to a whole minute so a retry after that time is due.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
* Include pre-releases no longer asks GitHub about every app on every check
With pre-releases on, the release feed was skipped and every app went to
GitHub's API on each 12-minute check, about 95 requests an hour against
GitHub's limit of 60 per network address. The feed is now fetched as usual,
GitHub keeps to the fallback's pace (hourly per app once loaded), and a newer
stable release in the feed replaces a saved older beta or RC between asks.
Adds docs/github-budget.md (spec and plan for #713) and the glossary terms.
Part of #713.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pre-releases on: show the feed's stable release while GitHub has nothing saved
Between GitHub's asks, an app with no saved GitHub answer for the
pre-release track (pre-releases just turned on) showed nothing until
GitHub's next turn, though the feed listed its stable release
(CodeRabbit on #1602).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pre-releases: test the check plan's hourly pace, and ask again when the setting changes
The last-asked record is now keyed by app and pre-release setting, so an answer under one
setting doesn't stand in for the other. check_plan's feed decision moves into remote_plan so a
test can drive it without a live feed.
* Releases: keep the pre-release cache when a stable save uses the same repo
The cache stored one row per repository, so a stable-only GitHub save replaced the
pre-release answer. Each setting now has its own key (repo and repo+pre); a file written
when there was only one row still loads, and the other setting is moved aside instead of
being evicted.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>