Repair stale bundled services after KeyPath updates - #1250
Conversation
|
Review finding
Test coverage confirms parameter forwarding ( Suggest gating the forced refresh on actual staleness (e.g. only take the refresh path when |
|
Addressed in b00346f. The composite runtime repair now rechecks the active runtime identity before refreshing: fresh or unknown active registrations remain untouched, while stale registrations take the unregister/register path. Added paired regression tests proving fresh active performs 0 unregister/register calls and stale active performs exactly 1 of each. Focused set: 79/79; full suite: 4,000 XCTest cases, 0 failures; pinned SwiftFormat: 0/8 files. |
|
Review finding — helper postcondition narrowing may cause false install failures
case .helperFreshOrApprovalPending:
return context.helper.freshness(expectedVersion: ...) == .fresh || context.helper.requiresApprovalThis drops the previous The added tests ( Suggest either OR'ing Other changes (SMAppService unregister-settle polling in |
|
Addressed the second finding in 7b3ac9a with explicit postcondition coverage and confirmed the production capture path. InstallerEngine.captureFreshContext invalidates validator/service caches before the final observation. HelperManager.getHelperHealth returns .healthy only when getHelperVersion returns a non-nil version; a nil read becomes registeredButUnresponsive or temporarilyUnavailable, so production does not report isWorking=true with an unknown version. I intentionally did not OR helper.isReady back in because the existing W6 contract requires unknown version to remain not fresh. New tests prove: working+unknown still satisfies readiness but fails freshness; exact version and pending approval satisfy freshness. Focused set: 94/94; full suite: 4,002 XCTest cases, 0 failures; pinned SwiftFormat: 0/11 files. |
|
Correctness: In // before
expectedPostconditions: [.helperReadyOrApprovalPending]
// after
expectedPostconditions: [.helperFreshOrApprovalPending]
Contrast this with the expectedPostconditions: [.helperReadyOrApprovalPending, .helperFreshOrApprovalPending]No test currently covers |
|
Addressed in 34bf95c. Both helper install recipes now declare the additive pair [.helperReadyOrApprovalPending, .helperFreshOrApprovalPending], matching the runtime recipe pattern. The underlying freshness check already guards isInstalled && isWorking, but the recipe contract now explicitly preserves both guarantees. Added a regression case proving an exact-version but nonworking helper fails the combined postconditions. Focused set: 95/95; full suite: 4,003 XCTest cases, 0 failures; pinned SwiftFormat: 0/11 files. |
|
Reviewed the diff (no repo inspection tools used). One design question worth confirming before merge, plus a minor nit: 1. New stale-unregister race guard may be bypassed on the 2. Minor style nit: in Everything else (freshness postconditions, |
|
Confirmed both points before merge:
No code change needed for this comment. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bb027496f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !context.helper.isReady || | ||
| context.helper.freshness(expectedVersion: WizardHelperConstants.expectedHelperVersion) != .fresh |
There was a problem hiding this comment.
Verify the helper's registered bundle identity
When upgrading from build 4 to this build, the existing BundleProgram helper can still point at the previous app bundle while responding with the unchanged KeyPathHelperContract.version (1.3.0), so this condition classifies it as fresh and skips re-registration. This is concrete for this update because the shipped helper behavior changed to require VirtualHID 8.0 while the helper version remained 1.3.0; compare the registered parent bundle version/path, or force unregister/register after the bundle update, rather than relying only on the XPC version response.
AGENTS.md reference: AGENTS.md:L317-L320
Useful? React with 👍 / 👎.
|
Post-merge acceptance is complete on exact merge commit |
Summary
Installer state-matrix row
Running and TCP responding, but active bundled runtime identity is stale after an app update. The repair must replace the registration with the current app bundle and independently verify freshness.
Validation
Release safety
The accepted build was private and was not published to the public Sparkle feed or installed over the laptop app. The branch was subsequently rebased over two unrelated master UI commits and the full suite was rerun. Rebuild and repeat signed/notarized validation from merged master before publishing a public release.