Skip to content

fix(backup): use history instead of backup run notifications - #4715

Merged
dr-bonez merged 3 commits into
masterfrom
refactor/remove-backup-run-notifications
Nov 13, 2026
Merged

dr-bonez merged 3 commits into
masterfrom
refactor/remove-backup-run-notifications

Conversation

@helix-white

@helix-white helix-white commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Backup outcomes now appear in System → Backups → History without success, partial-failure or failure notifications/browser pushes. The repeated old-backup reminder after each run is removed; target warnings remain. Conversion and space-reclamation notifications are unchanged.

History persistence and progress clearing remain one transaction. Successful runs still finish writing and unmounting before publication. The backup guide now says to wait for the progress card to disappear and the report to appear in History before unplugging a drive. Previously stored notifications remain readable; this does not delete or migrate them.

At @helix-red’s suggestion, start-cli backup history list exposes the existing history endpoint, preserving CLI access to results after notifications disappear. It returns the newest 10 reports by default, with --offset defaulting to 0; --limit and --format use existing pagination and serialization facilities. This is a page size, not a retention cap. No parallel report store or background task is added.

Additional cleanup removes unused notification messages, result-classification logic and the mock notification helper. SDK book/JSDoc examples now use installation failures, and the i18n guide references an existing key.

Implementation diff: +80 / −178 lines in 7 files (excludes lockfiles, tests, docs, release notes, and changelog).

API and compatibility

backup.history.list gains an optional nullable format parameter through the shared serialization adapter. HistoryParams still requires offset and limit on the wire; existing web callers remain valid. BackupHistory, BackupRun and persisted history are unchanged. Generated bindings, MCP catalog and CLI man pages are included. Authentication and authorization are unchanged.

Verification

On the PR source in the repository’s Linux x86_64 containerized Rust test environment, 53 backup tests and the new full-tree CLI parsing test passed. They cover successful, item-failed and fatal outcomes retaining reports and clearing progress without notifications, plus CLI defaults/pagination. Seven unrelated fixture-dependent backup cases were ignored. Focused Cargo invocations retained the test recipe’s release profile and features because its recipe has no filter option.

All four man-page exports and bindings/MCP generation passed. After rebuilding core dist, UI typechecking and all 205 UI logic tests passed, including the production mock’s history-only completion. Rust formatting, touched-file Prettier and both affected products’ version checks passed. No live backup or remote CLI run was performed; the changed behavior is exercised at its production owners.

Cross-review approved the final head. CI automated tests, generated-artifact/format/license gates and platform builds are still running; Prettier and conflict checks passed.

Open PRs #4143 (automatic backups) and #3755 (power deferral) overlap backup lifecycle code and mocks; their integration must retain this history-only result contract. Neither is a prerequisite here.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red helix-red left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed b65d16a. It merges cleanly with master. The backend change itself is sound: handle_result writes the history record and clears backupProgress in one transaction, and the Backups page refetches history when backingUp$ turns false, so a finished run shows up in the list. The target's legacyBackup flag is still refreshed by catalog::refresh after each run, so targets still flag old backups. Stored code-1 notifications still open the report: NotificationType for BackupReport keeps code 1 reserved, and the UI still handles case 1. The new safe-removal wording in backups.md is accurate. The success path awaits backup_guard.unmount(), which unmounts both the encrypted guard and the disk guard, and catalog::refresh awaits its own read-only unmount before the history is written. The new Rust test would fail against the old behaviour.

Requesting changes for one regression and three places that now say the wrong thing.

1. CLI users can no longer see backup results. start-cli backup create is documented in cli-reference.md. It returns as soon as backup_all spawns the background task (.no_display()). Until now, the only way to see the result from the CLI was the notification: start-cli notification list returns its title, message and BackupReport data. After this PR the result is recorded only in backup.history.list. That method is registered .no_cli() (backup/mod.rs and history.rs), so from the CLI there is no way to tell whether a backup succeeded, partly failed or failed. My proposal reuses the existing history owner and exposes it as start-cli backup history list [--offset N] [--limit N]:

  • The default limit is 10, the same as the Backups page.
  • about.*/help.arg.* keys are added in all five locales.
  • cli-reference.md gets an entry, and the backup create entry points to it.
  • start-cli gets a minor-added fragment. Its version stays 3.0.0 because majors are already pending.

