Skip to content

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.

Settings: remove the Experimental "Coding memory" switch, which could no longer turn on (#1260)

Deea0b3c3f8cf57
diff --git a/daemons/BRAIN.md b/daemons/BRAIN.md
index 8759a3c31..00cb76715 100644
--- a/daemons/BRAIN.md
+++ b/daemons/BRAIN.md
@@ -56,27 +56,11 @@ One implementation, `pair/control.ts`, behind a local-only `pair` request. Expos
Every write, local or remote, runs through the owning machine's `PairOwner` (`pair/owner.ts`), so the
floor and the journal live where the harness does.
-The experimental coding-memory service is enabled in **Settings → Experimental → Coding memory**,
-in addition to the companion and watching controls. The choice is local to this computer and account,
-defaults off, and takes effect without restarting. `HARNESS_CODING_MEMORY=1` remains a migration default
-only until the owner saves a choice; an explicit off wins. `recall_memory { query, conditions? }` is an agent read, bound by
-the host to the current collection, with a byte-bounded historical-context packet and an unverified
-delivery receipt. Its token is required even at `watch`; it cannot select an owner, project, session,
-or avatar. It cannot inspect the owner's whole library, correct records, change privacy, or forget.
-
-The separate `pair { verb: "memory", action: … }` control is for the person. Even reads require a
-verified loopback process outside Harness panes and belonging to the daemon's OS user; a pair token
-is refused. Unix-socket callers whose PID cannot be established are refused, not assumed to be the
-person. `harness pair memory list|status|show <id> --json` exposes the initial read-only CLI.
-The internal owner API also supplies paginated listing, retained evidence, and correction/forget/
-Learn/Recall previews. Applying a change needs a two-minute, one-use capability bound to owner,
-process, connection, exact command, and the unchanged library snapshot. `confirmed: true` never
-counts. The desktop viewer uses this transport in **Companions → Memories**. Two preference actions,
-`experiment` and `configure_experiment { enabled, expected }`, remain available while companions are off;
-the latter checks the saved revision. Neither can access memories or start learning with companions off.
-Turning Coding memory off cancels its background work and keeps saved records. Real-model quality and
-the rollout gates remain unverified. Like existing lesson approval, process checks do not defend against
-arbitrary malware running as the same OS user with access to the memory files.
+Coding memory (`recall_memory`, `pair { verb: "memory" }`) was taken out of the daemon in #684
+(2026-10-03): core answers every `pair` request with `UNSUPPORTED`, so `recall_memory` returns nothing and
+the companion's Memories page cannot load. Its Settings → Experimental switch, which could no longer be
+turned on, was removed on 2026-10-12. Memory in Harness is now the Memories harness in the Store
+(`store/agents/memories`), which reads the agents' own memory files and has its own switch.
**Autonomy dial** (zoo op `zoo.autonomy`, default `watch`): `watch` (read tools only, facts; lines
carry only `[g]`) · `suggest` (it recommends, every action waits for your key) · `act-on-key` (it may
diff --git a/desktop/lib/companions/coding_memory_settings.dart b/desktop/lib/companions/coding_memory_settings.dart
deleted file mode 100644
index d7e84da8a..000000000
--- a/desktop/lib/companions/coding_memory_settings.dart
+++ /dev/null
@@ -1,127 +0,0 @@
-import 'package:flutter/foundation.dart';
-
-import 'coding_memory_connection.dart';
-
-/// Owns an explicit local opt-in, using the same owner-verified transport as the library.
-class CodingMemorySettings extends ChangeNotifier {
- CodingMemorySettings(this.openConnection);
- final CodingMemoryConnection? Function() openConnection;
- CodingMemoryConnection? _connection;
- bool enabled = false, loaded = false, saving = false, _disposed = false;
- int _revision = 0, _generation = 0;
- String? error;
- Future<void>? _reading;
-
- void _notify() {
- if (!_disposed) notifyListeners();
- }
-
- void _ownerChanged() {
- if (_connection?.valid != false) return;
- ++_generation;
- enabled = loaded = saving = false;
- error = 'Your account or local connection changed. Refresh this setting.';
- _notify();
- }
-
- Future<Map<String, dynamic>> _request(Map<String, dynamic> payload) async {
- final connection = _connection;
- if (connection == null || !connection.valid) {
- throw const CodingMemoryFailure('OWNER_CHANGED');
- }
- final response = await connection.request(payload);
- if (!connection.valid) throw const CodingMemoryFailure('OWNER_CHANGED');
- if (response['ok'] != true) {
- throw CodingMemoryFailure(
- response['error'] as String? ?? 'MEMORY_UNAVAILABLE',
- );
- }
- if (response['enabled'] is! bool || response['revision'] is! int) {
- throw const CodingMemoryFailure('UNSUPPORTED');
- }
- return response;
- }
-
- void _apply(Map<String, dynamic> response) {
- final revision = response['revision'] as int;
- if (revision < _revision) return;
- enabled = response['enabled'] as bool;
- _revision = revision;
- loaded = true;
- error = null;
- }
-
- Future<void> refresh() {
- if (_disposed || saving) return Future.value();
- return _reading ??= _read().whenComplete(() => _reading = null);
- }
-
- Future<void> _read() async {
- if (_connection?.valid != true) {
- _connection?.removeListener(_ownerChanged);
- _connection?.dispose();
- _connection = openConnection()?..addListener(_ownerChanged);
- _revision = 0;
- loaded = enabled = false;
- }
- final generation = _generation;
- try {
- if (_connection == null) {
- throw const CodingMemoryFailure('LOCAL_UNAVAILABLE');
- }
- final response = await _request({'action': 'experiment'});
- if (!_disposed && generation == _generation) _apply(response);
- } catch (failure) {
- if (!_disposed && generation == _generation) {
- loaded = false;
- error = _message(failure);
- }
- }
- _notify();
- }
-
- Future<void> setEnabled(bool value) async {
- if (_disposed || saving || !loaded || _connection?.valid != true) return;
- final generation = ++_generation;
- saving = true;
- error = null;
- _notify();
- try {
- final response = await _request({
- 'action': 'configure_experiment',
- 'enabled': value,
- 'expected': _revision,
- });
- if (!_disposed && generation == _generation) _apply(response);
- } catch (failure) {
- if (!_disposed && generation == _generation) {
- loaded = false;
- error = '${_message(failure)} Refresh to check the saved choice.';
- }
- } finally {
- if (!_disposed && generation == _generation) saving = false;
- _notify();
- }
- }
-
- static String _message(Object failure) => switch (failure) {
- CodingMemoryFailure(code: 'DAEMONS_OFF') =>
- 'Turn on Focus-bar creature above to use coding memory.',
- CodingMemoryFailure(code: 'UNSUPPORTED') =>
- 'Update the local Harness service to use this setting.',
- CodingMemoryFailure(code: 'LOCAL_UNAVAILABLE') =>
- 'Connect this computer to Harness to choose this setting.',
- CodingMemoryFailure(code: 'SETTINGS_CHANGED') =>
- 'This setting changed in another window.',
- _ => codingMemoryError(failure),
- };
-
- @override
- void dispose() {
- _disposed = true;
- ++_generation;
- _connection?.removeListener(_ownerChanged);
- _connection?.dispose();
- super.dispose();
- }
-}
diff --git a/desktop/lib/settings/sections/experimental_section.dart b/desktop/lib/settings/sections/experimental_section.dart
index 19a7cdf91..6f00a7fdb 100644
--- a/desktop/lib/settings/sections/experimental_section.dart
+++ b/desktop/lib/settings/sections/experimental_section.dart
@@ -5,18 +5,11 @@ import 'package:flutter/material.dart';
import '../../shared/widgets/section_scaffold.dart';
import '../../shared/widgets/setting_row.dart';
import '../experimental_features.dart';
-import '../../companions/coding_memory_connection.dart';
-import '../../companions/coding_memory_settings.dart';
class ExperimentalSection extends StatefulWidget {
- const ExperimentalSection({
- super.key,
- this.store,
- this.openCodingMemory,
- });
+ const ExperimentalSection({super.key, this.store});
final ExperimentalFeaturesStore? store;
- final CodingMemoryConnection? Function()? openCodingMemory;
@override
State<ExperimentalSection> createState() => _ExperimentalSectionState();
@@ -43,7 +36,7 @@ class _ExperimentalSectionState extends State<ExperimentalSection> {
final features = ExperimentalFeature.values.where((f) => f.available);
return SectionScaffold(
title: 'Experimental',
- subtitle: 'Try features that are still taking shape. Account experiments sync across your devices; coding memory is local to this computer.',
+ subtitle: 'Try features that are still taking shape. Account experiments sync across your devices.',
child: SingleChildScrollView(
child: ListenableBuilder(
listenable: preferences,
@@ -113,13 +106,6 @@ class _ExperimentalSectionState extends State<ExperimentalSection> {
)
: null,
),
- if (widget.openCodingMemory case final open?)
- _CodingMemorySetting(
- open: open,
- companionEnabled: preferences.enabled(
- ExperimentalFeature.focusBarCreature,
- ),
- ),
],
),
),
@@ -127,83 +113,3 @@ class _ExperimentalSectionState extends State<ExperimentalSection> {
);
}
}
-
-class _CodingMemorySetting extends StatefulWidget {
- const _CodingMemorySetting({
- required this.open,
- required this.companionEnabled,
- });
- final CodingMemoryConnection? Function() open;
- final bool companionEnabled;
- @override
- State<_CodingMemorySetting> createState() => _CodingMemorySettingState();
-}
-
-class _CodingMemorySettingState extends State<_CodingMemorySetting> {
- late final settings = CodingMemorySettings(() => widget.open());
- @override
- void initState() {
- super.initState();
- unawaited(settings.refresh());
- }
-
- @override
- void didUpdateWidget(_CodingMemorySetting oldWidget) {
- super.didUpdateWidget(oldWidget);
- if (oldWidget.companionEnabled != widget.companionEnabled) {
- unawaited(settings.refresh());
- }
- }
-
- @override
- void dispose() {
- settings.dispose();
- super.dispose();
- }
-
- @override
- Widget build(BuildContext context) => ListenableBuilder(
- listenable: settings,
- builder: (context, _) => SettingRow(
- title: 'Coding memory',
- detail: 'Let your companion learn coding preferences and project knowledge across supported agents on this computer. Uses the model selected in Companions.',
- control: Semantics(
- label: 'Coding memory',
- child: Align(
- alignment: Alignment.centerLeft,
- child: Switch(
- key: const Key('experimental-coding-memory'),
- value: settings.enabled,
- onChanged: settings.loaded && !settings.saving
- ? (value) => unawaited(settings.setEnabled(value))
- : null,
- ),
- ),
- ),
- footer: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- 'For your account on this computer. Review memories and control learning and recall in Companions → Memories. Turning this off keeps saved memories.',
- ),
- if (!widget.companionEnabled)
- const Text(
- 'Learning and recall are paused while Focus-bar creature is off.',
- ),
- if (settings.saving)
- const Text('Saving…')
- else if (!settings.loaded && settings.error == null)
- const Text('Loading…'),
- if (settings.error case final error?) ...[
- const SizedBox(height: 8),
- Semantics(liveRegion: true, child: Text(error)),
- TextButton(
- onPressed: settings.saving ? null : settings.refresh,
- child: const Text('Refresh setting'),
- ),
- ],
- ],
- ),
- ),
- );
-}
diff --git a/desktop/lib/settings/settings_body.dart b/desktop/lib/settings/settings_body.dart
index bc3b46869..a2386ce03 100644
--- a/desktop/lib/settings/settings_body.dart
+++ b/desktop/lib/settings/settings_body.dart
@@ -47,7 +47,6 @@ class SettingsBody extends StatelessWidget {
SettingsSection.notifications => const NotificationsSection(),
SettingsSection.experimental => ExperimentalSection(
store: experimentalFeatures ?? notifier.experimentalFeatures,
- openCodingMemory: notifier.openCodingMemoryConnection,
),
SettingsSection.shortcuts => const ShortcutsSection(),
SettingsSection.debug => const DebugSection(),
diff --git a/desktop/test/coding_memory_settings_test.dart b/desktop/test/coding_memory_settings_test.dart
deleted file mode 100644
index e54c7b6b4..000000000
--- a/desktop/test/coding_memory_settings_test.dart
+++ /dev/null
@@ -1,232 +0,0 @@
-import 'dart:async';
-import 'dart:io';
-import 'dart:ui' as ui;
-
-import 'package:flutter/material.dart';
-import 'package:flutter/rendering.dart';
-import 'package:flutter_test/flutter_test.dart';
-import 'package:harness/companions/coding_memory_connection.dart';
-import 'package:harness/companions/coding_memory_settings.dart';
-import 'package:harness/settings/experimental_features.dart';
-import 'package:harness/settings/sections/experimental_section.dart';
-import 'package:harness/shared/theme/app_theme.dart';
-import 'package:harness/shared/theme/color_palette.dart';
-
-import 'experimental_features_test.dart' show AccountSettings;
-import 'support/real_fonts.dart';
-
-class SettingsConnection extends CodingMemoryConnection {
- @override
- bool valid = true;
- @override
- int epoch = 1;
- bool enabled = false;
- int revision = 0;
- String? failure;
- Completer<void>? hold;
- final calls = <Map<String, dynamic>>[];
- @override
- Future<Map<String, dynamic>> request(Map<String, dynamic> payload) async {
- calls.add(payload);
- await hold?.future;
- if (failure != null) throw CodingMemoryFailure(failure!);
- if (payload['action'] == 'configure_experiment') {
- expect(payload['expected'], revision);
- enabled = payload['enabled'] as bool;
- revision++;
- }
- return {'ok': true, 'enabled': enabled, 'revision': revision};
- }
-
- @override
- void invalidate() {
- valid = false;
- epoch++;
- notifyListeners();
- }
-}
-
-void main() {
- TestWidgetsFlutterBinding.ensureInitialized();
- setUpAll(loadRealFonts);
- late SettingsConnection connection;
- late CodingMemorySettings settings;
- setUp(() {
- connection = SettingsConnection();
- settings = CodingMemorySettings(() => connection);
- });
- tearDown(() => settings.dispose());
-
- test(
- 'reads without writing, waits for acknowledgement, and can turn memory off',
- () async {
- await settings.refresh();
- expect(settings.loaded, isTrue);
- expect(settings.enabled, isFalse);
- expect(connection.calls, [
- {'action': 'experiment'},
- ]);
- connection.hold = Completer();
- final saving = settings.setEnabled(true);
- expect(settings.saving, isTrue);
- expect(settings.enabled, isFalse);
- connection.hold!.complete();
- await saving;
- expect(settings.enabled, isTrue);
- expect(settings.saving, isFalse);
- await settings.setEnabled(false);
- expect(settings.enabled, isFalse);
- expect(connection.revision, 2);
- },
- );
-
- test(
- 'clears the previous account and rejects a late setting reply',
- () async {
- await settings.refresh();
- connection.hold = Completer();
- final saving = settings.setEnabled(true);
- connection.invalidate();
- connection.hold!.complete();
- await saving;
- expect(settings.loaded, isFalse);
- expect(settings.enabled, isFalse);
- expect(settings.error, contains('account'));
- },
- );
-
- test(
- 'does not repeat an uncertain write and refreshes the actual saved value',
- () async {
- await settings.refresh();
- connection.failure = 'TIMEOUT';
- await settings.setEnabled(true);
- expect(settings.loaded, isFalse);
- expect(settings.enabled, isFalse);
- await settings.setEnabled(true);
- expect(connection.calls.length, 2);
- connection.failure = null;
- connection.enabled = true;
- connection.revision = 1;
- await settings.refresh();
- expect(settings.enabled, isTrue);
- },
- );
-
- test(
- 'explains the companion prerequisite without enabling anything',
- () async {
- connection.failure = 'DAEMONS_OFF';
- await settings.refresh();
- expect(settings.loaded, isFalse);
- expect(settings.error, contains('Focus-bar creature'));
- expect(connection.calls, [
- {'action': 'experiment'},
- ]);
- },
- );
-
- for (final brightness in [Brightness.light, Brightness.dark]) {
- for (final scale in [1.0, 2.0]) {
- testWidgets(
- 'coding memory stays manageable with companions off, ${brightness.name} ${scale}x',
- (tester) async {
- tester.view.physicalSize = Size(scale == 1 ? 780 : 420, 1100);
- tester.view.devicePixelRatio = 1;
- addTearDown(tester.view.reset);
- final oldPalette = AppTheme.palette.value;
- final oldBrightness = AppTheme.brightness.value;
- AppTheme.palette.value = brightness == Brightness.dark
- ? HarnessPalette.graphite
- : HarnessPalette.paper;
- AppTheme.brightness.value = brightness;
- addTearDown(() {
- AppTheme.palette.value = oldPalette;
- AppTheme.brightness.value = oldBrightness;
- });
- final account = AccountSettings('synthetic-owner');
- final experiments = ExperimentalFeaturesStore(
- pollInterval: Duration.zero,
- )..bind(account.accountId, transport: account);
- addTearDown(experiments.dispose);
- connection.enabled = true;
- connection.revision = 1;
- final boundary = GlobalKey();
- await tester.pumpWidget(
- RepaintBoundary(
- key: boundary,
- child: MaterialApp(
- debugShowCheckedModeBanner: false,
- theme: buildAppTheme(brightness: brightness),
- builder: (context, child) => MediaQuery(
- data: MediaQuery.of(context)
- .copyWith(textScaler: TextScaler.linear(scale)),
- child: child!,
- ),
- home: Scaffold(
- body: ExperimentalSection(
- store: experiments,
- openCodingMemory: () => connection,
- ),
- ),
- ),
- ),
- );
- await tester.pumpAndSettle();
- final toggle = find.byKey(const Key('experimental-coding-memory'));
- await tester.ensureVisible(toggle);
- await tester.pumpAndSettle();
- expect(tester.widget<Switch>(toggle).value, isTrue);
- expect(tester.widget<Switch>(toggle).onChanged, isNotNull);
- expect(
- find.text(
- 'Learning and recall are paused while Focus-bar creature is off.',
- ),
- findsOneWidget,
- );
- expect(account.writes, isEmpty);
- final output =
- Platform.environment['HARNESS_MEMORY_SETTINGS_CAPTURE_DIR'];
- if (output != null) {
- await tester.runAsync(() async {
- final image =
- await (boundary.currentContext!.findRenderObject()
- as RenderRepaintBoundary)
- .toImage(pixelRatio: 1);
- final bytes = await image.toByteData(
- format: ui.ImageByteFormat.png,
- );
- await Directory(output).create(recursive: true);
- await File('$output/setting-${brightness.name}-${scale}x.png')
- .writeAsBytes(bytes!.buffer.asUint8List());
- image.dispose();
- });
- }
- connection.hold = Completer();
- await tester.tap(toggle);
- await tester.pump();
- expect(tester.widget<Switch>(toggle).value, isTrue);
- expect(tester.widget<Switch>(toggle).onChanged, isNull);
- connection.hold!.complete();
- await tester.pumpAndSettle();
- expect(tester.widget<Switch>(toggle).value, isFalse);
- expect(
- connection.calls.where(
- (call) => call['action'] == 'configure_experiment',
- ),
- [
- {
- 'action': 'configure_experiment',
- 'enabled': false,
- 'expected': 1,
- },
- ],
- );
- expect(account.writes, isEmpty);
- expect(tester.takeException(), isNull);
- await tester.pumpWidget(const SizedBox());
- },
- );
- }
- }
-}