Repository navigation
fix(drivers): keep the owner's driver choice and meet both id spellings - #1426
Conversation
Follow-up to #1422 after the owner set the rule: an owner picks which signed driver version runs, and nothing changes without that choice. - A version installed although the release bundles a newer one is a choice and stays across Core updates until the owner changes it. A newer version installed early still ends when a release catches up. The choice is kept per logical path in the config key-value store and forgotten when the owner goes back to the release's copy. - The bundled sources spell ids their own way (easee-cloud for the channel's easee_cloud). "Use bundled" answered "no bundled file declares driver easee_cloud" on the home box, and a first install did not reach the running instance until Core restarted. Both now accept the file the signed manifest names when its id passes the publisher's identity rule (device-drivers _identifies_same_driver); an equal id still counts anywhere, and a different id at that path does not. - The driver catalog reports release_version beside an override, and `ftw status` prints it. - The built-in beta channel honours device_repository.enabled: false. - Update Center counted any beta whose version differed as an update, an older one included; it now compares SemVer. - The note in drivers/BUNDLED_SOURCE.json no longer claims every channel artifact is write-inert. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8e8779829
ℹ️ 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 err := m.store.SaveConfig(pinKey(installed.LogicalPath), pinned); err != nil { | ||
| slog.Warn("driver repository: record chosen version", "path", installed.LogicalPath, "err", err) | ||
| } |
There was a problem hiding this comment.
Fail activation when pin persistence fails
If SQLite rejects this write—for example because the disk is full—the activation still returns success and the UI reports the older driver as selected, but no pin was stored. On a later Core release, RetireSupersededByBundled can therefore silently deactivate the owner's chosen version; propagate this failure or commit the activation and pin atomically rather than only logging it.
AGENTS.md reference: AGENTS.md:L22-L23
Useful? React with 👍 / 👎.
Independent review of #1422 and #1426: - RetireSupersededByBundled deactivated the managed selection when a release bundled a version at least as new. A failed update trial that fell back, or `ftw rollback`, then ran the older release's older copy and lost the version the owner had installed early. - A choice counted only when it was older than the bundled copy at that moment, so going back from an early 1.3.3 to 1.3.2 under a release with 1.3.0 was not kept, and the next release ran the rejected 1.3.3. The selection is no longer changed at start. driver-repository/active records what the owner selected; driver-repository/effective, which paths now resolve through (config, catalog, API, driver inventory), is derived from it and the release's drivers at every start and after every change. A selection runs while it is at least as new as the release's copy, or when the owner went back to it from a newer version that was running. A rollback of an activation restores the choice it replaced, so recovering from a failed install leaves no mark. The release marker is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
Independent review of #1422 and #1426: - RetireSupersededByBundled deactivated the managed selection when a release bundled a version at least as new. A failed update trial that fell back, or `ftw rollback`, then ran the older release's older copy and lost the version the owner had installed early. - A choice counted only when it was older than the bundled copy at that moment, so going back from an early 1.3.3 to 1.3.2 under a release with 1.3.0 was not kept, and the next release ran the rejected 1.3.3. The selection is no longer changed at start. driver-repository/active records what the owner selected; driver-repository/effective, which paths now resolve through (config, catalog, API, driver inventory), is derived from it and the release's drivers at every start and after every change. A selection runs while it is at least as new as the release's copy, or when the owner went back to it from a newer version that was running. A rollback of an activation restores the choice it replaced, so recovering from a failed install leaves no mark. The release marker is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
* fix(drivers): retry failed retirements and credit only the file that runs Codex review of #1422 found two defects: - RetireSupersededByBundled recorded the release as reconciled even when a Deactivate failed, so a retirement blocked once (for example by an unwritable active directory) was never tried again on that release. The release marker is now saved only when every retirement succeeded. - The catalog's used_by matched configured drivers by file name. An operator's own file elsewhere with the same name was credited to the catalog entry, and `ftw status` reported a version that was not running. It now compares the configured resolved path with the entry's file in its source directory. Both new tests fail on the previous code. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7 * fix(drivers): never lose a driver selection to a Core update Independent review of #1422 and #1426: - RetireSupersededByBundled deactivated the managed selection when a release bundled a version at least as new. A failed update trial that fell back, or `ftw rollback`, then ran the older release's older copy and lost the version the owner had installed early. - A choice counted only when it was older than the bundled copy at that moment, so going back from an early 1.3.3 to 1.3.2 under a release with 1.3.0 was not kept, and the next release ran the rejected 1.3.3. The selection is no longer changed at start. driver-repository/active records what the owner selected; driver-repository/effective, which paths now resolve through (config, catalog, API, driver inventory), is derived from it and the release's drivers at every start and after every change. A selection runs while it is at least as new as the release's copy, or when the owner went back to it from a newer version that was running. A rollback of an activation restores the choice it replaced, so recovering from a failed install leaves no mark. The release marker is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7 --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Follow-up to #1422, part of #1423. The owner set the rule: an owner picks which signed driver version runs, and nothing changes without that choice. The release carries a tested baseline set, and Settings lets the owner fetch and run another signed version of one driver.
Changes
driver_repository/pinned/<logical path>in the config key-value store.easee-cloudfor the channel'seasee_cloud,sungrow-shxforsungrow). On the home box, "Use bundled" failed withno bundled file declares driver easee_cloud, and a first install only took effect after a Core restart.bundledDriverForandsameDriverFileaccept the file at the path the signed manifest names when its id passes the publisher's identity rule (driverrepo.IdentifiesSameDriver, ported from device-drivers_identifies_same_driver).ctek-chargestorm-hybridcontainsctek), so it is always paired with the file path.release_versionfor managed and local entries, andftw statusprints it:Override: easee 1.3.2 from the driver channel; the release has 1.3.3.ChannelCatalogandInstallChannelhonourdevice_repository.enabled: false, asRefreshalready did.beta_availablecompared versions with!==, so an older beta counted as a waiting update. It now compares SemVer.drivers/BUNDLED_SOURCE.json. The note no longer claims every channel artifact is write-inert:control: trueentries keep their control path.Checked, not changed
A managed public artifact that is missing from the signed manifest fails closed. The device-drivers build carries every previous entry into
history(tools/ftw_repository.py), so that needs a channel reset.Evidence
TestChosenOlderVersionStaysUntilTheOwnerChangesIt;TestUsingTheBundledCopyForgetsTheChoice;TestBetaChannelRespectsTheOffSwitch;TestIdentifiesSameDriverFollowsThePublishersRule;TestChannelAndBundledSpellingsOfOneDriverMeet. On the old API code it fails withrestarted_drivers:[] runtime_verified:false.isNewerVersionover release and prerelease cases.make test: 69 packages ok.npm test: 630 pass, 1 fail. The failure is inupdate-dialog.test.mjs: "8,192 records processed" under anen_SElocale. It fails the same way on master and passes withLC_ALL=C.UTF-8, so it is unrelated.update-badge.js. Nothing renders differently, apart from an older beta no longer being offered.🤖 Generated with Claude Code
https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7