Skip to main content

Module verify_update

Module verify_update 

Source
Expand description

agentmux-launcher --verify-update <version> <dir> <file> [installed:<version>] [unreachable:<why>]

Used by the root helper of a .deb or .rpm install (agentmux-install-update, docs/specs/SPEC_LINUX_PACKAGE_UPGRADE_AND_REPOSITORY_2026_10_24.md §3.2): the helper fetches the release’s envelope, signature and manifest into <dir> (named as agentmux_common::update_manifest::file_names names them; a file the release doesn’t have is left out) and asks this to check <file> against them with the key this build pins, the same decision the app makes before it downloads (SPEC_SIGNED_UPDATE_CHECKSUMS_2026_10_25.md). One pinned key and one decision, so the shell script holds neither.

With installed:<version> it also holds the release to its upgrade floor (SPEC_UPGRADE_FLOOR_IN_SIGNED_MANIFEST): the higher of the floor the verified manifest signs and this build’s own, against the version the helper read from the package database. The helper runs as root on a caller’s word, so it takes the floor from the manifest it verified and the installed version from the database, never from the caller; a release whose manifest signs no floor is checked as before.

Exit status: 0 verified; 10 the release predates signing and has no manifest (the helper falls back to the checksum GitHub lists, as the app does); 1 refused, with the message the person reads on stderr.

Structs§

Request 🔒
What --verify-update was asked: the version, the folder of signed files, the package, and the optional parts.

Enums§

Verdict
What a check allows.

Constants§

BUILD_FLOOR 🔒
The upgrade floor of the repository when this build was made (UPGRADE_FLOOR): a floor only rises, so no later release’s is lower. The app’s check holds the same value.
EXIT_UNSIGNED_OLD
Exit status for a release made before signing existed, with no manifest.

Functions§

build_floor 🔒
BUILD_FLOOR when it is a version.
parse_request 🔒
Read the words after --verify-update. installed:<version> comes before the reason, which is one argument whose words were split apart and are put back together.
read_capped 🔒
A file a release publishes, if it was fetched, read with a cap.
run_if_requested
Handle --verify-update if it is what was asked, returning the exit status.
size_and_hash 🔒
The size and SHA-256 of path.
verify
Check file against the signed manifest files in dir for version, using keys. unreachable is the helper’s reason when it couldn’t fetch them at all. installed is the version the package database says is installed and about to be replaced: given, the release’s upgrade floor is enforced.
verify_replacing
verify, holding the release to its upgrade floor against installed when that is given. build is this build’s own floor.