Repository navigation
feat(start-os): offer to wait for a running backup before restarting or shutting down - #3755
helix-white wants to merge 122 commits into
Conversation
…or shutting down Powering the server off part-way through a backup can corrupt the backup of whichever service is being written at that moment, and nothing stopped it: Restart and Shutdown took effect immediately, and the case power button went straight to systemd-logind's poweroff. Restart or Shutdown during a backup now opens a prompt offering to wait for the backup to finish, which is also what happens if the user walks away — it counts down and takes that option for them. The choice is recorded server-side as serverInfo.statusInfo.deferredPowerAction, so it survives the browser: a task started at boot watches for the backup to clear and then carries the action out, an action bar in every connected UI says what is coming, and either the bar's Cancel or an immediate restart/shutdown clears it. The power button reaches the same place. While a backup runs, startd holds a systemd-logind 'handle-power-key' block inhibitor and reads the key itself from the devices udev tags 'power-switch' — logind's own set — so a press defers rather than powers off. It names 'handle-power-key' and not 'shutdown' deliberately: blocking 'shutdown' would also block the power-off StartOS asks systemd for at the end of its own teardown. Every step degrades to today's behavior on failure, and a beep acknowledges the press for whoever is standing at the server. Deferring is opt-in (--after-backup) so startos-shutdown.service and startos-restart.service, which cannot wait, are unchanged.
- power_key is Linux-only (libc::input_event, nix major/minor), so gate the module and its spawn on target_os = "linux"; it broke the apple-darwin build. - run_deferred_power_actions no longer returns after one action or one failure, so a later deferral is still honoured, and it backs off instead of spinning when the take mutation keeps failing. - Fold the backup check and the power action into one mutation, so a backup starting in between can no longer be interrupted. - Clear a stale backupProgress (and any deferred action) when startd starts without a reboot. A backup dies with the process that ran it, and a stale flag would otherwise leave the power key inhibited with nothing left to release it. - Hold the logind inhibitor only while the key is actually being read, so a server whose key StartOS cannot see keeps powering off as it does today rather than getting an inert button. - Route every in-app restart/shutdown through PowerService, so the restart-to-apply bar and the disk-repair restart stop bypassing the prompt. - Show one action bar at a time; they are position:fixed and were stacking. The deferred-power bar keeps its own gate, since the shared one is switched off for good on the first restart. - One timer drives the countdown label and the default it takes. - Mock clears the deferral on an immediate action, as the backend does. - Docs: the power button defers without asking, the CLI still interrupts unless asked not to, and shutting down on UPS battery wants "now".
… bar A second review round on the previous commit found that chaining the three action bars with @else if made the new one unreachable: statusInfo.restart is set on a hostname, language, kiosk or update change and is never cleared until the next boot, so it shadowed the deferred-power bar — the only place a queued restart or shutdown is shown, and the only way to cancel one. - Put the deferred-power bar first: it is transient and time-limited, the restart-reason bar is neither, and it is never gated off. - PowerService now reports whether the action was deferred, so the shared bar is only latched off once a restart is really under way. Dismissing the prompt used to hide the restart-to-apply bar for good with nothing having happened. - Give up the power key entirely when any one device stops being readable — there is no telling which device the firmware reports presses on, and an inhibitor outliving the reader is an inert button. - Re-defer rather than interrupt if a backup started since the deferred action was taken. - Reset the whole transient status, on the branch that skips init and before the RPC surface is serving. - Docs: ARCHITECTURE says the power-key handling is best-effort, the CLI reference lists --nowait alongside --after-backup, and a few comments now say what the code does.
…d's key codes Review round 1 on #3755. - The power key is now enumerated, inhibited and read once per backup rather than once per boot. Unplugging any keyboard used to end `read_power_key` for good — udev tags every key-capable device `power-switch`, so that is an ordinary event, not an error — leaving later backups unprotected with only a log line to say so. Per-backup setup also picks up a device plugged in since boot, and stops startd holding input devices open when nothing is at stake. - Match `KEY_POWER2` as well as `KEY_POWER`. logind handles both in one arm, and the inhibitor blocks both, so on hardware reporting 356 the button was inhibited and unread — inert for the whole backup. - A deferred action that fails to perform is put back rather than dropped, so it is either carried out or cancelled, never silently lost. - The backup prompt now carries the "will not come back online automatically" warning on the shutdown path. Skipping the usual confirm dropped it, and it is the one thing a user powering down needs to have read. - String 915 said "Powering down" but is shown on the restart path too; it now says "Interrupting it", in all five locales. - `STATUS_INFO_PTR` lived in two modules; `power.service`'s TSDoc claimed the emission reflected the server's decision when it reflects the user's choice; ARCHITECTURE.md restated the module's own rationale; a few comments narrated rather than explained. - surge-and-ups says the power button always waits, so on battery use the UI.
Review round 2 on #3755, plus one defect of my own found re-reading round 1. - Round 1's re-arm of a failed deferred action called `defer_or_begin`, which with the backup already over takes its other branch: it cleared the action and set `shuttingDown`/`restarting` without performing anything, leaving the header reading "Shutting down" until startd restarted. It writes the field directly now. - A failed logind `Inhibit` propagated out of `guard_backups` and ended the guard for the rest of the boot, while enumeration and read failures beside it only skipped one backup. A logind restart or a call timeout under backup load therefore left every later backup unguarded, silently. One backup's guard is now one fallible unit, so any failure costs that backup and no more — which is what the module doc already claimed. - The prompt's two buttons are sentences that do not shrink, and 25rem cannot hold them on one row in any locale — English overflows the dialog by 51px, German by 137px. The footer wraps now.
…n restart too Review round 3 on #3755. - Round 2 added `footer { flex-wrap: wrap }` to the prompt on the strength of a font measurement showing the two buttons overflowing a 25rem dialog. The measurement modelled a row that does not exist: Taiga already styles a selectorless dialog component's footer via `tui-dialog[data-appearance~=taiga]>ng-component>footer`, which sets `flex-wrap: wrap-reverse` at a specificity the component's own `footer[_ngcontent-*]` cannot reach. The footer always wrapped; the declaration never applied. Removed, along with the comment asserting otherwise. - `updateProgress` is written by an in-process task exactly like the four statuses beside it, so the boot-path reset now clears it too. A startd restart mid-download previously left it set with its writer dead, which `server.update` reads as "already updating" and the UI as a frozen progress bar — wedged until the box rebooted.
The review pass over this PR flagged its own weakest point: the branch that decides between recording a power action and performing it, and the take that clears it, had no test — and that is exactly where two of the defects found during review lived (a runner that exited after one action, and a re-arm that set shuttingDown without shutting anything down). Extracts the three db transitions from their mutate closures into free functions over DatabaseModel, following the pattern the version migrations already use, and drives them with json! fixtures. Seven tests, each verified to fail against a deliberately broken implementation: ignoring after_backup, taking without clearing, beginning without clearing a pending action, swapping the restart and shutdown arms, and making the power-key path begin an action rather than record one. The async wrappers and run_deferred_power_actions' loop still have no coverage; they need an RpcContext.
no, we really should prevent this |
|
Agreed: backups should be rejected once shutdown or restart begins. I read the proposed patch and will add the guard, regression tests, localized error, and docs, then remove the two obsolete PR-body bullets and re-request review after verification. Currently blocked before making changes: |
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
…n-during-backup Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
|
Addressed @dr-bonez’s request and @helix-b’s proposal in the updated branch.
Executed verification: Runtime verification used an isolated released 0.4.0 VM with the integrated static startbox binary and real ntfy backups. Both actions deferred/canceled; successful completion caused real reboot/poweroff; new requests after committed actions returned InvalidRequest/38. Synthetic KEY_POWER exercised the integrated handler, with the inhibitor present only during backup. The VM was released afterward. One unresolved observation for handoff: teardown logged volume-export “still in use” errors despite successful reboot/poweroff. This does not establish a root cause or error-free volume export; no adjacent teardown changes are included. Release pre-check passed version/content gates but publishing prerequisites are unavailable here (unpublished images/signing/S3 configuration); no release was attempted. Re-requesting cross-review of the final head; fresh CI will run on this push. |
|
CI update for Seven checks report failure because GitHub could not allocate a hosted runner: “The job was not acquired by Runner of type hosted even after multiple attempts.” I inspected the retarget classifier, conflict-marker check, change detector, two ISO compile jobs, and two Debian-package jobs: every affected job has runner_id=0 and no executed steps. These are infrastructure failures, not compiler/test failures; no code changes are indicated. The Automated Tests run confirms its change detector never started; backend tests, formatting/lockfiles, license checks, and generated-artifact checks were skipped as a result. Other builds are still running. CI is not green; the final-review brief will retain this limitation. |
|
Cross-review approved The brief retains the outstanding hosted-runner CI failures and the unresolved VM volume-export errors; successful reboot/poweroff does not establish error-free teardown. It also distinguishes best-effort physical-button protection from the stronger “always waits” wording in the user docs. No merge or release was performed. |
|
Latest CI for The CLI x86_64 musl job is now red: its log shows Hosted-runner allocation failures remain as previously documented, and other builds/checks are pending. No code change is indicated by the available logs. |
|
The completed start-cli failure notification matches the termination already investigated: no compiler error in the x86_64 musl log, followed by fail-fast cancellation of siblings. Requested one rerun of the failed jobs to obtain a completed result rather than changing code without a diagnosed source failure. Other CI remains pending; I will wait for workflow notifications. |
|
The completed ISO workflow confirms aarch64 compilation passed, while x86_64 and riscv64 never obtained hosted runners; image/migration jobs were skipped. There are no compiler failure logs to fix. Requested one failed-job rerun for this workflow and Automated Tests, whose change detector likewise never started, to recover the missing verification. The CLI retry and other builds/checks remain pending. No code changes. |
|
Registry CI built the x86_64 and riscv64 Debian packages successfully. Its aarch64 job never acquired a hosted runner, so I requested one failed-job rerun. The latest conflict-marker, retarget-classifier, and mergeability-metadata jobs also failed before any steps ran for the same runner-allocation reason; requested one retry of the latest conflict-marker check. Automated Tests has now passed its change detector on retry and queued the actual test/artifact jobs. CLI/ISO retries and remaining builds are still pending. No source failure is demonstrated, and no code changes were made. |
|
Retarget Mergeability and the retarget classifier failed on attempt 1 because no hosted runner was assigned; neither executed any steps. GitHub independently still reports MERGEABLE. Requested one retry of each; the subsequent retarget failure notification refers to the already-investigated first attempt, while attempt 2 is queued. All outstanding build/test retries remain pending; no code changes are indicated. |
|
StartTunnel built aarch64 and riscv64 packages successfully; its x86_64 job never acquired a hosted runner. Requested one failed-job retry, with no code changes. The mergeability-metadata retry has now passed; remaining build/test/check retries are still pending. |
|
I merged master
|
helix-white
left a comment
There was a problem hiding this comment.
Approving 40190cfc6. git merge-tree --write-tree origin/master HEAD exits 0, and 55d207bd8 is still master's tip.
There are two commits since my last approval at 259047ede:
01b1e83c0merges master55d207bd8. I read its--remerge-diff. The only conflict is the@start9labs/sharedstub inui.test.mjs. The resolution keeps this PR'sdatabaseSourceandwaitForPatchSequenceexports alongside #4907'sescapeHtml, and the concatenated export string still ends correctly.40190cfc6moves the five power strings from 1311–1315 to 1312–1316, since #4907's'Get help'took 1311. The shift is uniform in all five dictionaries, the text is identical once IDs are stripped, and no dictionary has a duplicate ID.
Apart from those dictionaries, the PR's own diff against master is identical across the merge in all 71 files. Range-diff pairs the 53 earlier commits as identical, and 40190cfc6 is the only new one.
The newly merged master commits leave this PR's behavior alone:
- #4907 makes
DialogServiceHTML-escape every dialoglabel. The power prompt passes none, since it titles itself, so it is unaffected. #4907's new frontend-skill rule says text from outside the OS never reaches Taiga as a raw string. This PR's power strings are OS-authored i18n keys rendered in templates, and its task messages interpolate only therestart/shutdownaction. #4907's edit togeneral.component.tsescapes the hostname in a different message from this PR'sPowerServicerestart. - #4847 changes only restore password handling in
restore.rs. It doesn't touch backup progress, backup admission or the power flags. - #4849 (an SDK
FileHelperfix) and #4909 (CLI registry naming) don't touch this PR's paths.
@dr-bonez, my earlier caveat stands. @helix-white implemented this PR through dcb9a44e8, so no independent review has covered it as a whole since the retired approval at 1146d17fb.
Under the reviewer rules I read the code only. CI on 40190cfc6 is still running, and it's the maintainer's to weigh.
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
…er menu Helix-Harness: claude-code Helix-Model: claude-opus-5-5
Helix-Harness: claude-code Helix-Model: claude-opus-5-5
…fter #4899 Helix-Harness: claude-code Helix-Model: claude-opus-5-5
…mail Guides book Helix-Harness: claude-code Helix-Model: claude-opus-5-5
…ume name doc Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
I merged master twice, ending at
Verification on the merged tree: the generators are clean after
|
helix-white
left a comment
There was a problem hiding this comment.
Approving 9bbfc1319. git merge-tree --write-tree origin/master HEAD exits 0, and eb288c5b9 is still master's tip.
There are five commits since my last approval at 40190cfc6. I read both merges with --remerge-diff.
36b845ed0merges master446ce7664, the #4898 registry-cache integration. Its only conflict is the import line inheader/menu.component.ts. The resolution keeps this PR'sPowerServiceand #4899'sLAST_SYNCED. The last-synced subtitle is separate frompromptPower.b3ca434bbmoves the five power strings to 1314–1318, since #4898 took 1312–1313. The shift is uniform in all five dictionaries, the text is unchanged, and no dictionary has a duplicate ID.7e532c456re-adds thePATCH_CACHEinjection that #4899 removed fromMockApiService. This PR'sdeferPowerstill waits onwaitForPatchSequence(this.cache, …).PATCH_CACHEis still theDumpthatSubtreePatchDBadvances, so the mock's fence still mirrors the live API'scache$fence. Thetest-rpc-clients.cjsstub supplies that dependency.9bd78150emerges mastereb288c5b9. Its only conflict isprojects/start-docs/ARCHITECTURE.md. The resolution keeps this PR's removal of the duplicatedversions.conflisting and master's Email Guides wording.versions.confitself listsemail-guides, so dropping the listing loses nothing.9bbfc1319regeneratesmcp-tools.jsonandstart-os.schemas.tsto carry #4901's doc comment onSharedVolume.name, which master's committed outputs lack. The added description matches the Rust doc comment word for word.
Apart from those, the PR's own diff against master is identical across both merges.
The newly merged master commits leave this PR's behavior alone:
- #4899's per-path subscriptions don't touch the barrier the UI relies on.
waitForPatchSequenceis unchanged, and the live API still applies it to every RPC response, so the pending bar still appears only after the server's patch. - #4901 moves 0.4.3 to migration revision 4, which suffixes duplicate
public.sharedVolumesnames. This PR's version tests readcurrent.migration_revision(), and their fixtures carry no shared volumes, so the private-data and service-data assertions still hold. - The MCP catalog has 179 tools against master's 178, so this PR still adds exactly one.
Not blocking: the description still says master's 0.4.3 node is at "revision 3", and #4901 made it 4. Its CI paragraph also ends at 40190cfc6.
@dr-bonez, my earlier caveat stands. @helix-white implemented this PR through dcb9a44e8, so no independent review has covered it as a whole since the retired approval at 1146d17fb.
Under the reviewer rules I read the code only. CI on 9bbfc1319 is still running, and it's the maintainer's to weigh.
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
… merged sources Helix-Harness: claude-code Helix-Model: claude-opus-5-5
Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
I merged master
|
helix-white
left a comment
There was a problem hiding this comment.
Approving 41a90a2a5. git merge-tree --write-tree origin/master HEAD exits 0 against master's tip d3f3e0b42. Master's two commits since 82fcc9b9b (#4845, #4893) touch none of this PR's files.
There are two commits since my last approval at 9bbfc1319:
1d2f86492merges master82fcc9b9b. I read its--remerge-diff. The only conflicts are the generatedmcp-tools.json,start-os.schemas.tsandtypes.schemas.ts, and the merge commit takes master's copies whole, without this PR's entries.41a90a2a5puts those entries back and moves the power strings:- The restored entries are
server.cancel-deferred-power,ShutdownParams.force,PowerAction,ServerStatus.deferredPowerActionand thewaitdoc line about deferred replies. - They now take #4931's form:
z.boolean().default(() => false),PowerAction.nullable().default(() => null)and"default": falsein the MCP catalog. Master renders the neighbouringwaitandrestartfields the same way, and other documented nullable defaults such asaccess. Both Rust fields carry a field-level#[serde(default)], which is the case #4931 renders this way. - #4932 committed #4901's
SharedVolume.namedoc on master, so this PR no longer carries it. - The power strings move from 1314–1318 to 1315–1319, since #4884's 'Enter your master password to continue.' took 1314. The shift is uniform in all five dictionaries, the text is unchanged, and no dictionary has a duplicate ID.
- The restored entries are
Apart from those three generated files and the five dictionaries, the PR's own diff against master is identical across the merge, still in the same 71 files. Range-diff pairs the 57 earlier commits as identical.
The newly merged master commits leave this PR's behavior alone:
- #4931 changes only the schema generator and its tests.
z.inputandz.outputare unchanged, andrpcClient.tsis untouched. This PR's client test still recordsserver.restart({})as{}, andPowerServicepassesforceexplicitly. An omitteddeferredPowerActionnow decodes to null, the Rust default. - #4884 serves
disk.repaironly in the diagnostic and normal contexts. The settings page's repair-then-restart calls it in the normal context, which keeps its authentication. Its restart still goes throughPowerService. - #4922 keeps the local auth cookie for on-box CLI calls, so the systemd units'
start-cli server restart --forceandserver shutdown --forceconnect as before. - #4874 and #4876: #4874 adds a firmware-flash report to
post_init, and #4876 hardens the proxy's gated upgrades. Neither touches backup admission, the power flags or this PR's UI. i18n.yamlhas no duplicate top-level keys, and the MCP catalog has 179 tools against master's 178.
Not blocking:
- The merge commit's message says it regenerated the bindings, but the regenerated entries are in
41a90a2a5, whose message covers only the IDs. The head is correct. - The description still says master's 0.4.3 node is at "revision 3", and #4901 made it 4.
@dr-bonez, my earlier caveat stands. @helix-white implemented this PR through dcb9a44e8, so no independent review has covered it as a whole since the retired approval at 1146d17fb.
Under the reviewer rules I read the code only. On 41a90a2a5, Prettier, formatting, licenses, the changelog check and the SDK, runtime and script tests have passed. Generated bindings, the Rust test suites and the builds are still running. CI is the maintainer's to weigh.
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
…t tests Helix-Harness: claude-code Helix-Model: claude-opus-5-5
…t for #4896 Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
I merged master
|
helix-white
left a comment
There was a problem hiding this comment.
Approving 032e0b29a. git merge-tree --write-tree origin/master HEAD exits 0, and b7ed50e5f is master's tip.
There are two commits since my last approval at 41a90a2a5:
9b9f9f74emerges masterb7ed50e5f. I read its--remerge-diff. The only conflict is the test module inmcp.rs, where this PR'spower_tools_offer_optional_force_and_cancellationand #4896'severy_cataloged_method_has_an_effectandtools_carry_effects_and_descriptionslanded at the same place. The resolution keeps all three unchanged.032e0b29agivesserver.cancel-deferred-powertheEFFECTmetadata #4896 now requires, asEffect::Write. The PR's test now asserts that itsreadOnlyHintanddestructiveHintare both false.
Effect::Write fits #4896's rule:
- #4896 calls a method destructive when what it discards can't be undone from what remains on the server. A write "loses nothing": start/stop/restart, mount/umount, mark seen/unseen and reversible toggles.
- The pending action is transient status like
restartingandshuttingDown.startdclears all three at every start. It holds no user data or configuration, and the same restart or shutdown call queues it again while the backup runs. - Master's destructive cancel and clear methods each lose something real:
clear-smtpandclear-nutdiscard configuration;action.clear-taskdiscards a task only the package can recreate;package.cancel-installabandons an install in progress.
server.restartrightly keeps master'sWrite. Its only new effects are replacing that pending status and, withforce, interrupting a backup, which master's restart always did.
Apart from those two lines, the PR's own diff against master is identical across the merge in all 71 files. Range-diff pairs the 58 earlier commits as identical.
The newly merged master commits leave this PR's behavior alone:
- #4868 only adds
i18n.yamlkeys, and the file still has no duplicate top-level keys. - #4900 (the bridge hostname), #4845 (ACME and WAN-probe gateways) and #4893 (container-runtime schemas) touch none of this PR's files.
- Master added no dictionary strings, so the power strings stay at 1315–1319 with no duplicates.
- The MCP catalog has 179 tools against master's 178, and the PR's tool keeps its description from
about.cancel-deferred-power.
Not blocking: the description still says master's 0.4.3 node is at "revision 3", and #4901 made it 4.
@dr-bonez, my earlier caveat stands. @helix-white implemented this PR through dcb9a44e8, so no independent review has covered it as a whole since the retired approval at 1146d17fb.
Under the reviewer rules I read the code only. On 032e0b29a, Prettier, formatting, licenses, the changelog check and the SDK, runtime and script tests have passed. Generated bindings, the Rust test suites and the builds are still running. CI is the maintainer's to weigh.
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 5969681880 approved 0a3a1b6 (base b67bf47); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 declares server.cancel-deferred-power as Effect::Write, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: sni.rs left because master's #4832 carries the same fixture, and the other 13 differing files are adaptations to master (power strings renumbered from 1303-1307 to 1315-1319 with identical text, generated schemas in #4931's default rendering, portal PatchDB re-injection after #4872, mock PATCH_CACHE re-injection after #4899, version tests following master's 0.4.3 migrations, docs rewording around Email Guides). Range-diff: 49 reviewed commits identical, 10 added, none dropped or changed. The ten merges resolve conflicts only in those adaptations and in mcp.rs, where 9b9f9f7 keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 5987603212 approved 8f9e1aa (base 63a33ed); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 declares server.cancel-deferred-power as Effect::Write, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: sni.rs left because master's #4832 carries the same fixture, and the other 13 differing files are adaptations to master (power strings renumbered from 1303-1307 to 1315-1319 with identical text, generated schemas in #4931's default rendering, portal PatchDB re-injection after #4872, mock PATCH_CACHE re-injection after #4899, the trust-migration fixture modelling #4757's SSH-key move, docs rewording around Email Guides). Range-diff: 50 reviewed commits identical, 9 added, none dropped or changed. The nine merges resolve conflicts only in those adaptations and in mcp.rs, where 9b9f9f7 keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 6003305074 approved 47bcca6 (base 95d728e); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 declares server.cancel-deferred-power as Effect::Write, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: sni.rs left because master's #4832 carries the same fixture, and the other 12 differing files are adaptations to master (power strings renumbered from 1307-1311 to 1315-1319 with identical text, generated schemas in #4931's default rendering, portal PatchDB re-injection after #4872, mock PATCH_CACHE re-injection after #4899, docs rewording around Email Guides); the version tests, including the sshPubkeys fixture this review approved, are unchanged. Range-diff: 52 reviewed commits identical, 7 added, none dropped or changed. The eight merges resolve conflicts only in those adaptations and in mcp.rs, where 9b9f9f7 keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 6004098605 approved 0da6ce4 (base 09b0eee); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 declares server.cancel-deferred-power as Effect::Write, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: the same 71 files, with 12 differing only as adaptations to master (power strings renumbered from 1311-1315 to 1315-1319 with identical text, generated schemas in #4931's default rendering, portal PatchDB re-injection after #4872, mock PATCH_CACHE re-injection after #4899, docs rewording around Email Guides), and backup admission, shutdown, startd, power_key.rs and PowerService unchanged as this review relied on. Range-diff: 53 reviewed commits identical, 6 added, none dropped or changed. The seven merges resolve conflicts only in those adaptations and in mcp.rs, where 9b9f9f7 keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 6013794232 approved 63bb85d (base c6eb52a); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 declares server.cancel-deferred-power as Effect::Write, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: the same 71 files, with 11 differing only as adaptations to master (power strings renumbered from 1311-1315 to 1315-1319 with identical text, generated schemas in #4931's default rendering, mock PATCH_CACHE re-injection after #4899, docs rewording around Email Guides), and the portal component this review examined is unchanged. Range-diff: 53 reviewed commits identical, 6 added, none dropped or changed. The six merges resolve conflicts only in those adaptations, the server man page, the UI test stub, the header imports and mcp.rs, where 9b9f9f7 keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 6031605339 approved 259047e (base a58eb56); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered, in the very registration it examined. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 adds .with_metadata(EFFECT, Effect::Write) to the server.cancel-deferred-power registration in lib.rs, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: the same 71 files, with 11 differing only as adaptations to master (power strings renumbered from 1311-1315 to 1315-1319 with identical text, generated schemas in #4931's default rendering, mock PATCH_CACHE re-injection after #4899, docs rewording around Email Guides). Range-diff: 53 reviewed commits identical, 6 added, none dropped or changed. The five merges resolve conflicts only in those adaptations, the UI test stub, the header imports and mcp.rs, where 9b9f9f7 keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 6045762558 approved 40190cf (base 55d207b); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 declares server.cancel-deferred-power as Effect::Write, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: the same 71 files, with 11 differing only as adaptations to master (power strings renumbered from 1312-1316 to 1315-1319 with identical text, generated schemas in #4931's default rendering, mock PATCH_CACHE re-injection after #4899, docs rewording around Email Guides), and the ui.test.mjs stub and label-less power prompt this review examined are unchanged. Range-diff: 54 reviewed commits identical, 5 added, none dropped or changed. The four merges resolve conflicts only in those adaptations, the header imports and mcp.rs, where 9b9f9f7 keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 6048121290 approved 9bbfc13 (base eb288c5); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). Since that review the PR's own MCP surface gained a decision the review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 declares server.cancel-deferred-power as Effect::Write, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. The rest of the PR's own diff is unchanged in substance: the same 71 files, with 8 differing only as adaptations to master (power strings renumbered from 1314-1318 to 1315-1319 with identical text, generated bindings and MCP catalog in #4931's default rendering, and #4901's SharedVolume.name doc now carried by master's #4932). Range-diff: 57 reviewed commits identical, 2 added (41a90a2 and 032e0b2), none dropped or changed. Merge 1d2f864 took master's generated files and 41a90a2 restored the PR's entries; merge 9b9f9f7 conflicted only in mcp.rs and keeps the PR's power-tool test beside #4896's effect tests. |
|
Retiring the marked review from @helix-white (#3755 (review)). Dismissed by Helix: the changes require a substantive PR brief update. Review 6050172612 approved 41a90a2 (base 82fcc9b); the head is now 032e0b2 (base b7ed50e, target still master, never retargeted). The only change to the PR's own diff is a decision this review never covered. Master's #4896 makes every cataloged method declare an effect, serves it as MCP readOnlyHint and destructiveHint, and frames the classification as a security boundary. 032e0b2 adds .with_metadata(EFFECT, Effect::Write) to the server.cancel-deferred-power registration in lib.rs, so the PR's new tool now advertises readOnlyHint false and destructiveHint false where it previously carried no annotations, and the PR's test in mcp.rs asserts both. Write versus Destructive is a real choice under #4896's rule (master marks package.cancel-install, clear-smtp, clear-nut and action.clear-task destructive), so the brief's Data model and API bullet, which called the cancel RPC simply an MCP tool, must now state its write, non-destructive classification, as the current description does. Nothing else in the PR's own diff changed: the same 71 files with identical lines apart from lib.rs and mcp.rs, and range-diff pairs all 58 reviewed commits as identical, adding only 032e0b2. Merge 9b9f9f7 of master b7ed50e conflicted only in the mcp.rs test module and keeps the PR's power-tool test beside #4896's effect tests. |
Closes #3608
Before merge, a maintainer decision: earlier VM testing of this branch hit an unexplained emergency-mode boot and volume-export "still in use", network and unmount errors. A later matrix of real backups with every power action passed, but it explained none of those observations and does not show error-free teardown. Nothing ties them to this PR. Whether they block merge is your call.
Release target: StartOS 0.4.3 and start-cli 3.0.0. The newest stable tags are
start-os/v0.4.2.1andstart-cli/v2.8.0, and neither contains this feature. The pendingminorpower fragment makes StartOS 0.4.3. CLI 3.0.0 comes from master's pending major change (removingserver update-signers), not from this PR.What changes
start-cli server restartandserver shutdownwait for a running backup by default, and--forceinterrupts it.--nowaitstill only controls whether the command waits for teardown to finish; it never permits interrupting a backup. A deferred request returns immediately.start-cli server cancel-deferred-powercancels the pending action. The CLI reference documents all of this as requiring StartOS 0.4.3 and start-cli 3.0.0.start-cli server shutdown --force/server restart --force. A shutdown that systemd is already carrying out, such assystemctl poweroffor the UPS Monitor's low-battery shutdown, interrupts a running backup. The Surge Protector and UPS page now says so and tells users to choose Shut down now for a manual shutdown on battery.Additional fixes, each deliberate:
Implementation diff: +759 / −143 lines in 31 files (excludes lockfiles, tests, docs, release notes, and changelog). About 210 of the added lines are the power-key reader in
power_key.rs.Data model and API
ShutdownParams(the input toserver.restartandserver.shutdown) gains optionalforce, defaulting to false. Older callers that omit it get the waiting behavior. Responses staynull.server.cancel-deferred-power, with no parameters and anullresponse. It is also an MCP tool, classified as a write effect (not read-only, not destructive): 179 tools against master's 178.serverInfo.statusInfogains nullabledeferredPowerAction, either"restart"or"shutdown". It records what the user asked for, not whether a backup is running. Existing databases read it as null, and the daemon clears it at every start, so no migration is needed.version/mod.rsandv0_4_0_5.rs, which check each step from 0.4.0.5 onward, that private and service data survive, and that a second boot at 0.4.3's migration revision changes nothing, plus the 0.4.0 welcome fix inv0_4_0.rs.How it works
handle-power-keyblock inhibitor plus its own key readers, held only while a backup runs. Ashutdowninhibitor would also block the final power-off StartOS asks systemd for. With no readable power-switch device or no inhibitor, logind keeps the key. A reader failure releases the inhibitor.PowerService, the existing dialog service, the generated clients and the existingwaitForPatchSequencebarrier in@start9labs/shared. A deferred request therefore shows the pending bar only once the server's patch has arrived. A deferred or dismissed restart keeps the restart-to-apply bar. The prompt titles itself in its own header, following the frontend skill's dialog convention; this was @helix-white's final-round proposal. The production mock follows the backend's order: it publishes backup history before clearing progress and committing a queued action.Decisions for you
de_DE,es_ES,fr_FRandpl_PLcopies of this PR's power and interrupted-indicator fragments predate feat(repo): curate, edit, and translate release notes at release time #4686, which retired per-fragment translations. feat(repo): curate, edit, and translate release notes at release time #4686 says open PRs carrying them need no change; the compiler ignores them and tag CI deletes them. They are left in place. Delete them before merge if you prefer.Testing
54341be68), with the repository's own scripts through the build cache:npm run check:uipassed: the StartOS UI typecheck and all 281 UI tests.npm run check:i18npassed, with all 1,100 keys valid.changelog.mjs validateandcheck-versionpassed for StartOS, which computes 0.4.3.backup.createto the local target with no services, so it backed up shared volumes only). Both dialogs held both choices for 5.1 seconds with nothing chosen. Escape closed the shutdown prompt without queuing an action. There were no page or console errors. The 390px image is a desktop window resized, not device emulation.dcb9a44e8by the previous implementer:8f9e1aaf9every check finished with no failure. That covered every test suite, generated bindings and the MCP catalog, formatting, licenses, the changelog check, binaries and all nine OS image builds. On0da6ce4d8, which merged master09b0eee39, full CI finished with every check passing or skipped, including all nine OS image builds. On63bb85d23, which merged masterc6eb52a7f, full CI finished with every check passing or skipped. That merge's only conflict was the portal component: fix(web): hide the restart banner while the server is restarting #4872 moved the restart bar's reason toOSService.restartReason$(hidden while a restart or shutdown is under way), and this PR had moved the bar's Restart button ontoPowerServiceand added the deferred-power bar. The resolution keeps both. On259047ede, which merged mastera58eb56ba, full CI finished with every check passing or skipped. That merge's only conflict was the generatedstart-cli-server.1man page, which feat(cli): add CLI bindings for every operator-drivable RPC #4856's new CLI bindings also changed; it was regenerated from the merged sources and adds this PR'scancel-deferred-powerentry to master's.40190cfc6merged master55d207bd8(its only conflict was theui.test.mjsstub exports) and was superseded by the next merge.9bbfc1319merged master througheb288c5b9, and full CI on it passed. The conflicts were import lines in the header menu (feat(start-os): subscribe each watched PatchDB path on the server #4899'sLAST_SYNCEDbeside this PR'sPowerService) and the docsARCHITECTURE.mdbook lists (Email Guides added to this PR's wording). Follow-up commits move the power strings to dictionary IDs 1314–1318 and restore the mock'sPATCH_CACHEinjection that the deferred-power fence needs after feat(start-os): subscribe each watched PatchDB path on the server #4899 removed it. They also regenerate bindings and the MCP catalog for feat(start-os): enforce unique shared-volume names #4901's shared-volume doc comment, which master's committed artifacts lacked.41a90a2a5merged master82fcc9b9b. Its only conflicts were generated bindings and the MCP catalog, which were regenerated on the merged sources. A follow-up commit moves the power strings to dictionary IDs 1315–1319 after master took 1314. Its CI passed apart from the two macOSstart-clibuilds, whererustcwas SIGKILLed with no compile error; they were rerun. The current head032e0b29amerges masterb7ed50e5f. Its only conflict was themcp.rstest module, where both sides' tests are kept. A follow-up commit classifiesserver.cancel-deferred-poweras a write effect, which feat(mcp): classify every tool's effect and describe it from the CLI #4896's catalog test requires. On that head these passed locally: the generators (clean), 97 version, 9 shutdown, 11 backup-admission, 2 power-key, 19 SNI and 5 MCP Rust tests,check:ui(348 UI tests),check:i18n(1,110 keys) and 104 RPC-client tests. Full CI on it finished with every check passing or skipped, including all nine OS image builds and both macOSstart-clibuilds.Screenshots
The pending-shutdown bar is unchanged since
dcb9a44e8, so its two images are reused. The three prompt images below are new for this head.Helix-Harness: claude-code
Helix-Model: claude-opus-5-5