DeepSeek-Reasonix
DeepSeek-Reasonix copied to clipboard
fix(update): reconcile pending update transactions / 自动对账挂起更新事务
Summary
Split slice of #7192: minimal updater network config loading and explicit seven-state pending-update reconciliation.
Retained / adapted from #7192
LoadUpdateNetworkConfig: expose only update channel, proxy, CA, and network settings to the updater; fall back to LKG, env proxy, and defaults when the live config is damaged.- Seven-state inspection:
none/prepared/probationary/failed_install/restored/active_handoff/blocked. - Cancel, rollback, and restored cleanup re-read under pending/target locks and bind original transaction bytes, transaction ID, installed record, and release unit (
PendingUpdateTransactionSnapshot,removePendingUpdateExactRawVerified). - Unified call sites: Desktop launch, check-update, install-update (Guard already reconciled on main via #7149).
- UI surfaces
UpdateInfo.Recoveryand explicit progress phases instead of opaque "a pending update already exists". - P1: unknown JSON fields present before first Inspect enter
blockedwithout deleting transaction, backup, or install records; cleanup-semantic field additions require schema version bumps.
Explicitly excluded
| Area | Destination |
|---|---|
| TOML encode / safe write pipeline | PR 1 (#7228) |
| Config escape auto-repair / banners | PR 2 |
| Session ownership recovery | PR 4 |
| Smart close / config v6 | PR 5 |
| Background jobs / mode switch | #7198 |
Dependencies
- None relative to PR 1/2. Base: latest
main-v2. - Builds on already-merged #7149 reconciliation executor; this PR adds inspect views, raw-byte end paths, network-only config load, and Desktop UI wiring.
Compatibility
| Surface | Old data / older binary | Conclusion |
|---|---|---|
| Pending update JSON | Extra unknown fields → blocked, no destructive cleanup | Safe |
UpdateInfo.Recovery |
New optional field (omitempty) |
Backward compatible |
| Progress phase strings | Additive | Older UIs ignore unknown phases |
| Full config load for updates | Replaced by network-only loader | Updater still works with damaged plugins/MCP config |
Cache impact
None expected: no prompt, tool schema, or request serialization changes.
Verification
go test ./internal/config -run 'UpdateNetwork|LoadUpdate'
go test ./internal/repair -run 'Update|Pending|Reconcile|Inspect'
go test -race ./internal/repair -run 'Update|Pending|Reconcile|Inspect'
cd desktop && go test -run 'Update|Reconcile|Pending' .
Real install matrix (Windows installer/portable, macOS signed app, Linux tar/deb upgrade/rollback/restart) remains a release gate and is not substituted by unit tests.
Refs: #7192 (supersede mapping will land after all five split PRs exist); builds on #7149
Split mapping (PR 3 of 5)
This PR is the pending-update reconciliation slice extracted from #7192 (builds on already-merged #7149).
| #7192 area | Destination |
|---|---|
| TOML encode / path scan / write pipeline | #7228 |
| Config recovery / isolation / banners | PR 2 (after #7228 merges) |
| Pending-update reconciliation | This PR (#7229) |
| Session ownership recovery | PR 4 (after #7198) |
| Smart close + config v6 | PR 5 (after #7198) |
| Background jobs / mode switch | #7198 |
Related: #7228 · #7198 · #7192 · #7149