Visual Studio Code, rebuilt in Rust
Rust
feat(lifecycle): port the unattended restart's window, launch and failed update blockers
rokartur6c2069fba369
diff --git a/native/crates/app/src/windows_state.rs b/native/crates/app/src/windows_state.rsindex 938aac4f29c..8543a544ab3 100644--- a/native/crates/app/src/windows_state.rs+++ b/native/crates/app/src/windows_state.rs@@ -190,7 +190,7 @@ pub fn window_bounds(ui: UiState, cx: &App) -> Option<(DisplayId, WindowBounds)>Some((display.id(), window_bounds))}-fn storage_file(user_data: &Path) -> PathBuf {+pub(crate) fn storage_file(user_data: &Path) -> PathBuf {user_data.join("User/globalStorage/storage.json")}diff --git a/native/crates/app/src/workbench/unattended_restart.rs b/native/crates/app/src/workbench/unattended_restart.rsindex ec9b58a6799..093921f0ffa 100644--- a/native/crates/app/src/workbench/unattended_restart.rs+++ b/native/crates/app/src/workbench/unattended_restart.rs@@ -2,12 +2,14 @@//! (contrib/update/browser/unattendedRestartParticipants.ts and the ones other areas register), called directly.use std::collections::{BTreeMap, BTreeSet};+use std::path::{Path, PathBuf};use std::time::{Duration, Instant};use futures::StreamExt;use futures::channel::mpsc::unbounded;use gpui::{AppContext, Context, Entity, Global, Task, Window, WindowHandle};use serde_json::Value;+use storage::state::FileStorage;use super::Workbench;use crate::update::State;@@ -142,6 +144,79 @@ fn instance_blocker(has_child_processes: bool, shell_type: Option<&str>, command(!input.trim().is_empty()).then_some("terminal.pendingInput")}+/// unattendedRestartScheduler.ts `PENDING_RESTART_STATE_KEY` and `FAILED_UPDATE_STATE_KEY`.+const PENDING_RESTART_KEY: &str = "update.unattendedRestart";+const FAILED_UPDATE_KEY: &str = "update.unattendedRestartFailedUpdate";++fn product_commit() -> &'static str {+ crate::product::get("commit").as_str().unwrap_or_default()+}++/// `reportCompletedRestart` without its telemetry, then `readFailedUpdateVersion`: an unattended restart that came+/// back on the same commit did not install its update, and the scheduler does not restart for it again.+fn failed_update_version(user_data: &Path, commit: &str) -> Option<String> {+ let mut storage = FileStorage::open(&windows_state::storage_file(user_data));+ if let Some(restart) = storage.get_item(PENDING_RESTART_KEY).cloned() {+ storage.remove_item(PENDING_RESTART_KEY);+ if restart["fromCommit"] == commit+ && let Some(version) = restart["toVersion"].as_str()+ {+ storage.set_item(FAILED_UPDATE_KEY, Some(serde_json::json!({ "commit": commit, "version": version })));+ }+ }+ let failed = storage.get_item(FAILED_UPDATE_KEY)?;+ match (failed["commit"] == commit, failed["version"].as_str()) {+ (true, Some(version)) => Some(version.to_owned()),+ _ => {+ // Another version runs now.+ storage.remove_item(FAILED_UPDATE_KEY);+ None+ }+ }+}++/// unattendedRestartScheduler.ts `SESSION_ARGUMENTS`: the relaunch drops them or discards the saved layout.+const SESSION_ARGUMENTS: [&str; 9] = ["disable-extensions", "disable-extension", "disable-layout-restore", "enable-proposed-api", "inspect-extensions", "inspect-brk-extensions", "profile", "profile-temp", "use-inmemory-secretstorage"];++/// updateRelaunchArguments.ts `RELAUNCH_STRING_ARGUMENTS` and `RELAUNCH_FLAG_ARGUMENTS`, which the macOS updater's+/// relaunch drops (it passes no arguments).+const RELAUNCH_ARGUMENTS: [&str; 38] = [+ "user-data-dir", "extensions-dir", "builtin-extensions-dir", "extensions-download-dir", "shared-data-dir", "agents-user-data-dir", "agents-extensions-dir", "agent-plugins-dir", "locale", "crash-reporter-directory", "password-store", "proxy-server", "proxy-bypass-list", "proxy-pac-url", "force-device-scale-factor", "ozone-platform", "js-flags", "enable-tracing", "trace-startup-format", "trace-startup-file", "trace-startup-duration",+ "disable-gpu", "disable-lcd-text", "disable-chromium-sandbox", "disable-gpu-sandbox", "disable-dev-shm-usage", "enable-coi", "force-renderer-accessibility", "enable-rdp-display-tracking", "ignore-certificate-errors", "allow-insecure-localhost", "disable-crash-reporter", "disable-telemetry", "disable-updates", "disable-workspace-trust", "disable-experiments", "disable-layout-restore", "use-inmemory-secretstorage",+];++/// `hasArgumentsLostOnRelaunch` on macOS (`getRelaunchArguments` not empty, or `hasSessionArguments`) and+/// `isLaunchedFromCli`: the relaunch resolves the login shell's environment instead.+fn launch_blockers(args: &crate::argv::ParsedArgs, raw: &[String], launched_from_cli: bool) -> Vec<&'static str> {+ let mut blockers = Vec::new();+ // Past `--` a `--no-sandbox` is a file name.+ let negated = raw.iter().take_while(|arg| *arg != "--").any(|arg| arg == "--no-sandbox" || arg == "--no-proxy-server");+ if negated || RELAUNCH_ARGUMENTS.iter().chain(&SESSION_ARGUMENTS).any(|id| args.flag(id)) {+ blockers.push("app.launchArguments");+ }+ if launched_from_cli {+ blockers.push("app.launchedFromCli");+ }+ blockers+}++/// `getWindowBlockers` of one window, without the fullscreen display its caller counts. Not reached: `window.notReady`+/// (a window is created ready), `window.remote`, and the floating windows' ones (the port's are all editor parts).+fn window_blockers(workbench: &Workbench) -> Vec<&'static str> {+ let mut blockers = Vec::new();+ if workbench.extension_development {+ blockers.push("window.extensionDevelopment");+ }+ if workbench.user_data_profiles.state.as_ref().is_some_and(|state| state.current.is_transient) {+ blockers.push("window.temporaryProfile");+ }+ // The window's own `SESSION_ARGUMENTS`: the port's windows keep only `--profile` and `--profile-temp`.+ if workbench.cli_profile.name.is_some() || workbench.cli_profile.temp {+ blockers.push("window.launchArguments");+ }+ blockers+}+/// The service's aggregation: ids deduplicated and sorted, details of one id joined with "; ".fn readiness(blockers: impl IntoIterator<Item = Blocker>) -> Readiness {let mut ids = BTreeSet::new();@@ -186,6 +261,9 @@ struct UnattendedRestart {evaluation: Task<()>,/// The `prevent-app-suspension` blocker and the timer of `KEEP_AWAKE_LIMIT`.keep_awake: Option<(i64, Task<()>)>,+ /// `hasArgumentsLostOnRelaunch` and `isLaunchedFromCli` of this process, which do not change.+ launch_blockers: Vec<&'static str>,+ user_data: PathBuf,}struct GlobalUnattendedRestart(Entity<UnattendedRestart>);@@ -223,7 +301,13 @@ impl Workbench {this.follow(step, cx);}).detach();- UnattendedRestart { scheduler: Scheduler::new(None), evaluation: Task::ready(()), keep_awake: None }+ let app = cx.global::<crate::AppState>();+ let raw = app.args[1..].to_vec();+ let args = crate::argv::parse_and_validate(&raw).map(|(args, _)| args).unwrap_or_default();+ let launch_blockers = launch_blockers(&args, &raw, std::env::var("VSCODE_CLI").is_ok_and(|cli| cli == "1"));+ let user_data = app.user_data.clone();+ let scheduler = Scheduler::new(failed_update_version(&user_data, product_commit()));+ UnattendedRestart { scheduler, evaluation: Task::ready(()), keep_awake: None, launch_blockers, user_data }});cx.set_global(GlobalUnattendedRestart(entity));}@@ -272,19 +356,30 @@ impl UnattendedRestart {// `cancelRestart`: no pending restart, no exact restore.if self.scheduler.pending.is_none() {windows_state::restore_exactly_on_next_startup(false, cx);+ FileStorage::open(&windows_state::storage_file(&self.user_data)).remove_item(PENDING_RESTART_KEY);}self.sync_keep_awake(cx);}- /// `getBlockers`' window part: every window's readiness, and `update.restartWhenIdle` on in all of them.+ /// `getBlockers`' window and app part: every window's readiness, `getWindowBlockers`, the launch's blockers, and+ /// `update.restartWhenIdle` on in all windows.fn evaluate(&mut self, cx: &mut Context<Self>) {let windows: Vec<WindowHandle<Workbench>> = cx.windows().into_iter().filter_map(|handle| handle.downcast::<Workbench>()).collect();- let mut blockers = Vec::new();+ let mut blockers: Vec<Blocker> = self.launch_blockers.iter().map(|id| (*id, None)).collect();+ if windows.is_empty() {+ blockers.push(("window.none", None));+ }let mut enabled = !windows.is_empty();+ let mut displays_with_full_screen_window = BTreeSet::new();for handle in windows {- let _ = handle.update(cx, |workbench, _, _| {- let mut window = workbench.can_restart_unattended();- blockers.extend(window.blockers.into_iter().map(|id| (id, window.details.remove(id))));+ let _ = handle.update(cx, |workbench, window, cx| {+ let mut readiness = workbench.can_restart_unattended();+ blockers.extend(readiness.blockers.into_iter().map(|id| (id, readiness.details.remove(id))));+ blockers.extend(window_blockers(workbench).into_iter().map(|id| (id, None)));+ // macOS restores one native fullscreen window per display at once.+ if window.is_fullscreen() && !displays_with_full_screen_window.insert(window.display(cx).map(|display| u64::from(display.id()))) {+ blockers.push(("window.fullScreenSameDisplay", None));+ }enabled &= workbench.setting("update.restartWhenIdle") == true;});}@@ -306,8 +401,16 @@ impl UnattendedRestart {if let Some(handle) = first {let _ = handle.update(cx, |_, window, cx| super::update::quit_and_install(window, cx));}- let restarting = matches!(crate::update::service(cx).read(cx).state(), State::Restarting { .. });- self.scheduler.restart_returned(restarting);+ let restarting = match crate::update::service(cx).read(cx).state() {+ State::Restarting { update, .. } => Some(update.version.clone()),+ _ => None,+ };+ // Upstream writes it at `onWillShutdown`; written here, a veto's `cancelRestart` removes it again.+ if let Some(version) = &restarting {+ let pending = serde_json::json!({ "fromCommit": product_commit(), "toVersion": version });+ FileStorage::open(&windows_state::storage_file(&self.user_data)).set_item(PENDING_RESTART_KEY, Some(pending));+ }+ self.scheduler.restart_returned(restarting.is_some());}fn sync_keep_awake(&mut self, cx: &mut Context<Self>) {@@ -356,6 +459,9 @@ mod tests {let (workbench, cx) = workbench(cx);let update = crate::update::Update { version: "bbbb".into(), product_version: "1.148.0".into(), timestamp: 2, url: "https://example.com/a.zip".into(), sha256hash: "ab".repeat(32) };workbench.update_in(cx, |workbench, window, cx| {+ let dir = std::env::temp_dir().join(format!("vsrustium-unattended-restart-host-{}", std::process::id()));+ let shared_storage = std::sync::Arc::new(std::sync::Mutex::new(storage::Storage::in_memory()));+ cx.set_global(crate::AppState { args: vec!["vsrustium".into()], runtime: exthost::Runtime::Bun, user_data: dir.clone(), app_root: dir.clone(), builtins: Vec::new(), user_extensions_folder: dir.join("extensions"), shared_storage });workbench.restored_at = Some(Instant::now() - 2 * EVENTUALLY);workbench.settings.lock().unwrap().update_value("update.restartWhenIdle", Some(&serde_json::json!(true)), config::service::Target::User, None, &[]).unwrap();workbench.register_update_actions(window, cx);@@ -370,6 +476,47 @@ mod tests {assert!(!keeps_awake(cx));}+ #[gpui::test]+ fn windows_that_do_not_come_back_as_they_are_block(cx: &mut gpui::TestAppContext) {+ let (workbench, cx) = workbench(cx);+ workbench.update(cx, |workbench, _| {+ assert_eq!(window_blockers(workbench), Vec::<&str>::new());+ workbench.extension_development = true;+ workbench.cli_profile.temp = true;+ assert_eq!(window_blockers(workbench), ["window.extensionDevelopment", "window.launchArguments"]);+ });+ }++ #[test]+ fn a_restart_that_came_back_on_the_same_commit_failed_to_install() {+ let user_data = std::env::temp_dir().join(format!("vsrustium-failed-update-{}", std::process::id()));+ std::fs::create_dir_all(user_data.join("User/globalStorage")).unwrap();+ let pending = |from: &str| FileStorage::open(&windows_state::storage_file(&user_data)).set_item(PENDING_RESTART_KEY, Some(serde_json::json!({ "fromCommit": from, "toVersion": "1.148.0" })));+ pending("aaaa");+ assert_eq!(failed_update_version(&user_data, "bbbb"), None);+ pending("aaaa");+ assert_eq!(failed_update_version(&user_data, "aaaa").as_deref(), Some("1.148.0"));+ assert_eq!(failed_update_version(&user_data, "aaaa").as_deref(), Some("1.148.0"));+ assert_eq!(failed_update_version(&user_data, "cccc"), None);+ assert_eq!(failed_update_version(&user_data, "aaaa"), None);+ std::fs::remove_dir_all(user_data).unwrap();+ }++ /// unattendedRestartScheduler.test.ts "hasArgumentsLostOnRelaunch" on macOS, and `isLaunchedFromCli`.+ #[test]+ fn launch_arguments_the_relaunch_drops_block() {+ let blockers = |raw: &[&str], cli: bool| {+ let raw: Vec<String> = raw.iter().map(|arg| arg.to_string()).collect();+ launch_blockers(&crate::argv::parse_and_validate(&raw).unwrap().0, &raw, cli)+ };+ assert_eq!(blockers(&["folder"], false), Vec::<&str>::new());+ assert_eq!(blockers(&["--user-data-dir", "/tmp/data"], false), ["app.launchArguments"]);+ assert_eq!(blockers(&["--disable-extensions"], false), ["app.launchArguments"]);+ assert_eq!(blockers(&["--no-sandbox"], false), ["app.launchArguments"]);+ assert_eq!(blockers(&["--", "--no-sandbox"], false), Vec::<&str>::new());+ assert_eq!(blockers(&[], true), ["app.launchedFromCli"]);+ }+/// unattendedRestart.test.ts "aggregates blockers, treats failures as blockers and forgets disposed participants",/// without the failing participant: the port's checks are calls that cannot fail or time out.#[test]diff --git a/native/crates/app/src/workbench/update.rs b/native/crates/app/src/workbench/update.rsindex 3d42f21f555..abac5b2ca98 100644--- a/native/crates/app/src/workbench/update.rs+++ b/native/crates/app/src/workbench/update.rs@@ -180,6 +180,8 @@ mod tests {std::fs::create_dir_all(dir.join("User")).unwrap();let settings = Arc::new(Mutex::new(config::service::Settings::load(config::registry::Registry::with_extensions(&[]), dir.join("User"), None)));let host = crate::host_sync::HostSync::new(std::sync::mpsc::channel().0);+ let shared_storage = Arc::new(Mutex::new(storage::Storage::in_memory()));+ cx.update(|cx| cx.set_global(crate::AppState { args: vec!["vsrustium".into()], runtime: exthost::Runtime::Bun, user_data: dir.clone(), app_root: app_root.clone(), builtins: Vec::new(), user_extensions_folder: dir.join("extensions"), shared_storage }));let (workbench, cx) = cx.add_window_view(|_, cx| Workbench::new(theme, app_root.clone(), None, crate::languages::Languages::new(&[]), settings, host, cx));cx.run_until_parked();(workbench, cx)diff --git a/port/ledger.md b/port/ledger.mdindex 6d439d2605b..3bd23473606 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -408,7 +408,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| workbench/services/languageDetection | workbench service | M13 | ported | [3 S] workbench/language_detection.rs: 4 s after typing a Python snippet into a new untitled editor (Cmd+N in a ui-pair run, hc) the port's language entry shows Python, the reference's still Plain Text, also after 12 s; not yet known whether the reference build lacks the detection model or the port detects where upstream does not | language_detection.rs (languageDetectionWebWorker.ts `detectLanguagesImpl`, `adjustLanguageConfidence`, the 10000 char sample) and workbench/language_detection.rs (`LanguageDetectionWorkerClient`: the file name guess first, then @vscode/vscode-languagedetection 1.0.23 with its model in a Bun worker from the app's node_modules, model ids mapped as `getLanguageId`; `autoDetectLanguage` of textEditorModel.ts for untitled models and extensionless plain text files, 600 ms throttle, skipped after an explicit language and with `workbench.editor.languageDetection` off): cargo test -p app language_detection (the worker test runs the real model). The history biases only feed the regexp model, which 1.147.0 does not ship (`vscode-regexp-languagedetection` is not a dependency), so neither side has it; no telemetry || workbench/services/languageStatus | workbench service | M13 | verified | | `$setLanguageStatus` / `$removeLanguageStatus`, statuses matched by selector, ordered by severity, source, id (workbench/language_status.rs): cargo test -p app language_status || workbench/services/layout | workbench service | M11 | ported | [3 L] editor_status.rs:606, content_hover.rs:498: no workbench-wide Tab order (the browser's DOM order): Tab stops at the content hover's ends, and Tab on the status bar in Tab Focus Mode keeps the focus (port/notes.md Toggle Tab Key Moves Focus) <br> [3 L] workbench.rs:591: the Workbench is one GPUI view, so every scroll frame of any list renders and lays out every part again, where upstream's DOM updates only the scrolled list; `scroll_frame_time` median / p95 at 42d10fe2347: Explorer 11.5 / 15.7 ms, Editor 18.0 / 19.2 to 42.0 ms, Settings 12.4 / 16.8 ms over the 8 ms gate (Extensions 2.8 / 3.0 meets it); per frame taffy lays out the whole workbench (6.6 ms of the Explorer frame), each `key_context` caller clones every `config.*` key (keyboard.rs:400), the menubar and the timeline toolbar are rebuilt; the next step is the part-entity split, side bar first (port/notes.md Scroll frame costs, cheap steps). GUI (Studio at load 33 to 57, 60 Hz display, 690 trackpad events in 7 s): main thread in `Window::draw` 86% scrolling the Explorer (800 files), 89% the Extensions @builtin list (port/notes.md Scroll frame costs) | layout.ts as a split-view tree (workbench/layout.rs): panel position (bottom, top, left, right) and alignment, primary side bar left or right, maximized panel with `panelMaximizationSupportedWhen`, hidden parts, persisted sizes and positions; zen mode (zen_mode.rs) with its settings and restore; centered layout (centered_layout.rs) with its sashes and stored margins; View > Appearance entries and the Panel Position and Align Panel submenus (cargo test -p app -- layout part_grid centered_layout zen_mode); layoutActions.ts Customize Layout quick pick (workbench/customize_layout.rs) with live items, Restore Defaults and Close, Toggle Activity Bar Visibility, Align Quick Input Top/Center (cargo test -p app -- customize_layout toggling_the_activity_bar; ui-pair m11/manage-menu.json, port/results/manage-menu.md; missing until then though the title bar showed its button); ui-pair layout-positions.json and layout-zen.json against the reference (port/results/layout.md). The pairs run with `zenMode.fullScreen` off. Maximize Secondary Side Bar (`workbench.action.maximizeAuxiliaryBar`, `restoreAuxiliaryBar`, `toggleMaximizedAuxiliaryBar`, the title's toggle) hides the other parts and restores them (workbench/panel.rs; cargo test -p app -- maximizing_the_secondary_side_bar_hides_the_other_parts_and_restore_brings_them_back). Zen mode enforces `zenMode.showTabs` on the main editor part until it ends (layout.ts `toggleZenMode` `enforcePartOptions`; workbench/zen_mode.rs `editor_show_tabs`; cargo test -p app -- show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own); navigationActions.ts `workbench.action.focusNextPart`/`focusPreviousPart` (F6, Shift+F6) walk editor, panel, auxiliary bar, status bar, activity bar and side bar past the hidden ones with layout.ts `focusPart` (the pane container's first expanded view; workbench/part_navigation.rs; cargo test -p app f6_walks_the_visible_parts); in an editor window F6 goes between its editor and its own status bar, whose entry focus is kept per window (workbench/auxiliary_windows.rs `auxiliary_status_bar`, workbench/status_entries.rs; cargo test -p app f6_in_an_editor_window_reaches_its_own_status_bar) |-| workbench/services/lifecycle | workbench service | M11 | ported | [3 L] unattendedRestart.ts: the editor detail names the scheme where upstream names `typeId`, `workbench.floatingWindowNotRestorable` cannot occur (the port's auxiliary windows are all editor parts), and the scheduler's app-level blockers are not ported: `getWindowBlockers` (`window.none` aside), `hasArgumentsLostOnRelaunch`, `app.dialogOpen`, `app.launchedFromCli`, and the remembered pending restart and failed update (`update.unattendedRestart`, `update.unattendedRestartFailedUpdate`) <br> [3 S] terminal/pty.rs:95: `hasChildProcesses` is a foreground process group other than the shell's, so a background job (`cmd &`) does not block the restart where upstream's childProcessMonitor.ts sees it | workbench/lifecycle.rs: ShutdownReason, onBeforeShutdown vetoes on quit, close button, closeWindow, reload and load (`window.confirmBeforeClose`, backup tracker auto save, hot exit, showSaveConfirm); cargo test -p app lifecycle; no phases or onWillShutdown joiners; workbench/unattended_restart.rs: `canRestartUnattended` with its blocker aggregation and change log, and the participants `workbench.starting` (2.5 s after restore), dialog, quick input, transient workspace, modal editor, editors not restored or not restorable, `debug.sessionActive`, `tasks.running`, the backup tracker's `workingCopy.*` and `cli.waitingForEditorClose`, terminalUnattendedRestart.ts, testingUnattendedRestart.ts, `testing.continuousRun`, webviewUnattendedRestart.ts and notebookUnattendedRestart.ts: cargo test -p app unattended_restart (unattendedRestart.test.ts, terminalUnattendedRestart.test.ts, testingUnattendedRestart.test.ts); update/unattended_restart.rs: unattendedRestartScheduler.ts's decisions (keep awake from the lock, restart once locked a minute, retry every minute, veto, a newer update postponing, battery and thermal pressure, resume restarting the clock, the update not installed last time) over injected time: cargo test -p app update::unattended_restart (13 of unattendedRestartScheduler.test.ts's cases, without the telemetry outcomes the port does not send); workbench/unattended_restart.rs `UnattendedRestart`: the scheduler's host on macOS (power events, window blur, update state, timers, the `prevent-app-suspension` blocker, `quitAndInstall` from a window): cargo test -p app a_locked_screen_keeps_the_machine_awake; windows_state.rs `setNextExactRestore`/`takeExactRestore` (minimized windows, hidden app): cargo test -p app windows_state; verified: cargo test -p app backup_tracker lifecycle (workingCopyBackupTracker.test.ts); ui-pair hot-exit.json `dirty`, `restored` vs the reference (port/results/windows.md, milestone 11 verification) |+| workbench/services/lifecycle | workbench service | M11 | ported | [3 L] unattendedRestart.ts: the editor detail names the scheme where upstream names `typeId`, `workbench.floatingWindowNotRestorable` cannot occur (the port's auxiliary windows are all editor parts), and the scheduler's `app.dialogOpen` (`hasOpenDialogs`) is not ported: the native open and save panels open from file_dialog.rs, profiles_editor_view.rs and merge_editor_view.rs without a count <br> [3 S] workbench/unattended_restart.rs `window_blockers`: a window keeps only `--profile` and `--profile-temp` of the command line that opened it, so `window.launchArguments` misses its other `SESSION_ARGUMENTS` and `window.launchedFromCli` its `VSCODE_CLI` environment <br> [3 S] terminal/pty.rs:95: `hasChildProcesses` is a foreground process group other than the shell's, so a background job (`cmd &`) does not block the restart where upstream's childProcessMonitor.ts sees it | workbench/lifecycle.rs: ShutdownReason, onBeforeShutdown vetoes on quit, close button, closeWindow, reload and load (`window.confirmBeforeClose`, backup tracker auto save, hot exit, showSaveConfirm); cargo test -p app lifecycle; no phases or onWillShutdown joiners; workbench/unattended_restart.rs: `canRestartUnattended` with its blocker aggregation and change log, and the participants `workbench.starting` (2.5 s after restore), dialog, quick input, transient workspace, modal editor, editors not restored or not restorable, `debug.sessionActive`, `tasks.running`, the backup tracker's `workingCopy.*` and `cli.waitingForEditorClose`, terminalUnattendedRestart.ts, testingUnattendedRestart.ts, `testing.continuousRun`, webviewUnattendedRestart.ts and notebookUnattendedRestart.ts: cargo test -p app unattended_restart (unattendedRestart.test.ts, terminalUnattendedRestart.test.ts, testingUnattendedRestart.test.ts); update/unattended_restart.rs: unattendedRestartScheduler.ts's decisions (keep awake from the lock, restart once locked a minute, retry every minute, veto, a newer update postponing, battery and thermal pressure, resume restarting the clock, the update not installed last time) over injected time: cargo test -p app update::unattended_restart (13 of unattendedRestartScheduler.test.ts's cases, without the telemetry outcomes the port does not send); workbench/unattended_restart.rs `UnattendedRestart`: the scheduler's host on macOS (power events, window blur, update state, timers, the `prevent-app-suspension` blocker, `quitAndInstall` from a window), `getWindowBlockers`, `hasArgumentsLostOnRelaunch`, `app.launchedFromCli` and the failed update remembered across the restart: cargo test -p app unattended_restart (a_locked_screen_keeps_the_machine_awake, windows_that_do_not_come_back_as_they_are_block, launch_arguments_the_relaunch_drops_block, a_restart_that_came_back_on_the_same_commit_failed_to_install); windows_state.rs `setNextExactRestore`/`takeExactRestore` (minimized windows, hidden app): cargo test -p app windows_state; verified: cargo test -p app backup_tracker lifecycle (workingCopyBackupTracker.test.ts); ui-pair hot-exit.json `dirty`, `restored` vs the reference (port/results/windows.md, milestone 11 verification) || workbench/services/localTranscription | workbench service | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert || workbench/services/localization | workbench service | M18 | verified | | ui-pair port/fixtures/extensions/ui-display-language.json: picking Deutsch installs MS-CEINTL.vscode-language-pack-de with the "Installing Deutsch language support..." progress and asks "Restart VSRustium to switch to Deutsch?"; localeService.ts: argv.json `locale` written and cleared, restart dialog, install of an MS-CEINTL pack: cargo test -p app nls localization; Command Palette titles, categories and descriptions translate by the reference call's module and key (port/tools/ref-commands with ref-nls-clone.ts; cargo test -p app a_palette_title_two_modules), menu bar items, side bar titles and pane headers by the reference's `nlsKeys` per menu, view and container (cargo test -p app menu_bar_items_and_view_titles_resolve_per_scope); other surfaces stay English (port/notes.md) || workbench/services/log | workbench service | M6 | verified | | output/log_levels.rs: defaultLogLevels.ts argv.json `log-level` read and write, `getDefaultLogLevel`, `parseLogLevel`; logs_actions.rs `setDefaultLogLevel` (cargo test -p app set_default_log_level_writes_argv, reads_and_writes_argv_log_levels); the Window log as logConstants.ts `windowLogId`; electron-browser logService.ts in a test run: the host console reaches stdout/stderr through the session; output/log_levels.rs: defaultLogLevels.ts argv.json `log-level` read and write, `getDefaultLogLevel`, `parseLogLevel`; logs_actions.rs `setDefaultLogLevel` (cargo test -p app set_default_log_level_writes_argv, reads_and_writes_argv_log_levels); the Window log as logConstants.ts `windowLogId` |