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
Simplify Desktop usage sharing to one Experimental toggle (#1368)
Dee656a7084f072
diff --git a/desktop/lib/app_shell.dart b/desktop/lib/app_shell.dartindex d42e9a68f..f8edeae4c 100644--- a/desktop/lib/app_shell.dart+++ b/desktop/lib/app_shell.dart@@ -276,7 +276,9 @@ class _RootShellState extends ConsumerState<RootShell>() => showSettingsScreen(context,app,- initialSection: SettingsSection.privacy,+ initialSection: kIsWeb+ ? SettingsSection.privacy+ : SettingsSection.experimental,source: 'setup_menu',),);diff --git a/desktop/lib/measurement/setup_usage_choice.dart b/desktop/lib/measurement/setup_usage_choice.dartindex a480fb0d7..748d04caf 100644--- a/desktop/lib/measurement/setup_usage_choice.dart+++ b/desktop/lib/measurement/setup_usage_choice.dart@@ -14,20 +14,27 @@ class SetupUsageChoice extends StatefulWidget {class _SetupUsageChoiceState extends State<SetupUsageChoice> {bool _saving = false;- String? _error;Future<void> _set(bool enabled) async {+ if (!mounted) return;+ ScaffoldMessenger.of(context).hideCurrentSnackBar();setState(() {_saving = true;- _error = null;});try {await widget.measurement.setSignedOutSharing(enabled);} catch (_) {if (mounted) {- setState(- () => _error =- 'Couldn’t save this setting for the next launch. Try again.',+ ScaffoldMessenger.of(context).showSnackBar(+ SnackBar(+ content: const Text(+ 'Couldn’t save this setting for the next launch.',+ ),+ action: SnackBarAction(+ label: 'Retry saving',+ onPressed: () => _set(widget.measurement.signedOutSharing),+ ),+ ),);}} finally {@@ -38,34 +45,14 @@ class _SetupUsageChoiceState extends State<SetupUsageChoice> {@overrideWidget build(BuildContext context) => ListenableBuilder(listenable: widget.measurement,- builder: (context, _) => SingleChildScrollView(- child: SettingRow(- title: 'Share product usage data',- detail:- 'Help improve Harness by sharing setup and sign-in counts and duration statistics. '- 'Your account details, prompts, code, files, and conversations are never included.',- controlSemanticLabel: 'Share product usage data',- control: Switch(- value: widget.measurement.signedOutSharing,- onChanged: widget.measurement.choiceLoaded && !_saving ? _set : null,- ),- footer: _error == null- ? const Text(- 'Applies to this computer before sign-in and is remembered for future launches. '- 'Turning this off also disables sharing for your account when you sign in.',- )- : Column(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- Text(_error!),- TextButton(- onPressed: _saving- ? null- : () => _set(widget.measurement.signedOutSharing),- child: const Text('Retry saving'),- ),- ],- ),+ builder: (context, _) => SettingRow(+ title: 'Share product usage data',+ inlineControl: true,+ controlSemanticLabel: 'Share product usage data',+ control: Switch(+ key: const ValueKey('product-usage-sharing'),+ value: widget.measurement.signedOutSharing,+ onChanged: widget.measurement.choiceLoaded && !_saving ? _set : null,),),);diff --git a/desktop/lib/settings/sections/experimental_section.dart b/desktop/lib/settings/sections/experimental_section.dartindex 6f00a7fdb..d8c092d10 100644--- a/desktop/lib/settings/sections/experimental_section.dart+++ b/desktop/lib/settings/sections/experimental_section.dart@@ -1,15 +1,19 @@import 'dart:async';import 'package:flutter/material.dart';+import 'package:flutter/foundation.dart' show kIsWeb;import '../../shared/widgets/section_scaffold.dart';import '../../shared/widgets/setting_row.dart';import '../experimental_features.dart';+import '../../state/app_state.dart';+import 'privacy_section.dart' show ProductUsageSetting;class ExperimentalSection extends StatefulWidget {- const ExperimentalSection({super.key, this.store});+ const ExperimentalSection({super.key, this.store, this.notifier});final ExperimentalFeaturesStore? store;+ final AppNotifier? notifier;@overrideState<ExperimentalSection> createState() => _ExperimentalSectionState();@@ -44,6 +48,8 @@ class _ExperimentalSectionState extends State<ExperimentalSection> {crossAxisAlignment: CrossAxisAlignment.stretch,spacing: 10,children: [+ if (!kIsWeb && widget.notifier != null)+ ProductUsageSetting(notifier: widget.notifier!, compact: true),if (!preferences.loaded ||(preferences.error != null &&preferences.errorFeature == null))diff --git a/desktop/lib/settings/sections/privacy_section.dart b/desktop/lib/settings/sections/privacy_section.dartindex 2d4fa34d0..49c073279 100644--- a/desktop/lib/settings/sections/privacy_section.dart+++ b/desktop/lib/settings/sections/privacy_section.dart@@ -17,37 +17,51 @@ class PrivacySection extends StatelessWidget {const PrivacySection({super.key, required this.notifier});final AppNotifier notifier;+ @override+ Widget build(BuildContext context) => SectionScaffold(+ title: 'Privacy',+ subtitle: 'Choose what you share to help improve Harness.',+ child: ProductUsageSetting(notifier: notifier),+ );+}++/// The same saved preference before and after sign-in. Desktop presents one row;+/// the browser keeps its existing Privacy page.+class ProductUsageSetting extends StatelessWidget {+ const ProductUsageSetting({+ super.key,+ required this.notifier,+ this.compact = false,+ });+ final AppNotifier notifier;+ final bool compact;+@overrideWidget build(BuildContext context) => ListenableBuilder(listenable: notifier,- builder: (context, _) => SectionScaffold(- title: 'Privacy',- subtitle: 'Choose what you share to help improve Harness.',- child:- notifier.isGuest ||- (!kIsWeb && notifier.status != AppStatus.authenticated)- ? notifier.productMeasurement.surface == 'web'- ? const Text(- 'Product usage sharing is available after sign-in.',- )- : SetupUsageChoice(measurement: notifier.productMeasurement)- : ProductUsagePreference(- key: ObjectKey(notifier.api),- request: ({bool? enabled}) async {- final value = await notifier.productUsageSettings(- enabled: enabled,- );- notifier.productMeasurement.savedChoice(- value,- explicit: enabled != null,- );- await notifier.productMeasurement.setupChoiceSaved;- return value;- },- feedback: notifier.api.productUsageFeedback,- measurement: notifier.productMeasurement,- ),- ),+ builder: (context, _) =>+ notifier.isGuest ||+ (!kIsWeb && notifier.status != AppStatus.authenticated)+ ? notifier.productMeasurement.surface == 'web'+ ? const Text('Product usage sharing is available after sign-in.')+ : SetupUsageChoice(measurement: notifier.productMeasurement)+ : ProductUsagePreference(+ key: ObjectKey(notifier.api),+ compact: compact,+ request: ({bool? enabled}) async {+ final value = await notifier.productUsageSettings(+ enabled: enabled,+ );+ notifier.productMeasurement.savedChoice(+ value,+ explicit: enabled != null,+ );+ await notifier.productMeasurement.setupChoiceSaved;+ return value;+ },+ feedback: notifier.api.productUsageFeedback,+ measurement: notifier.productMeasurement,+ ),);}@@ -58,10 +72,12 @@ class ProductUsagePreference extends StatefulWidget {required this.request,this.feedback,this.measurement,+ this.compact = false,});final UsagePreferenceRequest request;final ProductFeedbackRequest? feedback;final ProductMeasurement? measurement;+ final bool compact;@overrideState<ProductUsagePreference> createState() => _ProductUsagePreferenceState();@@ -79,6 +95,10 @@ class _ProductUsagePreferenceState extends State<ProductUsagePreference> {}Future<void> _read({bool? enabled}) async {+ if (!mounted) return;+ if (widget.compact && (enabled != null || _error != null)) {+ ScaffoldMessenger.of(context).hideCurrentSnackBar();+ }setState(() {_busy = true;_error = null;@@ -99,6 +119,14 @@ class _ProductUsagePreferenceState extends State<ProductUsagePreference> {// An ambiguous write must not leave a switch claiming the old value is still saved.if (enabled != null) _enabled = null;});+ if (widget.compact) {+ ScaffoldMessenger.of(context).showSnackBar(+ SnackBar(+ content: Text(_error!),+ action: SnackBarAction(label: 'Reload', onPressed: () => _read()),+ ),+ );+ }}} finally {if (mounted) {@@ -109,113 +137,125 @@ class _ProductUsagePreferenceState extends State<ProductUsagePreference> {}}+ Widget get _control => _enabled == null+ ? _busy+ ? const SizedBox.square(+ dimension: 20,+ child: CircularProgressIndicator(strokeWidth: 2),+ )+ : const Text('Unavailable')+ : Switch(+ key: const ValueKey('product-usage-sharing'),+ value: _enabled!,+ onChanged: _busy ? null : (value) => _read(enabled: value),+ );+@override- Widget build(BuildContext context) => SingleChildScrollView(- child: Column(- crossAxisAlignment: CrossAxisAlignment.stretch,- children: [- SettingRow(+ Widget build(BuildContext context) => widget.compact+ ? SettingRow(title: 'Share product usage data',- detail:- 'Help improve Harness by sharing usage counts and duration statistics. '- 'Your prompts, code, files, and conversations are never included.',+ inlineControl: true,controlSemanticLabel: 'Share product usage data',- control: _enabled == null- ? _busy- ? const SizedBox.square(- dimension: 20,- child: CircularProgressIndicator(strokeWidth: 2),- )- : const Text('Unavailable')- : Switch(- value: _enabled!,- onChanged: _busy ? null : (value) => _read(enabled: value),+ control: _control,+ )+ : SingleChildScrollView(+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ SettingRow(+ title: 'Share product usage data',+ detail:+ 'Help improve Harness by sharing usage counts and duration statistics. '+ 'Your prompts, code, files, and conversations are never included.',+ controlSemanticLabel: 'Share product usage data',+ control: _control,+ footer: const Text(+ 'Applies to every computer and app signed in to this account. '+ 'Turning this off stops new product usage reports. Essential service and security records are separate.',),- footer: const Text(- 'Applies to every computer and app signed in to this account. '- 'Turning this off stops new product usage reports. Essential service and security records are separate.',- ),- ),- if (_error != null) ...[- const SizedBox(height: 12),- Text(_error!),- Align(- alignment: Alignment.centerLeft,- child: TextButton(- onPressed: _busy ? null : () => _read(),- child: const Text('Reload'),- ),- ),- ],- const SizedBox(height: 8),- Align(- alignment: Alignment.centerLeft,- child: TextButton(- onPressed: () => setState(() {- _details = !_details;- }),- child: Text(_details ? 'Hide shared fields' : 'See what’s shared'),- ),- ),- if (_details) ...[- const SizedBox(height: 8),- const SelectableText(- 'Shared fields\n'- '• UTC day and a random report receipt to prevent duplicate counts\n'- '• Active and working computer counts; first and repeat work\n'- '• Desktop and terminal app opens\n'- '• The days you used Harness, which apps you used, whether an agent worked and your sign-up day, under a coded ID instead of your account; kept 10 days, then only as combined totals\n'- '• Agent turns started, ended, or interrupted (including automated work)\n'- '• Turn durations: under 10 seconds, 10–60 seconds, 1–5 minutes, or over 5 minutes\n'- '• Launch, resume, restart, model change and history request outcomes, fixed failure categories and wait buckets\n'- '• First response waits, missing responses and error-event counts; first-launch 24-hour response counts and D1/D7/D28 working-day returns\n'- '• A fixed feedback answer only when you choose to send one\n'- '• Protocol version and the revision of your sharing preference\n\n'- 'Desktop and CLI also share separate release and operating-system totals; '- 'fixed startup, viewer-load, update-apply, reconnect and resume-to-work outcomes; '- 'coarse memory, CPU and frame-time buckets; and counts of errors and interrupted app runs. '- 'No error text, stack trace, device specification or browsing address is sent. '- 'Local day flags measure explicit composer work and weekly use; they are never uploaded. '- 'The last app run keeps only local restart/update control flags, removed when sharing is off. '- 'Feedback views, answers and dismissals are counted without linking them to a task.\n\n'- 'Older apps contribute connection, remote-session, and turn-start totals. '- 'These event counts are separate from active computer counts.\n\n'- 'Sign-in checks your preference. Account, computer, and agent identifiers are not stored '- 'with the combined totals. The 10-day daily records use a coded ID instead of your account '- 'and are deleted when you turn sharing off. Queued local counters older than 35 days are discarded when Harness next runs. '- 'Server retry receipts are scheduled to expire after 36 days; combined totals after 13 months. Background cleanup may lag. '- 'Combined totals cannot be removed for one person. Apart from those 10-day records, reports create no per-person history. '- 'Previously collected activity records expire after 35 days. '- 'Fixed setup, sign-in, connection, viewer and update-stage outcomes; first and repeat feature use; weekly and monthly returns. '- 'Optional task feedback sends only your selected outcome or reason. '- 'A turn ending does not tell us whether your task succeeded.',- ),- ],- if (_enabled == true && widget.feedback != null) ...[- if (!kIsWeb)- TextButton(- onPressed: () => showTaskFeedback(- context,- choice: widget.request,- send: widget.feedback!,- measurement: widget.measurement,),- child: const Text('Rate task outcome'),- ),- ProductFeedback(- send: widget.feedback!,- onShown: widget.measurement?.observer(- ProductHealthMeasure.feedbackReasonShown,- ),- onAnswered: widget.measurement?.observer(- ProductHealthMeasure.feedbackReasonAnswered,- ),- onDismissed: widget.measurement?.observer(- ProductHealthMeasure.feedbackReasonDismissed,- ),+ if (_error != null) ...[+ const SizedBox(height: 12),+ Text(_error!),+ Align(+ alignment: Alignment.centerLeft,+ child: TextButton(+ onPressed: _busy ? null : () => _read(),+ child: const Text('Reload'),+ ),+ ),+ ],+ const SizedBox(height: 8),+ Align(+ alignment: Alignment.centerLeft,+ child: TextButton(+ onPressed: () => setState(() {+ _details = !_details;+ }),+ child: Text(+ _details ? 'Hide shared fields' : 'See what’s shared',+ ),+ ),+ ),+ if (_details) ...[+ const SizedBox(height: 8),+ const SelectableText(+ 'Shared fields\n'+ '• UTC day and a random report receipt to prevent duplicate counts\n'+ '• Active and working computer counts; first and repeat work\n'+ '• Desktop and terminal app opens\n'+ '• The days you used Harness, which apps you used, whether an agent worked and your sign-up day, under a coded ID instead of your account; kept 10 days, then only as combined totals\n'+ '• Agent turns started, ended, or interrupted (including automated work)\n'+ '• Turn durations: under 10 seconds, 10–60 seconds, 1–5 minutes, or over 5 minutes\n'+ '• Launch, resume, restart, model change and history request outcomes, fixed failure categories and wait buckets\n'+ '• First response waits, missing responses and error-event counts; first-launch 24-hour response counts and D1/D7/D28 working-day returns\n'+ '• A fixed feedback answer only when you choose to send one\n'+ '• Protocol version and the revision of your sharing preference\n\n'+ 'Desktop and CLI also share separate release and operating-system totals; '+ 'fixed startup, viewer-load, update-apply, reconnect and resume-to-work outcomes; '+ 'coarse memory, CPU and frame-time buckets; and counts of errors and interrupted app runs. '+ 'No error text, stack trace, device specification or browsing address is sent. '+ 'Local day flags measure explicit composer work and weekly use; they are never uploaded. '+ 'The last app run keeps only local restart/update control flags, removed when sharing is off. '+ 'Feedback views, answers and dismissals are counted without linking them to a task.\n\n'+ 'Older apps contribute connection, remote-session, and turn-start totals. '+ 'These event counts are separate from active computer counts.\n\n'+ 'Sign-in checks your preference. Account, computer, and agent identifiers are not stored '+ 'with the combined totals. The 10-day daily records use a coded ID instead of your account '+ 'and are deleted when you turn sharing off. Queued local counters older than 35 days are discarded when Harness next runs. '+ 'Server retry receipts are scheduled to expire after 36 days; combined totals after 13 months. Background cleanup may lag. '+ 'Combined totals cannot be removed for one person. Apart from those 10-day records, reports create no per-person history. '+ 'Previously collected activity records expire after 35 days. '+ 'Fixed setup, sign-in, connection, viewer and update-stage outcomes; first and repeat feature use; weekly and monthly returns. '+ 'Optional task feedback sends only your selected outcome or reason. '+ 'A turn ending does not tell us whether your task succeeded.',+ ),+ ],+ if (_enabled == true && widget.feedback != null) ...[+ if (!kIsWeb)+ TextButton(+ onPressed: () => showTaskFeedback(+ context,+ choice: widget.request,+ send: widget.feedback!,+ measurement: widget.measurement,+ ),+ child: const Text('Rate task outcome'),+ ),+ ProductFeedback(+ send: widget.feedback!,+ onShown: widget.measurement?.observer(+ ProductHealthMeasure.feedbackReasonShown,+ ),+ onAnswered: widget.measurement?.observer(+ ProductHealthMeasure.feedbackReasonAnswered,+ ),+ onDismissed: widget.measurement?.observer(+ ProductHealthMeasure.feedbackReasonDismissed,+ ),+ ),+ ],+ ],),- ],- ],- ),- );+ );}diff --git a/desktop/lib/settings/settings_body.dart b/desktop/lib/settings/settings_body.dartindex 5160ee4fe..4c412282f 100644--- a/desktop/lib/settings/settings_body.dart+++ b/desktop/lib/settings/settings_body.dart@@ -1,4 +1,5 @@import 'package:flutter/material.dart';+import 'package:flutter/foundation.dart' show kIsWeb;import '../state/app_state.dart';import 'experimental_features.dart';@@ -39,8 +40,10 @@ class SettingsBody extends StatelessWidget {'Customization opens over the workspace.',),SettingsSection.notifications => const NotificationsSection(),- SettingsSection.privacy => PrivacySection(notifier: notifier),+ SettingsSection.privacy when kIsWeb => PrivacySection(notifier: notifier),+ SettingsSection.privacy ||SettingsSection.experimental => ExperimentalSection(+ notifier: notifier,store: experimentalFeatures ?? notifier.experimentalFeatures,),SettingsSection.shortcuts => const ShortcutsSection(),diff --git a/desktop/lib/settings/settings_screen.dart b/desktop/lib/settings/settings_screen.dartindex b4f96b75f..654d3577e 100644--- a/desktop/lib/settings/settings_screen.dart+++ b/desktop/lib/settings/settings_screen.dart@@ -1,4 +1,5 @@import 'package:flutter/material.dart';+import 'package:flutter/foundation.dart' show kIsWeb;import 'package:flutter/services.dart';import '../shared/theme/app_theme.dart' as grid;@@ -97,7 +98,9 @@ class SettingsScreen extends StatefulWidget {class _SettingsScreenState extends State<SettingsScreen> {late SettingsSection _section =- widget.initialSection ?? kDefaultSettingsSection;+ !kIsWeb && widget.initialSection == SettingsSection.privacy+ ? SettingsSection.experimental+ : widget.initialSection ?? kDefaultSettingsSection;/// Narrow screens only: a section is open over the list. Opening Settings on/// a named section starts there; otherwise the list comes first.diff --git a/desktop/lib/settings/settings_section.dart b/desktop/lib/settings/settings_section.dartindex 34e294949..f11f80692 100644--- a/desktop/lib/settings/settings_section.dart+++ b/desktop/lib/settings/settings_section.dart@@ -38,7 +38,11 @@ enum SettingsSection {shortcuts(AppIcons.keyboard, 'Keyboard shortcuts'),connectors(AppIcons.plug, 'Connectors'),usage(AppIcons.chartNoAxesColumn, 'Usage'),- experimental(AppIcons.flaskConical, 'Experimental'),+ experimental(+ AppIcons.flaskConical,+ 'Experimental',+ keywords: kIsWeb ? [] : ['privacy', 'sharing', 'product usage data'],+ ),about(AppIcons.info, 'About'),debug(AppIcons.bug, 'Debug');@@ -95,6 +99,7 @@ List<SettingsGroup> settingsGroupsFor({required bool debugSurface}) {bool visible(SettingsSection section) =>// This computer's own: the services its agents use.(!kIsWeb || section != SettingsSection.connectors) &&+ (kIsWeb || section != SettingsSection.privacy) &&(debugSurface || !_kDeveloperSections.contains(section));return [for (final group in _kSettingsGroups)diff --git a/desktop/lib/shared/widgets/setting_row.dart b/desktop/lib/shared/widgets/setting_row.dartindex e8488203e..21430f3bf 100644--- a/desktop/lib/shared/widgets/setting_row.dart+++ b/desktop/lib/shared/widgets/setting_row.dart@@ -19,6 +19,7 @@ class SettingRow extends StatelessWidget {this.controlSemanticLabel,this.footer,this.alignTop = false,+ this.inlineControl = false,this.badge,});@@ -38,6 +39,10 @@ class SettingRow extends StatelessWidget {/// Align taller controls with the title; compact controls stay centered.final bool alignTop;+ /// Keep a small control beside its label even at large text sizes. The label+ /// can wrap; the switch does not need the wide editor's stacked layout.+ final bool inlineControl;+/// A small tag after the title, such as `New`. Null draws the title alone.final String? badge;@@ -100,8 +105,9 @@ class SettingRow extends StatelessWidget {children: [LayoutBuilder(builder: (context, constraints) =>- constraints.maxWidth <- MediaQuery.textScalerOf(context).scale(_stackBelow)+ !inlineControl &&+ constraints.maxWidth <+ MediaQuery.textScalerOf(context).scale(_stackBelow)? Column(crossAxisAlignment: CrossAxisAlignment.stretch,children: [diff --git a/desktop/test/privacy_section_test.dart b/desktop/test/privacy_section_test.dartindex 65abfd5c0..0d2577697 100644--- a/desktop/test/privacy_section_test.dart+++ b/desktop/test/privacy_section_test.dart@@ -5,12 +5,17 @@ import 'package:flutter_test/flutter_test.dart';import 'package:harness/settings/sections/privacy_section.dart';void main() {- Future<void> show(WidgetTester tester, UsagePreferenceRequest request) async {+ Future<void> show(+ WidgetTester tester,+ UsagePreferenceRequest request, {+ bool compact = false,+ }) async {await tester.pumpWidget(MaterialApp(home: Scaffold(body: ProductUsagePreference(request: request,+ compact: compact,feedback: (_, _) async {},),),@@ -19,6 +24,30 @@ void main() {await tester.pumpAndSettle();}+ testWidgets('one-row sharing keeps failed saves honest and can reload', (+ tester,+ ) async {+ await show(tester, ({bool? enabled}) async {+ if (enabled != null) throw StateError('PRIVATE_CANARY');+ return {'enabled': enabled ?? true};+ }, compact: true);+ expect(find.byType(Switch), findsOneWidget);+ expect(find.text('Share product usage data'), findsOneWidget);+ expect(find.text('See what’s shared'), findsNothing);+ expect(find.text('How did your latest task go?'), findsNothing);+ expect(find.text('Rate task outcome'), findsNothing);+ expect(find.textContaining('Help improve'), findsNothing);+ await tester.tap(find.byType(Switch));+ await tester.pumpAndSettle();+ expect(find.byType(Switch), findsNothing);+ expect(find.text('Unavailable'), findsOneWidget);+ expect(find.textContaining('PRIVATE_CANARY'), findsNothing);+ await tester.tap(find.text('Reload'));+ await tester.pumpAndSettle();+ expect(tester.widget<Switch>(find.byType(Switch)).value, isTrue);+ expect(tester.takeException(), isNull);+ });+testWidgets('offers task feedback directly from the privacy controls', (tester,) async {diff --git a/desktop/test/settings_screen_test.dart b/desktop/test/settings_screen_test.dartindex b04ff18de..5f217ec0d 100644--- a/desktop/test/settings_screen_test.dart+++ b/desktop/test/settings_screen_test.dart@@ -10,6 +10,7 @@ import 'dart:async';import 'dart:ui' show SemanticsAction, Tristate;import 'package:flutter/material.dart';+import 'package:flutter/foundation.dart' show kIsWeb;import 'package:flutter/services.dart';import 'package:flutter_test/flutter_test.dart';import 'package:package_info_plus/package_info_plus.dart';@@ -119,13 +120,17 @@ void main() {// What moved out: robots to the Devices tab, devices and profiles to Machines, and what// agents may do to Experimental (the account's, owner 2026-10-12).expect(- find.descendant(of: find.byType(SettingsNav), matching: find.text('Agents')),+ find.descendant(+ of: find.byType(SettingsNav),+ matching: find.text('Agents'),+ ),findsNothing,);for (final gone in ['Customize','Your devices','Profiles',+ if (!kIsWeb) 'Privacy','Autonomous robots',]) {expect(find.text(gone), findsNothing, reason: gone);@@ -352,9 +357,10 @@ void main() {),);semantics.dispose();- // Search → matching nav row → switch.+ // Search → matching nav row → usage sharing (Desktop) → creature.await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);await tester.sendKeyEvent(LogicalKeyboardKey.tab);+ if (!kIsWeb) await tester.sendKeyEvent(LogicalKeyboardKey.tab);await tester.pump();await tester.sendKeyEvent(LogicalKeyboardKey.space);await tester.pumpAndSettle();diff --git a/desktop/test/settings_section_test.dart b/desktop/test/settings_section_test.dartindex 43e529d37..21184cf7d 100644--- a/desktop/test/settings_section_test.dart+++ b/desktop/test/settings_section_test.dart@@ -30,7 +30,7 @@ void main() {SettingsSection.account,SettingsSection.customize,SettingsSection.notifications,- SettingsSection.privacy,+ if (kIsWeb) SettingsSection.privacy,SettingsSection.shortcuts,// What agents may do is the account's, under Experimental (owner, 2026-10-12).if (!kIsWeb) SettingsSection.connectors,@@ -57,7 +57,7 @@ void main() {[SettingsSection.customize,SettingsSection.notifications,- SettingsSection.privacy,+ if (kIsWeb) SettingsSection.privacy,SettingsSection.shortcuts,],[if (!kIsWeb) SettingsSection.connectors, SettingsSection.usage],diff --git a/desktop/test/setup_privacy_flow_test.dart b/desktop/test/setup_privacy_flow_test.dartindex 20c7dac99..c580cc900 100644--- a/desktop/test/setup_privacy_flow_test.dart+++ b/desktop/test/setup_privacy_flow_test.dart@@ -12,10 +12,14 @@ import 'package:harness/core/config.dart';import 'package:harness/measurement/product_measurement.dart';import 'package:harness/measurement/setup_usage_choice.dart';import 'package:harness/settings/settings_screen.dart';+import 'package:harness/settings/settings_section.dart';+import 'package:harness/settings/settings_nav.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;import 'package:harness/state/app_state.dart';import 'package:package_info_plus/package_info_plus.dart';import 'support/capture.dart';+import 'support/experimental_settings.dart';import 'support/memory_key_value_store.dart';import 'support/real_fonts.dart';@@ -142,7 +146,7 @@ void main() {AppStatus.preparingEnvironment,]) {testWidgets(- 'setup has no checkbox and its menu opens Privacy: ${status.name}',+ 'setup has no checkbox and its menu opens Experimental: ${status.name}',(tester) async {tester.view.devicePixelRatio = 1;tester.view.physicalSize = const Size(1100, 760);@@ -189,15 +193,26 @@ void main() {await tester.pumpAndSettle();expect(find.byType(SettingsScreen), findsOneWidget);expect(find.text('Share product usage data'), findsOneWidget);- expect(tester.widget<Switch>(find.byType(Switch)).value, isTrue);- await tester.tap(find.byType(Switch));+ expect(find.text('Privacy'), findsNothing);+ expect(find.text('See what’s shared'), findsNothing);+ expect(find.text('Rate task outcome'), findsNothing);+ expect(find.text('How did your latest task go?'), findsNothing);+ expect(+ tester+ .widget<Switch>(+ find.byKey(const ValueKey('product-usage-sharing')),+ )+ .value,+ isTrue,+ );+ await tester.tap(find.byKey(const ValueKey('product-usage-sharing')));await tester.pumpAndSettle();expect(usage.signedOutSharing, isFalse);expect(store.values, {ProductMeasurement.setupPreferenceKey:ProductMeasurement.pendingSetupOptOut,});- await captureWindow(tester, capture, 'privacy-${status.name}-off');+ await captureWindow(tester, capture, 'experimental-${status.name}-off');await tester.tap(find.byKey(const Key('settings-back-button')));await tester.pump(const Duration(milliseconds: 100));await closed.future;@@ -210,6 +225,75 @@ void main() {);}+ testWidgets(+ 'signed-in sharing is one row in Experimental and persists account opt-out',+ (tester) async {+ tester.view.devicePixelRatio = 1;+ tester.view.physicalSize = const Size(1100, 760);+ addTearDown(tester.view.reset);+ final storage = MemoryKeyValueStore();+ final usage = ProductMeasurement(+ surface: 'desktop',+ automatic: false,+ setupStorage: storage,+ sendSetup: (_) async => {},+ );+ await usage.setupChoiceReady;+ final api = _PreferenceApi()..fail = false;+ final app =+ AppNotifier(+ config: AppConfig.dev,+ authSession: AuthSession(storage: MemoryKeyValueStore()),+ productMeasurement: usage,+ )+ ..api = api+ ..signedIn = true+ ..status = AppStatus.authenticated;+ final experiments = MemoryExperimentalFeaturesStore(+ storage: MemoryKeyValueStore(),+ );+ addTearDown(experiments.dispose);+ usage.account(+ 'synthetic-account',+ choice: () => app.productUsageSettings(),+ send: (_) async => {},+ );+ await tester.pumpWidget(+ MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: Brightness.dark),+ home: SettingsScreen(+ notifier: app,+ // Existing deep links must land on the new row, with a selected rail entry.+ initialSection: SettingsSection.privacy,+ experimentalFeatures: experiments,+ ),+ ),+ );+ await tester.pumpAndSettle();+ final toggle = find.byKey(const ValueKey('product-usage-sharing'));+ expect(+ tester.widget<SettingsNav>(find.byType(SettingsNav)).section,+ SettingsSection.experimental,+ );+ expect(find.text('Privacy'), findsNothing);+ expect(find.text('See what’s shared'), findsNothing);+ expect(find.text('Rate task outcome'), findsNothing);+ expect(find.text('How did your latest task go?'), findsNothing);+ expect(tester.widget<Switch>(toggle).value, isTrue);+ await captureWindow(tester, capture, 'experimental-signed-in-on');+ await tester.tap(toggle);+ await tester.pumpAndSettle();+ expect(api.enabled, isFalse);+ expect(usage.sharing, isFalse);+ expect(usage.signedOutSharing, isFalse);+ expect(storage.values, {ProductMeasurement.setupPreferenceKey: 'false'});+ expect(tester.widget<Switch>(toggle).value, isFalse);+ await tester.pumpWidget(const SizedBox.shrink());+ app.dispose();+ },+ );+testWidgets('failed opt-out save stays off and retries that same choice', (tester,) async {@@ -226,7 +310,7 @@ void main() {home: Scaffold(body: SetupUsageChoice(measurement: usage)),),);- await tester.tap(find.byType(Switch));+ await tester.tap(find.byKey(const ValueKey('product-usage-sharing')));await tester.pumpAndSettle();expect(usage.signedOutSharing, isFalse);expect(find.textContaining('PRIVATE_CANARY'), findsNothing);diff --git a/docs/product-measurement.md b/docs/product-measurement.mdindex 6d70de6ee..eb99d677d 100644--- a/docs/product-measurement.md+++ b/docs/product-measurement.md@@ -13,7 +13,7 @@ automatically proven improvement. Changes still need review, tests and a deliber| Which actions break? | Create, resume, restart, model-change, history, fork, close, delete, search, history paging, Store list/install/update/remove, model list/download/start/stop and browser-open requests, fixed outcomes/errors and latency buckets | Request acceptance is not task success. Pending/unknown requests are separate from completed replies. || Does work get a response promptly? | First text response buckets; over-one-minute waits; error events; matched ends without text; interruptions | Includes automation. Tool-only turns, interruptions and missing lifecycle events can explain missing text. No message is inspected. || Do installations return to work? | D1/D7/D28 working-day cohorts, consecutive complete-week and calendar-month returns, return after a seven-day gap | Any working day can be a cohort; not new-signup retention. Local date flags produce unlinked totals. Opt-outs, reinstallations, resets and missing uploads affect results. |-| Was the task useful? | Optional Completed / Partly completed / Not completed plus five fixed reason choices, reachable from Rate task outcome and Privacy | Voluntary and self-selected; not representative success or satisfaction. There is no free-text input. |+| Was the task useful? | Optional Completed / Partly completed / Not completed plus five fixed reason choices from clients that offer feedback; current Desktop Settings no longer exposes feedback controls | Voluntary and self-selected; not representative success or satisfaction. There is no free-text input. || Is there usage at all? | Active and working computer counts; app opens; older-client relay totals | Background windows can count as active. An open is a surface going from no attached window to one, not each connection (the desktop holds one per machine and redials). Relay events are not distinct people; the populations must not be added together. || Which features get tried and used again? | First measured installations and daily first/repeat feature reach | Locally deduplicated installation-days, not unique accounts. Reads the apps make on their own (history, history paging, Store list, model list; `PRODUCT_USAGE_AUTOMATIC_ACTIONS`) count reliability only. The Store and model lists get reach only from the request an app marks `userAction` when a person opens them (`<action>_user_*`, `PRODUCT_USAGE_USER_OPENED_ACTIONS`); history has none. |@@ -22,8 +22,10 @@ automatically proven improvement. Changes still need review, tests and a deliber| Is measurement losing coverage? | Updated collector installation-days, pruned queues, full observation maps, unmatched app starts | Loss signals warrant caution. No signal does not prove complete collection. || How many people use Harness, and do they come back? | People active / working / new per day and per app, and D1/D2/D3/D7 returns (backend rollup of 10-day pseudonymous marks) | Sharing accounts only, staff excluded; an app open across midnight counts on both days, so prefer working returns. Not available before `PRODUCT_USAGE_SUBJECT_KEY` is set. |-Desktop setup and sign-in counts are enabled by default, with no onboarding checkbox. Users can-turn them off in **Settings → Privacy → Share product usage data**, including before sign-in through+Desktop setup and sign-in counts are enabled by default, with no onboarding checkbox. Desktop has+one “Share product usage data” switch in Experimental, with no separate Privacy page or feedback+controls. The browser keeps its existing Privacy page. Users can+turn them off in **Settings → Experimental → Share product usage data**, including before sign-in throughthe app menu. Local booleans remember the preference and a pending opt-out across launches; reporting waits forthat preference to load and stays off if it cannot be read. The confirmed account preference takesover after sign-in and is remembered for the next signed-out launch. An explicit Settings opt-out@@ -233,7 +235,7 @@ Suggested visible release note:> Harness now shares limited product usage counts by default to help us find broken or slow flows.> These counts do not include your prompts, responses, code, files or project details. Turn sharing-> off for your account in Settings → Privacy → Share product usage data, or use `harness privacy off`.+> off for your account in Settings → Experimental → Share product usage data, or use `harness privacy off`.> Existing opt-outs stay off. Optional feedback sends only the answer you choose.> With sharing on, Harness also keeps which days you used it and through which app, under an> coded ID instead of your account, for 10 days, then only as combined totals.diff --git a/docs/reviews/2026-10-16-simple-usage-setting/experimental.png b/docs/reviews/2026-10-16-simple-usage-setting/experimental.pngnew file mode 100644index 000000000..f67ce1303Binary files /dev/null and b/docs/reviews/2026-10-16-simple-usage-setting/experimental.png differ