Repository navigation
fix(update): bind installed updater bytes and version to the journal (W3-02h) - #457
Merged
Merged
Conversation
The journal is now produced after the download and carries the digest of the exact bytes update.install receives. The install gate compares those bytes and the announced version with the journal's candidate before begin_install, and the install effect repeats the check. Test-First: src-tauri/src/delivery_recovery/install.rs::delivery_recovery::install::tests::install_refuses_updater_bytes_whose_digest_or_version_differ_from_the_journal Test-First: src-tauri/src/delivery_recovery/install.rs::delivery_recovery::install::tests::journal_carries_the_digest_of_the_exact_updater_bytes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cuarroc
marked this pull request as ready for review
October 5, 2026 05:40
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
Author
|
@Mergifyio queue |
This was referenced Oct 5, 2026
Contributor
Merge Queue Status
This pull request spent 18 minutes 33 seconds in the queue, including 13 minutes 42 seconds running CI. Required conditions to merge
|
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dieses Paket schließt eine Lücke im Update-Ablauf: Das Protokoll (Journal) gilt jetzt für genau die heruntergeladenen Update-Bytes und die angekündigte Version. Ein Protokoll für Version A kann damit keine Update-Datei von Version B mehr freigeben. Eine Lücke bleibt offen (siehe "Open"): Der Neustart-Abgleich kann den Hash der installierten Datei noch nicht mit dem Update-Hash vergleichen und braucht eine Entscheidung von dir.
Report
Changed (3 files, +155/-28, base afd937d)
main.rs(prepare_and_install): download first, thenproduce_journal, so the journal is built from the exact bytesupdate.installreceives; passesStaged { bytes, version }to the gate.delivery_recovery/install.rs:Announced.signaturereplaced bybytes;signed_artifact_sha256andcandidate.binary.sha256are nowsha256(bytes)(feat(update): produce the recovery journal before the update download (W3-02g) #446 kimi F1). NewStaged+require_staged_matches: version and digest must equal the journal'sstaged_manifest, checked inrequire_install_evidencebeforebegin_installand again inInstallOnly::install; the closure receives the checked bytes (feat(update): route install through the recovery journal gate (W3-02e) #411 C1).delivery_recovery.rs: re-exportStaged.Tests (red-first, new at merge base)
install_refuses_updater_bytes_whose_digest_or_version_differ_from_the_journal: other bytes / other version -> refused, installer never called, journal staysBackupVerified.journal_carries_the_digest_of_the_exact_updater_bytes.Evidence
bash scripts/ci/red-first.sh --plan-> exit 0 (count=2, specs=2)bash scripts/ci/gates.sh lane prepushat bb5649c -> exit 0cargo test --bin projecta delivery_recovery-> 42 passed before the second test; install module 14 passedArchitecture drift: no new findings, allowlist untouched.
Open (needs decision): post-restart validation.
LiveEffects::validate(startup.rs:99) reportssha256(running exe), while the journal'scandidate.binary.sha256is the digest of the updater payload (archive/installer), never equal to the installed exe's hash.accept_handshake(delivery_recovery.rs:497) therefore cannot succeed for a real update. Fixing it means either recording the installed-exe digest by another route or changing the handshake identity, a seam/design decision I did not make silently. Weakening the handshake test was ruled out. The journal itself now carries the right digest, so promotion (signed_artifact_sha256) is bound to the real bytes.NICHT ABGEDECKT
#[cfg(windows)]tests and the Windows half of clippy (merge queue runs Windows).main.rswiring is covered by compile and gates only.Review disposition
Candidate SHA: bb5649c. Tier A. Reviewers (Ollama Cloud, author family claude): kimi-k3 (
kimi-k3:cloud) -> approve; glm-5.2 (glm-5.2:cloud) -> approve. Both checked against the code by the driver.main.rs:1264-1271: download now precedesproduce_journal, so a refused precondition (require_live_evidence,install.rs:77) costs a full download.install.rs:91:sha_hex(announced.bytes)runs on the async runtime thread.fs::readin the same function; negligible. The second hash runs insidespawn_blocking.install.rs:179-181/require_staged_matchesruns twice.InstallOnly::installguards the effect itself, the first one refuses beforebegin_install.Architecture drift: none found by either reviewer; no second pattern for state, errors (
Fx<T>as before), store or IPC introduced. No code change, candidate unchanged.