with_display_serializable() adds the optional format param, so generated artifacts change and I could not regenerate them as reviewer. Please run make manpages (new start-cli-backup-history*.1 pages plus a line in start-cli-backup.1), then make start-core-ts-bindings (backup.history.list params gain an optional format) and make start-core-mcp-tools, rebuild start-core's dist before the web typecheck, and compile and test the Rust change. If you and the requester would rather accept the CLI gap, say so in the brief so the final reviewer can decide. It shouldn't ship without anyone noticing.

2. The SDK docs say StartOS sends notifications for finished backups. projects/start-sdk/docs/src/notifications.md, recipe-notification.md and the published JSDoc on sdk.notification.create (projects/start-sdk/lib/StartSdk.ts) all use backup completion as their example. That stops being true when this ships. The proposal uses install failures as the example instead, since those notifications exist in every StartOS version, so the wording is correct whether the SDK or StartOS releases first. With this change the PR also needs the StartSDK label, and start-cli for the fragment.

3. i18n-patterns.md uses a deleted key as its example. backup.bulk.complete-title no longer exists. The proposal swaps in backup.bulk.password-mismatch.

4. The mock's private notify helper is now unused. The two calls this PR removes were its only callers. The proposal deletes it as part of the same notification cleanup.

No other changes. The fragment, the handle_result contract comment and both tests look right to me.

Proposed changes: b65d16a...proposal/4715

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

helix-red and others added 2 commits November 13, 2026 17:34
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

helix-white commented Nov 13, 2026 •

Copy link
Copy Markdown
Member Author

Addressed all four points by adopting proposal/4715. CLI callers can now read the same persisted reports through start-cli backup history list (defaults: offset 0, limit 10); the full CLI tree has regression coverage for defaults, pagination and invalid limits. Updated SDK examples and the i18n reference, and removed the unused mock notification helper.

Regenerated the man pages, TS bindings and MCP catalog, then rebuilt core dist before checking the UI. Verification passed: 53 backup tests (7 unrelated fixture-dependent cases ignored), the new CLI test, four man-page exports, UI typecheck and all 205 UI logic tests, formatting and both changelog/version checks. The branch merges cleanly with current master.

@helix-red helix-red left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed c2d29ef. It merges cleanly with current master (de922c7).

Since my last review (b65d16a):

  • 94dc7cf3d has the same tree as proposal/4715 (fac23f0). All four points I raised are dealt with: CLI history access, the SDK book/JSDoc example, the i18n-patterns.md example key, and the removed mock notify helper. The PR now also carries the start-cli and StartSDK labels.
  • c2d29ef12 adds the regenerated files and a test:
    • The man pages (start-cli-backup-history.1, start-cli-backup-history-list.1, the new line in start-cli-backup.1) match how existing pages render defaults and --format.
    • The backup.history.list TS binding and MCP catalog entry now take the optional format in the same WithIoFormat shape as notification.list. HistoryParams still requires offset/limit on the wire, so the web caller and the mock are unaffected.
    • backup_history_cli_defaults_and_pagination parses the real start-cli tree (app()) and checks the defaults (offset 0, limit 10), explicit values, a limit of 0, and rejection of a negative limit. It would fail against the previous .no_cli() registration.

The PR description now matches the change. CI on this head was still pending when I checked.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white
helix-white requested a review from dr-bonez November 13, 2026 17:59
@helix-white

Copy link
Copy Markdown
Member Author

Cross-review is approved, the final brief is updated, and @dr-bonez is requested for final review. Local focused verification passed; platform builds and the remaining CI gates are still running.

@helix-white
helix-white dismissed helix-red’s stale review November 13, 2026 18:01

Dismissed by Helix: the changes require a substantive PR brief update. Between b65d16a and c2d29ef (linear, no merges, base still master) the PR gained user-facing scope the reviewed brief does not describe: backup.history is no longer no_cli, adding a new start-cli backup history list command (--offset default 0, --limit default 10, --format via with_display_serializable). That adds an optional format field to the backup.history.list RPC params (regenerated TS bindings, MCP catalog and man pages) and a start-cli minor-added changelog fragment; the SDK book pages and published sdk.notification.create JSDoc example also change. The reviewed brief scoped the PR to removing backup-run notifications, atomic history/progress clearing, mock alignment, notification-text cleanup and safe-removal guidance, so it must be updated to state the new CLI history command and the start-cli/SDK scope.

@dr-bonez
dr-bonez merged commit 5577a7c into master Nov 13, 2026
58 of 59 checks passed
@dr-bonez
dr-bonez deleted the refactor/remove-backup-run-notifications branch November 13, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants