Skip to content

R06: preserve rollback until post-restart health commit - #251

Open
Oleksii-debug wants to merge 10 commits into
r06-host-updater-launch-0929-solfrom
r06-update-health-receipt-0929-sol
Open

Oleksii-debug wants to merge 10 commits into
r06-host-updater-launch-0929-solfrom
r06-update-health-receipt-0929-sol

Conversation

@Oleksii-debug

Copy link
Copy Markdown
Owner

Scope

Canonical successor to #250. Closes the stale-pending/rollback lifecycle after successful apply + relaunch without changing the existing apply authority or weakening rollback semantics.

Exact lineage

  • parent: r06-host-updater-launch-0929-sol@56eb145bc9f741d39f7c240a4156c45e32376105 (R06: launch trusted updater from packaged host #250)
  • candidate: r06-update-health-receipt-0929-sol@b840c8dc080037778e55a91b40767123bc20f579
  • direct parent → candidate: AHEAD 9 / BEHIND 0; exact parent is merge-base
  • lasting diff: 8 paths limited to updater health runtime, runner integration, packaged host/frontend health commit, and focused tests

Root cause closed

The canonical updater intentionally preserved same-directory rollback bytes after publication, but after successful relaunch it removed only apply-update.json; the old pending-update.json remained bound to the previous current_version. The updated application would therefore encounter stale old-version pending authority during startup recovery, while rollback bytes had no durable commit lifecycle.

Runtime health authority

Adds fixed-path update-health.json with strict schema and no filesystem paths. It is published only after exact installed-byte publication while the exact prior rollback bytes still exist, and binds:

  • previous semantic version;
  • target semantic version;
  • installed executable basename;
  • exact prior SHA-256;
  • exact installed SHA-256.

Publish/inspect re-verify the installed EXE and same-directory rollback as regular non-symlink files and exact hashes. Existing identical receipt is idempotent; divergent receipt fails closed.

Updater transaction ordering

execute_trusted_updater now performs:

  1. parent-exit proof;
  2. canonical exact-byte atomic apply;
  3. exact post-apply target check;
  4. durable health-receipt publication;
  5. updated application process creation.

If health-receipt publication fails, prior bytes are rolled back before receipt disarm. If relaunch fails, prior bytes are rolled back before receipt disarm. If rollback itself fails, receipt is deliberately preserved as durable recovery evidence rather than discarded.

Post-restart commit

Adds an outer packaged-host application_update.commit_post_restart_health empty-payload command. Browser code cannot supply path/version/hash authority. On pywebviewready, frontend calls this health commit before normal pending recovery. Native runtime verifies:

  • receipt target version equals the new host-owned packaged version;
  • current installed executable basename matches receipt;
  • exact current executable bytes match installed SHA;
  • exact rollback bytes match prior SHA.

Only then it removes stale pending-update.json, disarms the health receipt, and removes rollback bytes. A failed proof returns a bounded error and preserves rollback recovery state; pending recovery is not allowed to run first.

Qualification coverage

Runtime tests cover receipt publish/readback/idempotence, strict schema, installed/rollback tamper, target-version mismatch, symlink receipt rejection, commit cleanup, failed-proof preservation, receipt-only disarm, runner ordering, publish failure rollback, spawn failure rollback/disarm, target-substitution behavior, and callable authority validation.

Packaged-host tests cover empty-payload-only health commit, exact host-owned path/version forwarding, request-id correlation, no path disclosure, failed-proof recovery preservation, unrelated-command passthrough, and static startup ordering proving health commit precedes pending status plus aria-live/textContent/no-innerHTML constraints.

Explicit non-claims / remaining blockers

  • This health commit proves exact installed bytes plus successful packaged native/frontend bridge startup. It does not claim complete feature-level application health, visual correctness, source/theological acceptance, or HUMAN_NVDA acceptance.
  • Production Authenticode signing identity/private key remains external release work; real positive same-publisher update execution must continue to fail closed until signed artifacts exist.
  • No automatic rollback-after-later-crash watchdog is claimed; this change preserves rollback evidence until bridge-ready health commit but does not monitor the relaunched process after that commit.
  • No elevation policy change.
  • No physical Windows 11/WebView2 end-to-end update acceptance is claimed until hosted/physical evidence exists.

A proposed additional cross-platform executable-name hardening edit was rejected by the GitHub connector before repository mutation; no claim is made that this rejected edit landed. Existing receipt identity still requires exact equality to the host-owned target.name before cleanup.

READY_FOR_INTEGRATION=NO pending exact-head hosted qualification and changed-head review.

Adopt canonical #260 DEV05/DEV06/DEV10 exact-head checkout authority without changing update-health product bytes.

Copy link
Copy Markdown
Owner Author

HEAD_CHANGED / EXACT-HEAD QUALIFICATION AUTHORITY REPAIRED — bd8b40f3c4b035930ee745040596a3e25d59513f

#251 now carries the same already-integrated #260 literal-head checkout/assertion authority in DEV05, DEV06 and DEV10. This fast-forward changes qualification workflows only; the update-health receipt, runner, packaged host/UI and their regression bytes are unchanged from b840c8dc....

Direct compare to stacked parent #250 remains BEHIND 0 with exact parent merge-base. Earlier failures on b840c8dc... are not reused as product verdicts because several qualifying workflows checked out the synthetic PR merge ref. Fresh exact-head runs are required.

PRODUCT_BYTES_UNCHANGED=PASS
LITERAL_HEAD_QUALIFICATION_AUTHORITY=INSTALLED
READY_FOR_INTEGRATION=NO pending fresh exact-head hosted qualification and fresh product/security review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant