Skip to main content

Module signed_source

Module signed_source 

Source
Expand description

A second source for the update check, for when GitHub’s API limits this computer or fails (#47813).

The check learns which release is latest from the releases/latest page, which the API’s limit doesn’t touch, and asks the API for its files and checksums. While the API refuses, a release was known by its tag alone and could not be downloaded. This asks the release’s own download address instead: the signed envelope, its signature and the manifest (AgentMux-<version>-envelope.json, .sig, -manifest.json), which are not part of the API’s limit. Only GitHub’s release-download address is used as a source.

What it guarantees (each has a test below):

  • Nothing older or equal is offered. The envelope’s version must be the tag the check found, and the tag must be strictly newer than the running build. An equal or older tag is “nothing new”: not an error, not a download, and nothing is fetched for it.
  • One verifier. The file list is read from a manifest that passes the downloader’s own check (signature::judge and decide, with the same keys and signature rules, a second signature included), so the check can’t offer a file the download would refuse. Where the two could disagree on one input, a test fails.
  • The release’s own upgrade floor, from what the pipeline signed. A manifest may carry an upgrade.floor (SPEC_UPGRADE_FLOOR_IN_SIGNED_MANIFEST). When it carries a usable one, the floor used is the higher of that and this build’s own (BUILD_FLOOR), and neither the notes’ floor line nor the raw UPGRADE_FLOOR file is asked for. A manifest with none (or an unusable one, logged once per tag) falls back to what was done before: the repo’s UPGRADE_FLOOR file at the release’s tag, which the API’s answer vouches for no better (GitHub over TLS, unsigned). The floor used is then the higher of this build’s own and that file’s, so a read can only block a download, never allow one. A tag that isn’t plainly v<digits>.<digits>.<digits> builds no address, and a file that can’t be read or isn’t a plain version is no answer.
  • Bounded. It runs only when the API is limited or failed. A result is kept for its tag, a failed try is not repeated before the API’s limit ends (and never within [MIN_RETRY_GAP_MS]), and a manifest or floor that fails is logged once per tag.

An unsigned, unverifiable or unreachable answer is no answer: the release stays known by its tag.