The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Desktop: the Windows Desktop suite is green on main (#4618) (#3562)
0xken15304d4ee6e3fe
diff --git a/.github/workflows/windows-desktop.yml b/.github/workflows/windows-desktop.ymlindex 44c4bb5d6..96428a528 100644--- a/.github/workflows/windows-desktop.yml+++ b/.github/workflows/windows-desktop.yml@@ -74,7 +74,9 @@ jobs:- runner: windows-11-armarch: arm64runs-on: ${{ matrix.runner }}- timeout-minutes: 90+ # Measured on run 42370552362: arm64 takes 6 min to build, 52 min for the Desktop suite and about 25 min for the+ # installer specs, 90 min in all before the last step ends; x64 takes 64 min. 90 cut arm64 off in its last step.+ timeout-minutes: 120defaults:run:shell: pwshdiff --git a/desktop/lib/core/git_worktree.dart b/desktop/lib/core/git_worktree.dartindex 4eb660964..6dcdb35b6 100644--- a/desktop/lib/core/git_worktree.dart+++ b/desktop/lib/core/git_worktree.dart@@ -850,7 +850,9 @@ Future<bool> discardPreparedWorktree(// Without --force: a worktree with changes in it refuses. Ignored files// (what `.worktreeinclude` copied in) do not count as changes. As long as// `worktree add` may take: a deadline mid-delete leaves half a folder.- final removed = await git(folder, [+ // From the common directory: `-C folder` would stand git inside the folder+ // it deletes, and Windows refuses to delete a process's current folder.+ final removed = await git(common, ['worktree','remove','--',diff --git a/desktop/lib/finder/finder_controller.dart b/desktop/lib/finder/finder_controller.dartindex 220d3fcce..f4a2b2b36 100644--- a/desktop/lib/finder/finder_controller.dart+++ b/desktop/lib/finder/finder_controller.dart@@ -119,7 +119,7 @@ class FinderController extends ChangeNotifier {return tabs.open(finderDiffTabId(change), () {final diff = FinderDiffDocument(change,- p.join(repository?.root ?? root, change.path),+ repository?.pathOf(change) ?? p.normalize(p.join(root, change.path)),git.diff,);unawaited(diff.load());diff --git a/desktop/lib/finder/finder_file_actions.dart b/desktop/lib/finder/finder_file_actions.dartindex 9cb89aece..6e46cb75d 100644--- a/desktop/lib/finder/finder_file_actions.dart+++ b/desktop/lib/finder/finder_file_actions.dart@@ -55,7 +55,7 @@ extension FinderFileActions on FinderController {final repository = git.repository;if (repository == null) return;for (final change in changes.where((c) => c.area == GitArea.untracked)) {- await files.trash(p.join(repository.root, change.path));+ await files.trash(repository.pathOf(change));}await git.discard([for (final change in changes)diff --git a/desktop/lib/finder/finder_git_state.dart b/desktop/lib/finder/finder_git_state.dartindex 90ea350e6..2a6408da9 100644--- a/desktop/lib/finder/finder_git_state.dart+++ b/desktop/lib/finder/finder_git_state.dart@@ -126,7 +126,7 @@ class FinderGitState extends ChangeNotifier {final files = <String, GitChangeKind>{};final folders = <String, GitChangeKind>{};for (final change in repository?.changes ?? const <GitChange>[]) {- final path = p.join(repository!.root, change.path);+ final path = repository!.pathOf(change);files[path] = _stronger(files[path], change.kind);if (change.kind == GitChangeKind.deleted) continue;for (var dir = p.dirname(path); p.isWithin(root, dir) || dir == root;) {diff --git a/desktop/lib/finder/finder_models.dart b/desktop/lib/finder/finder_models.dartindex 70bfbece2..7385526e1 100644--- a/desktop/lib/finder/finder_models.dart+++ b/desktop/lib/finder/finder_models.dart@@ -1,5 +1,7 @@import 'dart:typed_data';+import 'package:path/path.dart' as p;+/// One row of a folder listing in a Finder tile.class FinderEntry {const FinderEntry({@@ -135,6 +137,11 @@ class GitChanges {final String? branch;final int ahead, behind;final List<GitChange> changes;++ /// Where [change] is on disk, spelled as this computer spells paths: Git+ /// writes `/` on Windows too, and the tree lists `\`.+ String pathOf(GitChange change) =>+ p.joinAll([root, ...p.posix.split(change.path)]);}enum DiffLineKind { meta, hunk, context, added, removed }diff --git a/desktop/lib/finder/local_finder_git.dart b/desktop/lib/finder/local_finder_git.dartindex 26393862b..474fa1e63 100644--- a/desktop/lib/finder/local_finder_git.dart+++ b/desktop/lib/finder/local_finder_git.dart@@ -21,7 +21,8 @@ class LocalFinderGit implements FinderGit {if (!await insideGitCheckout(folder)) return null;final top = await _git(folder, ['rev-parse', '--show-toplevel']);if (top.code != 0) return null;- final root = top.output.trim();+ // Git answers `C:/Users/…` on Windows, where the tree lists `C:\Users\…`.+ final root = p.normalize(top.output.trim());final (status, unstagedCounts, stagedCounts) = await (_git(folder, ['-c', 'core.quotePath=false', //@@ -59,9 +60,16 @@ class LocalFinderGit implements FinderGit {) async {if (entries.isEmpty) return const {};// A folder is asked with its trailing slash: `build/` in .gitignore- // matches only folders, and git does not look at the disk to tell.- String asked(FinderEntry entry) =>- entry.isDirectory ? '${entry.path}/' : entry.path;+ // matches only folders, and git does not look at the disk to tell. Git+ // quotes a path with a `\` in its answer, so a Windows path is asked+ // with `/`, which Git reads the same.+ String asked(FinderEntry entry) {+ final path = p.style == p.Style.windows+ ? entry.path.replaceAll(r'\', '/')+ : entry.path;+ return entry.isDirectory ? '$path/' : path;+ }+// One path a line: `-z` is for `--stdin` only, and quotePath off keeps// non-ASCII names as they are.final result = await _git(repository.root, [diff --git a/desktop/lib/finder/widgets/finder_changes_view.dart b/desktop/lib/finder/widgets/finder_changes_view.dartindex 7d6a17790..4d6de215d 100644--- a/desktop/lib/finder/widgets/finder_changes_view.dart+++ b/desktop/lib/finder/widgets/finder_changes_view.dart@@ -102,7 +102,7 @@ class _FinderChangesViewState extends State<FinderChangesView> {Widget _row(GitChanges repository, GitChange change) {final area = change.area;- final path = p.join(repository.root, change.path);+ final path = repository.pathOf(change);return FinderChangeRow(key: ValueKey('finder-change-${area.name}-${change.path}'),change: change,diff --git a/desktop/lib/sharing/shared_harness_panel.dart b/desktop/lib/sharing/shared_harness_panel.dartindex e1bf78250..b845828f2 100644--- a/desktop/lib/sharing/shared_harness_panel.dart+++ b/desktop/lib/sharing/shared_harness_panel.dart@@ -37,6 +37,7 @@ class SharedHarnessPanel extends StatefulWidget {this.linkEnvironment,this.onSignIn,this.onUsage,+ @visibleForTesting this.allowLocalTcpFixtureForTest = false,});final AppNotifier notifier;final TerminalPane pane;@@ -49,6 +50,10 @@ class SharedHarnessPanel extends StatefulWidget {/// A shared link's clicks, for its page to count; the workspace's own shared panes pass none.final ValueChanged<SharedAction>? onUsage;++ /// A loopback daemon fixture stands in for the Windows pipe under test+ /// ([WsConn.allowLocalTcpFixture]).+ final bool allowLocalTcpFixtureForTest;@overrideState<SharedHarnessPanel> createState() => _SharedHarnessPanelState();}@@ -142,6 +147,7 @@ class _SharedHarnessPanelState extends State<SharedHarnessPanel>localTransport: viewer == null? widget.notifier.localDaemonTransport: null,+ allowLocalTcpFixture: widget.allowLocalTcpFixtureForTest,accessTokenProvider: (force, failedToken) async => viewer == null? '': widget.link && !await viewer.auth.hasSession()diff --git a/desktop/lib/super_tabs/folder_zip.dart b/desktop/lib/super_tabs/folder_zip.dartindex d43068485..af3475a39 100644--- a/desktop/lib/super_tabs/folder_zip.dart+++ b/desktop/lib/super_tabs/folder_zip.dart@@ -15,6 +15,20 @@ String folderName(String path) {return name.isEmpty ? 'folder' : name;}+/// [path] as it goes into a message: as it is, or in double quotes when it+/// holds a space or anything else a shell reads specially, with `"`, `\`,+/// `$` and `` ` `` escaped, so it reads back as the same path. On Windows,+/// as a Windows terminal takes a dropped folder: `\` is the separator and a+/// name cannot hold `"`, so nothing inside the quotes is escaped.+String folderPathText(String path, {bool? isWindows}) {+ if (isWindows ?? Platform.isWindows) {+ return path.contains(RegExp(r'''[\s'$`!\[\]{}()&;]''')) ? '"$path"' : path;+ }+ return path.contains(RegExp(r'''[\s"'$`\\!*?\[\]{}()<>|&;]'''))+ ? '"${path.replaceAllMapped(RegExp(r'["\\$`]'), (m) => '\\${m[0]}')}"'+ : path;+}+/// [folder] as a zip whose entries sit under the folder's own name, worked on/// a background isolate. Null when its files weigh more than [limitBytes]/// together: they are counted before any is read, so a large folder is neverdiff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex 3d682052c..6c5056b4b 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -1423,14 +1423,6 @@ class _SuperTabViewState extends State<SuperTabView>);}- /// [path] as it goes into a message: as it is, or in double quotes when it- /// holds a space or anything else a shell reads specially, with `"`, `\`,- /// `$` and `` ` `` escaped, so it reads back as the same path.- static String _pathText(String path) =>- path.contains(RegExp(r'''[\s"'$`\\!*?\[\]{}()<>|&;]'''))- ? '"${path.replaceAllMapped(RegExp(r'["\\$`]'), (m) => '\\${m[0]}')}"'- : path;-/// Puts dropped folders' paths into chat [id]'s message at the cursor,/// space-separated, as a terminal takes a dropped folder.void _pasteFolders(String id, List<String> paths) {@@ -1444,7 +1436,7 @@ class _SuperTabViewState extends State<SuperTabView>final after = text.substring(selection.end);final pasted ='${before.isEmpty || RegExp(r'\s$').hasMatch(before) ? '' : ' '}'- '${paths.map(_pathText).join(' ')}'+ '${paths.map(folderPathText).join(' ')}''${after.startsWith(RegExp(r'\s')) ? '' : ' '}';final next = before + pasted + after;c.setDraft(id, next);@@ -1461,7 +1453,7 @@ class _SuperTabViewState extends State<SuperTabView>/// The dropped folders whose paths are still in chat [id]'s message.List<String> _foldersInMessage(String id) => [for (final path in _droppedFolders[id] ?? const <String>[])- if (_composer.text.contains(_pathText(path))) path,+ if (_composer.text.contains(folderPathText(path))) path,];/// Whether an agent of [group] runs on another computer than this one,@@ -1519,7 +1511,7 @@ class _SuperTabViewState extends State<SuperTabView>];String withoutPaths(String text) {for (final folder in attached) {- final path = _pathText(folder);+ final path = folderPathText(folder);text = text.contains('$path ')? text.replaceFirst('$path ', ''): text.contains(' $path')diff --git a/desktop/test/box_render_preview_test.dart b/desktop/test/box_render_preview_test.dartindex 47fd751a3..c0b98303b 100644--- a/desktop/test/box_render_preview_test.dart+++ b/desktop/test/box_render_preview_test.dart@@ -1,3 +1,5 @@+import 'dart:convert';+import 'support/open_harness.dart';import 'support/launch_menu.dart';@@ -179,16 +181,7 @@ Future<void> loadPreviewFonts({await load(family, ['/System/Library/Fonts/Menlo.ttc']);}await load('MaterialIcons', ['$materialFonts/MaterialIcons-Regular.otf']);- final home = Platform.environment['HOME'] ?? '';- final lucideRoot = Directory('$home/.pub-cache/hosted/pub.dev')- .listSync()- .whereType<Directory>()- .where((dir) => dir.path.contains('/lucide_icons_flutter-'))- .map((dir) => dir.path)- .fold<String?>(- null,- (best, path) => best == null || path.compareTo(best) > 0 ? path : best,- );+ final lucideRoot = _packageRoot('lucide_icons_flutter');if (lucideRoot != null) {await load('packages/lucide_icons_flutter/Lucide', ['$lucideRoot/assets/lucide.ttf',@@ -201,6 +194,25 @@ Future<void> loadPreviewFonts({}}+/// Where pub put [package], from the package config `flutter test` runs with,+/// so it is found on every OS: Windows keeps the pub cache under+/// `%LOCALAPPDATA%\Pub\Cache` and has no `HOME` (run 42364609130). Read+/// synchronously, since widget tests call this inside their fake clock.+String? _packageRoot(String package) {+ final config = File('.dart_tool/package_config.json');+ if (!config.existsSync()) return null;+ final packages =+ (jsonDecode(config.readAsStringSync()) as Map)['packages'] as List;+ for (final entry in packages.cast<Map>()) {+ if (entry['name'] != package) continue;+ return Directory.current.uri+ .resolve('.dart_tool/')+ .resolve(entry['rootUri'] as String)+ .toFilePath();+ }+ return null;+}+void main() {final dir = Platform.environment['BOX_RENDER_DIR'];diff --git a/desktop/test/export_logs_dialog_test.dart b/desktop/test/export_logs_dialog_test.dartindex 535279bde..6efefa807 100644--- a/desktop/test/export_logs_dialog_test.dart+++ b/desktop/test/export_logs_dialog_test.dart@@ -206,11 +206,15 @@ void main() {find.textContaining('It holds no credentials.'),findsOneWidget,);+ // Windows names its own file manager.+ final revealLabel = Platform.isWindows+ ? 'Show in Explorer'+ : 'Show in Finder';final close = find.widgetWithText(FilledButton, 'Close');- final reveal = find.widgetWithText(TextButton, 'Show in Finder');+ final reveal = find.widgetWithText(TextButton, revealLabel);for (final (button, text) in [(close, 'Close'),- (reveal, 'Show in Finder'),+ (reveal, revealLabel),]) {expect(button.hitTestable(), findsOneWidget);final label = tester.getRect(find.text(text));@@ -228,7 +232,7 @@ void main() {await tester.sendKeyUpEvent(LogicalKeyboardKey.shiftLeft);await tester.pump();expect(- Focus.of(tester.element(find.text('Show in Finder'))).hasFocus,+ Focus.of(tester.element(find.text(revealLabel))).hasFocus,isTrue,);await tester.sendKeyEvent(LogicalKeyboardKey.tab);diff --git a/desktop/test/finder/fakes.dart b/desktop/test/finder/fakes.dartindex d057e1c47..67e6d0530 100644--- a/desktop/test/finder/fakes.dart+++ b/desktop/test/finder/fakes.dart@@ -5,13 +5,18 @@ import 'package:harness/finder/finder_git.dart';import 'package:harness/finder/finder_models.dart';import 'package:path/path.dart' as p;+/// [relative] (`lib/main.dart`) in the fake folder `/r`, spelled as this+/// computer spells paths — `\r\lib\main.dart` on Windows — because the+/// Finder joins paths the platform's way.+String fakePath([String relative = '']) => p.normalize('/r/$relative');+/// An in-memory folder: `/r` holds `lib/main.dart` and `README.md`.class FakeFinderFiles implements FinderFiles {final texts = <String, String>{- '/r/README.md': '# Readme\n\nHello',- '/r/lib/main.dart': 'void main() {}\n',+ fakePath('README.md'): '# Readme\n\nHello',+ fakePath('lib/main.dart'): 'void main() {}\n',};- final folders = <String>{'/r', '/r/lib'};+ final folders = <String>{fakePath(), fakePath('lib')};final stamps = <String, DiskStamp>{};final listed = <String>[];final writes = <String, String>{};@@ -120,7 +125,12 @@ class FakeFinderGit implements FinderGit {Future<GitChanges?> changes(String folder) async {reads++;if (fail) throw const FinderException('Git is gone.');- return GitChanges(root: '/r', branch: 'main', ahead: 1, changes: current);+ return GitChanges(+ root: fakePath(),+ branch: 'main',+ ahead: 1,+ changes: current,+ );}@overridediff --git a/desktop/test/finder/finder_controller_test.dart b/desktop/test/finder/finder_controller_test.dartindex 091d2ba06..9a679e65c 100644--- a/desktop/test/finder/finder_controller_test.dart+++ b/desktop/test/finder/finder_controller_test.dart@@ -15,7 +15,7 @@ void main() {setUp(() async {files = FakeFinderFiles();git = FakeFinderGit();- controller = FinderController(root: '/r', files: files, git: git);+ controller = FinderController(root: fakePath(), files: files, git: git);addTearDown(controller.dispose);await controller.start();});@@ -26,50 +26,58 @@ void main() {test('reads the tree and the repository, and marks what changed', () {expect(controller.tree.rows.map((r) => r.entry.name), ['lib', 'README.md']);expect(- controller.git.fileStatus('/r/lib/main.dart'),+ controller.git.fileStatus(fakePath('lib/main.dart')),+ GitChangeKind.modified,+ );+ expect(+ controller.git.folderStatus(fakePath('lib')),GitChangeKind.modified,);- expect(controller.git.folderStatus('/r/lib'), GitChangeKind.modified);expect(controller.git.repository?.branch, 'main');});test('a preview tab gives way to the next preview; a kept one stays',() async {- controller.openFile('/r/README.md');- controller.openFile('/r/lib/main.dart');- expect(controller.tabs.tabs.map((t) => t.path), ['/r/lib/main.dart']);+ controller.openFile(fakePath('README.md'));+ controller.openFile(fakePath('lib/main.dart'));+ expect(controller.tabs.tabs.map((t) => t.path), [+ fakePath('lib/main.dart'),+ ]);- controller.openFile('/r/lib/main.dart', preview: false);- controller.openFile('/r/README.md');+ controller.openFile(fakePath('lib/main.dart'), preview: false);+ controller.openFile(fakePath('README.md'));expect(controller.tabs.tabs.map((t) => (t.path, t.preview)), [- ('/r/lib/main.dart', false),- ('/r/README.md', true),+ (fakePath('lib/main.dart'), false),+ (fakePath('README.md'), true),]);- expect(controller.tabs.activeId, 'file:/r/README.md');+ expect(controller.tabs.activeId, 'file:${fakePath('README.md')}');},);test('editing keeps a preview tab, marks it dirty, and saving writes it',() async {- controller.openFile('/r/lib/main.dart');+ controller.openFile(fakePath('lib/main.dart'));await pumpEventQueue();- final document = documentOf('/r/lib/main.dart');+ final document = documentOf(fakePath('lib/main.dart'));document.editor!.text = 'void main() => print(1);\n';expect(document.dirty, isTrue);expect(controller.tabs.active!.preview, isFalse);expect(await controller.saveActive(), isTrue);- expect(files.writes['/r/lib/main.dart'], 'void main() => print(1);\n');+ expect(+ files.writes[fakePath('lib/main.dart')],+ 'void main() => print(1);\n',+ );expect(document.dirty, isFalse);},);test('undoing back to the saved text leaves the tab clean', () async {- controller.openFile('/r/lib/main.dart');+ controller.openFile(fakePath('lib/main.dart'));await pumpEventQueue();- final document = documentOf('/r/lib/main.dart');+ final document = documentOf(fakePath('lib/main.dart'));document.editor!.text = 'changed';document.editor!.text = 'void main() {}\n';await Future<void>.delayed(const Duration(milliseconds: 300));@@ -77,19 +85,19 @@ void main() {});test('a clean tab follows the disk; a dirty one asks', () async {- controller.openFile('/r/README.md', preview: false);- controller.openFile('/r/lib/main.dart', preview: false);+ controller.openFile(fakePath('README.md'), preview: false);+ controller.openFile(fakePath('lib/main.dart'), preview: false);await pumpEventQueue();- files.changeOnDisk('/r/README.md', '# New');- controller.onDiskChanged({'/r/README.md'});+ files.changeOnDisk(fakePath('README.md'), '# New');+ controller.onDiskChanged({fakePath('README.md')});await pumpEventQueue();- expect(documentOf('/r/README.md').editor!.text, '# New');+ expect(documentOf(fakePath('README.md')).editor!.text, '# New');- final edited = documentOf('/r/lib/main.dart');+ final edited = documentOf(fakePath('lib/main.dart'));edited.editor!.text = 'mine';- files.changeOnDisk('/r/lib/main.dart', 'theirs');- controller.onDiskChanged({'/r/lib/main.dart'});+ files.changeOnDisk(fakePath('lib/main.dart'), 'theirs');+ controller.onDiskChanged({fakePath('lib/main.dart')});await pumpEventQueue();expect(edited.disk, FinderDiskChange.changed);expect(edited.editor!.text, 'mine');@@ -101,13 +109,13 @@ void main() {});test('its own save is not mistaken for a change on disk', () async {- controller.openFile('/r/lib/main.dart');+ controller.openFile(fakePath('lib/main.dart'));await pumpEventQueue();- final document = documentOf('/r/lib/main.dart');+ final document = documentOf(fakePath('lib/main.dart'));document.editor!.text = 'saved';await document.save();document.editor!.text = 'typing on';- controller.onDiskChanged({'/r/lib/main.dart'});+ controller.onDiskChanged({fakePath('lib/main.dart')});await pumpEventQueue();expect(document.disk, FinderDiskChange.none);});@@ -132,46 +140,52 @@ void main() {);expect(await controller.discard([FakeFinderGit.edited, fresh]), isNull);expect(git.discarded, ['lib/main.dart']);- expect(files.trashed, ['/r/notes.txt']);+ expect(files.trashed, [fakePath('notes.txt')]);});test('new files open kept; names are checked; renames close old tabs',() async {expect(- await controller.create('/r/lib', 'a.dart', asFolder: false),+ await controller.create(fakePath('lib'), 'a.dart', asFolder: false),isNull,);- expect(controller.tabs.active!.path, '/r/lib/a.dart');+ expect(controller.tabs.active!.path, fakePath('lib/a.dart'));expect(controller.tabs.active!.preview, isFalse);- expect(await controller.create('/r', 'x/y', asFolder: false), isNotNull);- expect(await controller.create('/r', ' ', asFolder: false), isNotNull);+ expect(+ await controller.create(fakePath(), 'x/y', asFolder: false),+ isNotNull,+ );+ expect(+ await controller.create(fakePath(), ' ', asFolder: false),+ isNotNull,+ );- expect(await controller.rename('/r/lib/a.dart', 'b.dart'), isNull);- expect(controller.tabs.byId('file:/r/lib/a.dart'), isNull);- expect(files.texts.containsKey('/r/lib/b.dart'), isTrue);+ expect(await controller.rename(fakePath('lib/a.dart'), 'b.dart'), isNull);+ expect(controller.tabs.byId('file:${fakePath('lib/a.dart')}'), isNull);+ expect(files.texts.containsKey(fakePath('lib/b.dart')), isTrue);},);test('a rename waits while the file has unsaved edits', () async {- controller.openFile('/r/README.md');+ controller.openFile(fakePath('README.md'));await pumpEventQueue();- documentOf('/r/README.md').editor!.text = 'draft';- expect(await controller.rename('/r/README.md', 'R.md'), isNotNull);- expect(files.texts.containsKey('/r/README.md'), isTrue);+ documentOf(fakePath('README.md')).editor!.text = 'draft';+ expect(await controller.rename(fakePath('README.md'), 'R.md'), isNotNull);+ expect(files.texts.containsKey(fakePath('README.md')), isTrue);});test('a failed Git read is said, and clears the marks', () async {git.fail = true;await controller.git.refresh();expect(controller.git.status, isA<FinderFailed<GitChanges?>>());- expect(controller.git.fileStatus('/r/lib/main.dart'), isNull);+ expect(controller.git.fileStatus(fakePath('lib/main.dart')), isNull);});test('ignored entries are marked once Git answers', () async {- git.ignoredPaths = {'/r/README.md'};+ git.ignoredPaths = {fakePath('README.md')};await controller.refresh();- expect(controller.git.isIgnored('/r/README.md'), isTrue);- expect(controller.git.isIgnored('/r/lib'), isFalse);+ expect(controller.git.isIgnored(fakePath('README.md')), isTrue);+ expect(controller.git.isIgnored(fakePath('lib')), isFalse);});}diff --git a/desktop/test/finder/finder_pane_panel_test.dart b/desktop/test/finder/finder_pane_panel_test.dartindex 399a66812..c3f56961f 100644--- a/desktop/test/finder/finder_pane_panel_test.dart+++ b/desktop/test/finder/finder_pane_panel_test.dart@@ -28,7 +28,7 @@ void main() {return grid.BrightnessScope(child: Scaffold(body: FinderPanePanel(- root: '/r',+ root: fakePath(),files: files,git: git,onFixedWidth: widths.add,@@ -91,7 +91,7 @@ void main() {await tester.pumpAndSettle();expect(find.byKey(const ValueKey('finder-code-editor')), findsOneWidget);final title = find.descendant(- of: tab('/r/lib/main.dart'),+ of: tab(fakePath('lib/main.dart')),matching: find.text('main.dart'),);expect(tester.widget<Text>(title).style?.fontStyle, FontStyle.italic);@@ -124,7 +124,7 @@ void main() {await tester.sendKeyEvent(LogicalKeyboardKey.keyS);await tester.sendKeyUpEvent(LogicalKeyboardKey.metaLeft);await tester.pumpAndSettle();- expect(files.writes['/r/lib/main.dart'], contains('x'));+ expect(files.writes[fakePath('lib/main.dart')], contains('x'));expect(find.byKey(const ValueKey('finder-tab-dirty')), findsNothing);}, variant: TargetPlatformVariant.only(TargetPlatform.macOS));@@ -146,7 +146,7 @@ void main() {expect(find.text('Unsaved changes'), findsOneWidget);await tester.tap(find.byKey(const ValueKey('finder-dialog-Don’t Save')));await tester.pumpAndSettle();- expect(tab('/r/README.md'), findsNothing);+ expect(tab(fakePath('README.md')), findsNothing);expect(files.writes, isEmpty);});@@ -208,8 +208,8 @@ void main() {);await tester.testTextInput.receiveAction(TextInputAction.done);await tester.pumpAndSettle();- expect(files.texts.containsKey('/r/notes.md'), isTrue);- expect(tab('/r/notes.md'), findsOneWidget);+ expect(files.texts.containsKey(fakePath('notes.md')), isTrue);+ expect(tab(fakePath('notes.md')), findsOneWidget);});testWidgets('with no file open it asks only for its file list\'s width', (diff --git a/desktop/test/finder/local_finder_test.dart b/desktop/test/finder/local_finder_test.dartindex 2aa91fbeb..f2ba040eb 100644--- a/desktop/test/finder/local_finder_test.dart+++ b/desktop/test/finder/local_finder_test.dart@@ -1,6 +1,7 @@import 'dart:io';import 'package:flutter_test/flutter_test.dart';+import 'package:harness/finder/finder_controller.dart';import 'package:harness/finder/finder_models.dart';import 'package:harness/finder/local_finder_files.dart';import 'package:harness/finder/local_finder_git.dart';@@ -30,6 +31,9 @@ void main() {await run(['init', '-q', '-b', 'main']);await run(['config', 'user.email', 'finder@test']);await run(['config', 'user.name', 'Finder Test']);+ // Git for Windows checks out with CRLF by default; this repository keeps+ // the bytes it was given, as a Mac's does.+ await run(['config', 'core.autocrlf', 'false']);file('a.txt').writeAsStringSync('one\ntwo\n');file('.gitignore').writeAsStringSync('build/\n');await run(['add', '.']);@@ -139,6 +143,24 @@ void main() {expect((await git.changes(root))!.changes, isEmpty);});+ // Git names the top folder `C:/Users/…` on Windows, and the tree lists+ // `C:\Users\…\a.txt`: no file there wore its Git colour.+ test('marks a changed file at the path the tree lists it', () async {+ await repository();+ file('a.txt').writeAsStringSync('one\nTWO\n');+ final controller = FinderController(root: root, files: files, git: git);+ addTearDown(controller.dispose);+ await controller.refresh();+ final listed = controller.tree.rows.firstWhere(+ (row) => row.entry.name == 'a.txt',+ );+ expect(controller.git.repository?.root, root);+ expect(+ controller.git.fileStatus(listed.entry.path),+ GitChangeKind.modified,+ );+ });+test('tells which entries Git ignores', () async {final repo = await repository();Directory(p.join(root, 'build')).createSync();diff --git a/desktop/test/git_worktree_test.dart b/desktop/test/git_worktree_test.dartindex 56cb73b40..184429b1b 100644--- a/desktop/test/git_worktree_test.dart+++ b/desktop/test/git_worktree_test.dart@@ -418,6 +418,27 @@ void main() {expect(await placeholder(), p.join(worktrees(), 'witty-finch'));});+ // Windows refuses to delete a folder a process stands in: run inside the+ // worktree, git emptied it and left the folder, and Cancel kept it.+ test('git removes it from outside the folder', () async {+ final path = await placeholder();+ final from = <String>[];+ Future<Process> start(List<String> argv, Map<String, String> env) {+ if (argv.contains('remove')) from.add(argv[argv.indexOf('-C') + 1]);+ return Process.start(+ 'git',+ argv,+ environment: env,+ includeParentEnvironment: false,+ );+ }++ expect(await discardPreparedWorktree(path, startProcess: start), isTrue);+ expect(from, hasLength(1));+ expect(p.equals(from.single, path), isFalse);+ expect(p.isWithin(path, from.single), isFalse);+ });+test('a subfolder project removes the whole worktree', () async {final sub = await ProjectFolderRequest.worktree(p.join(repo, 'src'),diff --git a/desktop/test/harness_cli_runner_windows_test.dart b/desktop/test/harness_cli_runner_windows_test.dartindex 56ef140d0..f66133506 100644--- a/desktop/test/harness_cli_runner_windows_test.dart+++ b/desktop/test/harness_cli_runner_windows_test.dart@@ -3,6 +3,7 @@ import 'dart:io';import 'package:flutter_test/flutter_test.dart';import 'package:harness/core/harness_cli_runner.dart';+import 'package:harness/core/hidden_process.dart';import 'package:harness/core/windows_layout.dart';import 'package:path/path.dart' as p;@@ -282,9 +283,12 @@ void main() {r'ends\','',];+ // The product's own runHidden, passed in: the runner refuses to spawn with no process+ // functions under flutter test, and harnessHome is a scratch profile with an echo cli.js.final result = await HarnessCliRunner(harnessHome: harnessHome,environment: {...Platform.environment, 'USERPROFILE': profile.path},+ runProcess: runHidden,).run(arguments);expect(result.exitCode, 0, reason: '${result.stderr}');expect(jsonDecode('${result.stdout}'.trim()), arguments);diff --git a/desktop/test/icon_catalog_render_test.dart b/desktop/test/icon_catalog_render_test.dartindex ecd51944e..1e8c6089a 100644--- a/desktop/test/icon_catalog_render_test.dart+++ b/desktop/test/icon_catalog_render_test.dart@@ -22,7 +22,7 @@ void main() {'lib',).listSync(recursive: true).whereType<File>()) {if (!file.path.endsWith('.dart') ||- file.path.endsWith('/app_icons.dart')) {+ file.path.endsWith('${Platform.pathSeparator}app_icons.dart')) {continue;}final lines = file.readAsLinesSync();diff --git a/desktop/test/local_daemon_transport_test.dart b/desktop/test/local_daemon_transport_test.dartindex 9c2fc44b1..aed517067 100644--- a/desktop/test/local_daemon_transport_test.dart+++ b/desktop/test/local_daemon_transport_test.dart@@ -13,6 +13,13 @@ import 'package:harness/ws/ws_conn.dart';const _computerId = '0123456789abcdef0123456789abcdef';+/// "No socket can exist" is the macOS and Linux data folder too long for one. Windows has no such+/// case: every local route goes over the daemon's proven pipe, and the credential is never shown to+/// a port (`LocalDaemonTransport.tcpHeaders`, CLI `localCredentialHeaders`, audit W1).+final Object _portCredentialSkip = Platform.isWindows+ ? 'macOS and Linux only: Windows reaches the daemon over its pipe and never sends the credential to a port'+ : false;+/// A stand-in daemon: `/api/status`, `/api/auth/me` and the local WebSocket,/// on whatever [HttpServer] it is given, counting what reached it.class _Daemon {@@ -237,7 +244,7 @@ void main() {expect(await api.me(), {'via': 'tcp'});expect(tcp.credentials.last, credential);- });+ }, skip: _portCredentialSkip);test('is not offered to a port while a socket can exist', () {final transport = LocalDaemonTransport(@@ -271,7 +278,7 @@ void main() {expect(tcp.selects, 1);expect(tcp.credentials, [credential]);- });+ }, skip: _portCredentialSkip);});group('discovery', () {diff --git a/desktop/test/native_webview_runtime_test.dart b/desktop/test/native_webview_runtime_test.dartindex 94f1f1a64..5970b55be 100644--- a/desktop/test/native_webview_runtime_test.dart+++ b/desktop/test/native_webview_runtime_test.dart@@ -10,6 +10,12 @@ import 'package:webview_flutter/webview_flutter.dart';import 'support/fake_webview.dart';import 'support/real_fonts.dart';+/// Windows asks the Linux plugin's channel nothing: it finds WebView2 by the folders its installer+/// writes ('WebView2 on Windows' below), and a Windows runner has WebView2, so the viewer is on.+final Object _asksNoPlugin = RuntimePlatform.isWindows+ ? 'Linux plugin channel: Windows finds WebView2 by its install folders, tested below'+ : false;+void main() {setUpAll(loadRealFonts);TestWidgetsFlutterBinding.ensureInitialized();@@ -69,7 +75,7 @@ void main() {test('missing native plugin keeps Harness usable', () async {await NativeWebViewRuntime.initialize();expect(NativeWebViewRuntime.available, isFalse);- });+ }, skip: _asksNoPlugin);test('native initialization errors disable the viewer', () async {messenger.setMockMethodCallHandler(NativeWebViewRuntime.channel, (_) async {@@ -77,7 +83,7 @@ void main() {});await NativeWebViewRuntime.initialize();expect(NativeWebViewRuntime.available, isFalse);- });+ }, skip: _asksNoPlugin);testWidgets('Linux recordings offer browser playback without WebKitGTK', (tester,) async {diff --git a/desktop/test/shared_harness_panel_test.dart b/desktop/test/shared_harness_panel_test.dartindex 052ea9209..087e210e4 100644--- a/desktop/test/shared_harness_panel_test.dart+++ b/desktop/test/shared_harness_panel_test.dart@@ -197,6 +197,8 @@ void main() {hasAccess: hasAccess,visible: true,onClose: () => closePressed = true,+ // The loopback daemon fixture; Windows otherwise dials only its pipe.+ allowLocalTcpFixtureForTest: true,),),),@@ -453,6 +455,7 @@ void main() {hasAccess: true,visible: true,onClose: () {},+ allowLocalTcpFixtureForTest: true,),),),diff --git a/desktop/test/super_tab_attachment_fetch_test.dart b/desktop/test/super_tab_attachment_fetch_test.dartindex 4b9096366..5577dbc67 100644--- a/desktop/test/super_tab_attachment_fetch_test.dart+++ b/desktop/test/super_tab_attachment_fetch_test.dart@@ -58,6 +58,9 @@ void main() {final hungUp = Completer<void>();raw.listen((socket) {socket.listen((_) {}, onDone: hungUp.complete, onError: (_) {});+ // The reader hanging up mid-answer can fail what is still being+ // written: on Windows as an aborted connection on this socket's sink.+ socket.done.ignore();socket..add(utf8.encode('HTTP/1.1 200 OK\r\ncontent-type: text/plain\r\n\r\n'),diff --git a/desktop/test/super_tab_attachments_test.dart b/desktop/test/super_tab_attachments_test.dartindex 411df4666..343dee065 100644--- a/desktop/test/super_tab_attachments_test.dart+++ b/desktop/test/super_tab_attachments_test.dart@@ -23,6 +23,7 @@ import 'package:harness/super_tabs/model.dart';import 'package:harness/super_tabs/view.dart';import 'package:harness/state/harness_attachments.dart';import 'package:harness/widgets/new_harness_paste.dart';+import 'package:path/path.dart' as p;import 'support/super_tab_fixture.dart';@@ -215,7 +216,9 @@ void main() {tester.view.devicePixelRatio = 1;addTearDown(tester.view.resetDevicePixelRatio);final (_, controller) = await open(tester);- final file = File('${Directory.systemTemp.path}/swarm-drop-test.log');+ final file = File(+ p.join(Directory.systemTemp.path, 'swarm-drop-test.log'),+ );await tester.runAsync(() => file.writeAsString('boom'));addTearDown(() => file.deleteSync());final inside = tester.getCenter(diff --git a/desktop/test/super_tab_folder_drop_test.dart b/desktop/test/super_tab_folder_drop_test.dartindex cd959240b..31ef2f95b 100644--- a/desktop/test/super_tab_folder_drop_test.dart+++ b/desktop/test/super_tab_folder_drop_test.dart@@ -11,8 +11,10 @@ import 'package:flutter/services.dart';import 'package:flutter_test/flutter_test.dart';import 'package:harness/super_tabs/attachment_upload.dart';import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/folder_zip.dart';import 'package:harness/super_tabs/view.dart';import 'package:harness/state/harness_attachments.dart';+import 'package:path/path.dart' as p;import 'support/super_tab_fixture.dart';@@ -26,9 +28,11 @@ void main() {setUp(() => root = Directory.systemTemp.createTempSync('swarm-folder-drop'));tearDown(() => root.deleteSync(recursive: true));- /// A real folder under [root], so the drop can tell it from a file.+ /// A real folder under [root], so the drop can tell it from a file. Its+ /// path is this computer's own, as a drop gives it: on Windows a `/` in it+ /// would end up in the name a dropped file is attached by.Directory folder(String name) =>- Directory('${root.path}/$name')..createSync();+ Directory(p.join(root.path, name))..createSync();/// The chat's one agent runs on [machineId]; this computer is `here`.Future<SuperTabController> open(@@ -139,6 +143,26 @@ void main() {for (final file in c.attachments('lead').files) file.name,];+ test('a Windows path goes in as it is, its backslashes its own, and in '+ 'quotes only for a space or a shell character', () {+ expect(+ folderPathText(r'C:\Users\RUNNER~1\AppData\docs', isWindows: true),+ r'C:\Users\RUNNER~1\AppData\docs',+ );+ expect(+ folderPathText(r'C:\Users\me\my notes', isWindows: true),+ r'"C:\Users\me\my notes"',+ );+ expect(+ folderPathText(r'C:\work\cost$HOME', isWindows: true),+ r'"C:\work\cost$HOME"',+ );+ expect(+ folderPathText(r'/work/back\slash', isWindows: false),+ r'"/work/back\\slash"',+ );+ });+testWidgets('a dropped folder puts its path at the cursor', (tester) async {final controller = await open(tester);final docs = folder('docs');@@ -193,7 +217,7 @@ void main() {tester,) async {final controller = await open(tester);- final log = File('${root.path}/trace.log')..writeAsStringSync('boom');+ final log = File(p.join(root.path, 'trace.log'))..writeAsStringSync('boom');await tester.enterText(composer, 'Here');await drop(tester, [log.path], until: () => names(controller).isNotEmpty);@@ -207,7 +231,7 @@ void main() {tester,) async {final controller = await open(tester);- final log = File('${root.path}/trace.log')..writeAsStringSync('boom');+ final log = File(p.join(root.path, 'trace.log'))..writeAsStringSync('boom');final src = folder('src');await drop(@@ -446,8 +470,10 @@ void main() {testWidgets('two folders of one name are both attached, the second ''numbered', (tester) async {final controller = await open(tester, machineId: 'studio');- final first = Directory('${root.path}/a/src')..createSync(recursive: true);- final second = Directory('${root.path}/b/src')..createSync(recursive: true);+ final first = Directory(p.join(root.path, 'a', 'src'))+ ..createSync(recursive: true);+ final second = Directory(p.join(root.path, 'b', 'src'))+ ..createSync(recursive: true);File('${first.path}/one.txt').writeAsStringSync('1');File('${second.path}/two.txt').writeAsStringSync('2');await drop(tester, [@@ -512,45 +538,53 @@ void main() {await close(tester, controller);});- testWidgets('a path a shell would read differently goes in quoted, its '- 'quotes, dollars, backticks and backslashes escaped', (tester) async {- final controller = await open(tester);- final quoted = folder('my "notes"'),- dollar = folder(r'cost$HOME'),- tick = folder('run`date`'),- slash = folder(r'back\slash'),- apostrophe = folder("it's");- final r = root.path;-- await drop(tester, [- quoted.path,- dollar.path,- tick.path,- slash.path,- apostrophe.path,- ], until: () => field(tester).text.contains('it'));-- expect(- field(tester).text,- '"$r/my \\"notes\\"" "$r/cost\\\$HOME" "$r/run\\`date\\`" '- '"$r/back\\\\slash" "$r/it\'s" ',- );- await close(tester, controller);- });-- testWidgets('Attach as zip takes out a path it escaped', (tester) async {+ testWidgets(+ 'a path a shell would read differently goes in quoted, its '+ 'quotes, dollars, backticks and backslashes escaped',+ (tester) async {+ final controller = await open(tester);+ final quoted = folder('my "notes"'),+ dollar = folder(r'cost$HOME'),+ tick = folder('run`date`'),+ slash = folder(r'back\slash'),+ apostrophe = folder("it's");+ final r = root.path;++ await drop(tester, [+ quoted.path,+ dollar.path,+ tick.path,+ slash.path,+ apostrophe.path,+ ], until: () => field(tester).text.contains('it'));++ expect(+ field(tester).text,+ '"$r/my \\"notes\\"" "$r/cost\\\$HOME" "$r/run\\`date\\`" '+ '"$r/back\\\\slash" "$r/it\'s" ',+ );+ await close(tester, controller);+ },+ // macOS and Linux names: a Windows name cannot hold `"`, and `\` is its+ // separator. The Windows rule is the unit test above. (testWidgets takes+ // no skip reason, only a bool.)+ skip: Platform.isWindows,+ );++ testWidgets('Attach as zip takes out a path it quoted', (tester) async {final controller = await open(tester, machineId: 'studio');- final quoted = folder('my "notes"');- File('${quoted.path}/a.txt').writeAsStringSync('a');+ // Escaped on macOS and Linux, quoted alone on Windows.+ final quoted = folder(r'cost$HOME');+ File(p.join(quoted.path, 'a.txt')).writeAsStringSync('a');await tester.enterText(composer, 'See');await drop(tester, [quoted.path,- ], until: () => field(tester).text.contains('notes'));+ ], until: () => field(tester).text.contains('cost'));await tester.tap(find.text('Attach as zip'));await settle(tester, () => names(controller).isNotEmpty);- expect(names(controller), ['my "notes".zip']);+ expect(names(controller), [r'cost$HOME.zip']);expect(field(tester).text, 'See ');await close(tester, controller);});diff --git a/desktop/test/super_tab_thread_composer_test.dart b/desktop/test/super_tab_thread_composer_test.dartindex 8c39e077f..891efcf6d 100644--- a/desktop/test/super_tab_thread_composer_test.dart+++ b/desktop/test/super_tab_thread_composer_test.dart@@ -13,6 +13,7 @@ import 'package:harness/super_tabs/controller.dart';import 'package:harness/super_tabs/places.dart';import 'package:harness/super_tabs/view.dart';import 'package:harness/widgets/new_harness_paste.dart';+import 'package:path/path.dart' as p;import 'support/super_tab_fixture.dart';@@ -380,7 +381,9 @@ void main() {testThread('a dropped file becomes a chip', (tester) async {final c = await openThread(tester, threaded());- final file = File('${Directory.systemTemp.path}/swarm-thread-drop.log');+ final file = File(+ p.join(Directory.systemTemp.path, 'swarm-thread-drop.log'),+ );await tester.runAsync(() => file.writeAsString('boom'));addTearDown(() => file.deleteSync());final inside = tester.getCenter(surface);diff --git a/desktop/test/support/real_fonts.dart b/desktop/test/support/real_fonts.dartindex c5dcb3907..29ccc7658 100644--- a/desktop/test/support/real_fonts.dart+++ b/desktop/test/support/real_fonts.dart@@ -50,7 +50,8 @@ Future<void> loadRealFonts() async {}// A model id is set in mono, and an unregistered mono family falls back to- // Ahem just as loudly.+ // Ahem just as loudly. `Consolas` is the Windows terminal default, and with+ // it the app's mono chrome there (`terminalFontFamily`).final mono = await bytes(_firstExisting('mono', ['/System/Library/Fonts/Supplemental/Courier New.ttf',@@ -64,6 +65,7 @@ Future<void> loadRealFonts() async {'SF Mono','Menlo','DejaVu Sans Mono',+ 'Consolas',]) {await (FontLoader(family)..addFont(Future.value(mono))).load();}diff --git a/desktop/test/windows_known_failures.txt b/desktop/test/windows_known_failures.txtindex 1107afadd..d5fce0617 100644--- a/desktop/test/windows_known_failures.txt+++ b/desktop/test/windows_known_failures.txt@@ -10,7 +10,7 @@test/community_hub_contract_test.dart::the limits and names are the backend'stest/swarm_screen_test.dart::the store tab has a compact text label (native=true)-# POSIX-font-fixture (88)+# POSIX-font-fixture (75)# test/support/real_fonts.dart searches only /System/Library and /usr/share/fonts; print events explicitly report no sans font.test/api_connections_test.dart::(setUpAll)test/api_model_picker_test.dart::(setUpAll)@@ -34,11 +34,6 @@ test/harness_comments_test.dart::(setUpAll)test/harness_customize_test.dart::(setUpAll)test/harness_picker_entry_test.dart::(setUpAll)test/icon_catalog_render_test.dart::(setUpAll)-test/keyboard_practice_test.dart::practice stays readable at Size(1000.0, 800.0) and 1.0 text in Brightness.dark-test/keyboard_practice_test.dart::practice stays readable at Size(1000.0, 800.0) and 1.0 text in Brightness.light-test/keyboard_practice_test.dart::practice stays readable at Size(480.0, 420.0) and 1.7 text in Brightness.dark-test/keyboard_practice_test.dart::practice stays readable at Size(480.0, 420.0) and 1.7 text in Brightness.light-test/keyboard_practice_test.dart::quick start wraps beside a narrow workspace with enlarged texttest/layout_palette_render_test.dart::(setUpAll)test/local_model_picker_test.dart::(setUpAll)test/login_fleet_map_test.dart::(setUpAll)@@ -67,10 +62,6 @@ test/setup_review_render_test.dart::(setUpAll)test/share_harness_test.dart::(setUpAll)test/shared_agent_page_test.dart::(setUpAll)test/shared_harness_panel_test.dart::(setUpAll)-test/shortcuts_browser_test.dart::lazy shortcuts keep keyboard paging visible at Size(1000.0, 700.0)/1.0/Brightness.dark-test/shortcuts_browser_test.dart::lazy shortcuts keep keyboard paging visible at Size(1000.0, 700.0)/1.0/Brightness.light-test/shortcuts_browser_test.dart::lazy shortcuts keep keyboard paging visible at Size(480.0, 420.0)/1.8/Brightness.dark-test/shortcuts_browser_test.dart::lazy shortcuts keep keyboard paging visible at Size(480.0, 420.0)/1.8/Brightness.lighttest/sign_in_step_test.dart::(setUpAll)test/signout_recovery_test.dart::(setUpAll)test/status_line_test.dart::(setUpAll)@@ -90,10 +81,6 @@ test/usage_loading_test.dart::(setUpAll)test/usage_section_test.dart::(setUpAll)test/web_tab_switcher_test.dart::(setUpAll)test/welcome_entry_layout_test.dart::(setUpAll)-test/welcome_wallpaper_shortcuts_test.dart::shortcut browser searches live bindings and practices the selected row-test/welcome_wallpaper_shortcuts_test.dart::shortcut popup fits and closes with Escape-test/welcome_wallpaper_shortcuts_test.dart::wallpaper gallery persists a choice and restores the blank default-test/welcome_wallpaper_shortcuts_test.dart::wallpapers keep a centered welcome and the selected terminal typetest/workspace_account_test.dart::(setUpAll)test/workspace_activity_test.dart::(setUpAll)test/workspace_expiry_screen_test.dart::(setUpAll)@@ -180,15 +167,8 @@ test/harness_cli_runner_test.dart::remote-password status invokes cli.js as diretest/harness_cli_runner_test.dart::uses the explicit legacy launcher before PATHtest/harness_cli_runner_test.dart::uses the managed Node runtime and CLI bundle without a shell-# POSIX-unix-socket-fixture (3)-# test/local_daemon_transport_test.dart creates Unix sockets; Windows uses an authenticated named pipe and never sends the credential over TCP.-test/local_daemon_transport_test.dart::local credential goes with REST over the port, never down the socket-test/local_daemon_transport_test.dart::local credential goes with the local WebSocket over the port-test/local_daemon_transport_test.dart::local WebSocket falls back to the port when the socket is not there--# POSIX-updater-or-appimage (8)+# POSIX-updater-or-appimage (7)# These tests exercise macOS updater keys/staging, or Linux AppImage Exec/chmod/install behavior; Windows updater is added later in C4.-test/about_section_test.dart::names the app and version without claiming an untested update statustest/desktop_updater_test.dart::Linux architecture packaging downloadAndStage stages the AppImage as-is and makes it executabletest/desktop_updater_test.dart::Linux architecture packaging downloadAndStage verifies a large download off the UI isolatetest/linux_app_image_test.dart::a path with spaces is quoted for the launcherdiff --git a/docs/plans/2026-11-07-windows-desktop-suite-green-plan.md b/docs/plans/2026-11-07-windows-desktop-suite-green-plan.mdnew file mode 100644index 000000000..c70194389--- /dev/null+++ b/docs/plans/2026-11-07-windows-desktop-suite-green-plan.md@@ -0,0 +1,86 @@+# Windows Desktop suite green on main Implementation Plan++> Written by the writing-plans skill as this project's Engineer role adapts it: the Engineer implements it task by+> task, test first; groups that share no files run in parallel by subagents; the pull request's review is the one review.++**Goal:** The hand-run Windows Desktop workflow passes on main, x64 and arm64: every test that fails there and is not in+`desktop/test/windows_known_failures.txt` is fixed for Windows, or skipped on Windows with its reason when it tests+macOS-only behaviour (task #4618).++**Architecture:** The last run whose tests passed was 2026-10-20 (`feat/windows-desktop` aca60708e); the list was written+on 10-21 and main has moved since, while every later run either skipped the tests or ran on a branch. Run 42364609130+(f5c81bb, #3524) lists 69 unlisted failures in 25 files. Each is traced to the change since 10-21 that broke it; the+fix goes where the behaviour lives: a Windows bug in `desktop/lib` is fixed there (the macOS path is the reference), a+test that assumed POSIX is made platform-neutral, and only a test of macOS-only behaviour is skipped on Windows, with+the reason in its `skip:`.++**Tech Stack:** Flutter (Dart) widget and unit tests; the `windows-desktop.yml` workflow (x64, arm64) as the only Windows+runner; `tool/windows_test_baseline.py check` to read a run's results.++**Spec:** Task #4618; run https://github.com/autonomous-ai/openharness/actions/runs/42364609130 (results artifact+`windows-desktop-tests-{x64,arm64}`); `docs/windows-rules.md`.++## Global Constraints++- Desktop only. `desktop/test/` is the task's area; a Windows bug in `desktop/lib` is fixed there and named in the PR.+- No window may open: processes in tests and code go through `startHidden`/`runHidden` (docs/windows-rules.md §1).+- Nothing is added to `windows_known_failures.txt` without a reason and a task.+- One hand-run Windows workflow at a time.+- macOS behaviour is unchanged: each touched test file still passes on macOS.++## Review Focus++- A fix that only hides the failure (a looser expectation) where the product is wrong on Windows.+- Paths: an 8.3 short name and the long name of one folder (`RUNNER~1` and `runneradmin`), `\` and `/`, drive letters.+- Line endings: Git on Windows checks out and writes `\r\n`.+- Text metrics: the Windows fonts the tests load (Arial, Courier New, Segoe UI) against the macOS ones.+- A skip that drops Windows coverage of behaviour Windows has.++---++### Task 1: Preview fonts find the pub cache on Windows++**Files:** `desktop/test/box_render_preview_test.dart` (`loadPreviewFonts`); fixes `preview_fonts_test`,+`super_tab_scorecard_test`, `super_tab_task_line_test`.++- [ ] Find the Lucide font through `.dart_tool/package_config.json`, not `$HOME/.pub-cache` (Windows keeps the cache under+ `%LOCALAPPDATA%\Pub\Cache`, and `HOME` is unset).+- [ ] The three files pass on macOS; Windows proves them.++### Task 2: Layout and text-metric tests++**Files:** `entry_surfaces_render_test`, `export_logs_dialog_test`, `api_connections_test`,+`new_agent_choices_layout_test`, `pane_phone_header_test`, `swarm_resize_test`, `status_line_test`,+`terminal_panel_header_test`, `shared_harness_panel_test`, `icon_catalog_render_test`, and what they share.++- [ ] For each, the failing measurement and why Windows differs; fix the cause (a font the test loads, a layout that+ overflows at text scale 2.0 on Windows widths) or, only for macOS-only chrome, skip with the reason.++### Task 3: Dropped folders and attached files on Windows++**Files:** `super_tab_folder_drop_test`, `super_tab_attachments_test`, `super_tab_thread_composer_test`,+`super_tab_attachment_fetch_test`, and the code they test.++- [ ] A Windows path is not shell-quoted for its backslashes (a dropped folder reads as on macOS).+- [ ] An attachment is named by its file name, not by a prefix cut that an 8.3 folder name throws off.+- [ ] An aborted read past the limit (WSAECONNABORTED) is the expected hang-up on Windows too.+- [ ] Each Windows bug gets a test that fails without the fix on every OS where possible.++### Task 4: Finder, Git and worktrees++**Files:** `finder/finder_controller_test`, `finder/finder_pane_panel_test`, `finder/local_finder_test`,+`git_worktree_test`, `cancel_discards_worktree_test`, and the code they test.++- [ ] Paths the tests write as `/r/...` compared as Windows paths; Git's `\r\n` checkouts; worktree removal on Windows.++### Task 5: Platform one-offs++**Files:** `harness_cli_runner_windows_test`, `local_daemon_transport_test`, `native_webview_runtime_test`.++- [ ] Each test's Windows expectation against the code it tests; a test of the real CLI under flutter test gives the+ runner its own process functions.++### Task 6: One Windows run++- [ ] Run `windows-desktop.yml` once on the branch; `tool/windows_test_baseline.py check` on both artifacts finds no new+ failure. Fix what remains and run again only for that.