Updater

Updater
Source snapshot: 9b4f8a3 (2026-09-23); retained QMail clone, including M7.
Working = implemented in this snapshot, not a new runtime/test certification.
Partial = an identified implementation/exposure gap; obsolete = retained compatibility only.
Entry points and static functions are selected navigation anchors; full lexical index: function-index.txt.
Used by / Tests list selected source references (including callback registration), not a proven dynamic call graph.
Tests were inspected, not executed; use tools/test.ps1 with isolated scratch data.
Old paths come from docs/path-map.txt; absent mappings denote additions after the move.

Version and manifest parser

Purpose
Parse legacy/new version strings and validate manifest v2 with a legacy-compatible prefix.
Files
src/update/version.c src/update/manifest.c
Old paths
No changed-path mapping for these files.
Public header
include/qmail/component.h src/update/update_download.h
Entry points
src/update/manifest.c:115 :: qm_manifest_parse() src/update/version.c:43 :: qmail_version_parse() src/update/version.c:69 :: qmail_version_compare() src/update/manifest.c:14 :: qm_component_safe_path()
Important static functions
src/update/version.c:33 :: valid_date() src/update/version.c:9 :: split_numeric() src/update/manifest.c:45 :: text_field() src/update/manifest.c:72 :: version()
Owns
Version parsing and strict manifest schema, field ordering, hashes, paths and URL validation.
Used by
src/update/archive.c src/update/component.c src/update/component_store.c src/update/update_download.c
Side effects
Parses into caller structs/buffers, allocating temporary JSON state; no network, installation or filesystem writes.
Tests
tests/update/component_test.c tests/update/manifest_check.c tests/update/manifest_v2_test.c tests/update/version_test.c
Platforms
Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status
working; VERSION.txt is absent; CMake still supplies date/build identity. See single-sources-of-truth.txt.

Component planning and download

Purpose
Plan client/server/themes updates and stream verified downloads into durable component records.
Files
src/update/component.c src/update/component_store.c src/update/update_download.c
Old paths
src/desktop_api/update_download.c -> src/update/update_download.c
Public header
include/qmail/component.h src/update/update_download.h
Entry points
src/update/component.c:10 :: qm_update_plan() src/update/component.c:63 :: qm_component_download() src/update/component_store.c:94 :: qm_component_query() src/update/update_download.c:317 :: qmail_update_network_status()
Important static functions
src/update/component_store.c:67 :: migration_receipt() src/update/update_download.c:127 :: manifest_validate() src/update/update_download.c:139 :: parse_manifest() src/update/component.c:35 :: chunk() src/update/component.c:45 :: record_transition() src/update/component_store.c:61 :: string()
Owns
Component lifecycle and journal transitions; absent optional themes do not block the manifest.
Used by
src/app/desktop_api_more.c
Side effects
Checks/downloads network artifacts, writes staging/journals, and launches file replacement/recovery; parser and progress helpers alone do not install.
Tests
tests/update/component_test.c tests/update/install_launch_test.c tests/update/update_download_bundle_test.c
Platforms
Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status
working

Installation and recovery

Purpose
Prepare component swaps, validate archives, launch Windows installation and provide standalone recovery.
Files
src/update/install_plan.c src/update/install_launch.c src/update/archive.c src/gui/host/upgrade.c src/gui/host/upgrade_bundle.inc src/gui/host/upgrade_bundle.ps1
Old paths
vendor/gui-3/src/host/desktop/upgrade.c -> src/gui/host/upgrade.c vendor/gui-3/src/host/desktop/upgrade_bundle.inc -> src/gui/host/upgrade_bundle.inc
Public header
include/qgui/desktop.h include/qmail/component.h
Entry points
src/update/install_plan.c:9 :: qm_install_prepare() src/update/install_launch.c:43 :: qm_install_launch() src/update/archive.c:13 :: qm_archive_admit() src/gui/host/upgrade.c:47 :: qgui_upgrade_helper_script()
Important static functions
src/gui/host/upgrade.c:82 :: launch_recovery_file() src/update/install_launch.c:12 :: quote() src/update/install_launch.c:22 :: launch() src/update/archive.c:37 :: inspect_bytes() src/gui/host/upgrade.c:13 :: ps_quote()
Owns
Durable install plan, component swaps and recovery script generation.
Used by
src/app/main.c src/update/component.c src/update/update_download.c
Side effects
Checks/downloads network artifacts, writes staging/journals, and launches file replacement/recovery; parser and progress helpers alone do not install.
Tests
tests/gui/server_gui_test.c tests/update/archive_check.c tests/update/component_test.c tests/update/install_launch_test.c tests/gui/host/test_p12_host.c
Platforms
Windows implementation; Linux/macOS installer parity pending.
Status
working; Windows installer; Linux/macOS installation remains partial.

Progress and transfer deferral

Purpose
Track update progress and defer installation until active transfers quiesce.
Files
src/update/progress.c src/update/quiescence.c
Old paths
No changed-path mapping for these files.
Public header
include/qmail/update_progress.h include/qmail/update_quiescence.h
Entry points
src/update/progress.c:16 :: qm_update_monitor() src/update/quiescence.c:4 :: qmail_update_transfers_idle()
Important static functions
None identified by lexical inspection; C++ methods and script helpers are outside the C static index.
Owns
Update progress snapshots and quiescence state.
Used by
src/app/main.c src/update/update_download.c
Side effects
Updates synchronized progress/quiescence state and queries active transfer state.
Tests
No direct symbol-reference test identified; indirect integration coverage is uncertain.
Platforms
Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status
working

Compatibility updater

Purpose
Retain the older update API used by compatibility callers and tests.
Files
src/update/update.c
Old paths
src/host/update.c -> src/update/update.c
Public header
include/qmail/update.h
Entry points
src/update/update.c:41 :: qmail_update_validate()
Important static functions
src/update/update.c:14 :: regular_file() src/update/update.c:28 :: same_path()
Owns
Legacy apply API; M7 component engine owns new desktop component updates.
Used by
src/platform/migration.c src/update/component_store.c src/update/install_plan.c
Side effects
Checks/downloads network artifacts, writes staging/journals, and launches file replacement/recovery; parser and progress helpers alone do not install.
Tests
tests/unit/migration_test.c tests/update/component_test.c tests/update/install_launch_test.c tests/update/update_test.c
Platforms
Windows; POSIX branches/dependencies where present. Linux/macOS runtime unverified in M13.
Status
partial; Do not treat its older single-executable contract as the component engine contract.